public class JepTest
extends TestCase
Modifier and Type | Field and Description |
---|---|
static boolean |
SHOW_BAD |
Constructor and Description |
---|
JepTest(java.lang.String name) |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
calcValue(Node expr) |
java.lang.Object |
calcValue(java.lang.String expr)
Parse and evaluate an expression.
|
void |
complexValueTest(java.lang.String expr,
Complex expected,
double tol)
Test parse-evaluate with complex number and given tollerence.
|
static void |
main(java.lang.String[] args)
Main entry point.
|
void |
myAssertEquals(java.lang.String msg,
java.lang.Object expected,
java.lang.Object actual)
Assertion with message on command line.
|
void |
myAssertNaN(java.lang.String msg,
java.lang.Object actual) |
protected void |
setUp()
Run before each test.
|
static 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(java.lang.String expr,
double a)
Test parse and evaluate with with a Double result.
|
void |
valueTest(java.lang.String expr,
double a,
double tol) |
void |
valueTest(java.lang.String expr,
java.lang.Object expected)
Test result j.evaluate(j.parse(expr))
|
void |
valueTest(java.lang.String expr,
java.lang.String expected) |
void |
valueTestInt(java.lang.String expr,
int a)
Test parse and evaluate which should give the result Integer(a).
|
void |
valueTestNaN(java.lang.String expr) |
public static final boolean SHOW_BAD
public static Test suite()
public static void main(java.lang.String[] args)
args
- protected void setUp()
public void myAssertEquals(java.lang.String msg, java.lang.Object expected, java.lang.Object actual)
msg
- message to displayexpected
- expected resultactual
- actual resultpublic void myAssertNaN(java.lang.String msg, java.lang.Object actual)
public java.lang.Object calcValue(java.lang.String expr) throws ParseException
expr
- string to parseParseException
public java.lang.Object calcValue(Node expr) throws ParseException
ParseException
public void valueTest(java.lang.String expr, java.lang.Object expected) throws java.lang.Exception
expr
- the expression to parse and evaluateexpected
- result expectedjava.lang.Exception
public void valueTest(java.lang.String expr, java.lang.String expected) throws java.lang.Exception
java.lang.Exception
public void valueTestNaN(java.lang.String expr) throws java.lang.Exception
java.lang.Exception
public void valueTestInt(java.lang.String expr, int a) throws java.lang.Exception
expr
- a
- expected value will be converted to an Integer.java.lang.Exception
public void valueTest(java.lang.String expr, double a) throws java.lang.Exception
expr
- a
- expected value will be converted to a Double.java.lang.Exception
public void valueTest(java.lang.String expr, double a, double tol) throws java.lang.Exception
java.lang.Exception
public void complexValueTest(java.lang.String expr, Complex expected, double tol) throws java.lang.Exception
expr
- expected
- tol
- java.lang.Exception
public void testGood()
public void testSimpleSum() throws java.lang.Exception
java.lang.Exception
public void testLogical() throws java.lang.Exception
java.lang.Exception
public void testFunction() throws java.lang.Exception
java.lang.Exception
public void testComplex() throws java.lang.Exception
java.lang.Exception
public void testIf() throws java.lang.Exception
java.lang.Exception
public void testAssign() throws java.lang.Exception
java.lang.Exception
public void testDotInName() throws ParseException, java.lang.Exception
ParseException
java.lang.Exception
public void testBinom() throws ParseException, java.lang.Exception
ParseException
java.lang.Exception
public void testNaN() throws java.lang.Exception
java.lang.Exception
public void testAssign2()
public void testNumParam() throws java.lang.Exception
java.lang.Exception
public void testUndeclared() throws java.lang.Exception
java.lang.Exception
public void testBad() throws java.lang.Exception
java.lang.Exception
http://www.singularsys.com/jep Copyright © 2007 Singular Systems