|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjunit.framework.Assert
junit.framework.TestCase
com.singularsys.jeptests.JepTest
public class JepTest
Field Summary | |
---|---|
protected Jep |
jep
The parser |
protected java.lang.Object |
myFalse
|
protected java.lang.Object |
myTrue
|
static boolean |
PRINT_RESULTS
|
Constructor Summary | |
---|---|
JepTest(java.lang.String name)
|
Method Summary | |
---|---|
protected java.lang.Object |
calcValue(Node node)
Calculate the value of an expression. |
protected java.lang.Object |
calcValue(java.lang.String expr)
Calculate the value of an expression. |
void |
complexValueTest(java.lang.String expr,
Complex expected,
double tol)
Test parse-evaluate with complex number and given tollerence. |
protected void |
myAssertEquals(java.lang.String msg,
java.lang.Object expected,
java.lang.Object actual)
|
void |
myAssertNaN(java.lang.String msg,
java.lang.Object actual)
|
void |
nodeTest(Node n,
java.lang.Object v)
|
void |
nodeTest(Node n,
Operator op)
|
void |
nodeTest(Node n,
java.lang.String name)
|
void |
nodeTest(Node n,
Variable v)
|
void |
setUp()
Sets up the parser. |
void |
testAssign()
|
void |
testBinom()
|
void |
testChangeVariable()
Test changing variables value after parsing |
void |
testComplex()
|
void |
testEvaluate()
Tests the evaluate() method. |
void |
testFormat()
|
void |
testFunction()
|
void |
testIf()
|
void |
testImplicitMul()
|
void |
testListAccess()
|
void |
testLogical()
|
void |
testNaN()
|
void |
testNumbers()
|
void |
testNumParam()
|
void |
testPlusPlus()
|
void |
testSetAllowUndeclared()
Tests whether allowUndeclared is working properly. |
void |
testSimpleSum()
|
void |
testStrings()
|
void |
testUminusPower()
|
void |
valueTest(java.lang.String expr,
double a,
double tol)
Test values to within a given precision |
protected void |
valueTest(java.lang.String expr,
java.lang.Object expected)
Test result j.evaluate(j.parse(expr)) |
void |
valueTestNaN(java.lang.String expr)
Test whether an expression evaluates to NaN |
void |
valueTestString(java.lang.String expr,
java.lang.String expected)
|
Methods inherited from class junit.framework.TestCase |
---|
countTestCases, createResult, getName, run, run, runBare, runTest, setName, 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, failNotEquals, failNotSame, failSame, format |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final boolean PRINT_RESULTS
protected Jep jep
protected java.lang.Object myTrue
protected java.lang.Object myFalse
Constructor Detail |
---|
public JepTest(java.lang.String name)
Method Detail |
---|
public void setUp()
setUp
in class junit.framework.TestCase
protected void valueTest(java.lang.String expr, java.lang.Object expected) throws java.lang.Exception
expr
- the expression to parse and evaluateexpected
- result expected
java.lang.Exception
protected java.lang.Object calcValue(Node node) throws java.lang.Exception
node
-
java.lang.Exception
protected java.lang.Object calcValue(java.lang.String expr) throws java.lang.Exception
expr
-
java.lang.Exception
protected void myAssertEquals(java.lang.String msg, java.lang.Object expected, java.lang.Object actual)
public void myAssertNaN(java.lang.String msg, java.lang.Object actual)
public void valueTestNaN(java.lang.String expr) throws java.lang.Exception
expr
-
java.lang.Exception
public void valueTestString(java.lang.String expr, java.lang.String expected) 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 valueTest(java.lang.String expr, double a, double tol) throws java.lang.Exception
expr
- a
- tol
-
java.lang.Exception
public void nodeTest(Node n, Operator op)
public void nodeTest(Node n, java.lang.String name)
public void nodeTest(Node n, Variable v)
public void nodeTest(Node n, java.lang.Object v)
public void testEvaluate() throws java.lang.Exception
java.lang.Exception
public void testChangeVariable()
public void testSetAllowUndeclared()
public void testSimpleSum() throws java.lang.Exception
java.lang.Exception
public void testNumbers() throws java.lang.Exception
java.lang.Exception
public void testStrings() throws java.lang.Exception
java.lang.Exception
public void testLogical() throws java.lang.Exception
java.lang.Exception
public void testNaN() throws java.lang.Exception
java.lang.Exception
public void testComplex() throws java.lang.Exception
java.lang.Exception
public void testFunction() throws java.lang.Exception
java.lang.Exception
public void testIf() throws java.lang.Exception
java.lang.Exception
public void testPlusPlus() throws java.lang.Exception
java.lang.Exception
public void testImplicitMul() throws java.lang.Exception
java.lang.Exception
public void testUminusPower() throws java.lang.Exception
java.lang.Exception
public void testNumParam() throws java.lang.Exception
java.lang.Exception
public void testBinom() throws ParseException, java.lang.Exception
ParseException
java.lang.Exception
public void testFormat() throws ParseException
ParseException
public void testAssign() throws java.lang.Exception
java.lang.Exception
public void testListAccess() throws java.lang.Exception
java.lang.Exception
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |