public final class ProgramTester
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static void |
runExpectingErrors(java.lang.String program,
java.lang.Class<? extends java.lang.Throwable> expectedExceptionType,
boolean searchCause,
java.lang.String... messageContents)
Tests a program expecting an error, and checks its message contents.
|
static void |
runExpectingErrors(java.lang.String program,
java.lang.Class<? extends java.lang.Throwable> expectedExceptionType,
java.lang.String... messageContents)
Tests a program expecting an error, and checks its message contents.
|
static <E extends java.lang.Throwable> |
runExpectingErrors(java.lang.String program,
java.lang.Class<E> expectedExceptionType,
java8.util.function.Consumer<E> analyzer)
Tests a program expecting an error, and checks its message contents.
|
static void |
runFile(java.lang.String file) |
static void |
runFile(java.lang.String file,
int runs) |
static void |
runFile(java.lang.String file,
int runs,
java.lang.Object expectedResult) |
static void |
runFileWithExplicitResult(java.lang.String file,
java.lang.Object expectedResult) |
static void |
runFileWithMultipleRuns(java.lang.String file) |
static void |
runFileWithMultipleRuns(java.lang.String file,
int min,
int max) |
static void |
runFileWithMultipleRuns(java.lang.String file,
java8.util.stream.IntStream stream) |
static java.lang.Object |
runProgram(java.lang.String s,
int runs) |
public static void runFileWithExplicitResult(java.lang.String file,
java.lang.Object expectedResult)
file - file to be testedexpectedResult - resultpublic static void runFile(java.lang.String file)
file - file to be testedpublic static void runExpectingErrors(java.lang.String program,
java.lang.Class<? extends java.lang.Throwable> expectedExceptionType,
boolean searchCause,
java.lang.String... messageContents)
program - the program to execute. It it ends in ".pt", it will be loaded as Protelis script from classpathexpectedExceptionType - the type of exception to be thrownsearchCause - if true, the message contents are searched for in the cause exception messagemessageContents - the strings that the exception message must includepublic static <E extends java.lang.Throwable> void runExpectingErrors(java.lang.String program,
java.lang.Class<E> expectedExceptionType,
java8.util.function.Consumer<E> analyzer)
E - exception type (static)program - the program to execute. It it ends in ".pt", it will be loaded as Protelis script from classpathexpectedExceptionType - the type of exception to be thrownanalyzer - the actions to perform on the exceptionpublic static void runExpectingErrors(java.lang.String program,
java.lang.Class<? extends java.lang.Throwable> expectedExceptionType,
java.lang.String... messageContents)
program - the program to execute. It it ends in ".pt", it will be loaded as Protelis script from classpathexpectedExceptionType - the type of exception to be thrownmessageContents - the strings that the exception message must includepublic static void runFileWithMultipleRuns(java.lang.String file)
file - file to be testedpublic static void runFileWithMultipleRuns(java.lang.String file,
int min,
int max)
file - file to be testedmin - min runsmax - max runspublic static void runFileWithMultipleRuns(java.lang.String file,
java8.util.stream.IntStream stream)
file - file to be testedstream - stream of runpublic static void runFile(java.lang.String file,
int runs)
file - file to be testedruns - number of runspublic static void runFile(java.lang.String file,
int runs,
java.lang.Object expectedResult)
file - file to be testedruns - number of runsexpectedResult - expected resultpublic static java.lang.Object runProgram(java.lang.String s,
int runs)
s - program to runruns - number of runs