public class JepTest
extends junit.framework.TestCase
| Modifier and Type | Field and Description |
|---|---|
static boolean |
SHOW_BAD |
| Modifier and Type | Method and Description |
|---|---|
Object |
calcValue(Node expr) |
Object |
calcValue(String expr)
Parse and evaluate an expression.
|
void |
complexValueTest(String expr,
Complex expected,
double tol)
Test parse-evaluate with complex number and given tollerence.
|
static void |
main(String[] args)
Main entry point.
|
void |
myAssertEquals(String msg,
Object expected,
Object actual)
Assertion with message on command line.
|
void |
myAssertNaN(String msg,
Object actual) |
static junit.framework.Test |
suite()
Create a test suite.
|
void |
testAssign() |
void |
testAssign2() |
void |
testBad() |
void |
testBinom() |
void |
testComplex() |
void |
testDotInName() |
void |
testFunction() |
void |
testGood()
just test JUnit working OK
|
void |
testIf() |
void |
testLogical() |
void |
testNaN() |
void |
testNumParam() |
void |
testSimpleSum() |
void |
testUndeclared() |
void |
valueTest(String expr,
double a)
Test parse and evaluate with with a Double result.
|
void |
valueTest(String expr,
double a,
double tol) |
void |
valueTest(String expr,
Object expected)
Test result j.evaluate(j.parse(expr))
|
void |
valueTest(String expr,
String expected) |
void |
valueTestInt(String expr,
int a)
Test parse and evaluate which should give the result Integer(a).
|
void |
valueTestNaN(String expr) |
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, fail, fail, failNotEquals, failNotSame, failSame, format, getName, run, run, runBare, setName, toStringpublic static final boolean SHOW_BAD
public JepTest(String name)
public static junit.framework.Test suite()
public static void main(String[] args)
args - public void myAssertEquals(String msg, Object expected, Object actual)
msg - message to displayexpected - expected resultactual - actual resultpublic Object calcValue(String expr) throws ParseException
expr - string to parseParseExceptionpublic Object calcValue(Node expr) throws ParseException
ParseExceptionpublic void valueTest(String expr, Object expected) throws Exception
expr - the expression to parse and evaluateexpected - result expectedExceptionpublic void valueTestInt(String expr, int a) throws Exception
expr - a - expected value will be converted to an Integer.Exceptionpublic void valueTest(String expr, double a) throws Exception
expr - a - expected value will be converted to a Double.Exceptionpublic void valueTest(String expr, double a, double tol) throws Exception
Exceptionpublic void complexValueTest(String expr, Complex expected, double tol) throws Exception
expr - expected - tol - Exceptionpublic void testGood()
public void testDotInName()
throws ParseException,
Exception
ParseExceptionExceptionpublic void testBinom()
throws ParseException,
Exception
ParseExceptionExceptionpublic void testAssign2()
Jas4pp 1.5 © Java Analysis Studio for Particle Physics