org.adichatz.testing plugin must be added to application environment.
|
To overcome this problem, follow instructions below:
A new window is open, then:
|
Remark:
An other way is to add missing plugins inside {plugin}/{projectName}.product file:
If you decide to add missing plugins inside {plugin}/{projectName}.product file, thing to delete these lines before exporting project.
A test case is composed of one or several Java classes with one ore several annoted methods.
Below, a simple Test class is described.
Create java class MyFirstTest.java in package org.mycompany.myproject.testing.
package org.mycompany.myproject.testing; import org.adichatz.engine.e4.core.PartCore; import org.adichatz.engine.e4.part.BoundedPart; import org.adichatz.engine.e4.resource.E4SimulationTools; import org.adichatz.engine.simulation.SimulationTools; import org.adichatz.testing.AdiAssert; import org.adichatz.testing.TestingTools; import org.testng.annotations.Test; public class MyFirstTest { @Test public void test() { // Select Option queriesMenus/filmQuery in navigator "groupNavigator" and return a part. BoundedPart filmQueryPart = E4SimulationTools.handleNavigatorOpenPartItem("groupNavigator", "queriesMenu", "filmQUERY"); // check that part is active. AdiAssert.isPartActive(filmQueryPart); TestingTools.testInfo("QueryForm with query 'filmQUERY' is active."); PartCore filmQueryCore = filmQueryPart.getGenCode(); // Launch query in filmQuery part. SimulationTools.handleContextMenuAction(filmQueryCore, "tableCM:contextMenu", "launchQueryAction"); } }
Remarks:
This test opens a QueryForm editor and launch a query to supply rows to the Table Controller contained in the editor.
A more complex Test class which checks databinding between Entity editors could be seen here.
You need to add an simple entry in file $projectDirectory/resources/xml/AdichatzTesting.xml as shown below:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <adichatzTestingTree expanded="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.adichatz.org/xsd/v0.9.1/testing/adichatzTestingTree.xsd"> <suite id="myFirstSuite" label="Suite example" launchOnStartup="false" expanded="true"> <test id="myFirstTest" label="my first test" testURI="bundleclass://myproject/org.mycompany.myproject.testing.MyFirstTest"/> </suite> </adichatzTestingTree>
Remarks:
A testing
To execute or reexecute a test case, click on the corresponding item (my first test).
A specific editor was created for reporting test results. By default, it is automatically open when a test fails.
Testing menu provides Testing tools options</wrap> as shown below:
.