Package groovy.test
Class GroovyTestCase
java.lang.Object
junit.framework.Assert
junit.framework.TestCase
groovy.test.GroovyTestCase
- All Implemented Interfaces:
- junit.framework.Test
public class GroovyTestCase
extends junit.framework.TestCase
A JUnit 3 
TestCase base class in Groovy.
 In case JUnit 4 is used, see GroovyAssert.- See Also:
- 
Field SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected voidassertArrayEquals(Object[] expected, Object[] value) Asserts that the arrays are equivalent and contain the same valuesprotected voidassertContains(char expected, char[] array) Asserts that the array of characters contains a given charprotected voidassertContains(int expected, int[] array) Asserts that the array of ints contains a given intstatic voidassertEquals(Object expected, Object actual) static voidassertEquals(String message, Object expected, Object actual) static voidassertEquals(String expected, String actual) protected voidassertInspect(Object value, String expected) Asserts that the value of inspect() on the given object matches the given text stringprotected voidassertLength(int length, char[] array) Asserts that the array of characters has a given lengthprotected voidassertLength(int length, int[] array) Asserts that the array of ints has a given lengthprotected voidassertLength(int length, Object[] array) Asserts that the array of objects has a given lengthprotected voidassertScript(String script) protected voidassertToString(Object value, String expected) Asserts that the value of toString() on the given object matches the given text stringprotected StringReturns a copy of a string in which all EOLs are \n.getName()Overload the getName() method to make the test cases look more like AgileDox (thanks to Joe Walnes for this tip!)protected StringbooleanConvenience method for subclasses of GroovyTestCase, identical tostatic booleannotYetImplemented(Object caller) protected StringshouldFail(Closure code) protected StringshouldFail(Class clazz, Closure code) protected StringshouldFail(Class clazz, String script) protected StringshouldFail(String script) protected StringshouldFailWithCause(Class clazz, Closure code) Methods inherited from class junit.framework.TestCaseassertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, countTestCases, createResult, fail, fail, failNotEquals, failNotSame, failSame, format, run, run, runBare, runTest, setName, setUp, tearDown, toString
- 
Field Details- 
log
- 
TEST_SCRIPT_NAME_PREFIX- See Also:
 
 
- 
- 
Constructor Details- 
GroovyTestCasepublic GroovyTestCase()
 
- 
- 
Method Details- 
getNameOverload the getName() method to make the test cases look more like AgileDox (thanks to Joe Walnes for this tip!)- Overrides:
- getNamein class- junit.framework.TestCase
 
- 
getMethodName
- 
assertArrayEqualsAsserts that the arrays are equivalent and contain the same values- Parameters:
- expected-
- value-
 
- 
assertLengthprotected void assertLength(int length, char[] array) Asserts that the array of characters has a given length- Parameters:
- length- expected length
- array- the array
 
- 
assertLengthprotected void assertLength(int length, int[] array) Asserts that the array of ints has a given length- Parameters:
- length- expected length
- array- the array
 
- 
assertLengthAsserts that the array of objects has a given length- Parameters:
- length- expected length
- array- the array
 
- 
assertContainsprotected void assertContains(char expected, char[] array) Asserts that the array of characters contains a given char- Parameters:
- expected- expected character to be found
- array- the array
 
- 
assertContainsprotected void assertContains(int expected, int[] array) Asserts that the array of ints contains a given int- Parameters:
- expected- expected int
- array- the array
 
- 
assertToStringAsserts that the value of toString() on the given object matches the given text string- Parameters:
- value- the object to be output to the console
- expected- the expected String representation
 
- 
assertInspectAsserts that the value of inspect() on the given object matches the given text string- Parameters:
- value- the object to be output to the console
- expected- the expected String representation
 
- 
assertScript- Throws:
- Exception
 
- 
getTestClassName
- 
shouldFail
- 
shouldFail
- 
shouldFailWithCause
- 
shouldFail
- 
shouldFail
- 
fixEOLsReturns a copy of a string in which all EOLs are \n.
- 
notYetImplemented
- 
notYetImplementedpublic boolean notYetImplemented()Convenience method for subclasses of GroovyTestCase, identical toGroovyTestCase.notYetImplemented(this); .- Returns:
- falsewhen not itself already in the call stack
- See Also:
 
- 
assertEquals
- 
assertEquals
- 
assertEquals
 
-