jstrachan    2002/11/27 05:07:48

  Modified:    jelly/src/java/org/apache/commons/jelly/tags/junit
                        AssertTag.java AssertEqualsTag.java
               jelly/src/java/org/apache/commons/jelly/tags/beanshell
                        BeanShellExpression.java
               jelly/src/java/org/apache/commons/jelly/tags/bsf
                        BSFExpression.java
  Log:
  Patched the getExpressionText() implementations so that they show the full 
expression used in Jelly with ${} tokens. Also added a test case for this behaviour.
  
  Also patched JellyUnit so that it now takes advantage of this new method to show 
more meaningful messages when assertions fail.
  
  Revision  Changes    Path
  1.5       +1 -1      
jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/junit/AssertTag.java
  
  Index: AssertTag.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/junit/AssertTag.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- AssertTag.java    30 Oct 2002 19:16:30 -0000      1.4
  +++ AssertTag.java    27 Nov 2002 13:07:47 -0000      1.5
  @@ -100,7 +100,7 @@
           }
           if (test != null) {
               if (! test.evaluateAsBoolean(context)) {
  -                fail( getBodyText(), "evaluating test: "+ test );
  +                fail( getBodyText(), "evaluating test: "+ test.getExpressionText() 
);
               }
           }
           else {
  
  
  
  1.5       +4 -1      
jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/junit/AssertEqualsTag.java
  
  Index: AssertEqualsTag.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/junit/AssertEqualsTag.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- AssertEqualsTag.java      25 Nov 2002 15:02:47 -0000      1.4
  +++ AssertEqualsTag.java      27 Nov 2002 13:07:48 -0000      1.5
  @@ -93,7 +93,10 @@
               return;
           }
   
  -        String expressions = "\nExpected expression: " + expected + "\nActual 
expression: " + actual;
  +        String expressions = "\nExpected expression: " 
  +            + expected.getExpressionText() 
  +            + "\nActual expression: " 
  +            + actual.getExpressionText();
           
           failNotEquals(message, expectedValue, actualValue, expressions);
       }
  
  
  
  1.10      +1 -1      
jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/beanshell/BeanShellExpression.java
  
  Index: BeanShellExpression.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/beanshell/BeanShellExpression.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- BeanShellExpression.java  27 Nov 2002 12:43:20 -0000      1.9
  +++ BeanShellExpression.java  27 Nov 2002 13:07:48 -0000      1.10
  @@ -88,7 +88,7 @@
       // Expression interface
       //------------------------------------------------------------------------- 
       public String getExpressionText() {
  -        return text;
  +        return "${" + text + "}";
       }
       
       public Object evaluate(JellyContext context) {
  
  
  
  1.9       +1 -1      
jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/bsf/BSFExpression.java
  
  Index: BSFExpression.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/bsf/BSFExpression.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- BSFExpression.java        27 Nov 2002 12:43:20 -0000      1.8
  +++ BSFExpression.java        27 Nov 2002 13:07:48 -0000      1.9
  @@ -104,7 +104,7 @@
       // Expression interface
       //------------------------------------------------------------------------- 
       public String getExpressionText() {
  -        return text;
  +        return "${" + text + "}";
       }
       
       public Object evaluate(JellyContext context) {
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to