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/antlib/selftest ConfigurationTest.java ContentTest.java ExtensionsTest.java PrimitiveTypesTest.java SubElementTest.java
Date Mon, 17 Dec 2001 09:21:40 GMT
donaldp     01/12/17 01:21:40

  Added:       proposal/myrmidon/src/java/org/apache/antlib/selftest
                        ConfigurationTest.java ContentTest.java
                        ExtensionsTest.java PrimitiveTypesTest.java
                        SubElementTest.java
  Log:
  Move selftesting task library into new package structure.
  
  Revision  Changes    Path
  1.1                  jakarta-ant/proposal/myrmidon/src/java/org/apache/antlib/selftest/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.antlib.selftest;
  
  import org.apache.avalon.framework.configuration.Configurable;
  import org.apache.avalon.framework.configuration.Configuration;
  import org.apache.avalon.framework.configuration.ConfigurationException;
  import org.apache.myrmidon.api.AbstractTask;
  import org.apache.myrmidon.api.TaskException;
  import org.apache.myrmidon.framework.AbstractContainerTask;
  
  /**
   * This is to test self interpretation of configuration.
   *
   * @author <a href="mailto:peter@apache.org">Peter Donald</a>
   */
  public class ConfigurationTest
      extends AbstractContainerTask
      implements Configurable
  {
      private String              m_message;
  
      public void configure( final Configuration configuration )
          throws ConfigurationException
      {
          final String message = configuration.getAttribute( "message" );
          final Object object = resolve( message );
  
          if( object instanceof String )
          {
              m_message = (String)object;
          }
          else
          {
              m_message = object.toString();
          }
      }
  
      public void execute()
          throws TaskException
      {
          getLogger().warn( m_message );
      }
  }
  
  
  
  1.1                  jakarta-ant/proposal/myrmidon/src/java/org/apache/antlib/selftest/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.antlib.selftest;
  
  import org.apache.myrmidon.api.AbstractTask;
  import org.apache.myrmidon.api.TaskException;
  
  /**
   * This is to test whether content is added.
   *
   * @author <a href="mailto:peter@apache.org">Peter Donald</a>
   */
  public class ContentTest
      extends AbstractTask
  {
      public void addContent( final Integer value )
      {
          getLogger().warn( "Integer content: " + value );
      }
  
      /*
        public void addContent( final String blah )
        {
        System.out.println( "String content: " + blah );
        }
      */
  
      public void execute()
          throws TaskException
      {
      }
  }
  
  
  
  1.1                  jakarta-ant/proposal/myrmidon/src/java/org/apache/antlib/selftest/ExtensionsTest.java
  
  Index: ExtensionsTest.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.antlib.selftest;
  
  import org.apache.myrmidon.api.AbstractTask;
  import org.apache.myrmidon.api.TaskException;
  import org.apache.antlib.selftest.extension1.ExtensionsLoadedClass;
  
  /**
   * This is to test whether extension is loaded.
   *
   * @author <a href="mailto:peter@apache.org">Peter Donald</a>
   */
  public class ExtensionsTest
      extends AbstractTask
  {
      public void execute()
          throws TaskException
      {
          ExtensionsLoadedClass.doSomething();
      }
  }
  
  
  
  1.1                  jakarta-ant/proposal/myrmidon/src/java/org/apache/antlib/selftest/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.antlib.selftest;
  
  import org.apache.myrmidon.api.AbstractTask;
  import org.apache.myrmidon.api.TaskException;
  
  /**
   * Test conversion of all the primitive types.
   *
   * @author <a href="mailto:peter@apache.org">Peter Donald</a>
   */
  public class PrimitiveTypesTest
      extends AbstractTask
  {
      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 execute()
          throws TaskException
      {
      }
  }
  
  
  
  1.1                  jakarta-ant/proposal/myrmidon/src/java/org/apache/antlib/selftest/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.antlib.selftest;
  
  import org.apache.myrmidon.api.AbstractTask;
  import org.apache.myrmidon.api.TaskException;
  
  /**
   * Test sub-elements addition.
   *
   * @author <a href="mailto:peter@apache.org">Peter Donald</a>
   */
  public class SubElementTest
      extends AbstractTask
  {
      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 execute()
          throws TaskException
      {
      }
  }
  
  
  

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message