Class ExpressionEvalTest

java.lang.Object
com.singularsys.jeptests.system.ExpressionEvalTest

public class ExpressionEvalTest extends Object
This class is designed for testing the validity of Jep evaluations. Expressions from a text file are evaluated with Jep in pairs of two, and the results are compared. If they do not match, the two expressions are printed to standard output.

Take for example an input text file containing the two lines

1+2
3.
The expressions '1+2' and '3' are evaluated with Jep and the results compared.
Author:
Nathan Funk
  • Field Details

    • lineCount

      protected int lineCount
      Current line position
  • Constructor Details

    • ExpressionEvalTest

      public ExpressionEvalTest()
      Creates a new ExpressionEvalTest instance
  • Method Details

    • main

      public static void main(String[] args)
      The main method checks the arguments and creates an instance and runs a test
    • testStandard

      public void testStandard() throws Exception
      Throws:
      Exception
    • testFast

      public void testFast() throws Exception
      Throws:
      Exception
    • testConfParser

      public void testConfParser() throws Exception
      Throws:
      Exception
    • testPostfixEvaluator

      public void testPostfixEvaluator() throws Exception
      Throws:
      Exception
    • testReals

      public void testReals() throws Exception
      Throws:
      Exception
    • testJepInstance

      public void testJepInstance(Jep jep, String fileName)
      Loads the file specified in fileName. Evaluates the expressions listed in it and compares the expressions with the results.
    • testJepInstance

      public void testJepInstance(Jep jep, BufferedReader reader)
    • println

      protected static void println(String str)
      Helper function for printing lines.