org.apache.commons.jexl2
Class IfTest

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.IfTest
All Implemented Interfaces:
junit.framework.Test

public class IfTest
extends JexlTestCase

Test cases for the if statement.

Since:
1.1

Field Summary
 
Fields inherited from class org.apache.commons.jexl2.JexlTestCase
JEXL
 
Constructor Summary
IfTest(String testName)
           
 
Method Summary
 void testBlockElse()
          Test the if statement handles blocks in the else statement correctly
 void testBlockIfTrue()
          Test the if statement handles blocks correctly
 void testIfWithArithmeticExpression()
          Test the if statement evaluates arithmetic expressions correctly
 void testIfWithAssignment()
          Test the if statement works with assignment
 void testIfWithDecimalArithmeticExpression()
          Test the if statement evaluates decimal arithmetic expressions correctly
 void testIfWithSimpleExpression()
          Test the if statement evaluates expressions correctly
 void testSimpleElse()
          Make sure if false executes the false statement
 void testSimpleIfFalse()
          Make sure if false doesn't execute the true statement
 void testSimpleIfTrue()
          Make sure if true executes the true statement
 void testTernary()
          Ternary operator condition undefined or null evaluates to false independantly of engine flags.
 void testTernaryShorthand()
          Ternary operator condition undefined or null evaluates to false independantly of engine flags.
 
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
 

Constructor Detail

IfTest

public IfTest(String testName)
Method Detail

testSimpleIfTrue

public void testSimpleIfTrue()
                      throws Exception
Make sure if true executes the true statement

Throws:
Exception - on any error

testSimpleIfFalse

public void testSimpleIfFalse()
                       throws Exception
Make sure if false doesn't execute the true statement

Throws:
Exception - on any error

testSimpleElse

public void testSimpleElse()
                    throws Exception
Make sure if false executes the false statement

Throws:
Exception - on any error

testBlockIfTrue

public void testBlockIfTrue()
                     throws Exception
Test the if statement handles blocks correctly

Throws:
Exception - on any error

testBlockElse

public void testBlockElse()
                   throws Exception
Test the if statement handles blocks in the else statement correctly

Throws:
Exception - on any error

testIfWithSimpleExpression

public void testIfWithSimpleExpression()
                                throws Exception
Test the if statement evaluates expressions correctly

Throws:
Exception - on any error

testIfWithArithmeticExpression

public void testIfWithArithmeticExpression()
                                    throws Exception
Test the if statement evaluates arithmetic expressions correctly

Throws:
Exception - on any error

testIfWithDecimalArithmeticExpression

public void testIfWithDecimalArithmeticExpression()
                                           throws Exception
Test the if statement evaluates decimal arithmetic expressions correctly

Throws:
Exception - on any error

testIfWithAssignment

public void testIfWithAssignment()
                          throws Exception
Test the if statement works with assignment

Throws:
Exception - on any error

testTernary

public void testTernary()
                 throws Exception
Ternary operator condition undefined or null evaluates to false independantly of engine flags.

Throws:
Exception

testTernaryShorthand

public void testTernaryShorthand()
                          throws Exception
Ternary operator condition undefined or null evaluates to false independantly of engine flags.

Throws:
Exception


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