Date: 2005-01-28T15:38:04
Editor: ZacharySmith
Wiki: Apache Beehive Wiki
Page: Controls/TestingControls/Milton
URL: http://wiki.apache.org/beehive/Controls/TestingControls/Milton
no comment
Change Log:
------------------------------------------------------------------------------
@@ -148,8 +148,7 @@
{
@Control
public InstantiationControlBean icb;
-
-
+
@WebMethod
public Report testInstantiation() throws Exception
{
@@ -159,3 +158,49 @@
}
}}}
+If you have questions about the JWS syntax please refer to the [wiki:/WSM WSM]
documentation. This should look similar to the JPF example above with a few
minor changes. In this case there is a `WebMethod` called `testInstantiate()`
which can directly return a `Report` to the JUnit accessor.
+[[BR]]
+
+'''JUnit Accessor Examples'''
+
+{{{
+import org.apache.beehive.test.tools.milton.junit.HtmlReportTestCase;
+
+import org.apache.beehive.test.tools.mantis.annotations.tch.*;
+
+public class TestDriveHelloControl extends HtmlReportTestCase
+{
+ public TestDriveHelloControl(String s){super(s);}
+
+
+ @Freq("checkin")
+ @Status("active")
+ public void testInstantiation() throws Exception
+ {
+
assertReport("controlsWeb/milton/pageflows/instantiate/InstantiationDriver/testInstantiation.do");
+ }
+
+}
+}}}
+The above example is a JPF accessor.
+[[BR]]
+
+{{{
+import org.apache.beehive.test.tools.milton.junit.SOAPReportTestCase;
+
+import org.apache.beehive.test.tools.mantis.annotations.tch.*;
+
+public class TestDriveHelloControl extends SOAPReportTestCase
+{
+ public TestDriveHelloControl(String s){super(s);}
+
+ @Freq("checkin")
+ @Status("active")
+ public void testInstantiation() throws Exception
+ {
+
assertReport("/controlsWeb/milton/webservices/instantiate/InstantiationDriverWebService.jws",
"testInstantiation");
+ }
+}
+}}}
+
+In both examples, the test method (`WebMethod` and `Action`) names are all the
same. This helps trace which methods are associated with each other. This
convention is not required but is definitly incouraged. When using Client
Generation you will get tests generated which look very similar to the above
examples (JPF, JPF, JUnit Accessors).