commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject cvs commit: jakarta-commons/jexl/src/test/org/apache/commons/jexl JexlTest.java
Date Fri, 20 Aug 2004 07:51:48 GMT
dion        2004/08/20 00:51:48

  Modified:    jexl/src/test/org/apache/commons/jexl JexlTest.java
  Log:
  Use assertExpression more often
  
  Revision  Changes    Path
  1.48      +7 -30     jakarta-commons/jexl/src/test/org/apache/commons/jexl/JexlTest.java
  
  Index: JexlTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/jexl/src/test/org/apache/commons/jexl/JexlTest.java,v
  retrieving revision 1.47
  retrieving revision 1.48
  diff -u -r1.47 -r1.48
  --- JexlTest.java	20 Aug 2004 07:44:07 -0000	1.47
  +++ JexlTest.java	20 Aug 2004 07:51:48 -0000	1.48
  @@ -111,9 +111,6 @@
   
           jc.getVars().put("list", l);
   
  -        Expression e = ExpressionFactory.createExpression("list[1]");
  -        Object o = e.evaluate(jc);
  -
           assertExpression(jc, "list[1]", new Integer(2));
           assertExpression(jc, "list[1+1]", new Integer(3));
           jc.getVars().put("loc", new Integer(1));
  @@ -393,34 +390,14 @@
       public void testConditions()
            throws Exception
       {
  -        Expression e = ExpressionFactory.createExpression("foo == 2");
           JexlContext jc = JexlHelper.createContext();
  -
           jc.getVars().put("foo", new Integer(2) );
  -        Object o = e.evaluate(jc);
  -
  -        assertTrue("o not instanceof Boolean", o instanceof Boolean);
  -        assertEquals("o incorrect", Boolean.TRUE, o);
  -
  -        e = ExpressionFactory.createExpression("2 == 3");
  -        o = e.evaluate(jc);
  -
  -        assertEquals("o incorrect", Boolean.FALSE, o );
  -
  -        e = ExpressionFactory.createExpression("3 == foo");
  -        o = e.evaluate(jc);
  -
  -        assertEquals("o incorrect", Boolean.FALSE, o );
  -
  -        e = ExpressionFactory.createExpression("3 != foo");
  -        o = e.evaluate(jc);
  -
  -        assertEquals("o incorrect", Boolean.TRUE, o );
  -
  -        e = ExpressionFactory.createExpression("foo != 2");
  -        o = e.evaluate(jc);
  -
  -        assertEquals("o incorrect", Boolean.FALSE, o );
  +        
  +        assertExpression(jc, "foo == 2", Boolean.TRUE);
  +        assertExpression(jc, "2 == 3", Boolean.FALSE);
  +        assertExpression(jc, "3 == foo", Boolean.FALSE);
  +        assertExpression(jc, "3 != foo", Boolean.TRUE);
  +        assertExpression(jc, "foo != 2", Boolean.FALSE);
       }
   
       /**
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message