Date: 2005-01-28T11:48:01
   Editor: ZacharySmith
   Wiki: Apache Beehive Wiki
   Page: Controls/TestingControls/Milton
   URL: http://wiki.apache.org/beehive/Controls/TestingControls/Milton

   no comment

Change Log:

------------------------------------------------------------------------------
@@ -65,12 +65,15 @@
 
  * 1. The Imports: In order to use Milton Client Generation you must import 
the Milton annotation interface, the Milton Report class, and any Control Beans 
that your test will use.
  * 2. The Driver Class: All Drivers you wish to have clients generated for 
must have the [EMAIL PROTECTED] method.  This tells the Milton processor that 
this Driver will need clients generated.  [EMAIL PROTECTED] has two fields:  
`clients()` which is an array of Enumerated types of support clients.  
Currently there are only two client types: `Milton.ClientType.JWS` and 
`Milton.ClientType.JPF`.  By default `clients` is set to 
`{Milton.ClientType.JWS, Milton.ClientType.JPF}`.  If you only wanted your test 
to run in one of those you could override it here.  The second field available 
for override on [EMAIL PROTECTED] is `junit()` which is a boolean which when 
set to true will cause the Milton Client Generation processor to generate JUnit 
accessors for your clients.  If you wish to write your own JUnit accessors set 
this to `false`.  As with all JWS-175 annotations you need only explicitly set 
the annotations fields if you wish to override the default.  As in the example, 
simply placing [EMAIL PROTECTED] on your class will result in the generation of 
JWS and JPF clients and JUnit accessors for each.
- * 3. The Test Methods:  All methods in a Milton Driver using Client 
Generation must having the following convention.
-  * 1. The method must return a Report object.
+ * 3. The Test Method Declaration:  All methods in a Milton Driver using 
Client Generation must having the following convention.
+  * 1. The method must return a `Report` object.
   * 2. The method name must start with 'test'
   * 3. The method must have at least one paramater that is a `ControlBean`.
-  * 4. The method must have the [EMAIL PROTECTED] annotation applied to it.  
This tells the Milton Client Generation processor that this is infact a Test 
method and that it must comply with the above conventions.  There are four 
fields available on this annotation:  `frequency()`, `status()`, 
`description()`, and `misc()`.  These annotations are made available to work 
with [wiki:/TCH TCH].  Please see the [wiki:/TCH TCH] documentation for more 
information.
+  * 4. The method must have the [EMAIL PROTECTED] annotation applied to it.  
This tells the Milton Client Generation processor that this is infact a Test 
method and that it must comply with the above conventions.  There are four 
fields available on this annotation:  `frequency()`, `status()`, 
`description()`, and `misc()`.  These annotations are made available to work 
with [wiki:/TCH TCH].  Please see the [wiki:/TCH TCH] documentation for more 
information on their meanings.
  * 4. The Test Methods Parameters: As stated in above in 3.3 each test method 
much have at least one parameter that is of type `ControlBean`.  The generated 
clients will instantiate a bean of this type and pass it to the Driver test 
method.  There are four fields available on this annotation:
   * 1. `name()` which by default is blank.  It is recommended that you leave 
the name blank.  This is the name which will be used in the client code to name 
the `ControlBean` type instance and used to be passed to your test method.  See 
documentation below.
-  * 2. `instantiate()` is an instance of the Enumerated type, 
`Milton.Instantiate` and can be set to `Milton.Instantiate.DECLARATIVE` (which 
is the default) or `Milton.Instantiate.PROGRAMATIC` which will cause the client 
to use the `java.beans.Beans` API.
-  * 3. `annotations` is  an array of `String`s which allows you to add 
annotations to Controls which use Declarative instantiation.  `annotations()` 
will be ignored for Controls using Programatic instantiation.  Currently Milton 
Client Generation does not support Property setting when using Programatic 
instantiation.  If you require this for your test you will need to use method 
two described below.
+  * 2. `instantiate()` is an instance of the Enumerated type, 
`Milton.Instantiate` and can be set to `Milton.Instantiate.DECLARATIVE` (which 
is the default) or `Milton.Instantiate.PROGRAMATIC` which will cause the client 
to use the `java.beans.Beans` API for instantiating an instance of the test 
Control.
+  * 3. `annotations()` is  an array of `String`s which allows you to add 
annotations to Controls which use Declarative instantiation.  `annotations()` 
will be ignored for Controls using Programatic instantiation.  Currently Milton 
Client Generation does not support Property setting when using Programatic 
instantiation.  If you require this for your test you will need to use method 
two described below.
+  * 4. `modifier()` is used to change the java access modifier for your 
control.  By default it is `public`.
+ * 4. The Test Method Body
+  * 1. In the example this test expects to receive a non-null 
`InstantiateControlBean` instance from the client.  The `ControlBean` has a 
method called `echoString(String s)` which should simply return back the String 
passed to it.  A `Report` is instantiated at the beginning of the method and 
updated as the test progresses and is then returned.

Reply via email to