Package groovy.util

Class GroovyTestCase

java.lang.Object
junit.framework.Assert
junit.framework.TestCase
groovy.util.GroovyTestCase
All Implemented Interfaces:
junit.framework.Test

@Deprecated
public class GroovyTestCase
extends junit.framework.TestCase
Deprecated.
A JUnit 3 TestCase base class in Groovy. In case JUnit 4 is used, see GroovyAssert.
See Also:
GroovyAssert
  • Field Details

    • log

      protected static Logger log
      Deprecated.
    • TEST_SCRIPT_NAME_PREFIX

      public static final String TEST_SCRIPT_NAME_PREFIX
      Deprecated.
      See Also:
      Constant Field Values
  • Constructor Details

    • GroovyTestCase

      public GroovyTestCase()
      Deprecated.
  • Method Details

    • getName

      public String getName()
      Deprecated.
      Overload the getName() method to make the test cases look more like AgileDox (thanks to Joe Walnes for this tip!)
      Overrides:
      getName in class junit.framework.TestCase
    • getMethodName

      public String getMethodName()
      Deprecated.
    • assertArrayEquals

      protected void assertArrayEquals​(Object[] expected, Object[] value)
      Deprecated.
      Asserts that the arrays are equivalent and contain the same values
      Parameters:
      expected -
      value -
    • assertLength

      protected void assertLength​(int length, char[] array)
      Deprecated.
      Asserts that the array of characters has a given length
      Parameters:
      length - expected length
      array - the array
    • assertLength

      protected void assertLength​(int length, int[] array)
      Deprecated.
      Asserts that the array of ints has a given length
      Parameters:
      length - expected length
      array - the array
    • assertLength

      protected void assertLength​(int length, Object[] array)
      Deprecated.
      Asserts that the array of objects has a given length
      Parameters:
      length - expected length
      array - the array
    • assertContains

      protected void assertContains​(char expected, char[] array)
      Deprecated.
      Asserts that the array of characters contains a given char
      Parameters:
      expected - expected character to be found
      array - the array
    • assertContains

      protected void assertContains​(int expected, int[] array)
      Deprecated.
      Asserts that the array of ints contains a given int
      Parameters:
      expected - expected int
      array - the array
    • assertToString

      protected void assertToString​(Object value, String expected)
      Deprecated.
      Asserts 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
    • assertInspect

      protected void assertInspect​(Object value, String expected)
      Deprecated.
      Asserts 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

      protected void assertScript​(String script) throws Exception
      Deprecated.
      Throws:
      Exception
    • getTestClassName

      protected String getTestClassName()
      Deprecated.
    • shouldFail

      protected String shouldFail​(Closure code)
      Deprecated.
    • shouldFail

      protected String shouldFail​(Class clazz, Closure code)
      Deprecated.
    • shouldFailWithCause

      protected String shouldFailWithCause​(Class clazz, Closure code)
      Deprecated.
    • shouldFail

      protected String shouldFail​(Class clazz, String script)
      Deprecated.
    • shouldFail

      protected String shouldFail​(String script)
      Deprecated.
    • fixEOLs

      protected String fixEOLs​(String value)
      Deprecated.
      Returns a copy of a string in which all EOLs are \n.
    • notYetImplemented

      public static boolean notYetImplemented​(Object caller)
      Deprecated.
    • notYetImplemented

      public boolean notYetImplemented()
      Deprecated.
      Convenience method for subclasses of GroovyTestCase, identical to
       GroovyTestCase.notYetImplemented(this); 
      .
      Returns:
      false when not itself already in the call stack
      See Also:
      notYetImplemented(java.lang.Object)
    • assertEquals

      public static void assertEquals​(String message, Object expected, Object actual)
      Deprecated.
    • assertEquals

      public static void assertEquals​(Object expected, Object actual)
      Deprecated.
    • assertEquals

      public static void assertEquals​(String expected, String actual)
      Deprecated.