dion        2004/09/07 21:36:52

  Modified:    jelly/src/test/org/apache/commons/jelly/core
                        TestInvokeStaticTag.java TestInvokeTag.java
                        ExceptionBean.java
               jelly/src/test/org/apache/commons/jelly/tags/junit
                        JUnitTagLibrary.java JellyAssertionFailedError.java
                        AssertThrowsTag.java
               jelly/src/test/org/apache/commons/jelly/expression
                        TestDynaBeans.java
  Log:
  detab
  
  Revision  Changes    Path
  1.8       +27 -27    
jakarta-commons/jelly/src/test/org/apache/commons/jelly/core/TestInvokeStaticTag.java
  
  Index: TestInvokeStaticTag.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-commons/jelly/src/test/org/apache/commons/jelly/core/TestInvokeStaticTag.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- TestInvokeStaticTag.java  16 Aug 2004 03:44:28 -0000      1.7
  +++ TestInvokeStaticTag.java  8 Sep 2004 04:36:52 -0000       1.8
  @@ -1,12 +1,12 @@
   /*
    * Copyright 2002,2004 The Apache Software Foundation.
  - * 
  + *
    * Licensed under the Apache License, Version 2.0 (the "License");
    * you may not use this file except in compliance with the License.
    * You may obtain a copy of the License at
  - * 
  + *
    *      http://www.apache.org/licenses/LICENSE-2.0
  - * 
  + *
    * Unless required by applicable law or agreed to in writing, software
    * distributed under the License is distributed on an "AS IS" BASIS,
    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  @@ -31,17 +31,17 @@
       }
   
       public static TestSuite suite() throws Exception {
  -        return new TestSuite(TestInvokeStaticTag.class);        
  +        return new TestSuite(TestInvokeStaticTag.class);
       }
   
       public void setUp() throws Exception {
           super.setUp();
  -    }    
  -    
  +    }
  +
       public void tearDown() throws Exception {
           super.tearDown();
  -    }  
  -    
  +    }
  +
       /**
        *  Gets the System property 'java.runtime.version' and compares it with,
        *  well, the same system property
  @@ -49,13 +49,13 @@
        public void testSimpleSystemInvoke() throws Exception {
           setUpScript( "testInvokeStaticTag.jelly" );
           Script script = getJelly().compileScript();
  -        
  +
           getJellyContext().setVariable( "test.simpleSystemInvoke",Boolean.TRUE );
  -        
  +
           getJellyContext().setVariable( "propertyName", "java.runtime.version" );
           script.run( getJellyContext(),getXMLOutput() );
  -                
  -        assertTrue( System.getProperty( "java.runtime.version" ).equals( 
getJellyContext().getVariable("propertyName" ) ) );        
  +
  +        assertTrue( System.getProperty( "java.runtime.version" ).equals( 
getJellyContext().getVariable("propertyName" ) ) );
       }
   
        /**
  @@ -65,42 +65,42 @@
       public void testSystemInvoke() throws Exception {
           setUpScript( "testInvokeStaticTag.jelly" );
           Script script = getJelly().compileScript();
  -        
  +
           getJellyContext().setVariable( "test.systemInvoke",Boolean.TRUE );
  -        
  +
           getJellyContext().setVariable( "propertyName", "TEST PROPERTY" );
           getJellyContext().setVariable( "propertyValue", "Jelly is cool" );
           script.run( getJellyContext(),getXMLOutput() );
  -                
  +
           assertTrue( System.getProperty( "TEST PROPERTY" ).equals( "Jelly is cool" ) 
);
  -        
  +
       }
   
        /**
        *  Uses the java.text.MessageFormat class to format a text message
  -     *  with 3 arguments. 
  +     *  with 3 arguments.
        */
       public void testMessageFormatInvoke() throws Exception {
           System.out.println( System.getProperties() );
           setUpScript( "testInvokeStaticTag.jelly" );
           Script script = getJelly().compileScript();
  -        
  +
           getJellyContext().setVariable( "test.messageFormatInvoke", Boolean.TRUE );
  -        
  +
           Object[] args = new Object[3];
           args[0] = "Jelly";
           args[1] = "coolest";
           args[2] = "used";
  -        
  +
           getJellyContext().setVariable( "args", args );
           getJellyContext().setVariable( "message", "Is not {0} the {1} thing you 
have ever {2}?" );
           script.run( getJellyContext(),getXMLOutput() );
  -         
  +
           assertNotNull( getJellyContext().getVariable("message") );
           assertTrue( getJellyContext().getVariable("message").equals("Is not Jelly 
the coolest thing you have ever used?") );
  -        
  +
       }
  -    
  +
       public void testInvokeThatThrowsException() throws Exception {
           setUpScript( "testInvokeStaticTag.jelly" );
           Script script = getJelly().compileScript();
  @@ -114,7 +114,7 @@
           assertNotNull( exception );
           assertEquals( exceptionMessage, exception.getMessage() );
       }
  -    
  +
       public void testInvokeThatDoesNotHandleException() throws Exception {
           setUpScript( "testInvokeStaticTag.jelly" );
           Script script = getJelly().compileScript();
  @@ -126,9 +126,9 @@
           assertNotNull( jellyException );
           assertTrue( "messages are the same", ! 
exceptionMessage.equals(jellyException.getMessage()) );
           assertTrue( "exception '" + jellyException.getMessage() + "' does not ends 
with '" +
  -                     exceptionMessage+"'", 
jellyException.getMessage().endsWith(exceptionMessage) );
  +                exceptionMessage+"'", 
jellyException.getMessage().endsWith(exceptionMessage) );
           assertNotNull( jellyException.getCause() );
           assertEquals( exceptionMessage, jellyException.getCause().getMessage() );
       }
  -    
  +
   }
  
  
  
  1.8       +12 -12    
jakarta-commons/jelly/src/test/org/apache/commons/jelly/core/TestInvokeTag.java
  
  Index: TestInvokeTag.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-commons/jelly/src/test/org/apache/commons/jelly/core/TestInvokeTag.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- TestInvokeTag.java        16 Aug 2004 03:44:28 -0000      1.7
  +++ TestInvokeTag.java        8 Sep 2004 04:36:52 -0000       1.8
  @@ -1,12 +1,12 @@
   /*
    * Copyright 2002,2004 The Apache Software Foundation.
  - * 
  + *
    * Licensed under the Apache License, Version 2.0 (the "License");
    * you may not use this file except in compliance with the License.
    * You may obtain a copy of the License at
  - * 
  + *
    *      http://www.apache.org/licenses/LICENSE-2.0
  - * 
  + *
    * Unless required by applicable law or agreed to in writing, software
    * distributed under the License is distributed on an "AS IS" BASIS,
    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  @@ -32,16 +32,16 @@
       }
   
       public static TestSuite suite() throws Exception {
  -        return new TestSuite(TestInvokeTag.class);        
  +        return new TestSuite(TestInvokeTag.class);
       }
   
       public void setUp() throws Exception {
           super.setUp();
  -    }    
  -    
  +    }
  +
       public void tearDown() throws Exception {
           super.tearDown();
  -    }    
  +    }
   
       public void testSimpleInvoke() throws Exception {
           setUpScript("testInvokeTag.jelly");
  @@ -94,7 +94,7 @@
           assertNotNull(getJellyContext().getVariable("argtwo"));
           assertEquals("Chicago",getJellyContext().getVariable("argtwo"));
       }
  -    
  +
       public void testInvokeThatThrowsException() throws Exception {
           setUpScript("testInvokeTag.jelly");
           Script script = getJelly().compileScript();
  @@ -109,7 +109,7 @@
           assertNotNull( exception );
           assertEquals( exceptionMessage, exception.getMessage() );
       }
  -    
  +
       public void testInvokeThatDoesNotHandleException() throws Exception {
           setUpScript("testInvokeTag.jelly");
           Script script = getJelly().compileScript();
  @@ -122,10 +122,10 @@
           assertNotNull( jellyException );
           assertTrue( "messages are the same", ! 
exceptionMessage.equals(jellyException.getMessage()) );
           assertTrue( "exception '" + jellyException.getMessage() + "' does not ends 
with '" +
  -                     exceptionMessage+"'", 
jellyException.getMessage().endsWith(exceptionMessage) );
  +                exceptionMessage+"'", 
jellyException.getMessage().endsWith(exceptionMessage) );
           assertNotNull( jellyException.getCause() );
           assertEquals( exceptionMessage, jellyException.getCause().getMessage() );
       }
  -    
  +
   
   }
  
  
  
  1.2       +8 -8      
jakarta-commons/jelly/src/test/org/apache/commons/jelly/core/ExceptionBean.java
  
  Index: ExceptionBean.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-commons/jelly/src/test/org/apache/commons/jelly/core/ExceptionBean.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ExceptionBean.java        12 Aug 2004 04:25:42 -0000      1.1
  +++ ExceptionBean.java        8 Sep 2004 04:36:52 -0000       1.2
  @@ -1,12 +1,12 @@
   /*
    * Copyright 2002,2004 The Apache Software Foundation.
  - * 
  + *
    * Licensed under the Apache License, Version 2.0 (the "License");
    * you may not use this file except in compliance with the License.
    * You may obtain a copy of the License at
  - * 
  + *
    *      http://www.apache.org/licenses/LICENSE-2.0
  - * 
  + *
    * Unless required by applicable law or agreed to in writing, software
    * distributed under the License is distributed on an "AS IS" BASIS,
    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  @@ -15,20 +15,20 @@
    */
   package org.apache.commons.jelly.core;
   
  -/** 
  +/**
    * A sample bean that throws exceptions when its methods are invoked.
    */
   public class ExceptionBean {
  -        
  +
       public ExceptionBean() {
       }
  -        
  +
       public void instanceMethod( String msg) throws Exception {
  -     throw new Exception( msg ); 
  +        throw new Exception( msg );
       }
   
       public static void staticMethod( String msg) throws Exception {
  -     throw new Exception( msg ); 
  +        throw new Exception( msg );
       }
   
   }
  
  
  
  1.7       +11 -11    
jakarta-commons/jelly/src/test/org/apache/commons/jelly/tags/junit/JUnitTagLibrary.java
  
  Index: JUnitTagLibrary.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-commons/jelly/src/test/org/apache/commons/jelly/tags/junit/JUnitTagLibrary.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- JUnitTagLibrary.java      24 Feb 2004 14:21:27 -0000      1.6
  +++ JUnitTagLibrary.java      8 Sep 2004 04:36:52 -0000       1.7
  @@ -1,12 +1,12 @@
   /*
    * Copyright 2002,2004 The Apache Software Foundation.
  - * 
  + *
    * Licensed under the Apache License, Version 2.0 (the "License");
    * you may not use this file except in compliance with the License.
    * You may obtain a copy of the License at
  - * 
  + *
    *      http://www.apache.org/licenses/LICENSE-2.0
  - * 
  + *
    * Unless required by applicable law or agreed to in writing, software
    * distributed under the License is distributed on an "AS IS" BASIS,
    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  @@ -35,11 +35,11 @@
   
       /** The Log to which logging calls will be made. */
       private Log log = LogFactory.getLog(JUnitTagLibrary.class);
  -    
  +
       public JUnitTagLibrary() {
           registerTag("assert", AssertTag.class);
           registerTag("assertEquals", AssertEqualsTag.class);
  -     registerTag("assertThrows", AssertThrowsTag.class);
  +        registerTag("assertThrows", AssertThrowsTag.class);
           registerTag("fail", FailTag.class);
           registerTag("run", RunTag.class );
           registerTag("case", CaseTag.class );
  @@ -53,21 +53,21 @@
           String attributeValue) throws JellyException {
   
           // #### may need to include some namespace URI information in the XPath 
instance?
  -        
  -        if (attributeName.equals("xpath")) {            
  +
  +        if (attributeName.equals("xpath")) {
               if ( log.isDebugEnabled() ) {
                   log.debug( "Parsing XPath expression: " + attributeValue );
               }
  -            
  +
               // XPath xpath = new Dom4jXPath(attributeValue);
               Expression xpathExpr = super.createExpression( factory,
                                                              tagScript,
                                                              attributeName,
                                                              attributeValue );
   
  -            return new XPathExpression(attributeValue, xpathExpr, tagScript);       
     
  +            return new XPathExpression(attributeValue, xpathExpr, tagScript);
           }
  -        
  +
           // will use the default expression instead
           return super.createExpression(factory, tagScript, attributeName, 
attributeValue);
       }
  
  
  
  1.4       +41 -41    
jakarta-commons/jelly/src/test/org/apache/commons/jelly/tags/junit/JellyAssertionFailedError.java
  
  Index: JellyAssertionFailedError.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-commons/jelly/src/test/org/apache/commons/jelly/tags/junit/JellyAssertionFailedError.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- JellyAssertionFailedError.java    24 Feb 2004 14:21:27 -0000      1.3
  +++ JellyAssertionFailedError.java    8 Sep 2004 04:36:52 -0000       1.4
  @@ -1,12 +1,12 @@
   /*
    * Copyright 2002,2004 The Apache Software Foundation.
  - * 
  + *
    * Licensed under the Apache License, Version 2.0 (the "License");
    * you may not use this file except in compliance with the License.
    * You may obtain a copy of the License at
  - * 
  + *
    *      http://www.apache.org/licenses/LICENSE-2.0
  - * 
  + *
    * Unless required by applicable law or agreed to in writing, software
    * distributed under the License is distributed on an "AS IS" BASIS,
    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  @@ -23,8 +23,8 @@
   
   import org.apache.commons.jelly.LocationAware;
   
  -/** 
  - * <p><code>JellyAssertionFailedError</code> is 
  +/**
  + * <p><code>JellyAssertionFailedError</code> is
    * a JUnit AssertionFailedError which is LocationAware so that it can include
    * details of where in the JellyUnit test case that the failure occurred.</p>
    *
  @@ -33,7 +33,7 @@
    */
   
   public class JellyAssertionFailedError extends AssertionFailedError implements 
LocationAware {
  -    
  +
       /** the underlying cause of the exception */
       private Throwable cause;
   
  @@ -45,10 +45,10 @@
   
       /** the line number in the script of the error */
       private int lineNumber = -1;
  -    
  +
       /** the column number in the script of the error */
       private int columnNumber = -1;
  -    
  +
       public JellyAssertionFailedError() {
       }
   
  @@ -60,77 +60,77 @@
           super(message);
           this.cause = cause;
       }
  -    
  +
       public JellyAssertionFailedError(Throwable cause) {
           super(cause.getLocalizedMessage());
           this.cause = cause;
       }
  -    
  +
       public Throwable getCause() {
           return cause;
       }
   
  -    
  -    /** 
  -     * @return the line number of the tag 
  +
  +    /**
  +     * @return the line number of the tag
        */
       public int getLineNumber() {
           return lineNumber;
       }
  -    
  -    /** 
  -     * Sets the line number of the tag 
  +
  +    /**
  +     * Sets the line number of the tag
        */
       public void setLineNumber(int lineNumber) {
           this.lineNumber = lineNumber;
       }
   
  -    /** 
  -     * @return the column number of the tag 
  +    /**
  +     * @return the column number of the tag
        */
       public int getColumnNumber() {
           return columnNumber;
       }
  -    
  -    /** 
  -     * Sets the column number of the tag 
  +
  +    /**
  +     * Sets the column number of the tag
        */
       public void setColumnNumber(int columnNumber) {
           this.columnNumber = columnNumber;
       }
   
  -    /** 
  -     * @return the Jelly file which caused the problem 
  +    /**
  +     * @return the Jelly file which caused the problem
        */
       public String getFileName() {
           return fileName;
       }
   
  -    /** 
  -     * Sets the Jelly file which caused the problem 
  +    /**
  +     * Sets the Jelly file which caused the problem
        */
       public void setFileName(String fileName) {
           this.fileName = fileName;
       }
  -    
   
  -    /** 
  +
  +    /**
        * @return the element name which caused the problem
        */
       public String getElementName() {
           return elementName;
       }
   
  -    /** 
  +    /**
        * Sets the element name which caused the problem
        */
       public void setElementName(String elementName) {
           this.elementName = elementName;
       }
  -    
  -    
  +
  +
       public String getMessage() {
  -        return super.getMessage() + " File: " + fileName + " At tag <" + 
elementName + ">: line: " 
  +        return super.getMessage() + " File: " + fileName + " At tag <" + 
elementName + ">: line: "
               + lineNumber + " column: " + columnNumber;
       }
   
  @@ -139,7 +139,7 @@
       }
   
       // #### overload the printStackTrace methods...
  -    public void printStackTrace(PrintWriter s) { 
  +    public void printStackTrace(PrintWriter s) {
           synchronized (s) {
               super.printStackTrace(s);
               if  (cause != null) {
  @@ -148,7 +148,7 @@
               }
           }
       }
  -        
  +
       public void printStackTrace(PrintStream s) {
           synchronized (s) {
               super.printStackTrace(s);
  @@ -159,11 +159,11 @@
           }
       }
   
  -     public void printStackTrace() {
  -             super.printStackTrace();
  -             if (cause != null) {
  -                     System.out.println("Root cause");
  -                     cause.printStackTrace();
  -             }
  -     }
  +    public void printStackTrace() {
  +        super.printStackTrace();
  +        if (cause != null) {
  +            System.out.println("Root cause");
  +            cause.printStackTrace();
  +        }
  +    }
   }
  
  
  
  1.5       +81 -81    
jakarta-commons/jelly/src/test/org/apache/commons/jelly/tags/junit/AssertThrowsTag.java
  
  Index: AssertThrowsTag.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-commons/jelly/src/test/org/apache/commons/jelly/tags/junit/AssertThrowsTag.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- AssertThrowsTag.java      24 Feb 2004 14:21:27 -0000      1.4
  +++ AssertThrowsTag.java      8 Sep 2004 04:36:52 -0000       1.5
  @@ -1,12 +1,12 @@
   /*
    * Copyright 2002,2004 The Apache Software Foundation.
  - * 
  + *
    * Licensed under the Apache License, Version 2.0 (the "License");
    * you may not use this file except in compliance with the License.
    * You may obtain a copy of the License at
  - * 
  + *
    *      http://www.apache.org/licenses/LICENSE-2.0
  - * 
  + *
    * Unless required by applicable law or agreed to in writing, software
    * distributed under the License is distributed on an "AS IS" BASIS,
    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  @@ -32,32 +32,32 @@
    */
   public class AssertThrowsTag extends AssertTagSupport {
   
  -     /** The Log to which logging calls will be made. */
  -     private static final Log log = LogFactory.getLog(AssertThrowsTag.class);
  +    /** The Log to which logging calls will be made. */
  +    private static final Log log = LogFactory.getLog(AssertThrowsTag.class);
   
  -     /**
  -      * The variable name to export the caught exception to.
  -      */
  -     private String var;
  -
  -     /**
  -      * The class name (fully qualified) of the exception expected to be thrown
  -      * by the body.  Also a superclass of the expected exception can be given.
  -      */
  -     private String expected;
  +    /**
  +     * The variable name to export the caught exception to.
  +     */
  +    private String var;
  +
  +    /**
  +     * The class name (fully qualified) of the exception expected to be thrown
  +     * by the body.  Also a superclass of the expected exception can be given.
  +     */
  +    private String expected;
   
       /**
        * Sets the ClassLoader to be used when loading an exception class
     */
       private ClassLoader classLoader;
  -    
  -     // Tag interface
  -     //-------------------------------------------------------------------------
  -     public void doTag(XMLOutput output) throws JellyTagException {
  +
  +    // Tag interface
  +    //-------------------------------------------------------------------------
  +    public void doTag(XMLOutput output) throws JellyTagException {
           Class throwableClass = null;
  -             try {
  +        try {
               throwableClass = getThrowableClass();
  -                     invokeBody(output);
  -             } 
  +            invokeBody(output);
  +        }
           catch (Throwable t) {
               if (t instanceof JellyException) {
                   // unwrap Jelly exceptions which wrap other exceptions
  @@ -66,72 +66,72 @@
                       t = je.getCause();
                   }
               }
  -                     if (var != null) {
  -                             context.setVariable(var, t);
  -                     }
  -                     if (throwableClass != null && 
!throwableClass.isAssignableFrom(t.getClass())) {
  -                             fail("Unexpected exception: " + t);
  -                     } 
  +            if (var != null) {
  +                context.setVariable(var, t);
  +            }
  +            if (throwableClass != null && 
!throwableClass.isAssignableFrom(t.getClass())) {
  +                fail("Unexpected exception: " + t);
  +            }
               else {
  -                             return;
  -                     }
  -             }
  -             fail("No exception was thrown.");
  -     }
  -
  -     // Properties
  -     //-------------------------------------------------------------------------
  -     /**
  -      * Sets the class name of exception expected to be thrown by the body.  The
  -      * class name must be fully qualified and can either be the expected
  -      * exception class itself or any supertype of it, but must be a subtype of
  -      * <code>java.lang.Throwable</code>.
  -      */
  -     public void setExpected(String expected) {
  -             this.expected = expected;
  -     }
  -
  -     /**
  -      * Sets the variable name to define for this expression.
  -      */
  -     public void setVar(String var) {
  -             this.var = var;
  -     }
  +                return;
  +            }
  +        }
  +        fail("No exception was thrown.");
  +    }
  +
  +    // Properties
  +    //-------------------------------------------------------------------------
  +    /**
  +     * Sets the class name of exception expected to be thrown by the body.  The
  +     * class name must be fully qualified and can either be the expected
  +     * exception class itself or any supertype of it, but must be a subtype of
  +     * <code>java.lang.Throwable</code>.
  +     */
  +    public void setExpected(String expected) {
  +        this.expected = expected;
  +    }
  +
  +    /**
  +     * Sets the variable name to define for this expression.
  +     */
  +    public void setVar(String var) {
  +        this.var = var;
  +    }
   
       /**
        * Sets the class loader to be used to load the exception type
     */
       public void setClassLoader(ClassLoader classLoader) {
           this.classLoader = classLoader;
       }
  -    
  +
       public ClassLoader getClassLoader() {
           if (classLoader == null) {
               return getClass().getClassLoader();
           }
           return classLoader;
       }
  -    
  -     // Implementation methods
  -     //-------------------------------------------------------------------------
  -
  -     /**
  -      * Returns the <code>Class</code> corresponding to the class
  -      * specified by <code>expected</code>. If
  -      * <code>expected</code> was either not specified then <code>java. lang.
  -      * Throwable</code> is returned.
  +
  +    // Implementation methods
  +    //-------------------------------------------------------------------------
  +
  +    /**
  +     * Returns the <code>Class</code> corresponding to the class
  +     * specified by <code>expected</code>. If
  +     * <code>expected</code> was either not specified then <code>java. lang.
  +     * Throwable</code> is returned.
        * Otherwise if the class couldn't be
  -     * found or doesn't denote an exception class then an exception is thrown. 
  -      * 
  -      * @return Class The class of the exception to expect
  -      */
  -     protected Class getThrowableClass() throws ClassNotFoundException {
  -             if (expected == null) {
  -                     return Throwable.class;
  -             }
  -
  -             Class throwableClass = null;
  -             try {
  -                     throwableClass = getClassLoader().loadClass(expected);
  +     * found or doesn't denote an exception class then an exception is thrown.
  +     *
  +     * @return Class The class of the exception to expect
  +     */
  +    protected Class getThrowableClass() throws ClassNotFoundException {
  +        if (expected == null) {
  +            return Throwable.class;
  +        }
  +
  +        Class throwableClass = null;
  +        try {
  +            throwableClass = getClassLoader().loadClass(expected);
           }
           catch (ClassNotFoundException e) {
               try {
  @@ -142,11 +142,11 @@
                   throw e;
               }
           }
  -            
  -             if (!Throwable.class.isAssignableFrom(throwableClass)) {
  -                     log.warn( "The class: " + expected + " is not an Exception 
class.");
  -                     return null;
  -             }
  -             return throwableClass;
  -     }
  +
  +        if (!Throwable.class.isAssignableFrom(throwableClass)) {
  +            log.warn( "The class: " + expected + " is not an Exception class.");
  +            return null;
  +        }
  +        return throwableClass;
  +    }
   }
  
  
  
  1.6       +22 -22    
jakarta-commons/jelly/src/test/org/apache/commons/jelly/expression/TestDynaBeans.java
  
  Index: TestDynaBeans.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-commons/jelly/src/test/org/apache/commons/jelly/expression/TestDynaBeans.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- TestDynaBeans.java        24 Feb 2004 14:20:29 -0000      1.5
  +++ TestDynaBeans.java        8 Sep 2004 04:36:52 -0000       1.6
  @@ -1,12 +1,12 @@
   /*
    * Copyright 2002,2004 The Apache Software Foundation.
  - * 
  + *
    * Licensed under the Apache License, Version 2.0 (the "License");
    * you may not use this file except in compliance with the License.
    * You may obtain a copy of the License at
  - * 
  + *
    *      http://www.apache.org/licenses/LICENSE-2.0
  - * 
  + *
    * Unless required by applicable law or agreed to in writing, software
    * distributed under the License is distributed on an "AS IS" BASIS,
    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  @@ -31,7 +31,7 @@
   import org.apache.commons.jelly.JellyContext;
   import org.apache.commons.jelly.expression.jexl.JexlExpressionFactory;
   
  -/** 
  +/**
    * Tests the use of Expression parsing
    *
    * @author <a href="mailto:[EMAIL PROTECTED]">James Strachan</a>
  @@ -59,32 +59,32 @@
           DynaBean dynaBean = dynaClass.newInstance();
           dynaBean.set( "stringProperty", "foo" );
           dynaBean.set( "intProperty", new Integer(24) );
  -                
  +
           context.setVariable("dbean", dynaBean);
   
           assertExpression("${dbean.stringProperty}", "foo");
           assertExpression("${dbean.intProperty}", new Integer(24));
       }
   
  -     protected DynaClass createDynaClass() {
  -             DynaProperty[] properties = {
  -                     new DynaProperty("booleanProperty", Boolean.TYPE),
  -                     new DynaProperty("booleanSecond", Boolean.TYPE),
  -                     new DynaProperty("doubleProperty", Double.TYPE),
  -                     new DynaProperty("floatProperty", Float.TYPE),
  -                     new DynaProperty("intProperty", Integer.TYPE),
  -                     new DynaProperty("listIndexed", List.class),
  -                     new DynaProperty("longProperty", Long.TYPE),
  -                     new DynaProperty("mappedProperty", Map.class),
  -                     new DynaProperty("mappedIntProperty", Map.class),
  -                     new DynaProperty("nullProperty", String.class),
  -                     new DynaProperty("shortProperty", Short.TYPE),
  -                     new DynaProperty("stringProperty", String.class),
  -             };
  +    protected DynaClass createDynaClass() {
  +        DynaProperty[] properties = {
  +            new DynaProperty("booleanProperty", Boolean.TYPE),
  +            new DynaProperty("booleanSecond", Boolean.TYPE),
  +            new DynaProperty("doubleProperty", Double.TYPE),
  +            new DynaProperty("floatProperty", Float.TYPE),
  +            new DynaProperty("intProperty", Integer.TYPE),
  +            new DynaProperty("listIndexed", List.class),
  +            new DynaProperty("longProperty", Long.TYPE),
  +            new DynaProperty("mappedProperty", Map.class),
  +            new DynaProperty("mappedIntProperty", Map.class),
  +            new DynaProperty("nullProperty", String.class),
  +            new DynaProperty("shortProperty", Short.TYPE),
  +            new DynaProperty("stringProperty", String.class),
  +        };
           return new BasicDynaClass("TestDynaClass", null, properties);
       }
  -    
  -    
  +
  +
       protected void assertExpression(String expressionText, Object expectedValue) 
throws Exception {
           Expression expression = CompositeExpression.parse(expressionText, factory);
           assertTrue( "Created a valid expression for: " + expressionText, expression 
!= null );
  
  
  

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

Reply via email to