From 37b2e99006d9a9814ed6da1d20644416930b86f1 Mon Sep 17 00:00:00 2001 From: Peter Donald Date: Tue, 5 Mar 2002 14:36:41 +0000 Subject: [PATCH] Commit new "data" classes to use during testing. One class per test git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@271749 13f79535-47bb-0310-9956-ffa450edef68 --- .../data/ConfigTestAttributeConvert.java | 46 +++++++++++++ .../configurer/data/ConfigTestContent.java | 42 ++++++++++++ .../configurer/data/ConfigTestEmpty.java | 22 ++++++ .../configurer/data/ConfigTestIdResolve.java | 42 ++++++++++++ .../data/ConfigTestIgnoreStringMethods.java | 67 +++++++++++++++++++ .../data/ConfigTestInterfaceAdder.java | 33 +++++++++ .../data/ConfigTestMismatchedRefType.java | 26 +++++++ .../data/ConfigTestMultipleTypedAdder.java | 28 ++++++++ .../data/ConfigTestNonInterfaceAdder.java | 23 +++++++ .../data/ConfigTestPropResolution.java | 41 ++++++++++++ .../data/ConfigTestReferenceAttribute.java | 41 ++++++++++++ .../data/ConfigTestReferenceConversion.java | 35 ++++++++++ .../data/ConfigTestReferenceElement.java | 37 ++++++++++ .../data/ConfigTestSetAttribute.java | 51 ++++++++++++++ .../configurer/data/ConfigTestSetElement.java | 57 ++++++++++++++++ .../configurer/data/ConfigTestTypedAdder.java | 34 ++++++++++ .../data/ConfigTestTypedAdderConversion.java | 40 +++++++++++ .../data/ConfigTestTypedAdderReference.java | 33 +++++++++ .../data/ConfigTestTypedAdderRole.java | 33 +++++++++ .../data/ConfigTestTypedConfigAdder.java | 33 +++++++++ .../data/ConfigTestUnknownReference.java | 26 +++++++ .../data/ConfigTestAttributeConvert.java | 46 +++++++++++++ .../configurer/data/ConfigTestContent.java | 42 ++++++++++++ .../configurer/data/ConfigTestEmpty.java | 22 ++++++ .../configurer/data/ConfigTestIdResolve.java | 42 ++++++++++++ .../data/ConfigTestIgnoreStringMethods.java | 67 +++++++++++++++++++ .../data/ConfigTestInterfaceAdder.java | 33 +++++++++ .../data/ConfigTestMismatchedRefType.java | 26 +++++++ .../data/ConfigTestMultipleTypedAdder.java | 28 ++++++++ .../data/ConfigTestNonInterfaceAdder.java | 23 +++++++ .../data/ConfigTestPropResolution.java | 41 ++++++++++++ .../data/ConfigTestReferenceAttribute.java | 41 ++++++++++++ .../data/ConfigTestReferenceConversion.java | 35 ++++++++++ .../data/ConfigTestReferenceElement.java | 37 ++++++++++ .../data/ConfigTestSetAttribute.java | 51 ++++++++++++++ .../configurer/data/ConfigTestSetElement.java | 57 ++++++++++++++++ .../configurer/data/ConfigTestTypedAdder.java | 34 ++++++++++ .../data/ConfigTestTypedAdderConversion.java | 40 +++++++++++ .../data/ConfigTestTypedAdderReference.java | 33 +++++++++ .../data/ConfigTestTypedAdderRole.java | 33 +++++++++ .../data/ConfigTestTypedConfigAdder.java | 33 +++++++++ .../data/ConfigTestUnknownReference.java | 26 +++++++ 42 files changed, 1580 insertions(+) create mode 100644 proposal/myrmidon/src/test/org/apache/myrmidon/components/configurer/data/ConfigTestAttributeConvert.java create mode 100644 proposal/myrmidon/src/test/org/apache/myrmidon/components/configurer/data/ConfigTestContent.java create mode 100644 proposal/myrmidon/src/test/org/apache/myrmidon/components/configurer/data/ConfigTestEmpty.java create mode 100644 proposal/myrmidon/src/test/org/apache/myrmidon/components/configurer/data/ConfigTestIdResolve.java create mode 100644 proposal/myrmidon/src/test/org/apache/myrmidon/components/configurer/data/ConfigTestIgnoreStringMethods.java create mode 100644 proposal/myrmidon/src/test/org/apache/myrmidon/components/configurer/data/ConfigTestInterfaceAdder.java create mode 100644 proposal/myrmidon/src/test/org/apache/myrmidon/components/configurer/data/ConfigTestMismatchedRefType.java create mode 100644 proposal/myrmidon/src/test/org/apache/myrmidon/components/configurer/data/ConfigTestMultipleTypedAdder.java create mode 100644 proposal/myrmidon/src/test/org/apache/myrmidon/components/configurer/data/ConfigTestNonInterfaceAdder.java create mode 100644 proposal/myrmidon/src/test/org/apache/myrmidon/components/configurer/data/ConfigTestPropResolution.java create mode 100644 proposal/myrmidon/src/test/org/apache/myrmidon/components/configurer/data/ConfigTestReferenceAttribute.java create mode 100644 proposal/myrmidon/src/test/org/apache/myrmidon/components/configurer/data/ConfigTestReferenceConversion.java create mode 100644 proposal/myrmidon/src/test/org/apache/myrmidon/components/configurer/data/ConfigTestReferenceElement.java create mode 100644 proposal/myrmidon/src/test/org/apache/myrmidon/components/configurer/data/ConfigTestSetAttribute.java create mode 100644 proposal/myrmidon/src/test/org/apache/myrmidon/components/configurer/data/ConfigTestSetElement.java create mode 100644 proposal/myrmidon/src/test/org/apache/myrmidon/components/configurer/data/ConfigTestTypedAdder.java create mode 100644 proposal/myrmidon/src/test/org/apache/myrmidon/components/configurer/data/ConfigTestTypedAdderConversion.java create mode 100644 proposal/myrmidon/src/test/org/apache/myrmidon/components/configurer/data/ConfigTestTypedAdderReference.java create mode 100644 proposal/myrmidon/src/test/org/apache/myrmidon/components/configurer/data/ConfigTestTypedAdderRole.java create mode 100644 proposal/myrmidon/src/test/org/apache/myrmidon/components/configurer/data/ConfigTestTypedConfigAdder.java create mode 100644 proposal/myrmidon/src/test/org/apache/myrmidon/components/configurer/data/ConfigTestUnknownReference.java create mode 100644 proposal/myrmidon/src/testcases/org/apache/myrmidon/components/configurer/data/ConfigTestAttributeConvert.java create mode 100644 proposal/myrmidon/src/testcases/org/apache/myrmidon/components/configurer/data/ConfigTestContent.java create mode 100644 proposal/myrmidon/src/testcases/org/apache/myrmidon/components/configurer/data/ConfigTestEmpty.java create mode 100644 proposal/myrmidon/src/testcases/org/apache/myrmidon/components/configurer/data/ConfigTestIdResolve.java create mode 100644 proposal/myrmidon/src/testcases/org/apache/myrmidon/components/configurer/data/ConfigTestIgnoreStringMethods.java create mode 100644 proposal/myrmidon/src/testcases/org/apache/myrmidon/components/configurer/data/ConfigTestInterfaceAdder.java create mode 100644 proposal/myrmidon/src/testcases/org/apache/myrmidon/components/configurer/data/ConfigTestMismatchedRefType.java create mode 100644 proposal/myrmidon/src/testcases/org/apache/myrmidon/components/configurer/data/ConfigTestMultipleTypedAdder.java create mode 100644 proposal/myrmidon/src/testcases/org/apache/myrmidon/components/configurer/data/ConfigTestNonInterfaceAdder.java create mode 100644 proposal/myrmidon/src/testcases/org/apache/myrmidon/components/configurer/data/ConfigTestPropResolution.java create mode 100644 proposal/myrmidon/src/testcases/org/apache/myrmidon/components/configurer/data/ConfigTestReferenceAttribute.java create mode 100644 proposal/myrmidon/src/testcases/org/apache/myrmidon/components/configurer/data/ConfigTestReferenceConversion.java create mode 100644 proposal/myrmidon/src/testcases/org/apache/myrmidon/components/configurer/data/ConfigTestReferenceElement.java create mode 100644 proposal/myrmidon/src/testcases/org/apache/myrmidon/components/configurer/data/ConfigTestSetAttribute.java create mode 100644 proposal/myrmidon/src/testcases/org/apache/myrmidon/components/configurer/data/ConfigTestSetElement.java create mode 100644 proposal/myrmidon/src/testcases/org/apache/myrmidon/components/configurer/data/ConfigTestTypedAdder.java create mode 100644 proposal/myrmidon/src/testcases/org/apache/myrmidon/components/configurer/data/ConfigTestTypedAdderConversion.java create mode 100644 proposal/myrmidon/src/testcases/org/apache/myrmidon/components/configurer/data/ConfigTestTypedAdderReference.java create mode 100644 proposal/myrmidon/src/testcases/org/apache/myrmidon/components/configurer/data/ConfigTestTypedAdderRole.java create mode 100644 proposal/myrmidon/src/testcases/org/apache/myrmidon/components/configurer/data/ConfigTestTypedConfigAdder.java create mode 100644 proposal/myrmidon/src/testcases/org/apache/myrmidon/components/configurer/data/ConfigTestUnknownReference.java diff --git a/proposal/myrmidon/src/test/org/apache/myrmidon/components/configurer/data/ConfigTestAttributeConvert.java b/proposal/myrmidon/src/test/org/apache/myrmidon/components/configurer/data/ConfigTestAttributeConvert.java new file mode 100644 index 000000000..6830561d2 --- /dev/null +++ b/proposal/myrmidon/src/test/org/apache/myrmidon/components/configurer/data/ConfigTestAttributeConvert.java @@ -0,0 +1,46 @@ +/* + * Copyright (C) The Apache Software Foundation. All rights reserved. + * + * This software is published under the terms of the Apache Software License + * version 1.1, a copy of which has been included with this distribution in + * the LICENSE.txt file. + */ +package org.apache.myrmidon.components.configurer.data; + +import org.apache.myrmidon.components.AbstractComponentTest; + +/** + * A class for testing conversion. + * + * @author Adam Murdoch + */ +public class ConfigTestAttributeConvert +{ + private int m_intProp; + private Integer m_integerProp; + + public void setIntProp( final int intProp ) + { + m_intProp = intProp; + } + + public void setIntegerProp( final Integer integerProp ) + { + m_integerProp = integerProp; + } + + public boolean equals( Object obj ) + { + ConfigTestAttributeConvert test = (ConfigTestAttributeConvert)obj; + if( m_intProp != test.m_intProp ) + { + return false; + } + if( !AbstractComponentTest.equals( m_integerProp, test.m_integerProp ) ) + { + return false; + } + + return true; + } +} diff --git a/proposal/myrmidon/src/test/org/apache/myrmidon/components/configurer/data/ConfigTestContent.java b/proposal/myrmidon/src/test/org/apache/myrmidon/components/configurer/data/ConfigTestContent.java new file mode 100644 index 000000000..1d28ef88f --- /dev/null +++ b/proposal/myrmidon/src/test/org/apache/myrmidon/components/configurer/data/ConfigTestContent.java @@ -0,0 +1,42 @@ +/* + * Copyright (C) The Apache Software Foundation. All rights reserved. + * + * This software is published under the terms of the Apache Software License + * version 1.1, a copy of which has been included with this distribution in + * the LICENSE.txt file. + */ +package org.apache.myrmidon.components.configurer.data; + +import java.util.ArrayList; +import java.util.List; +import org.apache.myrmidon.framework.DataType; +import org.apache.myrmidon.components.configurer.DefaultConfigurerTest; + +/** + * A simple test class with string properties. + * + * @author Adam Murdoch + */ +public class ConfigTestContent + implements DataType +{ + private String m_content; + + public boolean equals( final Object obj ) + { + final ConfigTestContent test = (ConfigTestContent)obj; + if( !DefaultConfigurerTest.equals( m_content, test.m_content ) ) + { + return false; + } + else + { + return true; + } + } + + public void addContent( final String content ) + { + m_content = content; + } +} diff --git a/proposal/myrmidon/src/test/org/apache/myrmidon/components/configurer/data/ConfigTestEmpty.java b/proposal/myrmidon/src/test/org/apache/myrmidon/components/configurer/data/ConfigTestEmpty.java new file mode 100644 index 000000000..00c5f2a8f --- /dev/null +++ b/proposal/myrmidon/src/test/org/apache/myrmidon/components/configurer/data/ConfigTestEmpty.java @@ -0,0 +1,22 @@ +/* + * Copyright (C) The Apache Software Foundation. All rights reserved. + * + * This software is published under the terms of the Apache Software License + * version 1.1, a copy of which has been included with this distribution in + * the LICENSE.txt file. + */ +package org.apache.myrmidon.components.configurer.data; + +import java.util.ArrayList; +import java.util.List; +import org.apache.myrmidon.framework.DataType; + +/** + * A simple test class with string properties. + * + * @author Adam Murdoch + */ +public class ConfigTestEmpty + implements DataType +{ +} diff --git a/proposal/myrmidon/src/test/org/apache/myrmidon/components/configurer/data/ConfigTestIdResolve.java b/proposal/myrmidon/src/test/org/apache/myrmidon/components/configurer/data/ConfigTestIdResolve.java new file mode 100644 index 000000000..0de5265df --- /dev/null +++ b/proposal/myrmidon/src/test/org/apache/myrmidon/components/configurer/data/ConfigTestIdResolve.java @@ -0,0 +1,42 @@ +/* + * Copyright (C) The Apache Software Foundation. All rights reserved. + * + * This software is published under the terms of the Apache Software License + * version 1.1, a copy of which has been included with this distribution in + * the LICENSE.txt file. + */ +package org.apache.myrmidon.components.configurer.data; + +import java.util.ArrayList; +import java.util.List; +import org.apache.myrmidon.framework.DataType; +import org.apache.myrmidon.components.configurer.DefaultConfigurerTest; + +/** + * A simple test class with string properties. + * + * @author Adam Murdoch + */ +public class ConfigTestIdResolve + implements DataType +{ + private String m_someProp; + + public boolean equals( final Object obj ) + { + final ConfigTestIdResolve test = (ConfigTestIdResolve)obj; + if( !DefaultConfigurerTest.equals( m_someProp, test.m_someProp ) ) + { + return false; + } + else + { + return true; + } + } + + public void setSomeProp( final String value ) + { + m_someProp = value; + } +} diff --git a/proposal/myrmidon/src/test/org/apache/myrmidon/components/configurer/data/ConfigTestIgnoreStringMethods.java b/proposal/myrmidon/src/test/org/apache/myrmidon/components/configurer/data/ConfigTestIgnoreStringMethods.java new file mode 100644 index 000000000..55c6f5b30 --- /dev/null +++ b/proposal/myrmidon/src/test/org/apache/myrmidon/components/configurer/data/ConfigTestIgnoreStringMethods.java @@ -0,0 +1,67 @@ +/* + * Copyright (C) The Apache Software Foundation. All rights reserved. + * + * This software is published under the terms of the Apache Software License + * version 1.1, a copy of which has been included with this distribution in + * the LICENSE.txt file. + */ +package org.apache.myrmidon.components.configurer.data; + +import java.util.ArrayList; +import junit.framework.AssertionFailedError; +import org.apache.myrmidon.components.configurer.ConfigTestStringProps; +import org.apache.myrmidon.components.configurer.DefaultConfigurerTest; +import org.apache.myrmidon.components.configurer.ConfigTestMultiSetter; + +/** + * A test class with multiple setters/adders/creators for a property. + * + * @author Adam Murdoch + */ +public class ConfigTestIgnoreStringMethods +{ + private ConfigTestIgnoreStringMethods m_prop1; + private ArrayList m_prop2 = new ArrayList(); + + public boolean equals( Object obj ) + { + ConfigTestIgnoreStringMethods test = (ConfigTestIgnoreStringMethods)obj; + if( !DefaultConfigurerTest.equals( m_prop1, test.m_prop1 ) ) + { + return false; + } + if( !m_prop2.equals( test.m_prop2 ) ) + { + return false; + } + return true; + } + + // + // Multiple setters + // + + public void addProp1( final String value ) + { + throw new AssertionFailedError(); + } + + public void addProp1( final ConfigTestIgnoreStringMethods value ) + { + m_prop1 = value; + } + + // + // Multiple Adders + // + + public void addProp2( final String value ) + { + throw new AssertionFailedError(); + } + + public void addProp2( final ConfigTestIgnoreStringMethods value ) + { + m_prop2.add( value ); + } +} diff --git a/proposal/myrmidon/src/test/org/apache/myrmidon/components/configurer/data/ConfigTestInterfaceAdder.java b/proposal/myrmidon/src/test/org/apache/myrmidon/components/configurer/data/ConfigTestInterfaceAdder.java new file mode 100644 index 000000000..48c15109e --- /dev/null +++ b/proposal/myrmidon/src/test/org/apache/myrmidon/components/configurer/data/ConfigTestInterfaceAdder.java @@ -0,0 +1,33 @@ +/* + * Copyright (C) The Apache Software Foundation. All rights reserved. + * + * This software is published under the terms of the Apache Software License + * version 1.1, a copy of which has been included with this distribution in + * the LICENSE.txt file. + */ +package org.apache.myrmidon.components.configurer.data; + +import java.util.ArrayList; +import org.apache.myrmidon.components.configurer.MyRole1; + +/** + * A test class with an interface property. + * + * @author Adam Murdoch + * @version $Revision$ $Date$ + */ +public class ConfigTestInterfaceAdder +{ + private final ArrayList m_elems = new ArrayList(); + + public void addPropA( final MyRole1 role1 ) + { + m_elems.add( role1 ); + } + + public boolean equals( Object obj ) + { + final ConfigTestInterfaceAdder test = (ConfigTestInterfaceAdder)obj; + return m_elems.equals( test.m_elems ); + } +} diff --git a/proposal/myrmidon/src/test/org/apache/myrmidon/components/configurer/data/ConfigTestMismatchedRefType.java b/proposal/myrmidon/src/test/org/apache/myrmidon/components/configurer/data/ConfigTestMismatchedRefType.java new file mode 100644 index 000000000..a00b94df8 --- /dev/null +++ b/proposal/myrmidon/src/test/org/apache/myrmidon/components/configurer/data/ConfigTestMismatchedRefType.java @@ -0,0 +1,26 @@ +/* + * Copyright (C) The Apache Software Foundation. All rights reserved. + * + * This software is published under the terms of the Apache Software License + * version 1.1, a copy of which has been included with this distribution in + * the LICENSE.txt file. + */ +package org.apache.myrmidon.components.configurer.data; + +import java.util.ArrayList; +import java.util.List; +import org.apache.myrmidon.framework.DataType; +import org.apache.myrmidon.components.configurer.DefaultConfigurerTest; + +/** + * A simple test class with string properties. + * + * @author Adam Murdoch + */ +public class ConfigTestMismatchedRefType + implements DataType +{ + public void setSomeProp( final String value ) + { + } +} diff --git a/proposal/myrmidon/src/test/org/apache/myrmidon/components/configurer/data/ConfigTestMultipleTypedAdder.java b/proposal/myrmidon/src/test/org/apache/myrmidon/components/configurer/data/ConfigTestMultipleTypedAdder.java new file mode 100644 index 000000000..c70b8e479 --- /dev/null +++ b/proposal/myrmidon/src/test/org/apache/myrmidon/components/configurer/data/ConfigTestMultipleTypedAdder.java @@ -0,0 +1,28 @@ +/* + * Copyright (C) The Apache Software Foundation. All rights reserved. + * + * This software is published under the terms of the Apache Software License + * version 1.1, a copy of which has been included with this distribution in + * the LICENSE.txt file. + */ +package org.apache.myrmidon.components.configurer.data; + +import org.apache.myrmidon.components.configurer.MyRole1; +import org.apache.myrmidon.components.configurer.MyRole2; + +/** + * Simple class with more than one typed adder method. + * + * @author Peter Donald + * @version $Revision$ $Date$ + */ +public class ConfigTestMultipleTypedAdder +{ + public void add( final MyRole1 role1 ) + { + } + + public void add( final MyRole2 role2 ) + { + } +} diff --git a/proposal/myrmidon/src/test/org/apache/myrmidon/components/configurer/data/ConfigTestNonInterfaceAdder.java b/proposal/myrmidon/src/test/org/apache/myrmidon/components/configurer/data/ConfigTestNonInterfaceAdder.java new file mode 100644 index 000000000..45535c961 --- /dev/null +++ b/proposal/myrmidon/src/test/org/apache/myrmidon/components/configurer/data/ConfigTestNonInterfaceAdder.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) The Apache Software Foundation. All rights reserved. + * + * This software is published under the terms of the Apache Software License + * version 1.1, a copy of which has been included with this distribution in + * the LICENSE.txt file. + */ +package org.apache.myrmidon.components.configurer.data; + +/** + * Simple class to test typed adder. + * + * @author Peter Donald + * @version $Revision$ $Date$ + */ +public class ConfigTestNonInterfaceAdder +{ + public void add( final Integer integer ) + { + System.out.println( "This should not have been called as " + + "Integer is not an interface" ); + } +} diff --git a/proposal/myrmidon/src/test/org/apache/myrmidon/components/configurer/data/ConfigTestPropResolution.java b/proposal/myrmidon/src/test/org/apache/myrmidon/components/configurer/data/ConfigTestPropResolution.java new file mode 100644 index 000000000..6a9e44c56 --- /dev/null +++ b/proposal/myrmidon/src/test/org/apache/myrmidon/components/configurer/data/ConfigTestPropResolution.java @@ -0,0 +1,41 @@ +/* + * Copyright (C) The Apache Software Foundation. All rights reserved. + * + * This software is published under the terms of the Apache Software License + * version 1.1, a copy of which has been included with this distribution in + * the LICENSE.txt file. + */ +package org.apache.myrmidon.components.configurer.data; + +import java.util.List; +import java.util.ArrayList; +import org.apache.myrmidon.components.configurer.DefaultConfigurerTest; + +/** + * Simple class to test typed adder. + * + * @author Peter Donald + * @version $Revision$ $Date$ + */ +public class ConfigTestPropResolution +{ + private String m_prop; + + public boolean equals( final Object obj ) + { + final ConfigTestPropResolution test = (ConfigTestPropResolution)obj; + if( !DefaultConfigurerTest.equals( m_prop, test.m_prop ) ) + { + return false; + } + else + { + return true; + } + } + + public void setProp( final String value ) + { + m_prop = value; + } +} diff --git a/proposal/myrmidon/src/test/org/apache/myrmidon/components/configurer/data/ConfigTestReferenceAttribute.java b/proposal/myrmidon/src/test/org/apache/myrmidon/components/configurer/data/ConfigTestReferenceAttribute.java new file mode 100644 index 000000000..9ec47f727 --- /dev/null +++ b/proposal/myrmidon/src/test/org/apache/myrmidon/components/configurer/data/ConfigTestReferenceAttribute.java @@ -0,0 +1,41 @@ +/* + * Copyright (C) The Apache Software Foundation. All rights reserved. + * + * This software is published under the terms of the Apache Software License + * version 1.1, a copy of which has been included with this distribution in + * the LICENSE.txt file. + */ +package org.apache.myrmidon.components.configurer.data; + +import java.util.List; +import java.util.ArrayList; +import org.apache.myrmidon.components.configurer.DefaultConfigurerTest; + +/** + * Simple class to test typed adder. + * + * @author Peter Donald + * @version $Revision$ $Date$ + */ +public class ConfigTestReferenceAttribute +{ + private String m_someProp; + + public boolean equals( final Object obj ) + { + final ConfigTestReferenceAttribute test = (ConfigTestReferenceAttribute)obj; + if( !DefaultConfigurerTest.equals( m_someProp, test.m_someProp ) ) + { + return false; + } + else + { + return true; + } + } + + public void setSomeProp( final String value ) + { + m_someProp = value; + } +} diff --git a/proposal/myrmidon/src/test/org/apache/myrmidon/components/configurer/data/ConfigTestReferenceConversion.java b/proposal/myrmidon/src/test/org/apache/myrmidon/components/configurer/data/ConfigTestReferenceConversion.java new file mode 100644 index 000000000..27101f389 --- /dev/null +++ b/proposal/myrmidon/src/test/org/apache/myrmidon/components/configurer/data/ConfigTestReferenceConversion.java @@ -0,0 +1,35 @@ +/* + * Copyright (C) The Apache Software Foundation. All rights reserved. + * + * This software is published under the terms of the Apache Software License + * version 1.1, a copy of which has been included with this distribution in + * the LICENSE.txt file. + */ +package org.apache.myrmidon.components.configurer.data; + +import java.util.ArrayList; +import java.util.List; +import org.apache.myrmidon.components.configurer.DefaultConfigurerTest; +import org.apache.myrmidon.components.configurer.MyRole1; +import org.apache.myrmidon.components.configurer.ConfigTestInterfaceProp; + +/** + * A simple test class. + * + * @author Adam Murdoch + */ +public class ConfigTestReferenceConversion +{ + private final ArrayList m_elems = new ArrayList(); + + public void setPropA( final MyRole1 role1 ) + { + m_elems.add( role1 ); + } + + public boolean equals( Object obj ) + { + final ConfigTestReferenceConversion test = (ConfigTestReferenceConversion)obj; + return m_elems.equals( test.m_elems ); + } +} diff --git a/proposal/myrmidon/src/test/org/apache/myrmidon/components/configurer/data/ConfigTestReferenceElement.java b/proposal/myrmidon/src/test/org/apache/myrmidon/components/configurer/data/ConfigTestReferenceElement.java new file mode 100644 index 000000000..4bbb9f893 --- /dev/null +++ b/proposal/myrmidon/src/test/org/apache/myrmidon/components/configurer/data/ConfigTestReferenceElement.java @@ -0,0 +1,37 @@ +/* + * Copyright (C) The Apache Software Foundation. All rights reserved. + * + * This software is published under the terms of the Apache Software License + * version 1.1, a copy of which has been included with this distribution in + * the LICENSE.txt file. + */ +package org.apache.myrmidon.components.configurer.data; + +import java.util.ArrayList; +import java.util.List; +import org.apache.myrmidon.components.configurer.DefaultConfigurerTest; + +/** + * A simple test class. + * + * @author Adam Murdoch + */ +public class ConfigTestReferenceElement +{ + private String m_someProp; + + public boolean equals( Object obj ) + { + ConfigTestReferenceElement test = (ConfigTestReferenceElement)obj; + if( !DefaultConfigurerTest.equals( m_someProp, test.m_someProp ) ) + { + return false; + } + return true; + } + + public void addSomeProp( final String value ) + { + m_someProp = value; + } +} diff --git a/proposal/myrmidon/src/test/org/apache/myrmidon/components/configurer/data/ConfigTestSetAttribute.java b/proposal/myrmidon/src/test/org/apache/myrmidon/components/configurer/data/ConfigTestSetAttribute.java new file mode 100644 index 000000000..cf44c852f --- /dev/null +++ b/proposal/myrmidon/src/test/org/apache/myrmidon/components/configurer/data/ConfigTestSetAttribute.java @@ -0,0 +1,51 @@ +/* + * Copyright (C) The Apache Software Foundation. All rights reserved. + * + * This software is published under the terms of the Apache Software License + * version 1.1, a copy of which has been included with this distribution in + * the LICENSE.txt file. + */ +package org.apache.myrmidon.components.configurer.data; + +import java.util.List; +import java.util.ArrayList; +import org.apache.myrmidon.components.configurer.DefaultConfigurerTest; + +/** + * Simple class to test typed adder. + * + * @author Peter Donald + * @version $Revision$ $Date$ + */ +public class ConfigTestSetAttribute +{ + private String m_someProp; + private List m_propList = new ArrayList(); + + public boolean equals( final Object obj ) + { + final ConfigTestSetAttribute test = (ConfigTestSetAttribute)obj; + if( !DefaultConfigurerTest.equals( m_someProp, test.m_someProp ) ) + { + return false; + } + else if( !m_propList.equals( test.m_propList ) ) + { + return false; + } + else + { + return true; + } + } + + public void setSomeProp( final String value ) + { + m_someProp = value; + } + + public void setProp( final String value ) + { + m_propList.add( value ); + } +} diff --git a/proposal/myrmidon/src/test/org/apache/myrmidon/components/configurer/data/ConfigTestSetElement.java b/proposal/myrmidon/src/test/org/apache/myrmidon/components/configurer/data/ConfigTestSetElement.java new file mode 100644 index 000000000..bc7b503fc --- /dev/null +++ b/proposal/myrmidon/src/test/org/apache/myrmidon/components/configurer/data/ConfigTestSetElement.java @@ -0,0 +1,57 @@ +/* + * Copyright (C) The Apache Software Foundation. All rights reserved. + * + * This software is published under the terms of the Apache Software License + * version 1.1, a copy of which has been included with this distribution in + * the LICENSE.txt file. + */ +package org.apache.myrmidon.components.configurer.data; + +import java.util.ArrayList; +import java.util.List; +import org.apache.myrmidon.components.configurer.DefaultConfigurerTest; + +/** + * A simple test class. + * + * @author Adam Murdoch + */ +public class ConfigTestSetElement +{ + private ConfigTestSetElement m_prop; + private List m_propList = new ArrayList(); + private String m_someProp; + + public boolean equals( Object obj ) + { + ConfigTestSetElement test = (ConfigTestSetElement)obj; + if( !DefaultConfigurerTest.equals( m_prop, test.m_prop ) ) + { + return false; + } + else if( !m_propList.equals( test.m_propList ) ) + { + return false; + } + else if( !DefaultConfigurerTest.equals( m_someProp, test.m_someProp ) ) + { + return false; + } + return true; + } + + public void setSomeProp( final String value ) + { + m_someProp = value; + } + + public void addProp( final ConfigTestSetElement test ) + { + m_prop = test; + } + + public void addAnotherProp( final ConfigTestSetElement test ) + { + m_propList.add( test ); + } +} diff --git a/proposal/myrmidon/src/test/org/apache/myrmidon/components/configurer/data/ConfigTestTypedAdder.java b/proposal/myrmidon/src/test/org/apache/myrmidon/components/configurer/data/ConfigTestTypedAdder.java new file mode 100644 index 000000000..7e1a75333 --- /dev/null +++ b/proposal/myrmidon/src/test/org/apache/myrmidon/components/configurer/data/ConfigTestTypedAdder.java @@ -0,0 +1,34 @@ +/* + * Copyright (C) The Apache Software Foundation. All rights reserved. + * + * This software is published under the terms of the Apache Software License + * version 1.1, a copy of which has been included with this distribution in + * the LICENSE.txt file. + */ +package org.apache.myrmidon.components.configurer.data; + +import java.util.ArrayList; +import org.apache.avalon.framework.configuration.Configuration; +import org.apache.myrmidon.components.configurer.MyRole1; + +/** + * Simple class to test adder for Configurations. + * + * @author Peter Donald + * @version $Revision$ $Date$ + */ +public class ConfigTestTypedAdder +{ + private ArrayList m_roles = new ArrayList(); + + public void add( final MyRole1 role ) + { + m_roles.add( role ); + } + + public boolean equals( final Object object ) + { + final ConfigTestTypedAdder other = (ConfigTestTypedAdder)object; + return m_roles.equals( other.m_roles ); + } +} diff --git a/proposal/myrmidon/src/test/org/apache/myrmidon/components/configurer/data/ConfigTestTypedAdderConversion.java b/proposal/myrmidon/src/test/org/apache/myrmidon/components/configurer/data/ConfigTestTypedAdderConversion.java new file mode 100644 index 000000000..b6a0cb9e8 --- /dev/null +++ b/proposal/myrmidon/src/test/org/apache/myrmidon/components/configurer/data/ConfigTestTypedAdderConversion.java @@ -0,0 +1,40 @@ +/* + * Copyright (C) The Apache Software Foundation. All rights reserved. + * + * This software is published under the terms of the Apache Software License + * version 1.1, a copy of which has been included with this distribution in + * the LICENSE.txt file. + */ +package org.apache.myrmidon.components.configurer.data; + +import java.util.ArrayList; +import org.apache.myrmidon.components.configurer.MyRole1; +import org.apache.myrmidon.framework.DataType; + +/** + * Simple class to test typed adder. + * + * @author Peter Donald + * @version $Revision$ $Date$ + */ +public class ConfigTestTypedAdderConversion + implements DataType +{ + private ArrayList m_roles = new ArrayList(); + private String m_prop; + + public void setProp( final String prop ) + { + m_prop = prop; + } + public void add( final MyRole1 role1 ) + { + m_roles.add( role1 ); + } + + public boolean equals( final Object object ) + { + final ConfigTestTypedAdderConversion other = (ConfigTestTypedAdderConversion)object; + return m_roles.equals( other.m_roles ); + } +} diff --git a/proposal/myrmidon/src/test/org/apache/myrmidon/components/configurer/data/ConfigTestTypedAdderReference.java b/proposal/myrmidon/src/test/org/apache/myrmidon/components/configurer/data/ConfigTestTypedAdderReference.java new file mode 100644 index 000000000..20a9c403f --- /dev/null +++ b/proposal/myrmidon/src/test/org/apache/myrmidon/components/configurer/data/ConfigTestTypedAdderReference.java @@ -0,0 +1,33 @@ +/* + * Copyright (C) The Apache Software Foundation. All rights reserved. + * + * This software is published under the terms of the Apache Software License + * version 1.1, a copy of which has been included with this distribution in + * the LICENSE.txt file. + */ +package org.apache.myrmidon.components.configurer.data; + +import java.util.ArrayList; +import org.apache.myrmidon.components.configurer.MyRole1; + +/** + * Simple class to test typed adder. + * + * @author Peter Donald + * @version $Revision$ $Date$ + */ +public class ConfigTestTypedAdderReference +{ + private ArrayList m_roles = new ArrayList(); + + public void add( final MyRole1 role1 ) + { + m_roles.add( role1 ); + } + + public boolean equals( final Object object ) + { + final ConfigTestTypedAdderReference other = (ConfigTestTypedAdderReference)object; + return m_roles.equals( other.m_roles ); + } +} diff --git a/proposal/myrmidon/src/test/org/apache/myrmidon/components/configurer/data/ConfigTestTypedAdderRole.java b/proposal/myrmidon/src/test/org/apache/myrmidon/components/configurer/data/ConfigTestTypedAdderRole.java new file mode 100644 index 000000000..ed950288a --- /dev/null +++ b/proposal/myrmidon/src/test/org/apache/myrmidon/components/configurer/data/ConfigTestTypedAdderRole.java @@ -0,0 +1,33 @@ +/* + * Copyright (C) The Apache Software Foundation. All rights reserved. + * + * This software is published under the terms of the Apache Software License + * version 1.1, a copy of which has been included with this distribution in + * the LICENSE.txt file. + */ +package org.apache.myrmidon.components.configurer.data; + +import java.util.ArrayList; +import org.apache.myrmidon.components.configurer.MyRole1; + +/** + * Simple class to test typed adder. + * + * @author Peter Donald + * @version $Revision$ $Date$ + */ +public class ConfigTestTypedAdderRole +{ + private ArrayList m_roles = new ArrayList(); + + public void add( final MyRole1 role1 ) + { + m_roles.add( role1 ); + } + + public boolean equals( final Object object ) + { + final ConfigTestTypedAdderRole other = (ConfigTestTypedAdderRole)object; + return m_roles.equals( other.m_roles ); + } +} diff --git a/proposal/myrmidon/src/test/org/apache/myrmidon/components/configurer/data/ConfigTestTypedConfigAdder.java b/proposal/myrmidon/src/test/org/apache/myrmidon/components/configurer/data/ConfigTestTypedConfigAdder.java new file mode 100644 index 000000000..790687fb8 --- /dev/null +++ b/proposal/myrmidon/src/test/org/apache/myrmidon/components/configurer/data/ConfigTestTypedConfigAdder.java @@ -0,0 +1,33 @@ +/* + * Copyright (C) The Apache Software Foundation. All rights reserved. + * + * This software is published under the terms of the Apache Software License + * version 1.1, a copy of which has been included with this distribution in + * the LICENSE.txt file. + */ +package org.apache.myrmidon.components.configurer.data; + +import java.util.ArrayList; +import org.apache.avalon.framework.configuration.Configuration; + +/** + * Simple class to test adder for Configurations. + * + * @author Peter Donald + * @version $Revision$ $Date$ + */ +public class ConfigTestTypedConfigAdder +{ + private ArrayList m_configurations = new ArrayList(); + + public void add( final Configuration configuration ) + { + m_configurations.add( configuration ); + } + + public boolean equals( final Object object ) + { + final ConfigTestTypedConfigAdder other = (ConfigTestTypedConfigAdder)object; + return m_configurations.equals( other.m_configurations ); + } +} diff --git a/proposal/myrmidon/src/test/org/apache/myrmidon/components/configurer/data/ConfigTestUnknownReference.java b/proposal/myrmidon/src/test/org/apache/myrmidon/components/configurer/data/ConfigTestUnknownReference.java new file mode 100644 index 000000000..32d17784b --- /dev/null +++ b/proposal/myrmidon/src/test/org/apache/myrmidon/components/configurer/data/ConfigTestUnknownReference.java @@ -0,0 +1,26 @@ +/* + * Copyright (C) The Apache Software Foundation. All rights reserved. + * + * This software is published under the terms of the Apache Software License + * version 1.1, a copy of which has been included with this distribution in + * the LICENSE.txt file. + */ +package org.apache.myrmidon.components.configurer.data; + +import java.util.ArrayList; +import java.util.List; +import org.apache.myrmidon.framework.DataType; +import org.apache.myrmidon.components.configurer.DefaultConfigurerTest; + +/** + * A simple test class with string properties. + * + * @author Adam Murdoch + */ +public class ConfigTestUnknownReference + implements DataType +{ + public void setSomeProp( final String value ) + { + } +} diff --git a/proposal/myrmidon/src/testcases/org/apache/myrmidon/components/configurer/data/ConfigTestAttributeConvert.java b/proposal/myrmidon/src/testcases/org/apache/myrmidon/components/configurer/data/ConfigTestAttributeConvert.java new file mode 100644 index 000000000..6830561d2 --- /dev/null +++ b/proposal/myrmidon/src/testcases/org/apache/myrmidon/components/configurer/data/ConfigTestAttributeConvert.java @@ -0,0 +1,46 @@ +/* + * Copyright (C) The Apache Software Foundation. All rights reserved. + * + * This software is published under the terms of the Apache Software License + * version 1.1, a copy of which has been included with this distribution in + * the LICENSE.txt file. + */ +package org.apache.myrmidon.components.configurer.data; + +import org.apache.myrmidon.components.AbstractComponentTest; + +/** + * A class for testing conversion. + * + * @author Adam Murdoch + */ +public class ConfigTestAttributeConvert +{ + private int m_intProp; + private Integer m_integerProp; + + public void setIntProp( final int intProp ) + { + m_intProp = intProp; + } + + public void setIntegerProp( final Integer integerProp ) + { + m_integerProp = integerProp; + } + + public boolean equals( Object obj ) + { + ConfigTestAttributeConvert test = (ConfigTestAttributeConvert)obj; + if( m_intProp != test.m_intProp ) + { + return false; + } + if( !AbstractComponentTest.equals( m_integerProp, test.m_integerProp ) ) + { + return false; + } + + return true; + } +} diff --git a/proposal/myrmidon/src/testcases/org/apache/myrmidon/components/configurer/data/ConfigTestContent.java b/proposal/myrmidon/src/testcases/org/apache/myrmidon/components/configurer/data/ConfigTestContent.java new file mode 100644 index 000000000..1d28ef88f --- /dev/null +++ b/proposal/myrmidon/src/testcases/org/apache/myrmidon/components/configurer/data/ConfigTestContent.java @@ -0,0 +1,42 @@ +/* + * Copyright (C) The Apache Software Foundation. All rights reserved. + * + * This software is published under the terms of the Apache Software License + * version 1.1, a copy of which has been included with this distribution in + * the LICENSE.txt file. + */ +package org.apache.myrmidon.components.configurer.data; + +import java.util.ArrayList; +import java.util.List; +import org.apache.myrmidon.framework.DataType; +import org.apache.myrmidon.components.configurer.DefaultConfigurerTest; + +/** + * A simple test class with string properties. + * + * @author Adam Murdoch + */ +public class ConfigTestContent + implements DataType +{ + private String m_content; + + public boolean equals( final Object obj ) + { + final ConfigTestContent test = (ConfigTestContent)obj; + if( !DefaultConfigurerTest.equals( m_content, test.m_content ) ) + { + return false; + } + else + { + return true; + } + } + + public void addContent( final String content ) + { + m_content = content; + } +} diff --git a/proposal/myrmidon/src/testcases/org/apache/myrmidon/components/configurer/data/ConfigTestEmpty.java b/proposal/myrmidon/src/testcases/org/apache/myrmidon/components/configurer/data/ConfigTestEmpty.java new file mode 100644 index 000000000..00c5f2a8f --- /dev/null +++ b/proposal/myrmidon/src/testcases/org/apache/myrmidon/components/configurer/data/ConfigTestEmpty.java @@ -0,0 +1,22 @@ +/* + * Copyright (C) The Apache Software Foundation. All rights reserved. + * + * This software is published under the terms of the Apache Software License + * version 1.1, a copy of which has been included with this distribution in + * the LICENSE.txt file. + */ +package org.apache.myrmidon.components.configurer.data; + +import java.util.ArrayList; +import java.util.List; +import org.apache.myrmidon.framework.DataType; + +/** + * A simple test class with string properties. + * + * @author Adam Murdoch + */ +public class ConfigTestEmpty + implements DataType +{ +} diff --git a/proposal/myrmidon/src/testcases/org/apache/myrmidon/components/configurer/data/ConfigTestIdResolve.java b/proposal/myrmidon/src/testcases/org/apache/myrmidon/components/configurer/data/ConfigTestIdResolve.java new file mode 100644 index 000000000..0de5265df --- /dev/null +++ b/proposal/myrmidon/src/testcases/org/apache/myrmidon/components/configurer/data/ConfigTestIdResolve.java @@ -0,0 +1,42 @@ +/* + * Copyright (C) The Apache Software Foundation. All rights reserved. + * + * This software is published under the terms of the Apache Software License + * version 1.1, a copy of which has been included with this distribution in + * the LICENSE.txt file. + */ +package org.apache.myrmidon.components.configurer.data; + +import java.util.ArrayList; +import java.util.List; +import org.apache.myrmidon.framework.DataType; +import org.apache.myrmidon.components.configurer.DefaultConfigurerTest; + +/** + * A simple test class with string properties. + * + * @author Adam Murdoch + */ +public class ConfigTestIdResolve + implements DataType +{ + private String m_someProp; + + public boolean equals( final Object obj ) + { + final ConfigTestIdResolve test = (ConfigTestIdResolve)obj; + if( !DefaultConfigurerTest.equals( m_someProp, test.m_someProp ) ) + { + return false; + } + else + { + return true; + } + } + + public void setSomeProp( final String value ) + { + m_someProp = value; + } +} diff --git a/proposal/myrmidon/src/testcases/org/apache/myrmidon/components/configurer/data/ConfigTestIgnoreStringMethods.java b/proposal/myrmidon/src/testcases/org/apache/myrmidon/components/configurer/data/ConfigTestIgnoreStringMethods.java new file mode 100644 index 000000000..55c6f5b30 --- /dev/null +++ b/proposal/myrmidon/src/testcases/org/apache/myrmidon/components/configurer/data/ConfigTestIgnoreStringMethods.java @@ -0,0 +1,67 @@ +/* + * Copyright (C) The Apache Software Foundation. All rights reserved. + * + * This software is published under the terms of the Apache Software License + * version 1.1, a copy of which has been included with this distribution in + * the LICENSE.txt file. + */ +package org.apache.myrmidon.components.configurer.data; + +import java.util.ArrayList; +import junit.framework.AssertionFailedError; +import org.apache.myrmidon.components.configurer.ConfigTestStringProps; +import org.apache.myrmidon.components.configurer.DefaultConfigurerTest; +import org.apache.myrmidon.components.configurer.ConfigTestMultiSetter; + +/** + * A test class with multiple setters/adders/creators for a property. + * + * @author Adam Murdoch + */ +public class ConfigTestIgnoreStringMethods +{ + private ConfigTestIgnoreStringMethods m_prop1; + private ArrayList m_prop2 = new ArrayList(); + + public boolean equals( Object obj ) + { + ConfigTestIgnoreStringMethods test = (ConfigTestIgnoreStringMethods)obj; + if( !DefaultConfigurerTest.equals( m_prop1, test.m_prop1 ) ) + { + return false; + } + if( !m_prop2.equals( test.m_prop2 ) ) + { + return false; + } + return true; + } + + // + // Multiple setters + // + + public void addProp1( final String value ) + { + throw new AssertionFailedError(); + } + + public void addProp1( final ConfigTestIgnoreStringMethods value ) + { + m_prop1 = value; + } + + // + // Multiple Adders + // + + public void addProp2( final String value ) + { + throw new AssertionFailedError(); + } + + public void addProp2( final ConfigTestIgnoreStringMethods value ) + { + m_prop2.add( value ); + } +} diff --git a/proposal/myrmidon/src/testcases/org/apache/myrmidon/components/configurer/data/ConfigTestInterfaceAdder.java b/proposal/myrmidon/src/testcases/org/apache/myrmidon/components/configurer/data/ConfigTestInterfaceAdder.java new file mode 100644 index 000000000..48c15109e --- /dev/null +++ b/proposal/myrmidon/src/testcases/org/apache/myrmidon/components/configurer/data/ConfigTestInterfaceAdder.java @@ -0,0 +1,33 @@ +/* + * Copyright (C) The Apache Software Foundation. All rights reserved. + * + * This software is published under the terms of the Apache Software License + * version 1.1, a copy of which has been included with this distribution in + * the LICENSE.txt file. + */ +package org.apache.myrmidon.components.configurer.data; + +import java.util.ArrayList; +import org.apache.myrmidon.components.configurer.MyRole1; + +/** + * A test class with an interface property. + * + * @author Adam Murdoch + * @version $Revision$ $Date$ + */ +public class ConfigTestInterfaceAdder +{ + private final ArrayList m_elems = new ArrayList(); + + public void addPropA( final MyRole1 role1 ) + { + m_elems.add( role1 ); + } + + public boolean equals( Object obj ) + { + final ConfigTestInterfaceAdder test = (ConfigTestInterfaceAdder)obj; + return m_elems.equals( test.m_elems ); + } +} diff --git a/proposal/myrmidon/src/testcases/org/apache/myrmidon/components/configurer/data/ConfigTestMismatchedRefType.java b/proposal/myrmidon/src/testcases/org/apache/myrmidon/components/configurer/data/ConfigTestMismatchedRefType.java new file mode 100644 index 000000000..a00b94df8 --- /dev/null +++ b/proposal/myrmidon/src/testcases/org/apache/myrmidon/components/configurer/data/ConfigTestMismatchedRefType.java @@ -0,0 +1,26 @@ +/* + * Copyright (C) The Apache Software Foundation. All rights reserved. + * + * This software is published under the terms of the Apache Software License + * version 1.1, a copy of which has been included with this distribution in + * the LICENSE.txt file. + */ +package org.apache.myrmidon.components.configurer.data; + +import java.util.ArrayList; +import java.util.List; +import org.apache.myrmidon.framework.DataType; +import org.apache.myrmidon.components.configurer.DefaultConfigurerTest; + +/** + * A simple test class with string properties. + * + * @author Adam Murdoch + */ +public class ConfigTestMismatchedRefType + implements DataType +{ + public void setSomeProp( final String value ) + { + } +} diff --git a/proposal/myrmidon/src/testcases/org/apache/myrmidon/components/configurer/data/ConfigTestMultipleTypedAdder.java b/proposal/myrmidon/src/testcases/org/apache/myrmidon/components/configurer/data/ConfigTestMultipleTypedAdder.java new file mode 100644 index 000000000..c70b8e479 --- /dev/null +++ b/proposal/myrmidon/src/testcases/org/apache/myrmidon/components/configurer/data/ConfigTestMultipleTypedAdder.java @@ -0,0 +1,28 @@ +/* + * Copyright (C) The Apache Software Foundation. All rights reserved. + * + * This software is published under the terms of the Apache Software License + * version 1.1, a copy of which has been included with this distribution in + * the LICENSE.txt file. + */ +package org.apache.myrmidon.components.configurer.data; + +import org.apache.myrmidon.components.configurer.MyRole1; +import org.apache.myrmidon.components.configurer.MyRole2; + +/** + * Simple class with more than one typed adder method. + * + * @author Peter Donald + * @version $Revision$ $Date$ + */ +public class ConfigTestMultipleTypedAdder +{ + public void add( final MyRole1 role1 ) + { + } + + public void add( final MyRole2 role2 ) + { + } +} diff --git a/proposal/myrmidon/src/testcases/org/apache/myrmidon/components/configurer/data/ConfigTestNonInterfaceAdder.java b/proposal/myrmidon/src/testcases/org/apache/myrmidon/components/configurer/data/ConfigTestNonInterfaceAdder.java new file mode 100644 index 000000000..45535c961 --- /dev/null +++ b/proposal/myrmidon/src/testcases/org/apache/myrmidon/components/configurer/data/ConfigTestNonInterfaceAdder.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) The Apache Software Foundation. All rights reserved. + * + * This software is published under the terms of the Apache Software License + * version 1.1, a copy of which has been included with this distribution in + * the LICENSE.txt file. + */ +package org.apache.myrmidon.components.configurer.data; + +/** + * Simple class to test typed adder. + * + * @author Peter Donald + * @version $Revision$ $Date$ + */ +public class ConfigTestNonInterfaceAdder +{ + public void add( final Integer integer ) + { + System.out.println( "This should not have been called as " + + "Integer is not an interface" ); + } +} diff --git a/proposal/myrmidon/src/testcases/org/apache/myrmidon/components/configurer/data/ConfigTestPropResolution.java b/proposal/myrmidon/src/testcases/org/apache/myrmidon/components/configurer/data/ConfigTestPropResolution.java new file mode 100644 index 000000000..6a9e44c56 --- /dev/null +++ b/proposal/myrmidon/src/testcases/org/apache/myrmidon/components/configurer/data/ConfigTestPropResolution.java @@ -0,0 +1,41 @@ +/* + * Copyright (C) The Apache Software Foundation. All rights reserved. + * + * This software is published under the terms of the Apache Software License + * version 1.1, a copy of which has been included with this distribution in + * the LICENSE.txt file. + */ +package org.apache.myrmidon.components.configurer.data; + +import java.util.List; +import java.util.ArrayList; +import org.apache.myrmidon.components.configurer.DefaultConfigurerTest; + +/** + * Simple class to test typed adder. + * + * @author Peter Donald + * @version $Revision$ $Date$ + */ +public class ConfigTestPropResolution +{ + private String m_prop; + + public boolean equals( final Object obj ) + { + final ConfigTestPropResolution test = (ConfigTestPropResolution)obj; + if( !DefaultConfigurerTest.equals( m_prop, test.m_prop ) ) + { + return false; + } + else + { + return true; + } + } + + public void setProp( final String value ) + { + m_prop = value; + } +} diff --git a/proposal/myrmidon/src/testcases/org/apache/myrmidon/components/configurer/data/ConfigTestReferenceAttribute.java b/proposal/myrmidon/src/testcases/org/apache/myrmidon/components/configurer/data/ConfigTestReferenceAttribute.java new file mode 100644 index 000000000..9ec47f727 --- /dev/null +++ b/proposal/myrmidon/src/testcases/org/apache/myrmidon/components/configurer/data/ConfigTestReferenceAttribute.java @@ -0,0 +1,41 @@ +/* + * Copyright (C) The Apache Software Foundation. All rights reserved. + * + * This software is published under the terms of the Apache Software License + * version 1.1, a copy of which has been included with this distribution in + * the LICENSE.txt file. + */ +package org.apache.myrmidon.components.configurer.data; + +import java.util.List; +import java.util.ArrayList; +import org.apache.myrmidon.components.configurer.DefaultConfigurerTest; + +/** + * Simple class to test typed adder. + * + * @author Peter Donald + * @version $Revision$ $Date$ + */ +public class ConfigTestReferenceAttribute +{ + private String m_someProp; + + public boolean equals( final Object obj ) + { + final ConfigTestReferenceAttribute test = (ConfigTestReferenceAttribute)obj; + if( !DefaultConfigurerTest.equals( m_someProp, test.m_someProp ) ) + { + return false; + } + else + { + return true; + } + } + + public void setSomeProp( final String value ) + { + m_someProp = value; + } +} diff --git a/proposal/myrmidon/src/testcases/org/apache/myrmidon/components/configurer/data/ConfigTestReferenceConversion.java b/proposal/myrmidon/src/testcases/org/apache/myrmidon/components/configurer/data/ConfigTestReferenceConversion.java new file mode 100644 index 000000000..27101f389 --- /dev/null +++ b/proposal/myrmidon/src/testcases/org/apache/myrmidon/components/configurer/data/ConfigTestReferenceConversion.java @@ -0,0 +1,35 @@ +/* + * Copyright (C) The Apache Software Foundation. All rights reserved. + * + * This software is published under the terms of the Apache Software License + * version 1.1, a copy of which has been included with this distribution in + * the LICENSE.txt file. + */ +package org.apache.myrmidon.components.configurer.data; + +import java.util.ArrayList; +import java.util.List; +import org.apache.myrmidon.components.configurer.DefaultConfigurerTest; +import org.apache.myrmidon.components.configurer.MyRole1; +import org.apache.myrmidon.components.configurer.ConfigTestInterfaceProp; + +/** + * A simple test class. + * + * @author Adam Murdoch + */ +public class ConfigTestReferenceConversion +{ + private final ArrayList m_elems = new ArrayList(); + + public void setPropA( final MyRole1 role1 ) + { + m_elems.add( role1 ); + } + + public boolean equals( Object obj ) + { + final ConfigTestReferenceConversion test = (ConfigTestReferenceConversion)obj; + return m_elems.equals( test.m_elems ); + } +} diff --git a/proposal/myrmidon/src/testcases/org/apache/myrmidon/components/configurer/data/ConfigTestReferenceElement.java b/proposal/myrmidon/src/testcases/org/apache/myrmidon/components/configurer/data/ConfigTestReferenceElement.java new file mode 100644 index 000000000..4bbb9f893 --- /dev/null +++ b/proposal/myrmidon/src/testcases/org/apache/myrmidon/components/configurer/data/ConfigTestReferenceElement.java @@ -0,0 +1,37 @@ +/* + * Copyright (C) The Apache Software Foundation. All rights reserved. + * + * This software is published under the terms of the Apache Software License + * version 1.1, a copy of which has been included with this distribution in + * the LICENSE.txt file. + */ +package org.apache.myrmidon.components.configurer.data; + +import java.util.ArrayList; +import java.util.List; +import org.apache.myrmidon.components.configurer.DefaultConfigurerTest; + +/** + * A simple test class. + * + * @author Adam Murdoch + */ +public class ConfigTestReferenceElement +{ + private String m_someProp; + + public boolean equals( Object obj ) + { + ConfigTestReferenceElement test = (ConfigTestReferenceElement)obj; + if( !DefaultConfigurerTest.equals( m_someProp, test.m_someProp ) ) + { + return false; + } + return true; + } + + public void addSomeProp( final String value ) + { + m_someProp = value; + } +} diff --git a/proposal/myrmidon/src/testcases/org/apache/myrmidon/components/configurer/data/ConfigTestSetAttribute.java b/proposal/myrmidon/src/testcases/org/apache/myrmidon/components/configurer/data/ConfigTestSetAttribute.java new file mode 100644 index 000000000..cf44c852f --- /dev/null +++ b/proposal/myrmidon/src/testcases/org/apache/myrmidon/components/configurer/data/ConfigTestSetAttribute.java @@ -0,0 +1,51 @@ +/* + * Copyright (C) The Apache Software Foundation. All rights reserved. + * + * This software is published under the terms of the Apache Software License + * version 1.1, a copy of which has been included with this distribution in + * the LICENSE.txt file. + */ +package org.apache.myrmidon.components.configurer.data; + +import java.util.List; +import java.util.ArrayList; +import org.apache.myrmidon.components.configurer.DefaultConfigurerTest; + +/** + * Simple class to test typed adder. + * + * @author Peter Donald + * @version $Revision$ $Date$ + */ +public class ConfigTestSetAttribute +{ + private String m_someProp; + private List m_propList = new ArrayList(); + + public boolean equals( final Object obj ) + { + final ConfigTestSetAttribute test = (ConfigTestSetAttribute)obj; + if( !DefaultConfigurerTest.equals( m_someProp, test.m_someProp ) ) + { + return false; + } + else if( !m_propList.equals( test.m_propList ) ) + { + return false; + } + else + { + return true; + } + } + + public void setSomeProp( final String value ) + { + m_someProp = value; + } + + public void setProp( final String value ) + { + m_propList.add( value ); + } +} diff --git a/proposal/myrmidon/src/testcases/org/apache/myrmidon/components/configurer/data/ConfigTestSetElement.java b/proposal/myrmidon/src/testcases/org/apache/myrmidon/components/configurer/data/ConfigTestSetElement.java new file mode 100644 index 000000000..bc7b503fc --- /dev/null +++ b/proposal/myrmidon/src/testcases/org/apache/myrmidon/components/configurer/data/ConfigTestSetElement.java @@ -0,0 +1,57 @@ +/* + * Copyright (C) The Apache Software Foundation. All rights reserved. + * + * This software is published under the terms of the Apache Software License + * version 1.1, a copy of which has been included with this distribution in + * the LICENSE.txt file. + */ +package org.apache.myrmidon.components.configurer.data; + +import java.util.ArrayList; +import java.util.List; +import org.apache.myrmidon.components.configurer.DefaultConfigurerTest; + +/** + * A simple test class. + * + * @author Adam Murdoch + */ +public class ConfigTestSetElement +{ + private ConfigTestSetElement m_prop; + private List m_propList = new ArrayList(); + private String m_someProp; + + public boolean equals( Object obj ) + { + ConfigTestSetElement test = (ConfigTestSetElement)obj; + if( !DefaultConfigurerTest.equals( m_prop, test.m_prop ) ) + { + return false; + } + else if( !m_propList.equals( test.m_propList ) ) + { + return false; + } + else if( !DefaultConfigurerTest.equals( m_someProp, test.m_someProp ) ) + { + return false; + } + return true; + } + + public void setSomeProp( final String value ) + { + m_someProp = value; + } + + public void addProp( final ConfigTestSetElement test ) + { + m_prop = test; + } + + public void addAnotherProp( final ConfigTestSetElement test ) + { + m_propList.add( test ); + } +} diff --git a/proposal/myrmidon/src/testcases/org/apache/myrmidon/components/configurer/data/ConfigTestTypedAdder.java b/proposal/myrmidon/src/testcases/org/apache/myrmidon/components/configurer/data/ConfigTestTypedAdder.java new file mode 100644 index 000000000..7e1a75333 --- /dev/null +++ b/proposal/myrmidon/src/testcases/org/apache/myrmidon/components/configurer/data/ConfigTestTypedAdder.java @@ -0,0 +1,34 @@ +/* + * Copyright (C) The Apache Software Foundation. All rights reserved. + * + * This software is published under the terms of the Apache Software License + * version 1.1, a copy of which has been included with this distribution in + * the LICENSE.txt file. + */ +package org.apache.myrmidon.components.configurer.data; + +import java.util.ArrayList; +import org.apache.avalon.framework.configuration.Configuration; +import org.apache.myrmidon.components.configurer.MyRole1; + +/** + * Simple class to test adder for Configurations. + * + * @author Peter Donald + * @version $Revision$ $Date$ + */ +public class ConfigTestTypedAdder +{ + private ArrayList m_roles = new ArrayList(); + + public void add( final MyRole1 role ) + { + m_roles.add( role ); + } + + public boolean equals( final Object object ) + { + final ConfigTestTypedAdder other = (ConfigTestTypedAdder)object; + return m_roles.equals( other.m_roles ); + } +} diff --git a/proposal/myrmidon/src/testcases/org/apache/myrmidon/components/configurer/data/ConfigTestTypedAdderConversion.java b/proposal/myrmidon/src/testcases/org/apache/myrmidon/components/configurer/data/ConfigTestTypedAdderConversion.java new file mode 100644 index 000000000..b6a0cb9e8 --- /dev/null +++ b/proposal/myrmidon/src/testcases/org/apache/myrmidon/components/configurer/data/ConfigTestTypedAdderConversion.java @@ -0,0 +1,40 @@ +/* + * Copyright (C) The Apache Software Foundation. All rights reserved. + * + * This software is published under the terms of the Apache Software License + * version 1.1, a copy of which has been included with this distribution in + * the LICENSE.txt file. + */ +package org.apache.myrmidon.components.configurer.data; + +import java.util.ArrayList; +import org.apache.myrmidon.components.configurer.MyRole1; +import org.apache.myrmidon.framework.DataType; + +/** + * Simple class to test typed adder. + * + * @author Peter Donald + * @version $Revision$ $Date$ + */ +public class ConfigTestTypedAdderConversion + implements DataType +{ + private ArrayList m_roles = new ArrayList(); + private String m_prop; + + public void setProp( final String prop ) + { + m_prop = prop; + } + public void add( final MyRole1 role1 ) + { + m_roles.add( role1 ); + } + + public boolean equals( final Object object ) + { + final ConfigTestTypedAdderConversion other = (ConfigTestTypedAdderConversion)object; + return m_roles.equals( other.m_roles ); + } +} diff --git a/proposal/myrmidon/src/testcases/org/apache/myrmidon/components/configurer/data/ConfigTestTypedAdderReference.java b/proposal/myrmidon/src/testcases/org/apache/myrmidon/components/configurer/data/ConfigTestTypedAdderReference.java new file mode 100644 index 000000000..20a9c403f --- /dev/null +++ b/proposal/myrmidon/src/testcases/org/apache/myrmidon/components/configurer/data/ConfigTestTypedAdderReference.java @@ -0,0 +1,33 @@ +/* + * Copyright (C) The Apache Software Foundation. All rights reserved. + * + * This software is published under the terms of the Apache Software License + * version 1.1, a copy of which has been included with this distribution in + * the LICENSE.txt file. + */ +package org.apache.myrmidon.components.configurer.data; + +import java.util.ArrayList; +import org.apache.myrmidon.components.configurer.MyRole1; + +/** + * Simple class to test typed adder. + * + * @author Peter Donald + * @version $Revision$ $Date$ + */ +public class ConfigTestTypedAdderReference +{ + private ArrayList m_roles = new ArrayList(); + + public void add( final MyRole1 role1 ) + { + m_roles.add( role1 ); + } + + public boolean equals( final Object object ) + { + final ConfigTestTypedAdderReference other = (ConfigTestTypedAdderReference)object; + return m_roles.equals( other.m_roles ); + } +} diff --git a/proposal/myrmidon/src/testcases/org/apache/myrmidon/components/configurer/data/ConfigTestTypedAdderRole.java b/proposal/myrmidon/src/testcases/org/apache/myrmidon/components/configurer/data/ConfigTestTypedAdderRole.java new file mode 100644 index 000000000..ed950288a --- /dev/null +++ b/proposal/myrmidon/src/testcases/org/apache/myrmidon/components/configurer/data/ConfigTestTypedAdderRole.java @@ -0,0 +1,33 @@ +/* + * Copyright (C) The Apache Software Foundation. All rights reserved. + * + * This software is published under the terms of the Apache Software License + * version 1.1, a copy of which has been included with this distribution in + * the LICENSE.txt file. + */ +package org.apache.myrmidon.components.configurer.data; + +import java.util.ArrayList; +import org.apache.myrmidon.components.configurer.MyRole1; + +/** + * Simple class to test typed adder. + * + * @author Peter Donald + * @version $Revision$ $Date$ + */ +public class ConfigTestTypedAdderRole +{ + private ArrayList m_roles = new ArrayList(); + + public void add( final MyRole1 role1 ) + { + m_roles.add( role1 ); + } + + public boolean equals( final Object object ) + { + final ConfigTestTypedAdderRole other = (ConfigTestTypedAdderRole)object; + return m_roles.equals( other.m_roles ); + } +} diff --git a/proposal/myrmidon/src/testcases/org/apache/myrmidon/components/configurer/data/ConfigTestTypedConfigAdder.java b/proposal/myrmidon/src/testcases/org/apache/myrmidon/components/configurer/data/ConfigTestTypedConfigAdder.java new file mode 100644 index 000000000..790687fb8 --- /dev/null +++ b/proposal/myrmidon/src/testcases/org/apache/myrmidon/components/configurer/data/ConfigTestTypedConfigAdder.java @@ -0,0 +1,33 @@ +/* + * Copyright (C) The Apache Software Foundation. All rights reserved. + * + * This software is published under the terms of the Apache Software License + * version 1.1, a copy of which has been included with this distribution in + * the LICENSE.txt file. + */ +package org.apache.myrmidon.components.configurer.data; + +import java.util.ArrayList; +import org.apache.avalon.framework.configuration.Configuration; + +/** + * Simple class to test adder for Configurations. + * + * @author Peter Donald + * @version $Revision$ $Date$ + */ +public class ConfigTestTypedConfigAdder +{ + private ArrayList m_configurations = new ArrayList(); + + public void add( final Configuration configuration ) + { + m_configurations.add( configuration ); + } + + public boolean equals( final Object object ) + { + final ConfigTestTypedConfigAdder other = (ConfigTestTypedConfigAdder)object; + return m_configurations.equals( other.m_configurations ); + } +} diff --git a/proposal/myrmidon/src/testcases/org/apache/myrmidon/components/configurer/data/ConfigTestUnknownReference.java b/proposal/myrmidon/src/testcases/org/apache/myrmidon/components/configurer/data/ConfigTestUnknownReference.java new file mode 100644 index 000000000..32d17784b --- /dev/null +++ b/proposal/myrmidon/src/testcases/org/apache/myrmidon/components/configurer/data/ConfigTestUnknownReference.java @@ -0,0 +1,26 @@ +/* + * Copyright (C) The Apache Software Foundation. All rights reserved. + * + * This software is published under the terms of the Apache Software License + * version 1.1, a copy of which has been included with this distribution in + * the LICENSE.txt file. + */ +package org.apache.myrmidon.components.configurer.data; + +import java.util.ArrayList; +import java.util.List; +import org.apache.myrmidon.framework.DataType; +import org.apache.myrmidon.components.configurer.DefaultConfigurerTest; + +/** + * A simple test class with string properties. + * + * @author Adam Murdoch + */ +public class ConfigTestUnknownReference + implements DataType +{ + public void setSomeProp( final String value ) + { + } +}