|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--junit.framework.Assert | +--junit.framework.TestCase | +--com.ashridgetech.jamda.test.BaseTest
Common facilities for tests on the Jamda classes.
Field Summary | |
protected java.util.List |
checkTextIgnorePrefixes
|
protected ClassWriter |
classWriter
|
static java.lang.String |
MAGICDRAW_STYLESHEET_LOCATION
|
protected static java.lang.String[] |
NO_NAMES
|
protected static Type[] |
NO_TYPES
|
protected static java.lang.String |
projectRoot
|
protected java.io.StringWriter |
stringWriter
|
protected static java.lang.String |
testFile
|
Constructor Summary | |
BaseTest(java.lang.String name)
Standard constructor required by subclasses of TestCase |
Method Summary | |
protected static void |
assertContains(java.util.Collection c,
java.lang.Object o)
Test that c contains an object equal to o . |
protected static void |
assertContainsAsString(java.util.Collection c,
java.lang.String s)
Test that c contains an object whose toString
method gives a value equal to s . |
protected static void |
assertContainsOnly(java.util.Collection c,
java.lang.Object o)
Test that c contains an object equal to o
and nothing else. |
protected static void |
assertContainsOnly(java.util.Collection c,
java.lang.Object o1,
java.lang.Object o2)
Test that c contains objects equal to o1 and
o2 and nothing else. |
protected static void |
assertContainsOnly(java.util.Collection c,
java.lang.Object o1,
java.lang.Object o2,
java.lang.Object o3)
Test that c contains objects equal to o1 ,
o2 and o3 and nothing else. |
protected static void |
assertContainsOnly(java.util.Collection c,
java.lang.Object o1,
java.lang.Object o2,
java.lang.Object o3,
java.lang.Object o4)
Test that c contains objects equal to o1 ,
o2 , o4 and o4 and nothing else. |
protected static void |
assertEmpty(java.util.Collection c)
Test that c is empty |
protected static void |
assertNotContainsAsString(java.util.Collection c,
java.lang.String s)
Test that c does not contain an object whose toString
method gives a value equal to s . |
static void |
checkAssocEnd(java.util.Collection assocEnds,
java.lang.String name,
java.lang.String otherEndName,
Type type,
StructuredType.Aggregation aggregation,
boolean isChangeable,
boolean isNavigable,
int lower,
int upper,
boolean isMultiple)
Check properties of an Association.End |
static void |
checkAttribute(Attribute attribute,
java.lang.String name,
Type type,
StructuredType.Visibility visibility,
boolean isStatic)
Check properties of an Attribute |
protected void |
checkEquals(java.lang.String expected,
java.lang.String actual)
Check two Strings for equality, and dump characters if they differ. |
protected void |
checkEquals(java.lang.String message,
java.lang.String expected,
java.lang.String actual)
Check two Strings for equality, and dump characters if they differ. |
static void |
checkOperation(Operation operation,
java.lang.String name,
StructuredType.Visibility visibility,
Type returnType,
boolean isStatic,
boolean isQuery,
boolean isAbstract,
java.lang.String[] paramNames,
Type[] paramTypes)
Check properties of an Operation |
static void |
checkProperty(Property prop,
java.lang.String name,
Type type,
StructuredType.Aggregation aggregation,
boolean isReadable,
boolean isWritable,
boolean isMultiple,
boolean isOid)
Check properties of an Property |
protected void |
checkText(java.lang.String expected)
Check the current text written to classWriter 's buffer. |
protected void |
checkText(java.lang.String expected,
boolean dumpOnFail)
Check the current text written to classWriter 's buffer. |
protected boolean |
checkTextIgnore(java.lang.String expectedLine,
java.lang.String actualLine)
|
protected static java.lang.String |
fullPathName(java.lang.String fileName)
|
protected static Model |
getModel()
|
protected java.lang.String |
getText()
Get the current text written to classWriter 's buffer. |
protected static Model |
loadModel(java.lang.String filename,
boolean useXsltTransform)
|
protected static Model |
loadModel(java.lang.String filename,
java.util.List factoryList,
java.util.List stdElementClasses,
boolean useXsltTransform)
|
protected static java.lang.String |
testFileName()
|
Methods inherited from class junit.framework.TestCase |
countTestCases, createResult, getName, run, run, runBare, runTest, setName, setUp, tearDown, toString |
Methods inherited from class junit.framework.Assert |
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, fail, fail |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final java.lang.String MAGICDRAW_STYLESHEET_LOCATION
protected static final java.lang.String[] NO_NAMES
protected static final Type[] NO_TYPES
protected static java.lang.String projectRoot
protected static java.lang.String testFile
protected java.io.StringWriter stringWriter
protected ClassWriter classWriter
protected java.util.List checkTextIgnorePrefixes
Constructor Detail |
public BaseTest(java.lang.String name)
TestCase
name
- nameMethod Detail |
protected static java.lang.String testFileName()
protected static java.lang.String fullPathName(java.lang.String fileName)
protected static Model getModel()
protected static Model loadModel(java.lang.String filename, boolean useXsltTransform)
protected static Model loadModel(java.lang.String filename, java.util.List factoryList, java.util.List stdElementClasses, boolean useXsltTransform)
public static void checkProperty(Property prop, java.lang.String name, Type type, StructuredType.Aggregation aggregation, boolean isReadable, boolean isWritable, boolean isMultiple, boolean isOid)
Property
public static void checkAssocEnd(java.util.Collection assocEnds, java.lang.String name, java.lang.String otherEndName, Type type, StructuredType.Aggregation aggregation, boolean isChangeable, boolean isNavigable, int lower, int upper, boolean isMultiple)
Association.End
public static void checkAttribute(Attribute attribute, java.lang.String name, Type type, StructuredType.Visibility visibility, boolean isStatic)
Attribute
public static void checkOperation(Operation operation, java.lang.String name, StructuredType.Visibility visibility, Type returnType, boolean isStatic, boolean isQuery, boolean isAbstract, java.lang.String[] paramNames, Type[] paramTypes)
Operation
protected static void assertEmpty(java.util.Collection c)
c
is empty
protected static void assertContains(java.util.Collection c, java.lang.Object o)
c
contains an object equal to o
.
protected static void assertContainsOnly(java.util.Collection c, java.lang.Object o)
c
contains an object equal to o
and nothing else.
protected static void assertContainsOnly(java.util.Collection c, java.lang.Object o1, java.lang.Object o2)
c
contains objects equal to o1
and
o2
and nothing else.
protected static void assertContainsOnly(java.util.Collection c, java.lang.Object o1, java.lang.Object o2, java.lang.Object o3)
c
contains objects equal to o1
,
o2
and o3
and nothing else.
protected static void assertContainsOnly(java.util.Collection c, java.lang.Object o1, java.lang.Object o2, java.lang.Object o3, java.lang.Object o4)
c
contains objects equal to o1
,
o2
, o4
and o4
and nothing else.
protected static void assertContainsAsString(java.util.Collection c, java.lang.String s)
c
contains an object whose toString
method gives a value equal to s
.
protected static void assertNotContainsAsString(java.util.Collection c, java.lang.String s)
c
does not contain an object whose toString
method gives a value equal to s
.
protected void checkEquals(java.lang.String message, java.lang.String expected, java.lang.String actual)
expected
- the expected textactual
- the actual textprotected void checkEquals(java.lang.String expected, java.lang.String actual)
expected
- the expected textactual
- the actual textprotected java.lang.String getText()
classWriter
's buffer.
protected void checkText(java.lang.String expected)
classWriter
's buffer.
expected
- the expected textprotected void checkText(java.lang.String expected, boolean dumpOnFail)
classWriter
's buffer.
expected
- the expected textdumpOnFail
- if true, print the actual text if it failsprotected boolean checkTextIgnore(java.lang.String expectedLine, java.lang.String actualLine)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |