Package org.apache.groovy.test
Class ScriptTestAdapter
java.lang.Object
org.apache.groovy.test.ScriptTestAdapter
- All Implemented Interfaces:
junit.framework.Test
An adapter to make any Groovy Script class an instance of a JUnit Test
-
Constructor Summary
ConstructorsConstructorDescriptionScriptTestAdapter(Class scriptClass, String[] arguments) Creates an adapter that runs the supplied Groovy script class as a JUnit test. -
Method Summary
-
Constructor Details
-
ScriptTestAdapter
Creates an adapter that runs the supplied Groovy script class as a JUnit test.- Parameters:
scriptClass- the compiled Groovy script class to executearguments- the command-line arguments passed to the script
-
-
Method Details
-
countTestCases
public int countTestCases()Returns the number of test cases represented by this adapter.- Specified by:
countTestCasesin interfacejunit.framework.Test- Returns:
- always
1
-
run
public void run(junit.framework.TestResult result) Executes the adapted script and reports the result to JUnit.- Specified by:
runin interfacejunit.framework.Test- Parameters:
result- theTestResultreceiving lifecycle callbacks and errors
-
toString
Returns a human-readable description of the adapted script test.
-