ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dona...@apache.org
Subject cvs commit: jakarta-ant/proposal/myrmidon/src/java/org/apache/ant/modules/test ConfigurationTest.java ContentTest.java PrimitiveTypesTest.java SubElementTest.java
Date Wed, 07 Feb 2001 05:36:47 GMT
donaldp     01/02/06 21:36:47

  Added:       proposal/myrmidon/src/java/org/apache/ant/modules/test
                        ConfigurationTest.java ContentTest.java
                        PrimitiveTypesTest.java SubElementTest.java
  Log:
  Package used to hold test cases for features of task engine
  
  Revision  Changes    Path
  1.1                  jakarta-ant/proposal/myrmidon/src/java/org/apache/ant/modules/test/ConfigurationTest.java
  
  Index: ConfigurationTest.java
  ===================================================================
  /*
   * 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 <a href="mailto:donaldp@apache.org">Peter Donald</a>
   */
  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 );
      }
  }
  
  
  
  1.1                  jakarta-ant/proposal/myrmidon/src/java/org/apache/ant/modules/test/ContentTest.java
  
  Index: ContentTest.java
  ===================================================================
  /*
   * 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 <a href="mailto:donaldp@apache.org">Peter Donald</a>
   */
  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
      {
      }
  }
  
  
  
  1.1                  jakarta-ant/proposal/myrmidon/src/java/org/apache/ant/modules/test/PrimitiveTypesTest.java
  
  Index: PrimitiveTypesTest.java
  ===================================================================
  
  /*
   * 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 <a href="mailto:donaldp@apache.org">Peter Donald</a>
   */
  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
      {
      }
  }
  
  
  
  1.1                  jakarta-ant/proposal/myrmidon/src/java/org/apache/ant/modules/test/SubElementTest.java
  
  Index: SubElementTest.java
  ===================================================================
  /*
   * 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 <a href="mailto:donaldp@apache.org">Peter Donald</a>
   */
  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
      {
      }
  }
  
  
  

Mime
View raw message