org.apache.commons.jexl2
Class JexlTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.apache.commons.jexl2.JexlTestCase
              extended by org.apache.commons.jexl2.JexlTest
All Implemented Interfaces:
junit.framework.Test

public class JexlTest
extends JexlTestCase

Simple testcases

Since:
1.0

Nested Class Summary
static class JexlTest.Duck
           
 
Field Summary
protected static String GET_METHOD_STRING
           
protected static String METHOD_STRING
           
 
Fields inherited from class org.apache.commons.jexl2.JexlTestCase
JEXL
 
Constructor Summary
JexlTest(String testName)
           
 
Method Summary
protected  void assertExpression(JexlContext jc, String expression, Object expected)
          Asserts that the given expression returns the given value when applied to the given context
 void testAntPropertiesWithMethods()
           
 void testArray()
           
 void testAssignment()
          Test assignment.
 void testBadParse()
          Make sure bad syntax throws ParseException
 void testBlankStrings()
          test some blank strings
 void testBoolean()
           
 void testBooleanShortCircuitAnd()
          Test that 'and' only evaluates the second item if needed
 void testBooleanShortCircuitOr()
          Test that 'or' only evaluates the second item if needed
 void testCalculations()
          test some simple mathematical calculations
 void testCharAtBug()
          Attempts to recreate bug http://jira.werken.com/ViewIssue.jspa?key=JELLY-8
 void testCoercionWithComparisionOperators()
           
 void testComment()
          Test the ## comment in a string
 void testComparisons()
          test some simple conditions
 void testConditions()
          test some simple conditions
 void testDuck()
           
 void testEmpty()
           
 void testEmptyDottedVariableName()
           
 void testEmptySubListOfMap()
           
 void testExpression()
           
 void testIntProperty()
          test the use of an int based property
 void testLogicExpressions()
          test some blank strings
 void testMapDot()
          test the use of dot notation to lookup map entries
 void testNegativeIntComparison()
          test the -1 comparison bug
 void testNew()
          test the new function e.g constructor invocation
 void testNotConditions()
          test some simple conditions
 void testNotConditionsWithDots()
          test some simple conditions
 void testNull()
          test some null conditions
 void testProperty()
          test a simple property expression
 void testSize()
           
 void testSizeAsProperty()
           
 void testStringConcatenation()
          Simple test of '+' as a string concatenation operator
 void testStringLit()
           
 void testStringLiterals()
          Tests string literals
 void testStringQuoting()
          test quoting in strings
 void testToString()
           
 void testUnicodeSupport()
           
 void testVariableNames()
          test variables with underscore names
 
Methods inherited from class org.apache.commons.jexl2.JexlTestCase
createEngine, createThreadedArithmeticEngine, debuggerCheck, flatten, flattenedStr, main, runTest, runTest, tearDown
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, setUp, 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

METHOD_STRING

protected static final String METHOD_STRING
See Also:
Constant Field Values

GET_METHOD_STRING

protected static final String GET_METHOD_STRING
See Also:
Constant Field Values
Constructor Detail

JexlTest

public JexlTest(String testName)
Method Detail

testProperty

public void testProperty()
                  throws Exception
test a simple property expression

Throws:
Exception

testBoolean

public void testBoolean()
                 throws Exception
Throws:
Exception

testStringLit

public void testStringLit()
                   throws Exception
Throws:
Exception

testExpression

public void testExpression()
                    throws Exception
Throws:
Exception

testEmpty

public void testEmpty()
               throws Exception
Throws:
Exception

testSize

public void testSize()
              throws Exception
Throws:
Exception

testSizeAsProperty

public void testSizeAsProperty()
                        throws Exception
Throws:
Exception

testNew

public void testNew()
             throws Exception
test the new function e.g constructor invocation

Throws:
Exception

testCalculations

public void testCalculations()
                      throws Exception
test some simple mathematical calculations

Throws:
Exception

testConditions

public void testConditions()
                    throws Exception
test some simple conditions

Throws:
Exception

testNotConditions

public void testNotConditions()
                       throws Exception
test some simple conditions

Throws:
Exception

testNotConditionsWithDots

public void testNotConditionsWithDots()
                               throws Exception
test some simple conditions

Throws:
Exception

testComparisons

public void testComparisons()
                     throws Exception
test some simple conditions

Throws:
Exception

testNull

public void testNull()
              throws Exception
test some null conditions

Throws:
Exception

testStringQuoting

public void testStringQuoting()
                       throws Exception
test quoting in strings

Throws:
Exception

testBlankStrings

public void testBlankStrings()
                      throws Exception
test some blank strings

Throws:
Exception

testLogicExpressions

public void testLogicExpressions()
                          throws Exception
test some blank strings

Throws:
Exception

testVariableNames

public void testVariableNames()
                       throws Exception
test variables with underscore names

Throws:
Exception

testMapDot

public void testMapDot()
                throws Exception
test the use of dot notation to lookup map entries

Throws:
Exception

testStringLiterals

public void testStringLiterals()
                        throws Exception
Tests string literals

Throws:
Exception

testIntProperty

public void testIntProperty()
                     throws Exception
test the use of an int based property

Throws:
Exception

testNegativeIntComparison

public void testNegativeIntComparison()
                               throws Exception
test the -1 comparison bug

Throws:
Exception

testCharAtBug

public void testCharAtBug()
                   throws Exception
Attempts to recreate bug http://jira.werken.com/ViewIssue.jspa?key=JELLY-8

Throws:
Exception

testEmptyDottedVariableName

public void testEmptyDottedVariableName()
                                 throws Exception
Throws:
Exception

testEmptySubListOfMap

public void testEmptySubListOfMap()
                           throws Exception
Throws:
Exception

testCoercionWithComparisionOperators

public void testCoercionWithComparisionOperators()
                                          throws Exception
Throws:
Exception

testBooleanShortCircuitAnd

public void testBooleanShortCircuitAnd()
                                throws Exception
Test that 'and' only evaluates the second item if needed

Throws:
Exception - if there are errors

testBooleanShortCircuitOr

public void testBooleanShortCircuitOr()
                               throws Exception
Test that 'or' only evaluates the second item if needed

Throws:
Exception - if there are errors

testStringConcatenation

public void testStringConcatenation()
                             throws Exception
Simple test of '+' as a string concatenation operator

Throws:
Exception

testToString

public void testToString()
                  throws Exception
Throws:
Exception

testBadParse

public void testBadParse()
                  throws Exception
Make sure bad syntax throws ParseException

Throws:
Exception - on errors

testComment

public void testComment()
                 throws Exception
Test the ## comment in a string

Throws:
Exception

testAssignment

public void testAssignment()
                    throws Exception
Test assignment.

Throws:
Exception

testAntPropertiesWithMethods

public void testAntPropertiesWithMethods()
                                  throws Exception
Throws:
Exception

testUnicodeSupport

public void testUnicodeSupport()
                        throws Exception
Throws:
Exception

testDuck

public void testDuck()
              throws Exception
Throws:
Exception

testArray

public void testArray()
               throws Exception
Throws:
Exception

assertExpression

protected void assertExpression(JexlContext jc,
                                String expression,
                                Object expected)
                         throws Exception
Asserts that the given expression returns the given value when applied to the given context

Throws:
Exception


Copyright © 2001-2011 The Apache Software Foundation. All Rights Reserved.