Package gw.test
Class TestClass
- java.lang.Object
-
- junit.framework.Assert
-
- junit.framework.TestCase
-
- gw.test.TestClass
-
- All Implemented Interfaces:
ITestWithMetadata,junit.framework.Test
- Direct Known Subclasses:
BaseRemoteTestClass
public abstract class TestClass extends junit.framework.TestCase implements ITestWithMetadata
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceTestClass.EqualityTester
-
Method Summary
-
Methods inherited from class junit.framework.TestCase
assertEquals, assertEquals, assertEquals, assertEquals, 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
-
-
-
-
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:
setUpin classjunit.framework.TestCase- Throws:
Exception
-
setExecutionManager
public void setExecutionManager(TestExecutionManager executionManager)
-
tearDown
protected final void tearDown() throws Exception- Overrides:
tearDownin classjunit.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:
runin interfacejunit.framework.Test- Overrides:
runin classjunit.framework.TestCase
-
reallyRun
public void reallyRun(junit.framework.TestResult result)
-
runBare
public void runBare() throws Throwable- Overrides:
runBarein classjunit.framework.TestCase- Throws:
Throwable
-
toString
public String toString()
- Overrides:
toStringin classjunit.framework.TestCase
-
setName
public void setName(String name)
- Overrides:
setNamein classjunit.framework.TestCase
-
getName
public String getName()
- Overrides:
getNamein classjunit.framework.TestCase
-
getExecutionManager
protected TestExecutionManager getExecutionManager()
-
createDefaultEnvironment
public TestEnvironment createDefaultEnvironment()
-
runTest
protected final void runTest() throws Throwable- Overrides:
runTestin classjunit.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(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)
-
assertCollectionEquals
public static void assertCollectionEquals(Collection o1, Collection o2)
-
assertCollectionEquals
public static void assertCollectionEquals(Collection o1, Collection o2, Comparator c)
-
assertListEquals
public static void assertListEquals(List o1, List o2, Comparator c)
-
assertIterableEquals
public static void assertIterableEquals(Iterable o1, Iterable 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:ITestWithMetadataReturns any applicable metadata for the tests in this class.- Specified by:
getMetadatain interfaceITestWithMetadata- Returns:
- A list of @link{gw.test.ITestMetadata} objects, one for each test method providing metadata.
-
addMetadata
protected void addMetadata(Collection<TestMetadata> metadata)
-
createMethodMetadata
public Collection<TestMetadata> createMethodMetadata(String method)
-
createClassMetadata
public Collection<TestMetadata> createClassMetadata()
-
createMetadata
protected Collection<TestMetadata> createMetadata(List<IAnnotationInfo> annotationInfos)
-
isMetaAnnotationInfo
protected boolean isMetaAnnotationInfo(IAnnotationInfo ai)
-
createMetadata
protected Collection<TestMetadata> createMetadata(Annotation[] annotations)
-
isMetaAnnotation
protected boolean isMetaAnnotation(Annotation ai)
-
initMetadata
public void initMetadata(String method)
-
assertCausesException
public static void assertCausesException(Runnable r, Class<? extends Throwable> c)
-
-