Package ro.sync.exml.workspace.api
Class PluginWorkspaceTCBase
java.lang.Object
junit.framework.Assert
junit.framework.TestCase
junit.extensions.jfcunit.JFCTestCase
ro.sync.exml.workspace.api.PluginWorkspaceTCBase
- All Implemented Interfaces:
junit.framework.Test
@API(type=EXTENDABLE,
src=PRIVATE)
public abstract class PluginWorkspaceTCBase
extends junit.extensions.jfcunit.JFCTestCase
Base class for testing plugins and frameworks.
For more details please read the topic called "Creating and Running Automated Tests" from the user manual:
https://www.oxygenxml.com/doc/ug-oxygen/topics/automated-tests.html
https://www.oxygenxml.com/doc/ug-oxygen/topics/automated-tests.html
- Since:
- 14.1
- See Also:
-
- "https://www.oxygenxml.com/doc/ug-oxygen/topics/automated-tests.html"
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
JSON Editorstatic final int
XML Authorstatic final int
XML Developerstatic final int
XML Editor -
Constructor Summary
ConstructorsConstructorDescriptionPluginWorkspaceTCBase
(File installationFolder, File frameworksFolder, File pluginsFolder, File optionsFolder, String licenseKey) Constructor.PluginWorkspaceTCBase
(File installationFolder, File frameworksFolder, File pluginsFolder, File optionsFolder, String licenseKey, int productID) Constructor.PluginWorkspaceTCBase
(File frameworksFolder, File pluginsFolder, String licenseKey) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionGet the WSAuthorEditorPage for the current edited file.Get the XML content currently loaded in the current editor.Get the plugin workspace.protected void
Invoke action with a certain ID on the AWT thread.protected void
moveCaretRelativeTo
(String text, int relativePosition, boolean select) Move caret relative to a text already existing in the author page.Open an URL.protected void
setUp()
protected void
tearDown()
Methods inherited from class junit.extensions.jfcunit.JFCTestCase
awtSleep, awtSleep, createNoExitSecurityManager, flushAWT, getAssertExit, getError, getHelper, getLockWait, hasError, isAWTRunning, pause, pauseAWT, resetError, resetForcedWait, resetSleepTime, resumeAWT, runBare, runCode, runTest, setAssertExit, setError, setForcedWait, setHelper, setLockWait, setSleepTime, sleep
Methods inherited from class junit.framework.TestCase
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, countTestCases, createResult, fail, fail, failNotEquals, failNotSame, failSame, format, getName, run, run, setName, toString
-
Field Details
-
XML_AUTHOR_PRODUCT
public static final int XML_AUTHOR_PRODUCTXML Author- See Also:
-
XML_EDITOR_PRODUCT
public static final int XML_EDITOR_PRODUCTXML Editor- See Also:
-
XML_DEVELOPER_PRODUCT
public static final int XML_DEVELOPER_PRODUCTXML Developer- See Also:
-
JSON_EDITOR_PRODUCT
public static final int JSON_EDITOR_PRODUCTJSON Editor- See Also:
-
-
Constructor Details
-
PluginWorkspaceTCBase
public PluginWorkspaceTCBase(File frameworksFolder, File pluginsFolder, String licenseKey) throws MalformedURLException Constructor. The installation folder will be assumed to be the folder in which the JVM has started (new File(".")).- Parameters:
frameworksFolder
- The folder from where to load the frameworks. Ifnull
it will default to the folder "frameworks" in the installationFolder.pluginsFolder
- The folder from where to load the plugins. Ifnull
it will default to the folder "plugins" in the installationFolder.licenseKey
- The license key used to license the test Oxygen application.- Throws:
MalformedURLException
- The folder parameters are incorrect.
-
PluginWorkspaceTCBase
public PluginWorkspaceTCBase(File installationFolder, File frameworksFolder, File pluginsFolder, File optionsFolder, String licenseKey) throws MalformedURLException Constructor.- Parameters:
installationFolder
- The folder where Oxygen is installed. Ifnull
it will default to the folder in which the JVM started (new File(".")).frameworksFolder
- The folder from where to load the frameworks. Ifnull
it will default to the folder "frameworks" in the installationFolder.pluginsFolder
- The folder from where to load the plugins. Ifnull
it will default to the folder "plugins" in the installationFolder.optionsFolder
- The folder from where to load the Oxygen options. Set to null to use the default options folder on your specific platform (located in the user home).licenseKey
- The license key used to license the test Oxygen application.- Throws:
MalformedURLException
- The folder parameters are incorrect.
-
PluginWorkspaceTCBase
public PluginWorkspaceTCBase(File installationFolder, File frameworksFolder, File pluginsFolder, File optionsFolder, String licenseKey, int productID) throws MalformedURLException Constructor.- Parameters:
installationFolder
- The folder where Oxygen is installed. Ifnull
it will default to the folder in which the JVM started (new File(".")).frameworksFolder
- The folder from where to load the frameworks. Ifnull
it will default to the folder "frameworks" in the installationFolder.pluginsFolder
- The folder from where to load the plugins. Ifnull
it will default to the folder "plugins" in the installationFolder.optionsFolder
- The folder from where to load the Oxygen options. Set to null to use the default options folder on your specific platform (located in the user home).licenseKey
- The license key used to license the test Oxygen application.productID
- ID of the product which should be started, one ofXML_AUTHOR_PRODUCT
,XML_EDITOR_PRODUCT
orXML_DEVELOPER_PRODUCT
. The ID of the product should match the type of Oxygen installation that you are using to start the test case.- Throws:
MalformedURLException
- The folder parameters are incorrect.
-
-
Method Details
-
tearDown
- Overrides:
tearDown
in classjunit.extensions.jfcunit.JFCTestCase
- Throws:
Exception
- See Also:
-
JFCTestCase.tearDown()
-
setUp
- Overrides:
setUp
in classjunit.extensions.jfcunit.JFCTestCase
- Throws:
Exception
- See Also:
-
JFCTestCase.setUp()
-
getPluginWorkspace
Get the plugin workspace.- Returns:
- Returns the plugin workspace.
-
open
Open an URL.- Parameters:
url
- The URL to open.- Returns:
- The author page.
- Throws:
Exception
- If an I/O exception occurs.
-
getCurrentEditorXMLContent
Get the XML content currently loaded in the current editor.- Returns:
- The XML content.
- Throws:
IOException
- If an I/O exception occurs.
-
getCurrentAuthorEditorPageAccess
Get the WSAuthorEditorPage for the current edited file.- Returns:
- the WSAuthorEditorPage for the current edited file. Can throw class cast exception if the current editor is not opened in the author page.
- Throws:
Exception
- Problems while accessing the current editor page.
-
invokeAuthorExtensionActionForID
Invoke action with a certain ID on the AWT thread.- Parameters:
id
- The id The action ID as defined in the framework.- Throws:
Exception
- Problems while accessing the current editor page.
-
moveCaretRelativeTo
protected void moveCaretRelativeTo(String text, int relativePosition, boolean select) throws Exception Move caret relative to a text already existing in the author page.- Parameters:
text
- The text to searchrelativePosition
- The delta to move the caret with after finding the text.- Throws:
Exception
- The anchor text was not found in the document.
-