|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--com.meyling.principia.module.PackageTest
General package test.
| Inner Class Summary | |
private static class |
PackageTest.TestReader
Special reader for test files with convenient methods for reading arguments. |
| Field Summary | |
static String |
ACTUAL_OUTPUT_FILE_POSTFIX
output file name postfix |
static String |
END
marks end of result |
static String |
EXCEPTION_TEST_FILE_PREFIX
test input file |
static String |
EXPECTED_OUTPUT_FILE_POSTFIX
expected output file name postfix |
static String |
FAIL
creation failed |
static String |
FALSE
false |
static String |
FILE_PATH
path to test data |
static String |
INPUT_FILE_POSTFIX
input file name postfix |
static String |
NEXT
seperates several arguments |
static PrintStream |
out
output stream |
static String |
RESULT
seperates result from arguments |
static String |
TEST_FILE_PREFIX
file name prefix |
static String |
TRUE
true |
| Constructor Summary | |
PackageTest()
|
|
| Method Summary | |
private static boolean |
isEndSeparator(String text)
Check if text is equal to END. |
private static boolean |
isNextSeparator(String text)
Check if text is equal to NEXT. |
private static boolean |
isResultSeparator(String text)
Check if text is equal to RESULT. |
private static boolean |
isSeparator(String text)
Check if text is equal to any separator:
NEXT, RESULT or END. |
static void |
main(String[] argument)
Runs the following test numbers (or all tests). |
static boolean |
test()
Run all normal tests in directory FILE_PATH.
|
static void |
testArgument(Argument argument,
StringBuffer list)
Performes simple argument tests: is argument equal to itself is argument equal to argument.copy() (both directions) is argument equal to same argument created of list with
ModuleCreator.readArgument() (both
directions)
is argument equal to same argument created of result of
ModuleCreator.writeArgument(com.meyling.principia.io.Output, com.meyling.principia.argument.Argument)
with ModuleCreator.readArgument()
(both directions)
|
static boolean |
testArgument(String argument)
Test a single normal test file. |
static boolean |
testCreate(PackageTest.TestReader reader,
int startLine)
Test creation of argument. |
static boolean |
testEquals(PackageTest.TestReader reader,
int startLine)
Test equality of arguments. |
static boolean |
testException()
Run all exception tests in directory FILE_PATH.
|
static boolean |
testExceptionArgument(String argument)
Test a single exception test file. |
static int |
testFile(String fileName)
Test this package with a file. |
static boolean |
testReplace1(PackageTest.TestReader reader,
int startLine)
Test simple replacement of arguments. |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
public static final String FILE_PATH
public static final String TEST_FILE_PREFIX
public static final String INPUT_FILE_POSTFIX
public static final String ACTUAL_OUTPUT_FILE_POSTFIX
public static final String EXPECTED_OUTPUT_FILE_POSTFIX
public static final String EXCEPTION_TEST_FILE_PREFIX
public static final String NEXT
public static final String RESULT
public static final String END
public static final String TRUE
public static final String FALSE
public static final String FAIL
public static PrintStream out
| Constructor Detail |
public PackageTest()
| Method Detail |
public static final void main(String[] argument)
System.out.argument - (optional) list of test numbers,
a leading "-t " runs the exception testpublic static final boolean test()
FILE_PATH.
All files that start with TEST_FILE_PREFIX and
end with INPUT_FILE_POSTFIX are put into
testArgument(java.lang.String). Iff all these tests return
true this method returns true.true iff all tests were okpublic static final boolean testException()
FILE_PATH.
All files that start with EXCEPTION_TEST_FILE_PREFIX and
end with INPUT_FILE_POSTFIX are put into
testArgument(java.lang.String). Iff all these tests return
true this method returns true.true iff all tests were okpublic static final boolean testArgument(String argument)
FILE_PATH TEST_FILE_PREFIX
argument INPUT_FILE_POSTFIX.
Start and result information is printed to System.out.argument - part of the file namepublic static final boolean testExceptionArgument(String argument)
FILE_PATH EXCEPTION_TEST_FILE_PREFIX
argument INPUT_FILE_POSTFIX.
Start and result information is printed to System.out.argument - part of the file namepublic static final int testFile(String fileName)
fileName - name of file with test data
public static boolean testCreate(PackageTest.TestReader reader,
int startLine)
throws IOException,
IllegalArgumentException
reader - source to read fromstartLine - source line where test startedIOException - if any file error occured
public static boolean testEquals(PackageTest.TestReader reader,
int startLine)
throws IOException,
IllegalArgumentException
reader - source to read fromstartLine - source line where test startedIOException - if any file error occuredIllegalArgumentException - if an expected creation
failed
public static boolean testReplace1(PackageTest.TestReader reader,
int startLine)
throws IOException,
IllegalArgumentException
reader - source to read fromstartLine - source line where test startedIOException - if any file error occuredIllegalArgumentException - if an expected creation
failedprivate static boolean isNextSeparator(String text)
text is equal to NEXT.text - compare textprivate static boolean isResultSeparator(String text)
text is equal to RESULT.text - compare textprivate static boolean isEndSeparator(String text)
text is equal to END.text - compare textprivate static boolean isSeparator(String text)
text is equal to any separator:
NEXT, RESULT or END.text - compare texttext equal to any separator
public static void testArgument(Argument argument,
StringBuffer list)
throws IllegalArgumentException
list with
ModuleCreator.readArgument() (both
directions)ModuleCreator.writeArgument(com.meyling.principia.io.Output, com.meyling.principia.argument.Argument)
with ModuleCreator.readArgument()
(both directions)argument - argument to testlist - from this data the argument was createdIllegalArgumentException - if test failed
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||