You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by di...@apache.org on 2004/09/09 14:29:36 UTC
cvs commit: jakarta-commons/jelly/src/test/org/apache/commons/jelly TestJellyContext.java TestCoreTags.java TestTrim.java TestJelly.java
dion 2004/09/09 05:29:36
Modified: jelly/src/test/org/apache/commons/jelly/core
TestFileTag.java Product.java TestUseBeanTag.java
TestIncludeTag.java TestSwitchTag.java
TestChooseTag.java Customer.java TestBreakTag.java
Order.java TestNewTag.java TestGetStaticTag.java
TestArgTag.java BaseJellyTest.java
jelly/src/java/org/apache/commons/jelly/util
NestedRuntimeException.java CommandLineParser.java
SafeContentHandler.java
jelly/src/java/org/apache/commons/jelly/xpath
XPathTagSupport.java XPathSource.java
XPathComparator.java
jelly/src/test/org/apache/commons/jelly
TestJellyContext.java TestCoreTags.java
TestTrim.java TestJelly.java
Log:
Fix license file whitespace
Revision Changes Path
1.6 +6 -6 jakarta-commons/jelly/src/test/org/apache/commons/jelly/core/TestFileTag.java
Index: TestFileTag.java
===================================================================
RCS file: /home/cvs/jakarta-commons/jelly/src/test/org/apache/commons/jelly/core/TestFileTag.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- TestFileTag.java 2 Sep 2004 06:11:28 -0000 1.5
+++ TestFileTag.java 9 Sep 2004 12:29:35 -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.
@@ -53,8 +53,8 @@
String data = (String)getJellyContext().getVariable("testFileTag");
//FIXME This doesn't take into account attribute ordering
- assertEquals("fully qualified attributes not passed",
- "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\"></html>",
+ assertEquals("fully qualified attributes not passed",
+ "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\"></html>",
data);
}
1.5 +7 -7 jakarta-commons/jelly/src/test/org/apache/commons/jelly/core/Product.java
Index: Product.java
===================================================================
RCS file: /home/cvs/jakarta-commons/jelly/src/test/org/apache/commons/jelly/core/Product.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- Product.java 24 Feb 2004 14:19:58 -0000 1.4
+++ Product.java 9 Sep 2004 12:29:35 -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.
@@ -15,7 +15,7 @@
*/
package org.apache.commons.jelly.core;
-/**
+/**
* A sample bean that we can construct via Jelly tags
*
* @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
@@ -25,10 +25,10 @@
private String id;
private String name;
-
+
public Product() {
}
-
+
public String toString() {
return "Product[id=" + id + ";name=" + name + "]";
}
1.5 +8 -8 jakarta-commons/jelly/src/test/org/apache/commons/jelly/core/TestUseBeanTag.java
Index: TestUseBeanTag.java
===================================================================
RCS file: /home/cvs/jakarta-commons/jelly/src/test/org/apache/commons/jelly/core/TestUseBeanTag.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- TestUseBeanTag.java 31 Aug 2004 04:26:51 -0000 1.4
+++ TestUseBeanTag.java 9 Sep 2004 12:29:35 -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.
@@ -29,9 +29,9 @@
}
public static TestSuite suite() throws Exception {
- return new TestSuite(TestUseBeanTag.class);
+ return new TestSuite(TestUseBeanTag.class);
}
-
+
/**
* Test a simple useBean tag works ok
* @throws Exception
@@ -47,7 +47,7 @@
assertEquals("name not set", "testing", customer.getName());
assertEquals("city not set", "sydney", customer.getCity());
}
-
+
/**
* test extension
*/
@@ -62,7 +62,7 @@
assertNull("name set wrongly", customer.getName());
assertEquals("city not set", "sydney", customer.getCity());
}
-
+
/** Test set a bad property name on a bean, should fail.
* @throws Exception
*/
@@ -74,7 +74,7 @@
Exception e = (Exception)getJellyContext().getVariable("ex");
assertNotNull("Should have failed to set invalid bean property", e);
}
-
+
/** Test set a bad property name on a bean, this should be silently ignored.
* @throws Exception
*/
1.4 +16 -16 jakarta-commons/jelly/src/test/org/apache/commons/jelly/core/TestIncludeTag.java
Index: TestIncludeTag.java
===================================================================
RCS file: /home/cvs/jakarta-commons/jelly/src/test/org/apache/commons/jelly/core/TestIncludeTag.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- TestIncludeTag.java 24 Feb 2004 14:19:58 -0000 1.3
+++ TestIncludeTag.java 9 Sep 2004 12:29:35 -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.
@@ -28,7 +28,7 @@
/**
* Makes sure that nested includes work correctly
- *
+ *
* @author Morgan Delagrange
* @version $Revision$
*/
@@ -43,26 +43,26 @@
}
public static TestSuite suite() throws Exception {
- return new TestSuite(TestIncludeTag.class);
+ return new TestSuite(TestIncludeTag.class);
}
-
+
public void setUp(String scriptName) throws Exception {
URL url = this.getClass().getResource(scriptName);
if ( url == null ) {
- throw new Exception(
- "Could not find Jelly script: " + scriptName
- + " in package of class: " + this.getClass().getName()
+ throw new Exception(
+ "Could not find Jelly script: " + scriptName
+ + " in package of class: " + this.getClass().getName()
);
}
setUpFromURL(url);
}
-
+
public void setUpFromURL(URL url) throws Exception {
context = new CoreTaglibOnlyContext();
xmlOutput = XMLOutput.createDummyXMLOutput();
jelly = new Jelly();
-
+
jelly.setUrl(url);
String exturl = url.toExternalForm();
@@ -71,7 +71,7 @@
URL baseurl = new URL(extBase);
context.setCurrentURL(baseurl);
}
-
+
public void testInnermost() throws Exception {
// performs no includes
setUp("c.jelly");
@@ -104,7 +104,7 @@
assertTrue("should have set 'a' variable to 'true'",
context.getVariable("a").equals("true"));
}
-
+
/**
* Insure that includes happen correctly when Jelly scripts
* are referenced as a file (rather than as a classpath
@@ -132,15 +132,15 @@
* are not inadvertantly called. Specifically addresses a bug
* in older Jelly dev versions where a nested include
* would trigger instantiation of all tag libraries.
- *
+ *
* @param namespaceURI
- * @return
+ * @return
*/
public TagLibrary getTagLibrary(String namespaceURI) {
if (namespaceURI.equals("jelly:core")) {
return super.getTagLibrary(namespaceURI);
} else {
- throw new NoClassDefFoundError("Unexpected tag library uri: " +
+ throw new NoClassDefFoundError("Unexpected tag library uri: " +
namespaceURI);
}
}
1.8 +12 -12 jakarta-commons/jelly/src/test/org/apache/commons/jelly/core/TestSwitchTag.java
Index: TestSwitchTag.java
===================================================================
RCS file: /home/cvs/jakarta-commons/jelly/src/test/org/apache/commons/jelly/core/TestSwitchTag.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- TestSwitchTag.java 24 Feb 2004 14:19:58 -0000 1.7
+++ TestSwitchTag.java 9 Sep 2004 12:29:35 -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,17 +32,17 @@
}
public static TestSuite suite() throws Exception {
- return new TestSuite(TestSwitchTag.class);
+ return new TestSuite(TestSwitchTag.class);
}
public void setUp() throws Exception {
super.setUp();
- }
-
+ }
+
public void tearDown() throws Exception {
super.tearDown();
- }
-
+ }
+
public void testSimpleSwitch() throws Exception {
setUpScript("testSwitchTag.jelly");
Script script = getJelly().compileScript();
@@ -146,7 +146,7 @@
// expected
}
}
-
+
public void testCaseWithoutValue() throws Exception {
setUpScript("testSwitchTag.jelly");
Script script = getJelly().compileScript();
@@ -158,7 +158,7 @@
// expected
}
}
-
+
public void testMultipleDefaults() throws Exception {
setUpScript("testSwitchTag.jelly");
Script script = getJelly().compileScript();
@@ -170,7 +170,7 @@
// expected
}
}
-
+
public void testCaseAfterDefault() throws Exception {
setUpScript("testSwitchTag.jelly");
Script script = getJelly().compileScript();
1.4 +7 -7 jakarta-commons/jelly/src/test/org/apache/commons/jelly/core/TestChooseTag.java
Index: TestChooseTag.java
===================================================================
RCS file: /home/cvs/jakarta-commons/jelly/src/test/org/apache/commons/jelly/core/TestChooseTag.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- TestChooseTag.java 24 Feb 2004 14:19:58 -0000 1.3
+++ TestChooseTag.java 9 Sep 2004 12:29:35 -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.
@@ -45,11 +45,11 @@
String resultTrue = (String) getJellyContext().getVariable("result.true");
String resultFalse = (String) getJellyContext().getVariable("result.false");
-
+
assertEquals("result.true", "AC", resultTrue);
assertEquals("result.false", "BC", resultFalse);
}
-
-
+
+
}
1.5 +17 -17 jakarta-commons/jelly/src/test/org/apache/commons/jelly/core/Customer.java
Index: Customer.java
===================================================================
RCS file: /home/cvs/jakarta-commons/jelly/src/test/org/apache/commons/jelly/core/Customer.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- Customer.java 24 Feb 2004 14:19:58 -0000 1.4
+++ Customer.java 9 Sep 2004 12:29:35 -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 java.util.Iterator;
import java.util.List;
-/**
+/**
* A sample bean that we can construct via Jelly tags
*
* @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
@@ -31,26 +31,26 @@
private String city;
private String location;
private List orders = new ArrayList();
-
-
+
+
public Customer() {
}
-
+
public Customer(String name) {
setName(name);
}
-
+
public Customer(String name, String city) {
setName(name);
setCity(city);
}
-
+
public Customer(String name, String city, Order anOrder) {
setName(name);
setCity(city);
addOrder(anOrder);
}
-
+
public Customer(Customer cust) {
setName(cust.getName());
setCity(cust.getCity());
@@ -62,29 +62,29 @@
}
}
}
-
+
public String toString() {
return super.toString() + "[name=" + name + ";city=" + city + "]";
}
/**
- * Creates a new Order object
+ * Creates a new Order object
*/
public Order createOrder() {
return new Order();
- }
+ }
public List getOrders() {
return orders;
}
-
+
public void addOrder(Order order) {
orders.add(order);
}
-
+
public void removeOrder(Order order) {
orders.remove(order);
- }
+ }
/**
* Returns the city.
1.2 +10 -10 jakarta-commons/jelly/src/test/org/apache/commons/jelly/core/TestBreakTag.java
Index: TestBreakTag.java
===================================================================
RCS file: /home/cvs/jakarta-commons/jelly/src/test/org/apache/commons/jelly/core/TestBreakTag.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- TestBreakTag.java 12 Aug 2004 04:58:04 -0000 1.1
+++ TestBreakTag.java 9 Sep 2004 12:29:35 -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.
@@ -40,10 +40,10 @@
script.run(getJellyContext(), getXMLOutput());
String simpleResult = (String) getJellyContext().getVariable("simpleResult");
-
+
assertEquals("simpleResult", "12345", simpleResult);
}
-
+
public void testConditionalBreakTag() throws Exception
{
setUpScript("testBreakTag.jelly");
@@ -52,7 +52,7 @@
script.run(getJellyContext(), getXMLOutput());
String simpleResult = (String) getJellyContext().getVariable("conditionalResult");
-
+
assertEquals("conditionalResult", "12345", simpleResult);
}
@@ -64,10 +64,10 @@
script.run(getJellyContext(), getXMLOutput());
String varBroken = (String) getJellyContext().getVariable("varBroken");
-
+
assertEquals("varBroken", "true", varBroken);
}
-
+
public void testVarNoBreakTag() throws Exception
{
setUpScript("testBreakTag.jelly");
@@ -76,9 +76,9 @@
script.run(getJellyContext(), getXMLOutput());
String varNotBroken = (String) getJellyContext().getVariable("varNotBroken");
-
+
assertEquals("varNotBroken", "false", varNotBroken);
}
-
+
}
1.5 +10 -10 jakarta-commons/jelly/src/test/org/apache/commons/jelly/core/Order.java
Index: Order.java
===================================================================
RCS file: /home/cvs/jakarta-commons/jelly/src/test/org/apache/commons/jelly/core/Order.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- Order.java 24 Feb 2004 14:19:58 -0000 1.4
+++ Order.java 9 Sep 2004 12:29:35 -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.
@@ -15,7 +15,7 @@
*/
package org.apache.commons.jelly.core;
-/**
+/**
* A sample bean that we can construct via Jelly tags
*
* @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
@@ -26,21 +26,21 @@
private Product product;
private int amount;
private double price;
-
+
public Order() {
}
-
+
public String toString() {
return "Order[amount=" + amount + ";price=" + price + ";product=" + product + "]";
}
-
- /**
+
+ /**
* Factory method to create a new Product
*/
public Product createProduct() {
return new Product();
}
-
+
/**
* Returns the amount.
* @return int
1.7 +5 -5 jakarta-commons/jelly/src/test/org/apache/commons/jelly/core/TestNewTag.java
Index: TestNewTag.java
===================================================================
RCS file: /home/cvs/jakarta-commons/jelly/src/test/org/apache/commons/jelly/core/TestNewTag.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- TestNewTag.java 30 Aug 2004 00:10:29 -0000 1.6
+++ TestNewTag.java 9 Sep 2004 12:29:35 -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.
@@ -33,7 +33,7 @@
}
public static TestSuite suite() throws Exception {
- return new TestSuite(TestNewTag.class);
+ return new TestSuite(TestNewTag.class);
}
public void testSimpleNew() throws Exception {
1.2 +10 -10 jakarta-commons/jelly/src/test/org/apache/commons/jelly/core/TestGetStaticTag.java
Index: TestGetStaticTag.java
===================================================================
RCS file: /home/cvs/jakarta-commons/jelly/src/test/org/apache/commons/jelly/core/TestGetStaticTag.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- TestGetStaticTag.java 5 Jun 2004 03:23:37 -0000 1.1
+++ TestGetStaticTag.java 9 Sep 2004 12:29:35 -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.
@@ -32,7 +32,7 @@
public static TestSuite suite() throws Exception {
- return new TestSuite(TestGetStaticTag.class);
+ return new TestSuite(TestGetStaticTag.class);
}
@@ -46,12 +46,12 @@
setUpScript( "testGetStaticTag.jelly" );
Script script = getJelly().compileScript();
-
+
getJellyContext().setVariable( "test.Integer.MAX_VALUE",
Boolean.TRUE );
-
+
script.run( getJellyContext(), getXMLOutput() );
-
+
assertEquals( new Integer(java.lang.Integer.MAX_VALUE),
getJellyContext().getVariable("value" ) );
}
@@ -67,9 +67,9 @@
setUpScript( "testGetStaticTag.jelly" );
Script script = getJelly().compileScript();
-
+
getJellyContext().setVariable( "test.InvalidGet", Boolean.TRUE );
-
+
try {
script.run( getJellyContext(), getXMLOutput() );
} catch(JellyTagException jte) {
1.8 +21 -21 jakarta-commons/jelly/src/test/org/apache/commons/jelly/core/TestArgTag.java
Index: TestArgTag.java
===================================================================
RCS file: /home/cvs/jakarta-commons/jelly/src/test/org/apache/commons/jelly/core/TestArgTag.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- TestArgTag.java 24 Feb 2004 14:19:58 -0000 1.7
+++ TestArgTag.java 9 Sep 2004 12:29:35 -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,7 +40,7 @@
}
public static TestSuite suite() throws Exception {
- return new TestSuite(TestArgTag.class);
+ return new TestSuite(TestArgTag.class);
}
public void setUp() throws Exception {
@@ -50,14 +50,14 @@
argTag.setContext(getJellyContext());
argTag.setParent(parentTag);
argTag.setBody(new MockScript());
- }
-
+ }
+
public void tearDown() throws Exception {
super.tearDown();
parentTag = null;
argTag = null;
- }
-
+ }
+
public void testToBooleanFromString() throws Exception {
argTag.setType("boolean");
argTag.setValue("true");
@@ -65,7 +65,7 @@
assertEquals(Boolean.TYPE,parentTag.getType(0));
assertEquals(Boolean.TRUE,parentTag.getValue(0));
}
-
+
public void testToCharFromString() throws Exception {
argTag.setType("char");
argTag.setValue("X");
@@ -121,7 +121,7 @@
assertEquals(Integer.TYPE,parentTag.getType(0));
assertEquals(new Integer((int)17),parentTag.getValue(0));
}
-
+
public void testToFloatFromString() throws Exception {
argTag.setType("float");
argTag.setValue("17.3");
@@ -137,7 +137,7 @@
assertEquals(Float.TYPE,parentTag.getType(0));
assertEquals(new Float((float)17.3),parentTag.getValue(0));
}
-
+
public void testToLongFromString() throws Exception {
argTag.setType("long");
argTag.setValue("17");
@@ -153,7 +153,7 @@
assertEquals(Long.TYPE,parentTag.getType(0));
assertEquals(new Long((long)17),parentTag.getValue(0));
}
-
+
public void testToDoubleFromString() throws Exception {
argTag.setType("double");
argTag.setValue("17.3");
@@ -196,9 +196,9 @@
}
private MockArgTagParent parentTag = null;
- private ArgTag argTag = null;
-
- class MockArgTagParent extends TagSupport implements ArgTagParent {
+ private ArgTag argTag = null;
+
+ class MockArgTagParent extends TagSupport implements ArgTagParent {
public void addArgument(Class type, Object value) {
typeList.add(type);
valueList.add(value);
@@ -206,19 +206,19 @@
public void doTag(XMLOutput output) {
}
-
+
private Class getType(int i) {
return (Class)(typeList.get(i));
}
-
+
private Object getValue(int i) {
return valueList.get(i);
}
-
+
private List typeList = new ArrayList();
private List valueList = new ArrayList();
}
-
+
class MockScript implements Script {
public Script compile() throws JellyException {
return this;
@@ -227,5 +227,5 @@
public void run(JellyContext context, XMLOutput output) throws JellyTagException {
}
}
-
+
}
1.4 +13 -13 jakarta-commons/jelly/src/test/org/apache/commons/jelly/core/BaseJellyTest.java
Index: BaseJellyTest.java
===================================================================
RCS file: /home/cvs/jakarta-commons/jelly/src/test/org/apache/commons/jelly/core/BaseJellyTest.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- BaseJellyTest.java 24 Feb 2004 14:19:58 -0000 1.3
+++ BaseJellyTest.java 9 Sep 2004 12:29:35 -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.
@@ -37,15 +37,15 @@
super.setUp();
jelly = new Jelly();
context = new JellyContext();
- xmlOutput = XMLOutput.createDummyXMLOutput();
- }
-
+ xmlOutput = XMLOutput.createDummyXMLOutput();
+ }
+
protected void setUpScript(String scriptname) throws Exception {
URL url = this.getClass().getResource(scriptname);
if(null == url) {
- throw new Exception(
- "Could not find Jelly script: " + scriptname
- + " in package of class: " + getClass().getName()
+ throw new Exception(
+ "Could not find Jelly script: " + scriptname
+ + " in package of class: " + getClass().getName()
);
}
jelly.setUrl(url);
@@ -60,15 +60,15 @@
protected Jelly getJelly() {
return jelly;
}
-
+
protected JellyContext getJellyContext() {
return context;
}
-
+
protected XMLOutput getXMLOutput() {
return xmlOutput;
}
-
+
private Jelly jelly = null;
private JellyContext context = null;
private XMLOutput xmlOutput = null;
1.5 +4 -4 jakarta-commons/jelly/src/java/org/apache/commons/jelly/util/NestedRuntimeException.java
Index: NestedRuntimeException.java
===================================================================
RCS file: /home/cvs/jakarta-commons/jelly/src/java/org/apache/commons/jelly/util/NestedRuntimeException.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- NestedRuntimeException.java 8 Sep 2004 04:30:38 -0000 1.4
+++ NestedRuntimeException.java 9 Sep 2004 12:29:35 -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 java.io.PrintStream;
import java.io.PrintWriter;
-/**
+/**
* A {@link RuntimeException} which is nested to preserve stack traces.
*
* This class allows the following code to be written to convert a regular
1.6 +8 -8 jakarta-commons/jelly/src/java/org/apache/commons/jelly/util/CommandLineParser.java
Index: CommandLineParser.java
===================================================================
RCS file: /home/cvs/jakarta-commons/jelly/src/java/org/apache/commons/jelly/util/CommandLineParser.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- CommandLineParser.java 24 Feb 2004 14:12:34 -0000 1.5
+++ CommandLineParser.java 9 Sep 2004 12:29:35 -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.
@@ -40,13 +40,13 @@
* Using a separate class allows us to run Jelly without
* CLI in the classpath when the command line interface
* is not in use.
- *
+ *
* @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
* @author Morgan Delagrange
* @version $Revision$
*/
public class CommandLineParser {
-
+
protected static CommandLineParser _instance = new CommandLineParser();
public static CommandLineParser getInstance() {
@@ -56,7 +56,7 @@
/**
* Parse out the command line options and configure
* the give Jelly instance.
- *
+ *
* @param args options from the command line
* @exception JellyException
* if the command line could not be parsed
@@ -101,7 +101,7 @@
JellyContext context = jelly.getJellyContext();
context.setVariable("args", args);
context.setVariable("commandLine", cmdLine);
- script.run(context, output);
+ script.run(context, output);
// now lets wait for all threads to close
Runtime.getRuntime().addShutdownHook(new Thread() {
1.4 +6 -6 jakarta-commons/jelly/src/java/org/apache/commons/jelly/util/SafeContentHandler.java
Index: SafeContentHandler.java
===================================================================
RCS file: /home/cvs/jakarta-commons/jelly/src/java/org/apache/commons/jelly/util/SafeContentHandler.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- SafeContentHandler.java 24 Feb 2004 14:12:34 -0000 1.3
+++ SafeContentHandler.java 9 Sep 2004 12:29:35 -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.
@@ -20,7 +20,7 @@
import org.xml.sax.Locator;
import org.xml.sax.SAXException;
-/**
+/**
* Ensures that only one start and end document event is passed onto the underlying
* ContentHandler. This object can only be used once and then discarded.
*
@@ -28,9 +28,9 @@
*/
public class SafeContentHandler implements ContentHandler {
private ContentHandler handler;
- private boolean documentStarted;
+ private boolean documentStarted;
private boolean documentEnded;
-
+
public SafeContentHandler(ContentHandler handler) {
this.handler = handler;
}
1.4 +7 -7 jakarta-commons/jelly/src/java/org/apache/commons/jelly/xpath/XPathTagSupport.java
Index: XPathTagSupport.java
===================================================================
RCS file: /home/cvs/jakarta-commons/jelly/src/java/org/apache/commons/jelly/xpath/XPathTagSupport.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- XPathTagSupport.java 24 Feb 2004 14:13:31 -0000 1.3
+++ XPathTagSupport.java 9 Sep 2004 12:29:36 -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.
@@ -25,12 +25,12 @@
public abstract class XPathTagSupport extends TagSupport {
// Implementation methods
- //-------------------------------------------------------------------------
+ //-------------------------------------------------------------------------
protected Object getXPathContext() {
- XPathSource tag = (XPathSource) findAncestorWithClass( XPathSource.class );
+ XPathSource tag = (XPathSource) findAncestorWithClass( XPathSource.class );
if ( tag != null ) {
return tag.getXPathSource();
}
return null;
- }
+ }
}
1.4 +6 -6 jakarta-commons/jelly/src/java/org/apache/commons/jelly/xpath/XPathSource.java
Index: XPathSource.java
===================================================================
RCS file: /home/cvs/jakarta-commons/jelly/src/java/org/apache/commons/jelly/xpath/XPathSource.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- XPathSource.java 24 Feb 2004 14:13:31 -0000 1.3
+++ XPathSource.java 9 Sep 2004 12:29:36 -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.
@@ -16,7 +16,7 @@
package org.apache.commons.jelly.xpath;
-/**
+/**
* A tag which is capable of producing a source of XPath context objects
* such as <x:forEach>
*
@@ -26,5 +26,5 @@
public interface XPathSource {
public Object getXPathSource();
-
+
}
1.4 +4 -4 jakarta-commons/jelly/src/java/org/apache/commons/jelly/xpath/XPathComparator.java
Index: XPathComparator.java
===================================================================
RCS file: /home/cvs/jakarta-commons/jelly/src/java/org/apache/commons/jelly/xpath/XPathComparator.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- XPathComparator.java 24 Feb 2004 14:13:31 -0000 1.3
+++ XPathComparator.java 9 Sep 2004 12:29:36 -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.
1.5 +3 -3 jakarta-commons/jelly/src/test/org/apache/commons/jelly/TestJellyContext.java
Index: TestJellyContext.java
===================================================================
RCS file: /home/cvs/jakarta-commons/jelly/src/test/org/apache/commons/jelly/TestJellyContext.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- TestJellyContext.java 24 Feb 2004 14:21:28 -0000 1.4
+++ TestJellyContext.java 9 Sep 2004 12:29:36 -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.
1.15 +6 -6 jakarta-commons/jelly/src/test/org/apache/commons/jelly/TestCoreTags.java
Index: TestCoreTags.java
===================================================================
RCS file: /home/cvs/jakarta-commons/jelly/src/test/org/apache/commons/jelly/TestCoreTags.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- TestCoreTags.java 24 Feb 2004 14:21:28 -0000 1.14
+++ TestCoreTags.java 9 Sep 2004 12:29:36 -0000 1.15
@@ -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.
@@ -70,7 +70,7 @@
}
assertEquals("Produces the correct output", "one two three", text);
}
-
+
public void testTrimEndWhitespace() throws Exception {
TextScript textScript = new TextScript(" ");
textScript.trimEndWhitespace();
@@ -88,7 +88,7 @@
textScript.trimEndWhitespace();
assertEquals("foo", textScript.getText());
}
-
+
public void testTrimStartWhitespace() throws Exception {
TextScript textScript = new TextScript(" ");
textScript.trimStartWhitespace();
1.5 +18 -18 jakarta-commons/jelly/src/test/org/apache/commons/jelly/TestTrim.java
Index: TestTrim.java
===================================================================
RCS file: /home/cvs/jakarta-commons/jelly/src/test/org/apache/commons/jelly/TestTrim.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- TestTrim.java 24 Feb 2004 14:21:28 -0000 1.4
+++ TestTrim.java 9 Sep 2004 12:29:36 -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.impl.TextScript;
-/**
+/**
* Tests the whitespace triming of scripts.
*
* @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
@@ -45,51 +45,51 @@
public void testTrim() throws Exception {
TextScript script = new TextScript( " foo " );
script.trimWhitespace();
-
+
assertEquals( "foo", script.getText() );
script = new TextScript( " foo " );
script.trimWhitespace();
-
+
assertEquals( "foo", script.getText() );
-
+
script = new TextScript( "foo" );
script.trimWhitespace();
-
+
assertEquals( "foo", script.getText() );
}
-
+
public void testTrimStart() throws Exception {
TextScript script = new TextScript( " foo " );
script.trimStartWhitespace();
-
+
assertEquals( "foo ", script.getText() );
script = new TextScript( " foo " );
script.trimStartWhitespace();
-
+
assertEquals( "foo ", script.getText() );
-
+
script = new TextScript( "foo" );
script.trimStartWhitespace();
-
+
assertEquals( "foo", script.getText() );
}
-
+
public void testTrimEnd() throws Exception {
TextScript script = new TextScript( " foo " );
script.trimEndWhitespace();
-
+
assertEquals( " foo", script.getText() );
script = new TextScript( " foo " );
script.trimEndWhitespace();
-
+
assertEquals( " foo", script.getText() );
-
+
script = new TextScript( "foo" );
script.trimEndWhitespace();
-
+
assertEquals( "foo", script.getText() );
}
}
1.5 +6 -6 jakarta-commons/jelly/src/test/org/apache/commons/jelly/TestJelly.java
Index: TestJelly.java
===================================================================
RCS file: /home/cvs/jakarta-commons/jelly/src/test/org/apache/commons/jelly/TestJelly.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- TestJelly.java 24 Feb 2004 14:21:28 -0000 1.4
+++ TestJelly.java 9 Sep 2004 12:29:36 -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.
@@ -20,7 +20,7 @@
import org.apache.commons.jelly.tags.junit.JellyTestSuite;
-/**
+/**
* A helper class to run jelly test cases as part of Ant's JUnit tests
*
* @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
@@ -31,8 +31,8 @@
public static void main( String[] args ) throws Exception {
TestRunner.run( suite() );
}
-
+
public static TestSuite suite() throws Exception {
- return createTestSuite(TestJelly.class, "suite.jelly");
+ return createTestSuite(TestJelly.class, "suite.jelly");
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org