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,PL33465Test,TestClassWrapper.ExceptionTestClass,TestClassWrapper.InvalidTestClass
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Stringprivate booleanprivate TestExecutionManagerprivate booleanprivate booleanprivate List<TestMetadata>private Stringprivate static Booleanprivate static final ThreadLocal<TestExecutionManager> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends TestClass>
junit.framework.Testprotected voidaddMetadata(Collection<TestMetadata> metadata) voidvoidafterTestMethod(Throwable possibleException) private static booleanallTrue(boolean[] booleans) private static voidappendFoundStatus(StringBuffer sb, Object[] expected, boolean[] expectedFound) static voidassertArrayEquals(Object[] expected, Object[] got) static voidassertArrayEquals(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.static voidassertArrayEquals(String message, byte[] expected, byte[] actual) Compare two byte arrays, first the size then each byte.static voidassertArrayEquals(String message, Object[] o1, Object[] o2) static voidassertCausesException(Runnable r, Class<? extends Throwable> c) static voidstatic voidassertCollectionEquals(Collection o1, Collection o2, Comparator c) static voidassertIterableEquals(Iterable o1, Iterable o2) private static voidassertIterableEquals(Iterable i1, Iterable i2, String s) static voidassertIterableEquals(Iterable o1, Iterable o2, Comparator c) private static voidassertIterableEquals(Iterable i1, Iterable i2, Comparator c, String s) static voidstatic voidassertListEquals(List o1, List o2) static voidassertListEquals(List o1, List o2, Comparator c) static voidassertMatchRegex(String message, String pattern, String result) static voidassertSetsEqual(Set o1, Set o2) static voidassertZero(int i) static voidassertZero(long i) voidvoidprotected Collection<TestMetadata>createMetadata(Annotation[] annotations) protected Collection<TestMetadata>createMetadata(List<IAnnotationInfo> annotationInfos) createMethodMetadata(String method) static TestClasscreateTestClass(IType testType) protected voidprotected TestExecutionManagerprotected StringReturns any applicable metadata for the tests in this class.getName()static IntegergetNumberOfInstancesOfTestClassCreated(String typeName) private TestExecutionManagerintgetType()protected voidvoidinitMetadata(String method) booleanprivate booleanprivate booleanprotected booleanprotected booleanprivate static boolean[]makeFoundArray(int length) private static Mapprivate static ListvoidreallyRun(junit.framework.TestResult result) voidvoidrun(junit.framework.TestResult result) voidrunBare()protected final voidrunTest()voidsetExecutionManager(TestExecutionManager executionManager) voidsetGosuTest(boolean gosuTest) voidprotected final voidsetUp()private static booleanprotected final voidtearDown()toString()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
-
Field Details
-
_pkgName
-
_className
-
_executionManager
-
THREAD_LOCAL_EXECUTION_MANAGER
-
_metadata
-
_doNotRun
private boolean _doNotRun -
_knownBreak
private boolean _knownBreak -
_numberOfInstancesCreatedByTypeName
-
_isGosuTest
private boolean _isGosuTest -
_skipKnownBreakTests
-
-
Constructor Details
-
TestClass
protected TestClass() -
TestClass
-
TestClass
protected TestClass(boolean shouldInit) -
TestClass
-
-
Method Details
-
isGosuTest
public boolean isGosuTest() -
setGosuTest
public void setGosuTest(boolean gosuTest) -
initInternalData
protected void initInternalData() -
getFullClassNameInternal
-
getNumberOfInstancesOfTestClassCreated
-
setUp
- Overrides:
setUpin classjunit.framework.TestCase- Throws:
Exception
-
setExecutionManager
-
tearDown
- Overrides:
tearDownin classjunit.framework.TestCase- Throws:
Exception
-
beforeTestClass
public void beforeTestClass() -
beforeTestMethod
public void beforeTestMethod() -
afterTestMethod
-
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
- Overrides:
runBarein classjunit.framework.TestCase- Throws:
Throwable
-
reallyRunBare
- Throws:
Throwable
-
toString
- Overrides:
toStringin classjunit.framework.TestCase
-
setName
- Overrides:
setNamein classjunit.framework.TestCase
-
getName
- Overrides:
getNamein classjunit.framework.TestCase
-
getExecutionManager
-
getThreadLocalExecutionManager
-
createDefaultEnvironment
-
runTest
- Overrides:
runTestin classjunit.framework.TestCase- Throws:
Throwable
-
skipKnownBreakTests
private static boolean skipKnownBreakTests() -
doRunTest
- Throws:
Throwable
-
getType
-
getTypeName
-
getClassName
-
getPackageName
-
assertArrayEquals
-
assertArrayEquals
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)
-
appendFoundStatus
-
makeFoundArray
private static boolean[] makeFoundArray(int length) -
allTrue
private static boolean allTrue(boolean[] booleans) -
assertArrayEquals
-
assertSetsEqual
-
assertCollectionEquals
-
assertListEquals
-
assertIterableEquals
-
assertCollectionEquals
-
assertListEquals
-
assertIterableEquals
-
assertIterableEqualsIgnoreOrder
-
assertZero
public static void assertZero(int i) -
assertZero
public static void assertZero(long i) -
assertMatchRegex
-
makeHistogram
-
assertIterableEquals
-
assertIterableEquals
-
makeList
-
getTotalNumTestMethods
public int getTotalNumTestMethods() -
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
-
createMethodMetadata
-
createClassMetadata
-
createMetadata
-
isKnownBreakQualifier
-
isMetaAnnotationInfo
-
createMetadata
-
isKnownBreakQualifier
-
isMetaAnnotation
-
initMetadata
-
assertCausesException
-
createTestClass
-
_suite
-