|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object junit.framework.Assert junit.framework.TestCase org.lsmp.djepJUnit.JepTest
public class JepTest
Field Summary | |
---|---|
static boolean |
SHOW_BAD
|
Constructor Summary | |
---|---|
JepTest(java.lang.String name)
|
Method Summary | |
---|---|
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 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(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)
|
Methods inherited from class junit.framework.TestCase |
---|
countTestCases, createResult, getName, name, run, run, runBare, runTest, setName, tearDown, toString |
Methods inherited from class junit.framework.Assert |
---|
assert, assert, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertNotNull, assertNotNull, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final boolean SHOW_BAD
Constructor Detail |
---|
public JepTest(java.lang.String name)
Method Detail |
---|
public static junit.framework.Test suite()
public static void main(java.lang.String[] args)
args
- protected void setUp()
setUp
in class junit.framework.TestCase
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 parse
ParseException
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 expected
java.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
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |