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 08:04:37 GMT
dion        2004/08/20 01:04:37

  Modified:    jexl/src/test/org/apache/commons/jexl JexlTest.java
  Log:
  Use assertExpression more often
  
  Revision  Changes    Path
  1.52      +4 -11     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.51
  retrieving revision 1.52
  diff -u -r1.51 -r1.52
  --- JexlTest.java	20 Aug 2004 08:01:16 -0000	1.51
  +++ JexlTest.java	20 Aug 2004 08:04:37 -0000	1.52
  @@ -495,17 +495,12 @@
           JexlContext jc = JexlHelper.createContext();
           jc.getVars().put("bar", "" );
   
  -        Expression e = ExpressionFactory.createExpression("foo == ''");
  -        Object o = e.evaluate(jc);
  -
  -        assertTrue("o not instanceof Boolean", o instanceof Boolean);
  -        assertEquals("o incorrect", Boolean.FALSE, o);
  -
  -
  +        assertExpression(jc, "foo == ''", Boolean.FALSE);
           assertExpression(jc, "bar == ''", Boolean.TRUE);
           assertExpression(jc, "barnotexist == ''", Boolean.FALSE);
           assertExpression(jc, "empty bar", Boolean.TRUE);
           assertExpression(jc, "bar.length() == 0", Boolean.TRUE);
  +        assertExpression(jc, "size(bar) == 0", Boolean.TRUE);
       }
   
       /**
  @@ -536,7 +531,6 @@
       public void testDoubleArrays()
            throws Exception
       {
  -        Expression e = ExpressionFactory.createExpression("foo[0][1]");
           JexlContext jc = JexlHelper.createContext();
   
           Object[][] foo = new Object[2][2];
  @@ -544,9 +538,8 @@
           foo[0][1] = "two";
   
           jc.getVars().put("foo", foo );
  -        Object o = e.evaluate(jc);
   
  -        assertEquals("o incorrect", "two", o);
  +        assertExpression(jc, "foo[0][1]", "two");
       }
   
       /**
  
  
  

---------------------------------------------------------------------
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