If you have developed complex custom plugins and/or document types the best way to test your implementation and insure that further changes will not interfere with the current behavior is to make automated tests for your customization.
An Oxygen XML Editor installation standalone (Author or Editor) comes with a main oxygen.jar library located in the [OXYGEN_DIR]. That JAR library contains a base class for testing developer customizations named ro.sync.exml.workspace.api.PluginWorkspaceTCBase.
Please see below some steps in order to develop JUnit tests for your customizations using the Eclipse workbench:
public class MyTestClass extends PluginWorkspaceTCBase {
/**
* Constructor.
*/
public MyTestClass() throws Exception {
super(new File("frameworks"), new File("plugins"),
"------START-LICENSE-KEY------\n" +
"\n" +
"Registration_Name=Developer\n" +
"\n" +
"Company=\n" +
"\n" +
"Category=Enterprise\n" +
"\n" +
"Component=XML-Editor, XSLT-Debugger, Saxon-SA\n" +
"\n" +
"Version=14\n" +
"\n" +
"Number_of_Licenses=1\n" +
"\n" +
"Date=09-04-2012\n" +
"\n" +
"Trial=31\n" +
"\n" +
"SGN=MCwCFGNoEGJSeiC3XCYIyalvjzHhGhhqAhRNRDpEu8RIWb8icCJO7HqfVP4++A\\=\\=\n" +
"\n" +
"-------END-LICENSE-KEY-------");
}
/**
* <p><b>Description:</b> TC for opening a file and using the bold operation</p>
* <p><b>Bug ID:</b> EXM-20417</p>
*
* @author radu_coravu
*
* @throws Exception
*/
public void testOpenFileAndBoldEXM_20417() throws Exception {
WSEditor ed = open(new File("D:/projects/eXml/test/authorExtensions/dita/sampleSmall.xml").toURL());
//Move caret
moveCaretRelativeTo("Context", 1, false);
//Insert <b>
invokeAuthorExtensionActionForID("bold");
assertEquals("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
"<!DOCTYPE task PUBLIC \"-//OASIS//DTD DITA Task//EN\" \"http://docs.oasis-open.org/dita/v1.1/OS/dtd/task.dtd\">\n" +
"<task id=\"taskId\">\n" +
" <title>Task <b>title</b></title>\n" +
" <prolog/>\n" +
" <taskbody>\n" +
" <context>\n" +
" <p>Context for the current task</p>\n" +
" </context>\n" +
" <steps>\n" +
" <step>\n" +
" <cmd>Task step.</cmd>\n" +
" </step>\n" +
" </steps>\n" +
" </taskbody>\n" +
"</task>\n" +
"", getCurrentEditorXMLContent());
}
}