Author: simonetripodi
Date: Thu Feb 3 16:27:43 2011
New Revision: 1066857
URL: http://svn.apache.org/viewvc?rev=1066857&view=rev
Log:
first checkin of test entities, cleaned-up version of the proper on /trunk
Added:
commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/Address.java
(with props)
commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/AlphaBean.java
(with props)
commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/BetaBean.java
(with props)
commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/Box.java
(with props)
commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/Employee.java
(with props)
commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/GenericBean.java
(with props)
commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/Nameable.java
(with props)
commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/NamedBean.java
(with props)
commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/NamespacedBox.java
(with props)
commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/OrderRule.java
(with props)
commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/ParamBean.java
(with props)
commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/SimpleTestBean.java
(with props)
Added:
commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/Address.java
URL:
http://svn.apache.org/viewvc/commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/Address.java?rev=1066857&view=auto
==============================================================================
---
commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/Address.java
(added)
+++
commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/Address.java
Thu Feb 3 16:27:43 2011
@@ -0,0 +1,106 @@
+/* $Id$
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.digester3;
+
+/**
+ * Bean for Digester testing.
+ */
+public class Address {
+
+ public Address() {
+ this("My Street", "My City", "US", "MyZip");
+ }
+
+ public Address(String street, String city, String state, String zipCode) {
+ super();
+ setStreet(street);
+ setCity(city);
+ setState(state);
+ setZipCode(zipCode);
+ }
+
+ private String city = null;
+
+ public String getCity() {
+ return (this.city);
+ }
+
+ public void setCity(String city) {
+ this.city = city;
+ }
+
+ private String state = null;
+
+ public String getState() {
+ return (this.state);
+ }
+
+ public void setState(String state) {
+ this.state = state;
+ }
+
+ private String street = null;
+
+ public String getStreet() {
+ return (this.street);
+ }
+
+ public void setStreet(String street) {
+ this.street = street;
+ }
+
+ private String type = null;
+
+ public String getType() {
+ return (this.type);
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ private String zipCode = null;
+
+ public String getZipCode() {
+ return (this.zipCode);
+ }
+
+ public void setZipCode(String zipCode) {
+ this.zipCode = zipCode;
+ }
+
+ public void setEmployee(Employee employee) {
+ employee.addAddress(this);
+ }
+
+ @Override
+ public String toString() {
+ StringBuffer sb = new StringBuffer("Address[");
+ sb.append("street=");
+ sb.append(street);
+ sb.append(", city=");
+ sb.append(city);
+ sb.append(", state=");
+ sb.append(state);
+ sb.append(", zipCode=");
+ sb.append(zipCode);
+ sb.append("]");
+ return (sb.toString());
+ }
+
+}
Propchange:
commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/Address.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/Address.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange:
commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/Address.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added:
commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/AlphaBean.java
URL:
http://svn.apache.org/viewvc/commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/AlphaBean.java?rev=1066857&view=auto
==============================================================================
---
commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/AlphaBean.java
(added)
+++
commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/AlphaBean.java
Thu Feb 3 16:27:43 2011
@@ -0,0 +1,63 @@
+/* $Id$
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.digester3;
+
+public class AlphaBean implements Nameable {
+
+ private String name = "ALPHA";
+
+ private Nameable child;
+
+ private Nameable parent;
+
+ public AlphaBean() {}
+
+ public AlphaBean(String name) {
+ setName(name);
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public void setParent(Nameable parent) {
+ this.parent = parent;
+ }
+
+ public Nameable getParent() {
+ return parent;
+ }
+
+ public void setChild(Nameable child) {
+ this.child = child;
+ }
+
+ public Nameable getChild() {
+ return child;
+ }
+
+ @Override
+ public String toString() {
+ return "[AlphaBean] name=" + name + " child=" + child;
+ }
+
+}
Propchange:
commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/AlphaBean.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/AlphaBean.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange:
commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/AlphaBean.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added:
commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/BetaBean.java
URL:
http://svn.apache.org/viewvc/commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/BetaBean.java?rev=1066857&view=auto
==============================================================================
---
commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/BetaBean.java
(added)
+++
commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/BetaBean.java
Thu Feb 3 16:27:43 2011
@@ -0,0 +1,59 @@
+/* $Id$
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.digester3;
+
+public class BetaBean implements Nameable {
+
+ private String name = "BETA";
+
+ private Nameable child;
+
+ private Nameable parent;
+
+ public BetaBean() {}
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public void setParent(Nameable parent) {
+ this.parent = parent;
+ }
+
+ public Nameable getParent() {
+ return parent;
+ }
+
+ public void setChild(Nameable child) {
+ this.child = child;
+ }
+
+ public Nameable getChild() {
+ return child;
+ }
+
+ @Override
+ public String toString() {
+ return "[BetaBean] name=" + name + " child=" + child;
+ }
+
+}
Propchange:
commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/BetaBean.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/BetaBean.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange:
commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/BetaBean.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added:
commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/Box.java
URL:
http://svn.apache.org/viewvc/commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/Box.java?rev=1066857&view=auto
==============================================================================
---
commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/Box.java
(added)
+++
commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/Box.java
Thu Feb 3 16:27:43 2011
@@ -0,0 +1,81 @@
+/* $Id$
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.digester3;
+
+import java.util.LinkedList;
+import java.util.List;
+
+/**
+ * Simple class for use in unit tests. A box has an ID, and can have
+ * multiple boxes within it.
+ */
+public class Box {
+
+ private List<Box> children = new LinkedList<Box>();
+
+ private String id;
+
+ public Box() {}
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public void addChild(Box child) {
+ this.children.add(child);
+ }
+
+ public List<Box> getChildren() {
+ return children;
+ }
+
+ @Override
+ public String toString() {
+ StringBuffer buf = new StringBuffer();
+ buf.append("[Box] id=");
+ buf.append(id);
+ buf.append(" nchildren=");
+ buf.append(children.size());
+
+ for (Box child : children) {
+ buf.append(" ");
+ buf.append(child.toString());
+ }
+ return buf.toString();
+ }
+
+ /**
+ * Return a string containing this object's name value, followed by the
+ * names of all child objects (and their children etc) in pre-order
+ * sequence. Each name is separated by a space from the preceding one.
+ */
+ public String getIds() {
+ StringBuffer buf = new StringBuffer();
+ buf.append(this.id);
+ for (Box child : children) {
+ buf.append(" ");
+ buf.append(child.getIds());
+ }
+ return buf.toString();
+ }
+
+}
Propchange:
commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/Box.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/Box.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange:
commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/Box.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added:
commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/Employee.java
URL:
http://svn.apache.org/viewvc/commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/Employee.java?rev=1066857&view=auto
==============================================================================
---
commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/Employee.java
(added)
+++
commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/Employee.java
Thu Feb 3 16:27:43 2011
@@ -0,0 +1,116 @@
+/* $Id$
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.digester3;
+
+import java.util.ArrayList;
+
+/**
+ * Bean for Digester testing.
+ */
+public class Employee {
+
+ private final ArrayList<Address> addresses = new ArrayList<Address>();
+
+ private String firstName = null;
+
+ private String lastName = null;
+
+ // this is to allow testing of primitive convertion
+ private int age;
+
+ private boolean active;
+
+ private float salary;
+
+ public Employee() {
+ this("My First Name", "My Last Name");
+ }
+
+ public Employee(String firstName, String lastName) {
+ setFirstName(firstName);
+ setLastName(lastName);
+ }
+
+ public void addAddress(Address address) {
+ addresses.add(address);
+ }
+
+ public Address getAddress(String type) {
+ for (Address address : addresses) {
+ if (type.equals(address.getType()))
+ return (address);
+ }
+ return (null);
+ }
+
+ public void removeAddress(Address address) {
+ addresses.remove(address);
+ }
+
+ public String getFirstName() {
+ return (this.firstName);
+ }
+
+ public void setFirstName(String firstName) {
+ this.firstName = firstName;
+ }
+
+ public String getLastName() {
+ return (this.lastName);
+ }
+
+ public void setLastName(String lastName) {
+ this.lastName = lastName;
+ }
+
+ public int getAge() {
+ return age;
+ }
+
+ public void setAge(int age) {
+ this.age = age;
+ }
+
+ public boolean isActive() {
+ return active;
+ }
+
+ public void setActive(boolean active) {
+ this.active = active;
+ }
+
+ public float getSalary() {
+ return salary;
+ }
+
+ public void setSalary(float salary) {
+ this.salary = salary;
+ }
+
+ @Override
+ public String toString() {
+ StringBuffer sb = new StringBuffer("Employee[");
+ sb.append("firstName=");
+ sb.append(firstName);
+ sb.append(", lastName=");
+ sb.append(lastName);
+ sb.append("]");
+ return (sb.toString());
+ }
+
+}
Propchange:
commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/Employee.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/Employee.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange:
commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/Employee.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added:
commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/GenericBean.java
URL:
http://svn.apache.org/viewvc/commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/GenericBean.java?rev=1066857&view=auto
==============================================================================
---
commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/GenericBean.java
(added)
+++
commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/GenericBean.java
Thu Feb 3 16:27:43 2011
@@ -0,0 +1,264 @@
+/* $Id$
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.digester3;
+
+/**
+ * General purpose test bean for Digester tests.
+ */
+public class GenericBean {
+
+ /**
+ * A boolean property whose initial value is true.
+ */
+ private boolean booleanProperty = true;
+
+ public boolean getBooleanProperty() {
+ return (booleanProperty);
+ }
+
+ public void setBooleanProperty(boolean booleanProperty) {
+ this.booleanProperty = booleanProperty;
+ }
+
+
+ /**
+ * A double property.
+ */
+ private double doubleProperty = 321.0;
+
+ public double getDoubleProperty() {
+ return (this.doubleProperty);
+ }
+
+ public void setDoubleProperty(double doubleProperty) {
+ this.doubleProperty = doubleProperty;
+ }
+
+
+ /**
+ * A boolean property whose initial value is false
+ */
+ private boolean falseProperty = false;
+
+ public boolean getFalseProperty() {
+ return (falseProperty);
+ }
+
+ public void setFalseProperty(boolean falseProperty) {
+ this.falseProperty = falseProperty;
+ }
+
+
+ /**
+ * A float property.
+ */
+ private float floatProperty = (float) 123.0;
+
+ public float getFloatProperty() {
+ return (this.floatProperty);
+ }
+
+ public void setFloatProperty(float floatProperty) {
+ this.floatProperty = floatProperty;
+ }
+
+
+ /**
+ * Integer arrays that are accessed as an array as well as indexed.
+ */
+ private int intArray[] = { 0, 10, 20, 30, 40 };
+
+ public int[] getIntArray() {
+ return (this.intArray);
+ }
+
+ public void setIntArray(int intArray[]) {
+ this.intArray = intArray;
+ }
+
+ private int intIndexed[] = { 0, 10, 20, 30, 40 };
+
+ public int getIntIndexed(int index) {
+ return (intIndexed[index]);
+ }
+
+ public void setIntIndexed(int index, int value) {
+ intIndexed[index] = value;
+ }
+
+
+ private int intMultibox[] = new int[0];
+
+ public int[] getIntMultibox() {
+ return (this.intMultibox);
+ }
+
+ public void setIntMultibox(int intMultibox[]) {
+ this.intMultibox = intMultibox;
+ }
+
+ /**
+ * An integer property.
+ */
+ private int intProperty = 123;
+
+ public int getIntProperty() {
+ return (this.intProperty);
+ }
+
+ public void setIntProperty(int intProperty) {
+ this.intProperty = intProperty;
+ }
+
+
+ /**
+ * A long property.
+ */
+ private long longProperty = 321;
+
+ public long getLongProperty() {
+ return (this.longProperty);
+ }
+
+ public void setLongProperty(long longProperty) {
+ this.longProperty = longProperty;
+ }
+
+
+ /**
+ * A multiple-String SELECT element.
+ */
+ private String[] multipleSelect = { "Multiple 3", "Multiple 5",
+ "Multiple 7" };
+
+ public String[] getMultipleSelect() {
+ return (this.multipleSelect);
+ }
+
+ public void setMultipleSelect(String multipleSelect[]) {
+ this.multipleSelect = multipleSelect;
+ }
+
+
+ /**
+ * A nested reference to another test bean (populated as needed).
+ */
+ private GenericBean nested = null;
+
+ public GenericBean getNested() {
+ if (nested == null)
+ nested = new GenericBean();
+ return (nested);
+ }
+
+
+ /**
+ * A String property with an initial value of null.
+ */
+ private String nullProperty = null;
+
+ public String getNullProperty() {
+ return (this.nullProperty);
+ }
+
+ public void setNullProperty(String nullProperty) {
+ this.nullProperty = nullProperty;
+ }
+
+
+ /**
+ * A short property.
+ */
+ private short shortProperty = (short) 987;
+
+ public short getShortProperty() {
+ return (this.shortProperty);
+ }
+
+ public void setShortProperty(short shortProperty) {
+ this.shortProperty = shortProperty;
+ }
+
+
+ /**
+ * A single-String value for a SELECT element.
+ */
+ private String singleSelect = "Single 5";
+
+ public String getSingleSelect() {
+ return (this.singleSelect);
+ }
+
+ public void setSingleSelect(String singleSelect) {
+ this.singleSelect = singleSelect;
+ }
+
+
+ /**
+ * String arrays that are accessed as an array as well as indexed.
+ */
+ private String stringArray[] =
+ { "String 0", "String 1", "String 2", "String 3", "String 4" };
+
+ public String[] getStringArray() {
+ return (this.stringArray);
+ }
+
+ public void setStringArray(String stringArray[]) {
+ this.stringArray = stringArray;
+ }
+
+ private String stringIndexed[] =
+ { "String 0", "String 1", "String 2", "String 3", "String 4" };
+
+ public String getStringIndexed(int index) {
+ return (stringIndexed[index]);
+ }
+
+ public void setStringIndexed(int index, String value) {
+ stringIndexed[index] = value;
+ }
+
+
+ /**
+ * A String property.
+ */
+ private String stringProperty = "This is a string";
+
+ public String getStringProperty() {
+ return (this.stringProperty);
+ }
+
+ public void setStringProperty(String stringProperty) {
+ this.stringProperty = stringProperty;
+ }
+
+ /**
+ * An empty String property.
+ */
+ private String emptyStringProperty = "";
+
+ public String getEmptyStringProperty() {
+ return (this.emptyStringProperty);
+ }
+
+ public void setEmptyStringProperty(String emptyStringProperty) {
+ this.emptyStringProperty = emptyStringProperty;
+ }
+
+}
Propchange:
commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/GenericBean.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/GenericBean.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange:
commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/GenericBean.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added:
commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/Nameable.java
URL:
http://svn.apache.org/viewvc/commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/Nameable.java?rev=1066857&view=auto
==============================================================================
---
commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/Nameable.java
(added)
+++
commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/Nameable.java
Thu Feb 3 16:27:43 2011
@@ -0,0 +1,29 @@
+/* $Id$
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.digester3;
+
+/**
+ * Interface used for testing.
+ */
+public interface Nameable {
+
+ String getName();
+
+ void setName(String name);
+
+}
Propchange:
commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/Nameable.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/Nameable.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange:
commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/Nameable.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added:
commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/NamedBean.java
URL:
http://svn.apache.org/viewvc/commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/NamedBean.java?rev=1066857&view=auto
==============================================================================
---
commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/NamedBean.java
(added)
+++
commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/NamedBean.java
Thu Feb 3 16:27:43 2011
@@ -0,0 +1,48 @@
+/* $Id$
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.digester3;
+
+/**
+ * Very simple test bean.
+ */
+public class NamedBean {
+
+ private String name = "**UNSET**";
+
+ public NamedBean() {}
+
+ public NamedBean(String name) {}
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public void test(String name, String ignored) {
+ setName(name);
+ }
+
+ @Override
+ public String toString() {
+ return "NamedBean[" + getName() + "]";
+ }
+
+}
Propchange:
commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/NamedBean.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/NamedBean.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange:
commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/NamedBean.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added:
commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/NamespacedBox.java
URL:
http://svn.apache.org/viewvc/commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/NamespacedBox.java?rev=1066857&view=auto
==============================================================================
---
commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/NamespacedBox.java
(added)
+++
commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/NamespacedBox.java
Thu Feb 3 16:27:43 2011
@@ -0,0 +1,45 @@
+/* $Id$
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.digester3;
+
+import java.util.Map;
+
+/**
+ * Simple class for use in unit tests. A box with a namespaces property
+ * to store the current namespaces as a Map.
+ *
+ * Used by NamespaceSnapshotTestCase.
+ */
+public class NamespacedBox extends Box {
+
+ private Map<String, String> namespaces;
+
+ public NamespacedBox() {
+ super();
+ }
+
+ public Map<String, String> getNamespaces() {
+ return namespaces;
+ }
+
+ public void setNamespaces(Map<String, String> namespaces) {
+ this.namespaces = namespaces;
+ }
+
+}
Propchange:
commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/NamespacedBox.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/NamespacedBox.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange:
commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/NamespacedBox.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added:
commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/OrderRule.java
URL:
http://svn.apache.org/viewvc/commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/OrderRule.java?rev=1066857&view=auto
==============================================================================
---
commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/OrderRule.java
(added)
+++
commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/OrderRule.java
Thu Feb 3 16:27:43 2011
@@ -0,0 +1,128 @@
+/* $Id$
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.digester3;
+
+import java.util.List;
+
+import org.xml.sax.Attributes;
+
+/**
+ * <p>This rule implementation is intended to help test digester.
+ * The idea is that you can test which rule matches by looking
+ * at the identifier.</p>
+ */
+public class OrderRule extends Rule {
+
+ /** String identifing this particular <code>TestRule</code> */
+ private String identifier;
+
+ /** Used when testing body text */
+ private String bodyText;
+
+ /** Used when testing call orders */
+ private List<Rule> order;
+
+ /**
+ * Base constructor.
+ *
+ * @param identifier Used to tell which TestRule is which
+ */
+ public OrderRule(String identifier) {
+ this.identifier = identifier;
+ }
+
+ /**
+ * Constructor sets namespace URI.
+ *
+ * @param identifier Used to tell which TestRule is which
+ * @param namespaceURI Set rule namespace
+ */
+ public OrderRule(String identifier, String namespaceURI) {
+ this.identifier = identifier;
+ setNamespaceURI(namespaceURI);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void begin(String namespace, String name, Attributes attributes)
throws Exception {
+ appendCall();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void body(String namespace, String name, String text) throws
Exception {
+ this.bodyText = text;
+ appendCall();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void end(String namespace, String name) throws Exception {
+ appendCall();
+ }
+
+ /**
+ * If a list has been set, append this to the list.
+ */
+ private void appendCall() {
+ if (this.order != null) {
+ this.order.add(this);
+ }
+ }
+
+ /**
+ * Get the body text that was set.
+ */
+ public String getBodyText() {
+ return bodyText;
+ }
+
+ /**
+ * Get the identifier associated with this test.
+ */
+ public String getIdentifier() {
+ return identifier;
+ }
+
+ /**
+ * Get call order list.
+ */
+ public List<Rule> getOrder() {
+ return order;
+ }
+
+ /**
+ * Set call order list
+ */
+ public void setOrder(List<Rule> order) {
+ this.order = order;
+ }
+
+ /**
+ * Return the identifier.
+ */
+ @Override
+ public String toString() {
+ return identifier;
+ }
+
+}
Propchange:
commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/OrderRule.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/OrderRule.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange:
commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/OrderRule.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added:
commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/ParamBean.java
URL:
http://svn.apache.org/viewvc/commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/ParamBean.java?rev=1066857&view=auto
==============================================================================
---
commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/ParamBean.java
(added)
+++
commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/ParamBean.java
Thu Feb 3 16:27:43 2011
@@ -0,0 +1,56 @@
+/* $Id$
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.digester3;
+
+/**
+ * This bean is used to replicate a reasonably complex use case
+ * whose behaviour has changed from Digester 1.3 to 1.4.
+ */
+public class ParamBean {
+
+ private boolean cool;
+
+ private String that;
+
+ private String _this;
+
+ public ParamBean() {}
+
+ public boolean isCool() {
+ return cool;
+ }
+
+ public void setCool(boolean cool) {
+ this.cool = cool;
+ }
+
+ public String getThis() {
+ return _this;
+ }
+
+ public String getThat() {
+ return that;
+ }
+
+ public String setThisAndThat(String _this, String that) {
+ this._this = _this;
+ this.that = that;
+ return "The Other";
+ }
+
+}
Propchange:
commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/ParamBean.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/ParamBean.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange:
commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/ParamBean.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added:
commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/SimpleTestBean.java
URL:
http://svn.apache.org/viewvc/commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/SimpleTestBean.java?rev=1066857&view=auto
==============================================================================
---
commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/SimpleTestBean.java
(added)
+++
commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/SimpleTestBean.java
Thu Feb 3 16:27:43 2011
@@ -0,0 +1,84 @@
+/* $Id$
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.digester3;
+
+/**
+ * <p> As it's name suggests just a simple bean used for testing.
+ */
+public class SimpleTestBean {
+
+ private String alpha;
+
+ private String beta;
+
+ private String gamma;
+
+ private String delta;
+
+ public String getAlpha() {
+ return alpha;
+ }
+
+ public void setAlpha(String alpha) {
+ this.alpha = alpha;
+ }
+
+ public String getBeta() {
+ return beta;
+ }
+
+ public void setBeta(String beta) {
+ this.beta = beta;
+ }
+
+ public String getGamma() {
+ return gamma;
+ }
+
+ public void setGamma(String gamma) {
+ this.gamma = gamma;
+ }
+
+ public String getDeltaValue() { // Retrieves "write only" value
+ return delta;
+ }
+
+ public void setDelta(String delta) { // "delta" is a write-only property
+ this.delta = delta;
+ }
+
+ public void setAlphaBeta(String alpha, String beta) {
+ setAlpha(alpha);
+ setBeta(beta);
+ }
+
+ @Override
+ public String toString() {
+ StringBuffer sb = new StringBuffer("[SimpleTestBean]");
+ sb.append(" alpha=");
+ sb.append(alpha);
+ sb.append(" beta=");
+ sb.append(beta);
+ sb.append(" gamma=");
+ sb.append(gamma);
+ sb.append(" delta=");
+ sb.append(delta);
+
+ return sb.toString();
+ }
+}
Propchange:
commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/SimpleTestBean.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/SimpleTestBean.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange:
commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/SimpleTestBean.java
------------------------------------------------------------------------------
svn:mime-type = text/plain