Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@www.apache.org Received: (qmail 57967 invoked from network); 9 Sep 2004 12:32:16 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 9 Sep 2004 12:32:16 -0000 Received: (qmail 50237 invoked by uid 500); 9 Sep 2004 12:32:03 -0000 Delivered-To: apmail-jakarta-commons-dev-archive@jakarta.apache.org Received: (qmail 50105 invoked by uid 500); 9 Sep 2004 12:32:02 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 50081 invoked by uid 500); 9 Sep 2004 12:32:01 -0000 Received: (qmail 50068 invoked by uid 99); 9 Sep 2004 12:32:00 -0000 X-ASF-Spam-Status: No, hits=-2.8 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.28) with SMTP; Thu, 09 Sep 2004 05:31:58 -0700 Received: (qmail 57839 invoked by uid 1431); 9 Sep 2004 12:31:57 -0000 Date: 9 Sep 2004 12:31:57 -0000 Message-ID: <20040909123157.57838.qmail@minotaur.apache.org> From: dion@apache.org To: jakarta-commons-cvs@apache.org Subject: cvs commit: jakarta-commons/jelly/src/test/org/apache/commons/jelly/impl TestTagLibraryResolver.java X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N dion 2004/09/09 05:31:57 Modified: jelly/src/test/org/apache/commons/jelly/tags/junit AssertTag.java SuiteTag.java AssertTagSupport.java AssertEqualsTag.java FailTag.java CaseTag.java RunTag.java JellyTestSuite.java jelly/src/test/org/apache/commons/jelly/test/xml TestDummyXMLOutput.java TestNonexistentTags.java TestXMLValidation.java TestDefaultNamespaceFilter.java TestXMLParserCache.java TestCData.java jelly/src/test/org/apache/commons/jelly/core/extension CoreExtensionTagLibrary.java UseBeanExtendedTag.java UseBeanIgnoreBadProps.java jelly/src/test/org/apache/commons/jelly/expression TestExpressions.java jelly/src/test/org/apache/commons/jelly/test/impl DummyTag.java TestEmbedded.java DummyTagLibrary.java jelly/src/test/org/apache/commons/jelly/impl TestTagLibraryResolver.java Log: Fix license file whitespace Revision Changes Path 1.6 +12 -12 jakarta-commons/jelly/src/test/org/apache/commons/jelly/tags/junit/AssertTag.java Index: AssertTag.java =================================================================== RCS file: /home/cvs/jakarta-commons/jelly/src/test/org/apache/commons/jelly/tags/junit/AssertTag.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- AssertTag.java 24 Feb 2004 14:21:27 -0000 1.5 +++ AssertTag.java 9 Sep 2004 12:31:56 -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. @@ -23,7 +23,7 @@ import org.jaxen.JaxenException; import org.jaxen.XPath; -/** +/** * Performs an assertion that a given boolean expression, or XPath expression is * true. If the expression returns false then this test fails. * @@ -34,7 +34,7 @@ /** The expression to evaluate. */ private Expression test; - + /** The XPath expression to evaluate */ private XPath xpath; @@ -42,7 +42,7 @@ } // Tag interface - //------------------------------------------------------------------------- + //------------------------------------------------------------------------- public void doTag(XMLOutput output) throws JellyTagException { if (test == null && xpath == null) { throw new MissingAttributeException( "test" ); @@ -61,15 +61,15 @@ } catch (JaxenException anException) { throw new JellyTagException("Error evaluating xpath", anException); } - + } } - + // Properties - //------------------------------------------------------------------------- + //------------------------------------------------------------------------- - /** + /** * Sets the boolean expression to evaluate. If this expression returns true * then the test succeeds otherwise if it returns false then the text will * fail with the content of the tag being the error message. @@ -78,7 +78,7 @@ this.test = test; } - /** + /** * Sets the boolean XPath expression to evaluate. If this expression returns true * then the test succeeds otherwise if it returns false then the text will * fail with the content of the tag being the error message. 1.5 +24 -24 jakarta-commons/jelly/src/test/org/apache/commons/jelly/tags/junit/SuiteTag.java Index: SuiteTag.java =================================================================== RCS file: /home/cvs/jakarta-commons/jelly/src/test/org/apache/commons/jelly/tags/junit/SuiteTag.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- SuiteTag.java 24 Feb 2004 14:21:27 -0000 1.4 +++ SuiteTag.java 9 Sep 2004 12:31:56 -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. @@ -22,7 +22,7 @@ import org.apache.commons.jelly.TagSupport; import org.apache.commons.jelly.XMLOutput; -/** +/** * Represents a collection of TestCases.. This tag is analagous to * JUnit's TestSuite class. * @@ -33,29 +33,29 @@ /** the test suite this tag created */ private TestSuite suite; - + /** the name of the variable of the test suite */ private String var; - + /** the name of the test suite to create */ private String name; public SuiteTag() { } - + /** * Adds a new Test to this suite */ public void addTest(Test test) { getSuite().addTest(test); - } - + } + // Tag interface - //------------------------------------------------------------------------- + //------------------------------------------------------------------------- public void doTag(XMLOutput output) throws JellyTagException { suite = createSuite(); - - TestSuite parent = (TestSuite) context.getVariable("org.apache.commons.jelly.junit.suite"); + + TestSuite parent = (TestSuite) context.getVariable("org.apache.commons.jelly.junit.suite"); if ( parent == null ) { context.setVariable("org.apache.commons.jelly.junit.suite", suite ); } @@ -64,42 +64,42 @@ } invokeBody(output); - + if ( var != null ) { context.setVariable(var, suite); - } + } } - + // Properties - //------------------------------------------------------------------------- + //------------------------------------------------------------------------- public TestSuite getSuite() { return suite; } - + /** * Sets the name of the test suite whichi is exported */ public void setVar(String var) { this.var = var; } - + /** * @return the name of this test suite */ public String getName() { return name; } - - /** + + /** * Sets the name of this test suite */ public void setName(String name) { this.name = name; } - + // Implementation methods - //------------------------------------------------------------------------- - + //------------------------------------------------------------------------- + /** * Factory method to create a new TestSuite */ 1.4 +12 -12 jakarta-commons/jelly/src/test/org/apache/commons/jelly/tags/junit/AssertTagSupport.java Index: AssertTagSupport.java =================================================================== RCS file: /home/cvs/jakarta-commons/jelly/src/test/org/apache/commons/jelly/tags/junit/AssertTagSupport.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- AssertTagSupport.java 24 Feb 2004 14:21:27 -0000 1.3 +++ AssertTagSupport.java 9 Sep 2004 12:31:56 -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. @@ -17,10 +17,10 @@ import org.apache.commons.jelly.xpath.XPathTagSupport; -/** +/** * The abstract base class of any assertion tag which is * useful for implementation inheritence. - * + * * @author James Strachan * @version $Revision$ */ @@ -30,15 +30,15 @@ } // Implementation methods - //------------------------------------------------------------------------- - + //------------------------------------------------------------------------- + /** - * Produces a failure assertion with the given message + * Produces a failure assertion with the given message */ protected void fail(String message) throws JellyAssertionFailedError { throw new JellyAssertionFailedError(message); } - + /** * Produces a failure assertion with the given message and added detail. */ @@ -50,7 +50,7 @@ fail(message + ". Assertion failed while " + detail); } } - + /** * Produces a failure if the actual value was not equal to the expected value */ @@ -61,5 +61,5 @@ } fail(formatted + "expected:[" + expected + "] but was:[" + actual + "]" + expressions); } - + } 1.5 +21 -21 jakarta-commons/jelly/src/test/org/apache/commons/jelly/tags/junit/AssertEqualsTag.java Index: AssertEqualsTag.java =================================================================== RCS file: /home/cvs/jakarta-commons/jelly/src/test/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 24 Feb 2004 14:21:27 -0000 1.4 +++ AssertEqualsTag.java 9 Sep 2004 12:31:56 -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. @@ -19,7 +19,7 @@ import org.apache.commons.jelly.XMLOutput; import org.apache.commons.jelly.expression.Expression; -/** +/** * Compares an actual object against an expected object and if they are different * then the test will fail. * @@ -30,42 +30,42 @@ private Expression actual; private Expression expected; - + // Tag interface - //------------------------------------------------------------------------- + //------------------------------------------------------------------------- public void doTag(XMLOutput output) throws JellyTagException { String message = getBodyText(); - Object expectedValue = expected.evaluate(context); - Object actualValue = actual.evaluate(context); - + Object expectedValue = expected.evaluate(context); + Object actualValue = actual.evaluate(context); + if (expectedValue == null && actualValue == null) { return; } - if (actualValue != null && expectedValue.equals(actualValue)) { + if (actualValue != null && expectedValue.equals(actualValue)) { return; } - String expressions = "\nExpected expression: " - + expected.getExpressionText() - + "\nActual expression: " + String expressions = "\nExpected expression: " + + expected.getExpressionText() + + "\nActual expression: " + actual.getExpressionText(); - + failNotEquals(message, expectedValue, actualValue, expressions); } - + // Properties - //------------------------------------------------------------------------- - - /** - * Sets the actual value which will be compared against the + //------------------------------------------------------------------------- + + /** + * Sets the actual value which will be compared against the * expected value. */ public void setActual(Expression actual) { this.actual = actual; } - + /** * Sets the expected value to be tested against */ 1.5 +11 -11 jakarta-commons/jelly/src/test/org/apache/commons/jelly/tags/junit/FailTag.java Index: FailTag.java =================================================================== RCS file: /home/cvs/jakarta-commons/jelly/src/test/org/apache/commons/jelly/tags/junit/FailTag.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- FailTag.java 24 Feb 2004 14:21:27 -0000 1.4 +++ FailTag.java 9 Sep 2004 12:31:56 -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. @@ -18,7 +18,7 @@ import org.apache.commons.jelly.JellyTagException; import org.apache.commons.jelly.XMLOutput; -/** +/** * This tag causes a failure message. The message can either * be specified in the tags body or via the message attribute. * @@ -33,7 +33,7 @@ } // Tag interface - //------------------------------------------------------------------------- + //------------------------------------------------------------------------- public void doTag(XMLOutput output) throws JellyTagException { String message = getMessage(); if ( message == null ) { @@ -41,9 +41,9 @@ } fail( message ); } - + // Properties - //------------------------------------------------------------------------- + //------------------------------------------------------------------------- /** * @return the failure message @@ -51,9 +51,9 @@ public String getMessage() { return message; } - - - /** + + + /** * Sets the failure message. If this attribute is not specified then the * body of this tag will be used instead. */ 1.6 +18 -18 jakarta-commons/jelly/src/test/org/apache/commons/jelly/tags/junit/CaseTag.java Index: CaseTag.java =================================================================== RCS file: /home/cvs/jakarta-commons/jelly/src/test/org/apache/commons/jelly/tags/junit/CaseTag.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- CaseTag.java 24 Feb 2004 14:21:27 -0000 1.5 +++ CaseTag.java 9 Sep 2004 12:31:56 -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. @@ -23,7 +23,7 @@ import org.apache.commons.jelly.TagSupport; import org.apache.commons.jelly.XMLOutput; -/** +/** * Represents a single test case in a test suite; this tag is analagous to * JUnit's TestCase class. * @@ -33,16 +33,16 @@ public class CaseTag extends TagSupport { private String name; - - + + // Tag interface - //------------------------------------------------------------------------- + //------------------------------------------------------------------------- public void doTag(final XMLOutput output) throws JellyTagException { String name = getName(); if ( name == null ) { name = toString(); } - + // #### we need to redirect the output to a TestListener // or something? TestCase testCase = new TestCase(name) { @@ -50,16 +50,16 @@ // create a new child context so that each test case // will have its own variable scopes JellyContext newContext = new JellyContext( context ); - + // disable inheritence of variables and tag libraries newContext.setExportLibraries(false); newContext.setExport(false); - + // invoke the test case getBody().run(newContext, output); } }; - + // lets find the test suite TestSuite suite = getSuite(); if ( suite == null ) { @@ -67,9 +67,9 @@ } suite.addTest(testCase); } - + // Properties - //------------------------------------------------------------------------- + //------------------------------------------------------------------------- /** * @return the name of this test case @@ -77,16 +77,16 @@ public String getName() { return name; } - - /** + + /** * Sets the name of this test case */ public void setName(String name) { this.name = name; } - + // Implementation methods - //------------------------------------------------------------------------- + //------------------------------------------------------------------------- /** * Strategy method to find the corrent TestSuite to add a new Test case to 1.5 +26 -26 jakarta-commons/jelly/src/test/org/apache/commons/jelly/tags/junit/RunTag.java Index: RunTag.java =================================================================== RCS file: /home/cvs/jakarta-commons/jelly/src/test/org/apache/commons/jelly/tags/junit/RunTag.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- RunTag.java 24 Feb 2004 14:21:27 -0000 1.4 +++ RunTag.java 9 Sep 2004 12:31:56 -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,7 +32,7 @@ import org.xml.sax.SAXException; import org.xml.sax.helpers.AttributesImpl; -/** +/** * This tag will run the given Test which could be an individual TestCase or a TestSuite. * The TestResult can be specified to capture the output, otherwise the results are output * as XML so that they can be formatted in some custom manner. @@ -44,24 +44,24 @@ /** The Log to which logging calls will be made. */ private static final Log log = LogFactory.getLog(RunTag.class); - + private Test test; private TestResult result; private TestListener listener; - + // Tag interface - //------------------------------------------------------------------------- + //------------------------------------------------------------------------- public void doTag(XMLOutput output) throws JellyTagException { Test test = getTest(); if ( test == null ) { - test = (Test) context.getVariable("org.apache.commons.jelly.junit.suite"); + test = (Test) context.getVariable("org.apache.commons.jelly.junit.suite"); } if ( test == null ) { throw new MissingAttributeException( "test" ); } TestResult result = getResult(); if ( result == null ) { - result = createResult(output); + result = createResult(output); } TestListener listener = getListener(); if ( listener == null ) { @@ -70,9 +70,9 @@ result.addListener(listener); test.run(result); } - + // Properties - //------------------------------------------------------------------------- + //------------------------------------------------------------------------- /** * Returns the TestResult used to capture the output of the test. @@ -125,7 +125,7 @@ // Implementation methods - //------------------------------------------------------------------------- + //------------------------------------------------------------------------- /** * Factory method to create a new TestResult to capture the output of @@ -134,51 +134,51 @@ protected TestResult createResult(XMLOutput output) { return new TestResult(); } - + /** * Factory method to create a new TestListener to capture the output of * the test cases - */ + */ protected TestListener createTestListener(final XMLOutput output) { return new TestListener() { public void addError(Test test, Throwable t) { try { output.startElement("error"); - + output.startElement("message"); output.write(t.getMessage()); output.endElement("message"); - + output.startElement("stack"); output.write( stackTraceToString(t) ); output.endElement("stack"); - + output.endElement("error"); } catch (SAXException e) { handleSAXException(e); } } - + public void addFailure(Test test, AssertionFailedError t) { try { output.startElement("failure"); - + output.startElement("message"); output.write(t.getMessage()); output.endElement("message"); - + output.startElement("stack"); output.write( stackTraceToString(t) ); output.endElement("stack"); - + output.endElement("failure"); } catch (SAXException e) { handleSAXException(e); } } - + public void endTest(Test test) { try { output.endElement("test"); @@ -187,13 +187,13 @@ handleSAXException(e); } } - + public void startTest(Test test) { try { String name = test.toString(); AttributesImpl attributes = new AttributesImpl(); attributes.addAttribute("", "name", "name", "CDATA", name); - + output.startElement("test", attributes); } catch (SAXException e) { @@ -211,7 +211,7 @@ t.printStackTrace(new PrintWriter(writer)); return writer.toString(); } - + /** * Handles SAX Exceptions */ 1.4 +14 -14 jakarta-commons/jelly/src/test/org/apache/commons/jelly/tags/junit/JellyTestSuite.java Index: JellyTestSuite.java =================================================================== RCS file: /home/cvs/jakarta-commons/jelly/src/test/org/apache/commons/jelly/tags/junit/JellyTestSuite.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- JellyTestSuite.java 24 Feb 2004 14:21:27 -0000 1.3 +++ JellyTestSuite.java 9 Sep 2004 12:31:56 -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. @@ -24,7 +24,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -/** +/** * An abstract base class for creating a TestSuite via a Jelly script. * * @author James Strachan @@ -38,14 +38,14 @@ /** * Helper method to create a test suite from a file name on the class path - * in the package of the given class. - * For example a test could call + * in the package of the given class. + * For example a test could call * * createTestSuite( Foo.class, "suite.jelly" ); * - * which would loaad the 'suite.jelly script from the same package as the Foo + * which would loaad the 'suite.jelly script from the same package as the Foo * class on the classpath. - * + * * @param testClass is the test class used to load the script via the classpath * @param script is the name of the script, which is typically just a name, no directory. * @return a newly created TestSuite @@ -53,17 +53,17 @@ public static TestSuite createTestSuite(Class testClass, String script) throws Exception { URL url = testClass.getResource(script); if ( url == null ) { - throw new Exception( - "Could not find Jelly script: " + script - + " in package of class: " + testClass.getName() + throw new Exception( + "Could not find Jelly script: " + script + + " in package of class: " + testClass.getName() ); } return createTestSuite( url ); } - + /** * Helper method to create a test suite from the given Jelly script - * + * * @param script is the URL to the script which should create a TestSuite * @return a newly created TestSuite */ 1.7 +10 -10 jakarta-commons/jelly/src/test/org/apache/commons/jelly/test/xml/TestDummyXMLOutput.java Index: TestDummyXMLOutput.java =================================================================== RCS file: /home/cvs/jakarta-commons/jelly/src/test/org/apache/commons/jelly/test/xml/TestDummyXMLOutput.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- TestDummyXMLOutput.java 24 Feb 2004 14:21:27 -0000 1.6 +++ TestDummyXMLOutput.java 9 Sep 2004 12:31:56 -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. @@ -28,7 +28,7 @@ /** * Confirm that XMLOutput.createDummyXMLOutput() * doesn't do anything funky. - * + * * @author Morgan Delagrange * @version $Revision$ */ @@ -43,7 +43,7 @@ } public static TestSuite suite() throws Exception { - return new TestSuite(TestDummyXMLOutput.class); + return new TestSuite(TestDummyXMLOutput.class); } public void setUp(String scriptName) throws Exception { @@ -51,13 +51,13 @@ this.xmlOutput = XMLOutput.createDummyXMLOutput(); this.jelly = new Jelly(); - + String script = scriptName; URL url = this.getClass().getResource(script); if ( url == null ) { - throw new Exception( - "Could not find Jelly script: " + script - + " in package of class: " + this.getClass().getName() + throw new Exception( + "Could not find Jelly script: " + script + + " in package of class: " + this.getClass().getName() ); } this.jelly.setUrl(url); 1.6 +12 -12 jakarta-commons/jelly/src/test/org/apache/commons/jelly/test/xml/TestNonexistentTags.java Index: TestNonexistentTags.java =================================================================== RCS file: /home/cvs/jakarta-commons/jelly/src/test/org/apache/commons/jelly/test/xml/TestNonexistentTags.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- TestNonexistentTags.java 24 Feb 2004 14:21:27 -0000 1.5 +++ TestNonexistentTags.java 9 Sep 2004 12:31:56 -0000 1.6 @@ -1,19 +1,19 @@ /* * 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. * See the License for the specific language governing permissions and * limitations under the License. */ - + package org.apache.commons.jelly.test.xml; import java.net.URL; @@ -30,7 +30,7 @@ /** * A test to confirm that Jelly scripts fail to parse if they declare tags * that do not exist - * + * * @author Morgan Delagrange * @version $Revision$ */ @@ -44,7 +44,7 @@ } public static TestSuite suite() throws Exception { - return new TestSuite(TestNonexistentTags.class); + return new TestSuite(TestNonexistentTags.class); } public void setUp(String scriptName) throws Exception { @@ -52,13 +52,13 @@ xmlOutput = XMLOutput.createDummyXMLOutput(); jelly = new Jelly(); - + String script = scriptName; URL url = this.getClass().getResource(script); if ( url == null ) { - throw new Exception( - "Could not find Jelly script: " + script - + " in package of class: " + this.getClass().getName() + throw new Exception( + "Could not find Jelly script: " + script + + " in package of class: " + this.getClass().getName() ); } jelly.setUrl(url); @@ -75,5 +75,5 @@ } catch (JellyException e) { } } - + } 1.9 +10 -10 jakarta-commons/jelly/src/test/org/apache/commons/jelly/test/xml/TestXMLValidation.java Index: TestXMLValidation.java =================================================================== RCS file: /home/cvs/jakarta-commons/jelly/src/test/org/apache/commons/jelly/test/xml/TestXMLValidation.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- TestXMLValidation.java 24 Feb 2004 14:21:27 -0000 1.8 +++ TestXMLValidation.java 9 Sep 2004 12:31:56 -0000 1.9 @@ -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. @@ -30,7 +30,7 @@ /** * A test to confirm that invalid documents are * reject iff jelly.setValidateXML(true) - * + * * @author Morgan Delagrange * @version $Revision$ */ @@ -45,7 +45,7 @@ } public static TestSuite suite() throws Exception { - return new TestSuite(TestXMLValidation.class); + return new TestSuite(TestXMLValidation.class); } public void setUp(String scriptName) throws Exception { @@ -53,13 +53,13 @@ xmlOutput = XMLOutput.createXMLOutput(new StringWriter()); jelly = new Jelly(); - + String script = scriptName; URL url = this.getClass().getResource(script); if ( url == null ) { - throw new Exception( - "Could not find Jelly script: " + script - + " in package of class: " + this.getClass().getName() + throw new Exception( + "Could not find Jelly script: " + script + + " in package of class: " + this.getClass().getName() ); } jelly.setUrl(url); 1.6 +10 -10 jakarta-commons/jelly/src/test/org/apache/commons/jelly/test/xml/TestDefaultNamespaceFilter.java Index: TestDefaultNamespaceFilter.java =================================================================== RCS file: /home/cvs/jakarta-commons/jelly/src/test/org/apache/commons/jelly/test/xml/TestDefaultNamespaceFilter.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- TestDefaultNamespaceFilter.java 24 Feb 2004 14:21:27 -0000 1.5 +++ TestDefaultNamespaceFilter.java 9 Sep 2004 12:31:56 -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. @@ -26,7 +26,7 @@ import org.apache.commons.jelly.Script; import org.apache.commons.jelly.XMLOutput; -/** +/** * A helper class to run jelly test cases as part of Ant's JUnit tests * * @author James Strachan @@ -43,7 +43,7 @@ } public static TestSuite suite() throws Exception { - return new TestSuite(TestDefaultNamespaceFilter.class); + return new TestSuite(TestDefaultNamespaceFilter.class); } public void setUp() throws Exception { @@ -51,13 +51,13 @@ xmlOutput = XMLOutput.createXMLOutput(new StringWriter()); jelly = new Jelly(); - + String script = "nsFilterTest.jelly"; URL url = this.getClass().getResource(script); if ( url == null ) { - throw new Exception( - "Could not find Jelly script: " + script - + " in package of class: " + this.getClass().getName() + throw new Exception( + "Could not find Jelly script: " + script + + " in package of class: " + this.getClass().getName() ); } jelly.setUrl(url); 1.9 +12 -12 jakarta-commons/jelly/src/test/org/apache/commons/jelly/test/xml/TestXMLParserCache.java Index: TestXMLParserCache.java =================================================================== RCS file: /home/cvs/jakarta-commons/jelly/src/test/org/apache/commons/jelly/test/xml/TestXMLParserCache.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- TestXMLParserCache.java 24 Feb 2004 14:21:27 -0000 1.8 +++ TestXMLParserCache.java 9 Sep 2004 12:31:56 -0000 1.9 @@ -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. @@ -30,7 +30,7 @@ /** * A test to confirm that invalid documents are * reject iff jelly.setValidateXML(true) - * + * * @author Morgan Delagrange * @version $Revision$ */ @@ -45,7 +45,7 @@ } public static TestSuite suite() throws Exception { - return new TestSuite(TestXMLParserCache.class); + return new TestSuite(TestXMLParserCache.class); } public void setUp(String scriptName) throws Exception { @@ -53,20 +53,20 @@ xmlOutput = XMLOutput.createXMLOutput(new StringWriter()); jelly = new Jelly(); - + String script = scriptName; URL url = this.getClass().getResource(script); if ( url == null ) { - throw new Exception( - "Could not find Jelly script: " + script - + " in package of class: " + this.getClass().getName() + throw new Exception( + "Could not find Jelly script: " + script + + " in package of class: " + this.getClass().getName() ); } jelly.setUrl(url); } public void testParserCache1() throws Exception { - // without validation, should + // without validation, should // not fail because validation is disabled setUp("invalidScript1.jelly"); jelly.setValidateXML(false); @@ -93,7 +93,7 @@ assertTrue("should have no var when default namspace is not set", context.getVariable("usedDefaultNamespace") == null); - // now we have a default namespace, so we + // now we have a default namespace, so we // should see a variable, despite the XMLParser cache jelly.setDefaultNamespaceURI("jelly:core"); script = jelly.compileScript(); 1.6 +9 -9 jakarta-commons/jelly/src/test/org/apache/commons/jelly/test/xml/TestCData.java Index: TestCData.java =================================================================== RCS file: /home/cvs/jakarta-commons/jelly/src/test/org/apache/commons/jelly/test/xml/TestCData.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- TestCData.java 1 Sep 2004 05:33:01 -0000 1.5 +++ TestCData.java 9 Sep 2004 12:31:56 -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. @@ -39,7 +39,7 @@ /** * CDATA sections should be retained in the output. - * + * * @throws Exception */ public void testCData() throws Exception { @@ -48,18 +48,18 @@ Script script = jelly.compileScript(); JellyContext context = new JellyContext(); script.run(context, XMLOutput.createDummyXMLOutput()); - + String output = (String) context.getVariable("foo"); assertTrue("'foo' is not null", output != null); - + String golden = "\n"; golden += "\n"; golden += "]>"; - + assertEquals("output should contain the CDATA section", golden, output); } - + public void testDom4JCData() throws SAXException { StringWriter writer = new StringWriter(); OutputFormat format = new OutputFormat(); @@ -78,7 +78,7 @@ output.endDocument(); System.err.println("output was: '" + writer.toString() +"'"); System.err.println("golden is : '" + golden +"'"); - assertEquals("output should contain the CDATA section", + assertEquals("output should contain the CDATA section", decl + golden, writer.toString()); } 1.3 +3 -3 jakarta-commons/jelly/src/test/org/apache/commons/jelly/core/extension/CoreExtensionTagLibrary.java Index: CoreExtensionTagLibrary.java =================================================================== RCS file: /home/cvs/jakarta-commons/jelly/src/test/org/apache/commons/jelly/core/extension/CoreExtensionTagLibrary.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- CoreExtensionTagLibrary.java 31 Aug 2004 04:26:51 -0000 1.2 +++ CoreExtensionTagLibrary.java 9 Sep 2004 12:31:57 -0000 1.3 @@ -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. 1.2 +3 -3 jakarta-commons/jelly/src/test/org/apache/commons/jelly/core/extension/UseBeanExtendedTag.java Index: UseBeanExtendedTag.java =================================================================== RCS file: /home/cvs/jakarta-commons/jelly/src/test/org/apache/commons/jelly/core/extension/UseBeanExtendedTag.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- UseBeanExtendedTag.java 30 Aug 2004 01:04:12 -0000 1.1 +++ UseBeanExtendedTag.java 9 Sep 2004 12:31:57 -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. 1.2 +3 -3 jakarta-commons/jelly/src/test/org/apache/commons/jelly/core/extension/UseBeanIgnoreBadProps.java Index: UseBeanIgnoreBadProps.java =================================================================== RCS file: /home/cvs/jakarta-commons/jelly/src/test/org/apache/commons/jelly/core/extension/UseBeanIgnoreBadProps.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- UseBeanIgnoreBadProps.java 31 Aug 2004 04:26:51 -0000 1.1 +++ UseBeanIgnoreBadProps.java 9 Sep 2004 12:31:57 -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. 1.16 +16 -16 jakarta-commons/jelly/src/test/org/apache/commons/jelly/expression/TestExpressions.java Index: TestExpressions.java =================================================================== RCS file: /home/cvs/jakarta-commons/jelly/src/test/org/apache/commons/jelly/expression/TestExpressions.java,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- TestExpressions.java 7 Sep 2004 04:11:05 -0000 1.15 +++ TestExpressions.java 9 Sep 2004 12:31:57 -0000 1.16 @@ -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,7 +23,7 @@ import org.apache.commons.jelly.JellyContext; import org.apache.commons.jelly.expression.jexl.JexlExpressionFactory; -/** +/** * Tests the use of Expression parsing * * @author James Strachan @@ -49,7 +49,7 @@ public void testExpresssions() throws Exception { context.setVariable("topping", "cheese"); context.setVariable("type", "deepPan"); - + assertExpression("foo", "foo"); assertExpression("${topping}", "cheese"); @@ -59,7 +59,7 @@ assertExpression("A ${topping} ${type} pizza", "A cheese deepPan pizza"); assertExpression("${topping}-${type}", "cheese-deepPan"); } - + public void testAntExpresssions() throws Exception { context.setVariable("maven.home.foo", "cheese"); @@ -69,45 +69,45 @@ assertExpression("ham and ${maven.home.foo} pizza", "ham and cheese pizza"); assertExpression("${maven.home.foo.length()}", new Integer(6)); } - + public void testNotConditions() throws Exception { context.setVariable("a", Boolean.TRUE); context.setVariable("b", Boolean.FALSE); context.setVariable("c", "true"); context.setVariable("d", "false"); - + assertExpression("${a}", Boolean.TRUE); assertExpression("${!a}", Boolean.FALSE); assertExpression("${b}", Boolean.FALSE); assertExpression("${!b}", Boolean.TRUE); - + assertExpression("${c}", "true"); assertExpression("${!c}", Boolean.FALSE); assertExpression("${d}", "false"); assertExpression("${!d}", Boolean.TRUE); } - + public void testNotConditionsWithDot() throws Exception { context.setVariable("x.a", Boolean.TRUE); context.setVariable("x.b", Boolean.FALSE); context.setVariable("x.c", "true"); context.setVariable("x.d", "false"); - + assertExpression("${x.a}", Boolean.TRUE); assertExpression("${!x.a}", Boolean.FALSE); assertExpression("${x.b}", Boolean.FALSE); assertExpression("${!x.b}", Boolean.TRUE); - + assertExpression("${x.c}", "true"); assertExpression("${!x.c}", Boolean.FALSE); assertExpression("${x.d}", "false"); assertExpression("${!x.d}", Boolean.TRUE); } - + public void testNull() throws Exception { context.setVariable("something.blank", ""); context.setVariable("something.ok", "cheese"); - + assertExpression("${something.blank.length() == 0}", Boolean.TRUE); assertExpression("${something.blank == ''}", Boolean.TRUE); assertExpression("${something.ok != null}", Boolean.TRUE); @@ -116,13 +116,13 @@ //assertExpression("${something.null != ''}", Boolean.FALSE); assertExpression("${unknown == null}", Boolean.TRUE); } - + protected void assertExpression(String expressionText, Object expectedValue) throws Exception { Expression expression = CompositeExpression.parse(expressionText, factory); assertTrue( "Created a valid expression for: " + expressionText, expression != null ); Object value = expression.evaluate(context); assertEquals( "Wrong result for expression: " + expressionText, expectedValue, value ); - + String text = expression.getExpressionText(); assertEquals( "Wrong textual representation for expression text: ", expressionText, text); } 1.6 +5 -5 jakarta-commons/jelly/src/test/org/apache/commons/jelly/test/impl/DummyTag.java Index: DummyTag.java =================================================================== RCS file: /home/cvs/jakarta-commons/jelly/src/test/org/apache/commons/jelly/test/impl/DummyTag.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- DummyTag.java 24 Feb 2004 14:21:27 -0000 1.5 +++ DummyTag.java 9 Sep 2004 12:31:57 -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. @@ -23,7 +23,7 @@ /** * Simple Test Tag - * + * * @author Vinay Chandran */ public class DummyTag extends TagSupport { @@ -33,7 +33,7 @@ private String m_classToBeLoaded = null; /** - * + * * @see org.apache.commons.jelly.Tag#doTag(XMLOutput) * @see org.apache.commons.jelly.tags.core.JellyTag */ 1.5 +5 -5 jakarta-commons/jelly/src/test/org/apache/commons/jelly/test/impl/TestEmbedded.java Index: TestEmbedded.java =================================================================== RCS file: /home/cvs/jakarta-commons/jelly/src/test/org/apache/commons/jelly/test/impl/TestEmbedded.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- TestEmbedded.java 24 Feb 2004 14:21:27 -0000 1.4 +++ TestEmbedded.java 9 Sep 2004 12:31:57 -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. @@ -26,8 +26,8 @@ import junit.textui.TestRunner; /** - * Unit case of Embedded - * + * Unit case of Embedded + * * @author Vinay Chandran */ public class TestEmbedded extends TestCase 1.6 +4 -4 jakarta-commons/jelly/src/test/org/apache/commons/jelly/test/impl/DummyTagLibrary.java Index: DummyTagLibrary.java =================================================================== RCS file: /home/cvs/jakarta-commons/jelly/src/test/org/apache/commons/jelly/test/impl/DummyTagLibrary.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- DummyTagLibrary.java 24 Feb 2004 14:21:27 -0000 1.5 +++ DummyTagLibrary.java 9 Sep 2004 12:31:57 -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. @@ -19,7 +19,7 @@ /** * Test taglibrary - * + * * @author Vinay Chandran */ public class DummyTagLibrary extends TagLibrary { 1.8 +8 -8 jakarta-commons/jelly/src/test/org/apache/commons/jelly/impl/TestTagLibraryResolver.java Index: TestTagLibraryResolver.java =================================================================== RCS file: /home/cvs/jakarta-commons/jelly/src/test/org/apache/commons/jelly/impl/TestTagLibraryResolver.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- TestTagLibraryResolver.java 24 Feb 2004 14:20:29 -0000 1.7 +++ TestTagLibraryResolver.java 9 Sep 2004 12:31:57 -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. @@ -40,15 +40,15 @@ } public void testResolver() throws Exception { - /** - * @todo temporary disbled test case until I can figure out how to get + /** + * @todo temporary disbled test case until I can figure out how to get * it to work with commons-discovery */ -/* +/* TagLibrary library = resolver.resolveTagLibrary("jelly:test-library" ); - + assertTrue( "Found a tag library", library != null ); assertEquals( "Tag library is of the correct type", "org.apache.commons.jelly.test.impl.DummyTagLibrary", library.getClass().getName() ); -*/ +*/ } } --------------------------------------------------------------------- To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-dev-help@jakarta.apache.org