diff --git a/proposal/myrmidon/src/java/org/apache/ant/modules/test/ConfigurationTest.java b/proposal/myrmidon/src/java/org/apache/ant/modules/test/ConfigurationTest.java new file mode 100644 index 000000000..3090fc155 --- /dev/null +++ b/proposal/myrmidon/src/java/org/apache/ant/modules/test/ConfigurationTest.java @@ -0,0 +1,47 @@ +/* + * 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 file. + */ +package org.apache.ant.modules.test; + +import org.apache.ant.AntException; +import org.apache.ant.configuration.Configurable; +import org.apache.ant.configuration.Configuration; +import org.apache.ant.tasklet.AbstractTasklet; +import org.apache.avalon.ConfigurationException; + +/** + * This is to test self interpretation of configuration. + * + * @author Peter Donald + */ +public class ConfigurationTest + extends AbstractTasklet + implements Configurable +{ + protected String m_message; + + public void configure( final Configuration configuration ) + throws ConfigurationException + { + String message = configuration.getAttribute( "message" ); + final Object object = getContext().resolveValue( message ); + if( object instanceof String ) + { + m_message = (String)object; + } + else + { + m_message = object.toString(); + } + } + + public void run() + throws AntException + { + getLogger().warn( m_message ); + } +} diff --git a/proposal/myrmidon/src/java/org/apache/ant/modules/test/ContentTest.java b/proposal/myrmidon/src/java/org/apache/ant/modules/test/ContentTest.java new file mode 100644 index 000000000..4cc24b290 --- /dev/null +++ b/proposal/myrmidon/src/java/org/apache/ant/modules/test/ContentTest.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 file. + */ +package org.apache.ant.modules.test; + +import org.apache.ant.AntException; +import org.apache.ant.tasklet.AbstractTasklet; + +/** + * This is to test whether content is added. + * + * @author Peter Donald + */ +public class ContentTest + extends AbstractTasklet +{ + public void addContent( final Integer value ) + { + getLogger().warn( "Integer content: " + value ); + } + + /* + public void addContent( final String blah ) + { + System.out.println( "String: " + blah ); + } + */ + + public void run() + throws AntException + { + } +} diff --git a/proposal/myrmidon/src/java/org/apache/ant/modules/test/PrimitiveTypesTest.java b/proposal/myrmidon/src/java/org/apache/ant/modules/test/PrimitiveTypesTest.java new file mode 100644 index 000000000..87a078b4a --- /dev/null +++ b/proposal/myrmidon/src/java/org/apache/ant/modules/test/PrimitiveTypesTest.java @@ -0,0 +1,91 @@ + +/* + * 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 file. + */ +package org.apache.ant.modules.test; + +import org.apache.ant.AntException; +import org.apache.ant.tasklet.AbstractTasklet; + +/** + * Test conversion of all the primitive types. + * + * @author Peter Donald + */ +public class PrimitiveTypesTest + extends AbstractTasklet +{ + public void setInteger( final Integer value ) + { + getLogger().warn( "setInteger( " + value + " );" ); + } + + public void setInteger2( final int value ) + { + getLogger().warn( "setInteger2( " + value + " );" ); + } + + public void setShort( final Short value ) + { + getLogger().warn( "setShort( " + value + " );" ); + } + + public void setShort2( final short value ) + { + getLogger().warn( "setShort2( " + value + " );" ); + } + + public void setByte( final Byte value ) + { + getLogger().warn( "setByte( " + value + " );" ); + } + + public void setByte2( final byte value ) + { + getLogger().warn( "setByte2( " + value + " );" ); + } + + public void setLong( final Long value ) + { + getLogger().warn( "setLong( " + value + " );" ); + } + + public void setLong2( final long value ) + { + getLogger().warn( "setLong2( " + value + " );" ); + } + + public void setFloat( final Float value ) + { + getLogger().warn( "setFloat( " + value + " );" ); + } + + public void setFloat2( final float value ) + { + getLogger().warn( "setFloat2( " + value + " );" ); + } + + public void setDouble( final Double value ) + { + getLogger().warn( "setDouble( " + value + " );" ); + } + + public void setDouble2( final double value ) + { + getLogger().warn( "setDouble2( " + value + " );" ); + } + + public void setString( final String value ) + { + getLogger().warn( "setString( " + value + " );" ); + } + + public void run() + throws AntException + { + } +} diff --git a/proposal/myrmidon/src/java/org/apache/ant/modules/test/SubElementTest.java b/proposal/myrmidon/src/java/org/apache/ant/modules/test/SubElementTest.java new file mode 100644 index 000000000..c02123e5b --- /dev/null +++ b/proposal/myrmidon/src/java/org/apache/ant/modules/test/SubElementTest.java @@ -0,0 +1,44 @@ +/* + * 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 file. + */ +package org.apache.ant.modules.test; + +import org.apache.ant.AntException; +import org.apache.ant.tasklet.AbstractTasklet; + +/** + * Test sub-elements addition. + * + * @author Peter Donald + */ +public class SubElementTest + extends AbstractTasklet +{ + public static final class Beep + { + public void setMessage( final String string ) + { + System.out.println( string ); + } + } + + public Beep createCreateBeep() + { + System.out.println( "createCreateBeep()" ); + return new Beep(); + } + + public void addAddBeep( final Beep beep ) + { + System.out.println( "addBeeper(" + beep + ");" ); + } + + public void run() + throws AntException + { + } +}