Package gw.test

Class TestClass

    • Constructor Detail

      • TestClass

        protected TestClass()
      • TestClass

        protected TestClass​(String s)
      • TestClass

        protected TestClass​(boolean shouldInit)
      • TestClass

        protected TestClass​(String s,
                            boolean shouldInit)
    • Method Detail

      • isGosuTest

        public boolean isGosuTest()
      • setGosuTest

        public void setGosuTest​(boolean gosuTest)
      • initInternalData

        protected void initInternalData()
      • getFullClassNameInternal

        protected String getFullClassNameInternal()
      • getNumberOfInstancesOfTestClassCreated

        public static Integer getNumberOfInstancesOfTestClassCreated​(String typeName)
      • setUp

        protected final void setUp()
                            throws Exception
        Overrides:
        setUp in class junit.framework.TestCase
        Throws:
        Exception
      • tearDown

        protected final void tearDown()
                               throws Exception
        Overrides:
        tearDown in class junit.framework.TestCase
        Throws:
        Exception
      • beforeTestClass

        public void beforeTestClass()
      • beforeTestMethod

        public void beforeTestMethod()
      • afterTestMethod

        public void afterTestMethod​(Throwable possibleException)
      • afterTestClass

        public void afterTestClass()
      • run

        public void run​(junit.framework.TestResult result)
        Specified by:
        run in interface junit.framework.Test
        Overrides:
        run in class junit.framework.TestCase
      • reallyRun

        public void reallyRun​(junit.framework.TestResult result)
      • runBare

        public void runBare()
                     throws Throwable
        Overrides:
        runBare in class junit.framework.TestCase
        Throws:
        Throwable
      • toString

        public String toString()
        Overrides:
        toString in class junit.framework.TestCase
      • setName

        public void setName​(String name)
        Overrides:
        setName in class junit.framework.TestCase
      • getName

        public String getName()
        Overrides:
        getName in class junit.framework.TestCase
      • createDefaultEnvironment

        public TestEnvironment createDefaultEnvironment()
      • runTest

        protected final void runTest()
                              throws Throwable
        Overrides:
        runTest in class junit.framework.TestCase
        Throws:
        Throwable
      • getType

        public IType getType()
      • getTypeName

        public String getTypeName()
      • getClassName

        public String getClassName()
      • getPackageName

        public String getPackageName()
      • assertArrayEquals

        public static void assertArrayEquals​(Object[] expected,
                                             Object[] got)
      • assertArrayEquals

        public static void assertArrayEquals​(String message,
                                             byte[] expected,
                                             byte[] actual)
        Compare two byte arrays, first the size then each byte.
        Parameters:
        expected -
        actual -
      • assertArrayEquals

        public static void assertArrayEquals​(Object[] expected,
                                             Object[] got,
                                             TestClass.EqualityTester tester)
        Verifies that all elements in the first array are present in the second array and match the elements in the first array. Uses EqualityUtil to determine equality and is order-insensitive.
        Parameters:
        expected - the expected result (reference)
        got - the obtained result (what to compare against the reference)
      • assertArrayEquals

        public static void assertArrayEquals​(String message,
                                             Object[] o1,
                                             Object[] o2)
      • assertSetsEqual

        public static void assertSetsEqual​(Set o1,
                                           Set o2)
      • assertCollectionEquals

        public static void assertCollectionEquals​(Collection o1,
                                                  Collection o2)
      • assertListEquals

        public static void assertListEquals​(List o1,
                                            List o2)
      • assertIterableEquals

        public static void assertIterableEquals​(Iterable o1,
                                                Iterable o2)
      • assertListEquals

        public static void assertListEquals​(List o1,
                                            List o2,
                                            Comparator c)
      • assertIterableEqualsIgnoreOrder

        public static void assertIterableEqualsIgnoreOrder​(Iterable i1,
                                                           Iterable i2)
      • assertZero

        public static void assertZero​(int i)
      • assertZero

        public static void assertZero​(long i)
      • assertMatchRegex

        public static void assertMatchRegex​(String message,
                                            String pattern,
                                            String result)
      • getTotalNumTestMethods

        public int getTotalNumTestMethods()
      • getMetadata

        public List<TestMetadata> getMetadata()
        Description copied from interface: ITestWithMetadata
        Returns any applicable metadata for the tests in this class.
        Specified by:
        getMetadata in interface ITestWithMetadata
        Returns:
        A list of @link{gw.test.ITestMetadata} objects, one for each test method providing metadata.
      • isMetaAnnotationInfo

        protected boolean isMetaAnnotationInfo​(IAnnotationInfo ai)
      • isMetaAnnotation

        protected boolean isMetaAnnotation​(Annotation ai)
      • initMetadata

        public void initMetadata​(String method)
      • assertCausesException

        public static void assertCausesException​(Runnable r,
                                                 Class<? extends Throwable> c)
      • createTestClass

        public static TestClass createTestClass​(IType testType)
      • _suite

        public static <T extends TestClass> junit.framework.Test _suite​(Class<T> clazz)