Oxygen XML Editor 14.2 Author API

ro.sync.exml.workspace.api
Class PluginWorkspaceTCBase

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by junit.extensions.jfcunit.JFCTestCase
              extended by 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:
http://www.oxygenxml.com/doc/ug-oxygen/topics/automated-tests.html

Since:
14.1

*********************************
EXPERIMENTAL - Subject to change
********************************

Please note that this API is not marked as final and it can change in one of the next versions of the application. If you have suggestions, comments about it, please let us know.

See Also:
"http://www.oxygenxml.com/doc/ug-oxygen/topics/automated-tests.html"

Constructor Summary
PluginWorkspaceTCBase(java.io.File installationFolder, java.io.File frameworksFolder, java.io.File pluginsFolder, java.io.File optionsFolder, java.lang.String licenseKey)
          Constructor.
PluginWorkspaceTCBase(java.io.File frameworksFolder, java.io.File pluginsFolder, java.lang.String licenseKey)
          Constructor.
 
Method Summary
 WSAuthorEditorPage getCurrentAuthorEditorPageAccess()
          Get the WSAuthorEditorPage for the current edited file.
 java.lang.String getCurrentEditorXMLContent()
          Get the XML content currently loaded in the current editor.
 StandalonePluginWorkspace getPluginWorkspace()
          Get the plugin workspace.
protected  void invokeAuthorExtensionActionForID(java.lang.String id)
          Invoke action with a certain ID on the AWT thread.
protected  void moveCaretRelativeTo(java.lang.String text, int relativePosition, boolean select)
          Move caret relative to a text already existing in the author page.
 WSEditor open(java.net.URL url)
          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
countTestCases, createResult, getName, run, run, setName, toString
 
Methods inherited from class junit.framework.Assert
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, fail, fail
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PluginWorkspaceTCBase

public PluginWorkspaceTCBase(java.io.File frameworksFolder,
                             java.io.File pluginsFolder,
                             java.lang.String licenseKey)
                      throws java.lang.Exception
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. If null it will default to the folder "frameworks" in the installationFolder.
pluginsFolder - The folder from where to load the plugins. If null it will default to the folder "plugins" in the installationFolder.
licenseKey - The license key used to license the test Oxygen application.
Throws:
java.lang.Exception

PluginWorkspaceTCBase

public PluginWorkspaceTCBase(java.io.File installationFolder,
                             java.io.File frameworksFolder,
                             java.io.File pluginsFolder,
                             java.io.File optionsFolder,
                             java.lang.String licenseKey)
                      throws java.lang.Exception
Constructor.

Parameters:
installationFolder - The folder where Oxygen is installed. If null it will default to the folder in which the JVM started (new File(".")).
frameworksFolder - The folder from where to load the frameworks. If null it will default to the folder "frameworks" in the installationFolder.
pluginsFolder - The folder from where to load the plugins. If null 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:
java.lang.Exception
Method Detail

tearDown

protected void tearDown()
                 throws java.lang.Exception
Overrides:
tearDown in class junit.extensions.jfcunit.JFCTestCase
Throws:
java.lang.Exception
See Also:
JFCTestCase.tearDown()

setUp

protected void setUp()
              throws java.lang.Exception
Overrides:
setUp in class junit.extensions.jfcunit.JFCTestCase
Throws:
java.lang.Exception
See Also:
JFCTestCase.setUp()

getPluginWorkspace

public StandalonePluginWorkspace getPluginWorkspace()
Get the plugin workspace.

Returns:
Returns the plugin workspace.

open

public WSEditor open(java.net.URL url)
              throws java.lang.Exception
Open an URL.

Parameters:
url - The URL to open.
Returns:
The author page.
Throws:
java.lang.Exception

getCurrentEditorXMLContent

public java.lang.String getCurrentEditorXMLContent()
                                            throws java.lang.Exception
Get the XML content currently loaded in the current editor.

Returns:
The XML content.
Throws:
java.lang.Exception

getCurrentAuthorEditorPageAccess

public WSAuthorEditorPage getCurrentAuthorEditorPageAccess()
                                                    throws java.lang.Exception
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:
java.lang.Exception

invokeAuthorExtensionActionForID

protected void invokeAuthorExtensionActionForID(java.lang.String id)
                                         throws java.lang.Exception
Invoke action with a certain ID on the AWT thread.

Parameters:
id - The id The action ID as defined in the framework.
Throws:
java.lang.Exception

moveCaretRelativeTo

protected void moveCaretRelativeTo(java.lang.String text,
                                   int relativePosition,
                                   boolean select)
                            throws java.lang.Exception
Move caret relative to a text already existing in the author page.

Parameters:
text - The text to search
relativePosition - The delta to move the caret with after finding the text.
Throws:
java.lang.Exception

Oxygen XML Editor 14.2 Author API

© Copyright SyncRO Soft SRL 2002 - 2013. All rights reserved.