This task sets the specified property to the list of test cases to run. List of
test cases is created based on given J2ME application or classes and/or java source files
specified via test descriptions. Test cases included are classes
and/or java source files that implement
momeunit.framework.Test
interface and/or match specified pattern.
Tests can be described by using <testdir>
, <tesjar>
nested tags. <testlist>
task is an implicit test and can be described using
testdir
, testtype
and testjar
attributes.
Users can use pattern to further refine list of test cases to run. Format of pattern
resembles Ant path pattern. Instead of slash ('/'
), dot ('.'
)
is used. It looks like ant package pattern ( e.g. "**.*Test"
matches any file that ends with Test at any package, "test.**.*"
matches any file below test package, "**.*"
matches all
files).
Java source files will be compiled to test that they implement
Test
interface.
The value of set property is intended to be used for building and/or running test application using other tasks (e.g. from antenna project).
Attribute |
Description |
Required |
appjar |
Jar file of J2ME application to scan for tests. If set all tests descriptions are ignored. |
No |
Classpath to use. The default is |
No |
|
config |
CLDC version to use. Note: The least version |
No; default is |
defpatten |
Pattern to be used as default for nested |
No; default is |
onlyTests |
Include in tests list classes specified by implicit test or
|
No; default is |
pattern |
Pattern to refine list of test cases of implicit test. The
format of this pattern resembles Ant path pattern. Instead of
slash ( Note: Only files implementing
|
No |
profile |
MIDP version to use. Note: The least version |
No; default is |
property |
Name of the property to set to list of test cases to run separated by
|
Yes |
separator |
Character used for separating test cases in created list.
The default value is comma ( |
No; default is |
testdir |
Root directory of classes or source java files to be scanned for test cases. Note: Java source files will be compiled to test
that they implement |
Either one of them or |
testjar |
Jar file to be scanned for test cases. |
|
testtype |
Type of files specified by testdir attribute. Either
Note: Can be used only in conjunction with |
No; default is |
tmpdir |
Directory where |
No |
wtkhome |
Home directory of WTK used. If not set uses |
No |
The location of class files to be used at compiling java source files can be specified using this PATH like structure.
Configures compiler that compiles java source files, if there are some.
This tag extends <javac>
task,
All attributes and nested tags of <javac>
except forbidden in
compiler
can be specified.
compiler
forbids following attributes:
classpath
, classpathref
–
classpath of testlist
is used instead;
src
, sourcepath
, sourcepathref
-
sources specified by testdir
tags and testdir
attribute of
testlist
are used instead;
and nested tags:
classpath
– classpath of
testlist
is used instead;
src
, sourcepath
- sources
specified by testdir
tags and testdir
attribute of testlist
are used instead;
target
attribute is preset to 1.1
and source
attribute is preset to 1.3
.
Additional attributes defined in compiler:
Attribute |
Description |
Required |
destdir |
Directory where to place compiled classes. Defaults to
temporary directory under |
No |
delonexit |
Delete compiled classes after tests run. Default is Note: Users should be careful with specifying this attribute.
if |
No |
Defines classes to be scanned for tests cases. This tag extends fileset. All attributes and nested tags of fileset are allowed. Only files designated by this tag are scanned for test cases.
Attribute |
Description |
Required |
dir |
Directory of files to be scanned for test cases. Files below this directory will be compiled if necessary. |
Yes |
type |
Type of files under dir. Either |
No; default is |
pattern |
Pattern to refine test cases enlisted. The format of this
pattern resembles Ant path pattern. Instead of slash ( Note: Only files implementing
|
No |
onlyTests |
Include only classes that implement
|
No |
if |
Only run tests if the named property is set. |
No |
unless |
Only run tests if the named property is not set. |
No |
Defines classes to be scanned for tests cases. This tag extends zipfileset. All attributes and nested tags of zipfileset are allowed. Only files designated by this tag are scanned for test cases.
Attribute |
Description |
Required |
src |
Jar file to be scanned for test cases. |
Yes |
pattern |
Pattern to refine test cases enlisted. The format of this
pattern resembles Ant path pattern. Instead of slash ( Note: Only files implementing
|
No |
onlyTests |
Include only classes that implement
|
No |
if |
Only run tests if the named property is set. |
No |
unless |
Only run tests if the named property is not set. |
No |
<testlist property="testlist" appjar="res/myapp.jar" />
Sets testlist
property to a list of test names of all classes
of myapp.jar that implement momeunit.framework.Test interface.
<testlist property="testlist" appjar="res/myapp.jar" separator=";" />
Does the same as previous example but tests are separated by semicolon instead of comma.
<testlist property="testlist" testdir="src" testtype="src" />
Sets testlist
property to a list of test names of all java
source files under src directory that implement momeunit.framework.Test interface.
Compiles java source files before.
<testlist property="testlist" > <testdir dir=src" type="src" /> </testlist>
Does the same as previous example.
<testlist property="testlist" testdir="src" pattern="**.*Test" onlyTest="off" />
Sets testlist
property to a list of test names of all classes under src directory
that ends on Test. Doesn't test classes for implementing
momeunit.framework.Test interface.
<target name="buildApp" ... > ... <testlist property="testlist" testdir="bin" /> ... <wtkjad ... > ... <attribute name="MoMEUnit-Tests" value="${testlist}"/> <attribute name="MoMEUnit-TestsName"" value="MyApp"/> <midlet name="MIDletTestRunner" class="momeunit.runner.MIDletTestRunner" /> ... </wtkjad> ... </target>
Sets testlist
property to a list of test names of all classes under bin
directory that implement momeunit.framework.Test interface. Makes JAD descriptor for
running tests by MIDletTestRunner using antenna tasks.