Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.singularsys.jeptests
Class JepTest

    java.lang.Object
      junit.framework.Assert
          junit.framework.TestCase
              com.singularsys.jeptests.JepTest

All Implemented Interfaces:
  junit.framework.Test

Direct Known Subclasses:
  CPTest, ExtendedParserTest, PostfixEvalTest

    public class JepTest

extends junit.framework.TestCase

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 tolerence.
`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)`
`static void` | `nodeTest(Node n, java.lang.Object v)`
`static void` | `nodeTest(Node n, Operator op)`
`static void` | `nodeTest(Node n, java.lang.String name)`
`static void` | `nodeTest(Node n, Variable v)`
`void` | `parseExceptionWithSpecParser(Jep j)` Called by testParseException with a specific parser instance
`protected void` | `printTestHeader(java.lang.String str)` Prints a header with the name of the test as specified in str.
`void` | `setUp()` Sets up the parser.
`void` | `testAssign()`
`void` | `testBinom()`
`void` | `testBlankParser()` Test creating a Jep instance with no functions and no variables.
`void` | `testChangeVariable()` Test changing variables value after parsing
`void` | `testComplex()`
`void` | `testEmptyEqn()`
`void` | `testEmptyEqn2()`
`void` | `testEvalExceptions()` Test whether evaluation exceptions are thrown when they should be.
`void` | `testEvaluate()` Tests the evaluate() method.
`void` | `testExpectedTokenSequence()` Tests for bug #52
`void` | `testFormat()`
`void` | `testFunction()`
`void` | `testIf()`
`void` | `testImplicitMul()`
`void` | `testLazyLogical()`
`void` | `testListAccess()`
`void` | `testLogarithm()`
`void` | `testLogical()`
`void` | `testMacroFunction()`
`void` | `testMultiDimArray()`
`void` | `testMultiLine()`
`void` | `testNaN()`
`void` | `testNumbers()`
`void` | `testNumParam()`
`void` | `testParseException()` Tests whether a parse exceptions are thrown when they should be.
`void` | `testPlusPlus()`
`void` | `testSemiColon()`
`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

### PRINT_RESULTS

    public static final boolean PRINT_RESULTS

See Also:
  Constant Field Values

### jep

    protected Jep jep

  The parser

### myTrue

    protected java.lang.Object myTrue

### myFalse

    protected java.lang.Object myFalse

Constructor Detail

### JepTest

    public JepTest(java.lang.String name)

Method Detail

### setUp

    public void setUp()

  Sets up the parser.

  Overrides:
    `setUp` in class `junit.framework.TestCase`

### printTestHeader

    protected void printTestHeader(java.lang.String str)

  Prints a header with the name of the test as specified in str.

### valueTest

    protected void valueTest(java.lang.String expr,
                             java.lang.Object expected)
                      throws java.lang.Exception

  Test result j.evaluate(j.parse(expr))

  Parameters:
    `expr` - the expression to parse and evaluate
    `expected` - result expected
  Throws:
    `java.lang.Exception`

### calcValue

    protected java.lang.Object calcValue(Node node)
                                  throws java.lang.Exception

  Calculate the value of an expression.

  Parameters:
    `node` -
  Throws:
    `java.lang.Exception`

### calcValue

    protected java.lang.Object calcValue(java.lang.String expr)
                                  throws java.lang.Exception

  Calculate the value of an expression.

  Parameters:
    `expr` -
  Throws:
    `java.lang.Exception`

### myAssertEquals

    protected void myAssertEquals(java.lang.String msg,
                                  java.lang.Object expected,
                                  java.lang.Object actual)

### myAssertNaN

    public void myAssertNaN(java.lang.String msg,
                            java.lang.Object actual)

### valueTestNaN

    public void valueTestNaN(java.lang.String expr)
                      throws java.lang.Exception

  Test whether an expression evaluates to NaN

  Parameters:
    `expr` -
  Throws:
    `java.lang.Exception`

### valueTestString

    public void valueTestString(java.lang.String expr,
                                java.lang.String expected)
                         throws java.lang.Exception

  Throws:
    `java.lang.Exception`

### complexValueTest

    public void complexValueTest(java.lang.String expr,
                                 Complex expected,
                                 double tol)
                          throws java.lang.Exception

  Test parse-evaluate with complex number and given tolerence.

  Parameters:
    `expr` -
    `expected` -
    `tol` -
  Throws:
    `java.lang.Exception`

### valueTest

    public void valueTest(java.lang.String expr,
                          double a,
                          double tol)
                   throws java.lang.Exception

  Test values to within a given precision

  Parameters:
    `expr` - expression
    `a` - the expected value
    `tol` - tolerance
  Throws:
    `java.lang.Exception`

### nodeTest

    public static void nodeTest(Node n,
                                Operator op)

### nodeTest

    public static void nodeTest(Node n,
                                java.lang.String name)

### nodeTest

    public static void nodeTest(Node n,
                                Variable v)

### nodeTest

    public static void nodeTest(Node n,
                                java.lang.Object v)

### testSimpleSum

    public void testSimpleSum()
                       throws java.lang.Exception

  Throws:
    `java.lang.Exception`

### testEvaluate

    public void testEvaluate()
                      throws java.lang.Exception

  Tests the evaluate() method.

  Throws:
    `java.lang.Exception`

### testChangeVariable

    public void testChangeVariable()

  Test changing variables value after parsing

### testSetAllowUndeclared

    public void testSetAllowUndeclared()
                                throws java.lang.Exception

  Tests whether allowUndeclared is working properly.

  Throws:
    `java.lang.Exception`

### testNumbers

    public void testNumbers()
                     throws java.lang.Exception

  Throws:
    `java.lang.Exception`

### testStrings

    public void testStrings()
                     throws java.lang.Exception

  Throws:
    `java.lang.Exception`

### testLogical

    public void testLogical()
                     throws java.lang.Exception

  Throws:
    `java.lang.Exception`

### testNaN

    public void testNaN()
                 throws java.lang.Exception

  Throws:
    `java.lang.Exception`

### testComplex

    public void testComplex()
                     throws java.lang.Exception

  Throws:
    `java.lang.Exception`

### testFunction

    public void testFunction()
                      throws java.lang.Exception

  Throws:
    `java.lang.Exception`

### testIf

    public void testIf()
                throws java.lang.Exception

  Throws:
    `java.lang.Exception`

### testPlusPlus

    public void testPlusPlus()
                      throws java.lang.Exception

  Throws:
    `java.lang.Exception`

### testImplicitMul

    public void testImplicitMul()
                         throws java.lang.Exception

  Throws:
    `java.lang.Exception`

### testUminusPower

    public void testUminusPower()
                         throws java.lang.Exception

  Throws:
    `java.lang.Exception`

### testNumParam

    public void testNumParam()
                      throws java.lang.Exception

  Throws:
    `java.lang.Exception`

### testBinom

    public void testBinom()
                   throws ParseException,
                          java.lang.Exception

  Throws:
    `ParseException`
    `java.lang.Exception`

### testFormat

    public void testFormat()
                    throws java.lang.Exception

  Throws:
    `java.lang.Exception`

### testAssign

    public void testAssign()
                    throws java.lang.Exception

  Throws:
    `java.lang.Exception`

### testListAccess

    public void testListAccess()
                        throws java.lang.Exception

  Throws:
    `java.lang.Exception`

### testMultiDimArray

    public void testMultiDimArray()
                           throws java.lang.Exception

  Throws:
    `java.lang.Exception`

### testLazyLogical

    public void testLazyLogical()
                         throws java.lang.Exception

  Throws:
    `java.lang.Exception`

### testLogarithm

    public void testLogarithm()
                       throws java.lang.Exception

  Throws:
    `java.lang.Exception`

### testBlankParser

    public void testBlankParser()
                         throws java.lang.Exception

  Test creating a Jep instance with no functions and no variables.

  Throws:
    `java.lang.Exception`

### testMacroFunction

    public void testMacroFunction()
                           throws java.lang.Exception

  Throws:
    `java.lang.Exception`

### testParseException

    public void testParseException()

  Tests whether a parse exceptions are thrown when they should be. Tests on both the standard parser and the configurable parser. See ticket #50

### parseExceptionWithSpecParser

    public void parseExceptionWithSpecParser(Jep j)

  Called by testParseException with a specific parser instance

  Parameters:
    `j` - the parser instance

### testEvalExceptions

    public void testEvalExceptions()

  Test whether evaluation exceptions are thrown when they should be.

### testSemiColon

    public void testSemiColon()
                       throws java.lang.Exception

  Throws:
    `java.lang.Exception`

### testMultiLine

    public void testMultiLine()
                       throws java.lang.Exception

  Throws:
    `java.lang.Exception`

### testEmptyEqn

    public void testEmptyEqn()
                      throws java.lang.Exception

  Throws:
    `java.lang.Exception`

### testEmptyEqn2

    public void testEmptyEqn2()
                       throws java.lang.Exception

  Throws:
    `java.lang.Exception`

### testExpectedTokenSequence

    public void testExpectedTokenSequence()

  Tests for bug #52

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2008 Singular Systems http://www.singularsys.com/jep