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 Thu, 19 Aug 2004 17:35:47 GMT
dion        2004/08/19 10:35:47

  Modified:    jexl/src/test/org/apache/commons/jexl JexlTest.java
  Log:
  Add a test for parse exception throwing
  
  Revision  Changes    Path
  1.42      +19 -1     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.41
  retrieving revision 1.42
  diff -u -r1.41 -r1.42
  --- JexlTest.java	18 Aug 2004 07:03:34 -0000	1.41
  +++ JexlTest.java	19 Aug 2004 17:35:47 -0000	1.42
  @@ -28,6 +28,7 @@
   import junit.framework.TestCase;
   import junit.framework.TestSuite;
   
  +import org.apache.commons.jexl.parser.ParseException;
   import org.apache.commons.jexl.resolver.FlatResolver;
   
   /**
  @@ -1096,6 +1097,23 @@
           JexlContext jc = JexlHelper.createContext();
           jc.getVars().put("aBool", Boolean.FALSE);
       	assertExpression(jc, "aBool.valueOf('true')", Boolean.TRUE);
  +    }
  +    
  +    /**
  +     * Make sure bad syntax throws ParseException
  +     * @throws Exception on errors
  +     */
  +    public void testBadParse() throws Exception
  +    {
  +    	try
  +		{
  +    		JexlContext jc = JexlHelper.createContext();
  +    		Expression e = ExpressionFactory.createExpression("empty()");
  +		}
  +    	catch (ParseException pe)
  +		{
  +    		System.err.println("Expecting a parse exception: " + pe.getMessage());
  +		}
       }
       
       /**
  
  
  

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