Package org.codenarc.test
Class TestUtil
- java.lang.Object
-
- org.codenarc.test.TestUtil
-
- All Implemented Interfaces:
groovy.lang.GroovyObject
public class TestUtil extends Object implements groovy.lang.GroovyObject
-
-
Constructor Summary
Constructors Constructor Description TestUtil()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static voidassertContainsAll(String text, Object strings)static voidassertContainsAllInOrder(String text, Object strings)static voidassertEqualSets(Collection collection1, Collection collection2)static List<org.apache.log4j.spi.LoggingEvent>captureLog4JMessages(groovy.lang.Closure closure)static StringcaptureSystemOut(groovy.lang.Closure closure)static booleancontainsAll(String text, Object strings)groovy.lang.MetaClassgetMetaClass()ObjectgetProperty(String property)ObjectinvokeMethod(String method, Object arguments)voidsetMetaClass(groovy.lang.MetaClass mc)voidsetProperty(String property, Object value)static StringshouldFail(groovy.lang.Closure code)static StringshouldFail(Class expectedExceptionClass, groovy.lang.Closure code)static StringshouldFailWithMessageContaining(Class expectedExceptionClass, String expectedText, groovy.lang.Closure code)static voidshouldFailWithMessageContaining(Object text, groovy.lang.Closure closure)
-
-
-
Method Detail
-
getMetaClass
public groovy.lang.MetaClass getMetaClass()
- Specified by:
getMetaClassin interfacegroovy.lang.GroovyObject
-
setMetaClass
public void setMetaClass(groovy.lang.MetaClass mc)
- Specified by:
setMetaClassin interfacegroovy.lang.GroovyObject
-
invokeMethod
public Object invokeMethod(String method, Object arguments)
- Specified by:
invokeMethodin interfacegroovy.lang.GroovyObject
-
getProperty
public Object getProperty(String property)
- Specified by:
getPropertyin interfacegroovy.lang.GroovyObject
-
setProperty
public void setProperty(String property, Object value)
- Specified by:
setPropertyin interfacegroovy.lang.GroovyObject
-
shouldFail
public static String shouldFail(groovy.lang.Closure code)
-
shouldFailWithMessageContaining
public static String shouldFailWithMessageContaining(Class expectedExceptionClass, String expectedText, groovy.lang.Closure code)
-
shouldFailWithMessageContaining
public static void shouldFailWithMessageContaining(Object text, groovy.lang.Closure closure)
-
assertEqualSets
public static void assertEqualSets(Collection collection1, Collection collection2)
-
captureSystemOut
public static String captureSystemOut(groovy.lang.Closure closure)
-
captureLog4JMessages
public static List<org.apache.log4j.spi.LoggingEvent> captureLog4JMessages(groovy.lang.Closure closure)
-
-