org.momeunit.ant.taskdefs
Class TestListTask

java.lang.Object
  extended by org.apache.tools.ant.ProjectComponent
      extended by org.apache.tools.ant.Task
          extended by org.momeunit.ant.taskdefs.TestListTask

public class TestListTask
extends org.apache.tools.ant.Task

TestList task intended to set 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 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.

Version:
1.1.2
Author:
Sergio Morozov

Field Summary
static String DEFAULT_CONFIGURATION
          Default cldc version.
static String DEFAULT_PROFILE
          Default midp version.
static char DEFAULT_TESTS_SEPARATOR
          Default tests names separator.
 
Fields inherited from class org.apache.tools.ant.Task
description, location, target, taskName, taskType, wrapper
 
Fields inherited from class org.apache.tools.ant.ProjectComponent
project
 
Constructor Summary
TestListTask()
          Creates testlist task.
 
Method Summary
 org.apache.tools.ant.types.Path createClassPath()
          Returns created classpsth,
 Compiler createCompiler()
          Creates compiler.
 TestDir createTestDir()
          Creates testdir tag.
 TestJar createTestJar()
          Creates testjar tag.
 void execute()
          Executes task.
 String getPattern(String pattern)
          Returns given pattern or defaultpattern if given is null.
 void setAppJar(File appJar)
          Sets jar file of J2ME application to scan for test cases
 void setClassPath(org.apache.tools.ant.types.Path classpath)
          Adds path to classpath.
 void setConfig(String cldc)
          Sets CLDC version to use.
 void setDefPattern(String pattern)
          Sets default pattern to use.
 void setOnlyTests(boolean onlyTests)
          Sets flag that indicates whether to include only classes from implicit test that implement Test interface.
 void setPattern(String pattern)
          Sets pattern to refine list of test cases of implicit test.
 void setProfile(String midp)
          Sets MIDP version to use.
 void setProperty(String property)
          Sets name of property to set to list of tests.
 void setSeparator(char separator)
          Sets separator used to separate tests in the list.
 void setTestDir(File testDir)
          Sets root directory of files to be scanned for test cases.
 void setTestJar(File testJar)
          Sets jar file to be scanned for test cases.
 void setTestType(String testType)
          Sets type of files specified by testdir attribute.
 void setTmpDir(File dir)
          Sets temporary directory.
 void setWtkHome(File dir)
          Sets WTK home directory.
 
Methods inherited from class org.apache.tools.ant.Task
getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, maybeConfigure, perform, reconfigure, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
 
Methods inherited from class org.apache.tools.ant.ProjectComponent
getProject, setProject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_TESTS_SEPARATOR

public static final char DEFAULT_TESTS_SEPARATOR
Default tests names separator.

Since:
1.1
See Also:
Constant Field Values

DEFAULT_CONFIGURATION

public static final String DEFAULT_CONFIGURATION
Default cldc version.

Since:
1.1
See Also:
Constant Field Values

DEFAULT_PROFILE

public static final String DEFAULT_PROFILE
Default midp version.

Since:
1.1
See Also:
Constant Field Values
Constructor Detail

TestListTask

public TestListTask()
Creates testlist task.

Since:
1.1
Method Detail

execute

public void execute()
             throws org.apache.tools.ant.BuildException
Executes task.

Overrides:
execute in class org.apache.tools.ant.Task
Throws:
org.apache.tools.ant.BuildException
Since:
1.1
See Also:
Task.execute()

setTmpDir

public void setTmpDir(File dir)
Sets temporary directory.

Parameters:
dir - temporary directory.
Since:
1.1

setWtkHome

public void setWtkHome(File dir)
Sets WTK home directory.

Parameters:
dir - WTK home directory.
Since:
1.1

setClassPath

public void setClassPath(org.apache.tools.ant.types.Path classpath)
Adds path to classpath.

Parameters:
classpath - path to add to classpath.
Since:
1.1

createClassPath

public org.apache.tools.ant.types.Path createClassPath()
Returns created classpsth,

Returns:
the created classpsth as Path.
Since:
1.1

createCompiler

public Compiler createCompiler()
Creates compiler.

Returns:
the created compiler.
Since:
1.1

setDefPattern

public void setDefPattern(String pattern)
Sets default pattern to use.

Parameters:
pattern - the default pattern to use.
Since:
1.1

setPattern

public void setPattern(String pattern)
Sets pattern to refine list of test cases of implicit test. The format of this 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. The default value is specified by defpattern attribute.

Parameters:
pattern - the pattern to set.
Since:
1.1

setTestDir

public void setTestDir(File testDir)
Sets root directory of files to be scanned for test cases. All files below this directory will be added to J2ME application.

Parameters:
testDir - directory of files to be scanned for test cases.
Since:
1.1

setTestJar

public void setTestJar(File testJar)
Sets jar file to be scanned for test cases. All files in this file will be included in J2ME application.

Parameters:
testJar - jar file to be scanned for test cases
Since:
1.1

setTestType

public void setTestType(String testType)
Sets type of files specified by testdir attribute.

Parameters:
testType - type of files specified by testdir attribute
Since:
1.1

setAppJar

public void setAppJar(File appJar)
Sets jar file of J2ME application to scan for test cases

Parameters:
appJar - the appJar file to set.
Since:
1.1

getPattern

public String getPattern(String pattern)
Returns given pattern or defaultpattern if given is null.

Parameters:
pattern - pattern to test for nullability.
Returns:
the pattern to use, either given or default.
Since:
1.1

createTestDir

public TestDir createTestDir()
Creates testdir tag.

Returns:
created testdir tag.
Since:
1.1

createTestJar

public TestJar createTestJar()
Creates testjar tag.

Returns:
created testjar tag.
Since:
1.1

setOnlyTests

public void setOnlyTests(boolean onlyTests)
Sets flag that indicates whether to include only classes from implicit test that implement Test interface.

Parameters:
onlyTests - the onlyTests to set.
Since:
1.1

setProperty

public void setProperty(String property)
Sets name of property to set to list of tests.

Parameters:
property - name of property to set to list of tests.
Since:
1.1

setSeparator

public void setSeparator(char separator)
Sets separator used to separate tests in the list.

Parameters:
separator - character used to separate tests in the list.
Since:
1.1

setConfig

public void setConfig(String cldc)
Sets CLDC version to use.

Parameters:
cldc - CLDC version to use.
Since:
1.1

setProfile

public void setProfile(String midp)
Sets MIDP version to use.

Parameters:
midp - MIDP version to use.
Since:
1.1