Date: 2005-01-28T15:51:13
Editor: ZacharySmith
Wiki: Apache Beehive Wiki
Page: Controls/TestingControls/Milton
URL: http://wiki.apache.org/beehive/Controls/TestingControls/Milton
no comment
Change Log:
------------------------------------------------------------------------------
@@ -158,7 +158,7 @@
}
}}}
-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.
+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. Also note that
when using Milton your `WebMethod` must take no parameters as the Milton test
clients have no mechanism to pass data to the JWS. In other words, your tests
must be self contained as much as possible so that they can easily be moved
from one client context to another.
[[BR]]
'''JUnit Accessor Examples'''
@@ -168,9 +168,9 @@
import org.apache.beehive.test.tools.mantis.annotations.tch.*;
-public class TestDriveHelloControl extends HtmlReportTestCase
+public class TestInstantiation extends HtmlReportTestCase
{
- public TestDriveHelloControl(String s){super(s);}
+ public TestInstantiation(String s){super(s);}
@Freq("checkin")
@@ -182,16 +182,16 @@
}
}}}
-JPF Accessors like the one above must extend `HtmlReportTestCase` to take
advantage of the `assertReport` methods. The String passed to `assertReport`
is the path relative to the root to the JPF which contains your test. (You can
put in a fully qualified URL here if you prefer but Milton can discover the
name of your host) Here we take advantage of the JPF 'ActionName.do' syntax.
The annotations [EMAIL PROTECTED] and [EMAIL PROTECTED] are used for creating
TCH files. It is higly encouraged that you use TCH as it helps to organize the
test base. For more information on TCH please see the [wiki:/TCH TCH]
documentation. [[BR]]
+JPF Accessors like the one above must extend `HtmlReportTestCase` to take
advantage of the `assertReport` methods. The String passed to `assertReport`
is the path relative to the root to the JPF which contains your test. (You can
put in a fully qualified URL here if you prefer but Milton can discover the
name of your host) Here we take advantage of the JPF 'actionName.do' syntax.
The annotations [EMAIL PROTECTED] and [EMAIL PROTECTED] are used for creating
TCH files. You are highly encouraged to use TCH as it helps to organize the
test base. For more information on TCH please see the [wiki:/TCH TCH]
documentation. [[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 class TestInstantiation extends SOAPReportTestCase
{
- public TestDriveHelloControl(String s){super(s);}
+ public TestInstantiation(String s){super(s);}
@Freq("checkin")
@Status("active")
@@ -202,7 +202,6 @@
}
}}}
-The above example is a JWS accessor. [[BR]]
+The above is quite similar to the JPF accessor example. Here the accessor
extends `SOAPReportTestCase` which contains code to deserialize the `Report`
returned by the `testInstantiation()` Web Method. [[BR]]
-
-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).
+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 encouraged. When using Client
Generation you will get tests generated which look very similar to the above
examples (JPF, JPF, JUnit Accessors).