avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dona...@apache.org
Subject cvs commit: jakarta-avalon-testlet/src/java/org/apache/testlet/engine/ant Test.java
Date Mon, 02 Apr 2001 02:06:36 GMT
donaldp     01/04/01 19:06:36

  Added:       src/java/org/apache/testlet/engine/ant Test.java
  Log:
  Add in new ant task here so that taskdefs will work inside build.xmls
  
  Revision  Changes    Path
  1.1                  jakarta-avalon-testlet/src/java/org/apache/testlet/engine/ant/Test.java
  
  Index: Test.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.testlet.engine.ant;
   
  import java.util.Vector;
  import org.apache.tools.ant.BuildException; 
  import org.apache.tools.ant.taskdefs.Java;  
   
  /** 
   * 
   * @author <a href="mailto:donaldp@apache.org">Peter Donald</a> 
   */ 
  public class Test 
      extends Java {
   
      protected Vector                          m_tests            = new Vector();
  
      protected static final class TestletEntry {
  
          protected String m_testname = "";
  
          public void addText( final String testname ) {
              m_testname += testname;
          }
  
          public String toString() {
              return m_testname;
          }
      }
  
      public Test() {
          setClassname( "org.apache.testlet.engine.TextTestEngine" );
      }
  
      public TestletEntry createTestlet() {
          final TestletEntry entry = new TestletEntry();
          m_tests.addElement( entry );
          return entry;
      }
   
      public void setShowSuccess( final boolean showSuccess ) {
          createArg().setValue( "-s=" + showSuccess );
      } 
   
      public void setShowBanner( final String showBanner ) { 
          createArg().setValue( "-b=" + showBanner );
      } 
   
      public void setShowTrace( final boolean showTrace ) {
          createArg().setValue( "-t=" + showTrace );
      } 
   
      public void setForceShowTrace( final boolean forceShowTrace ) { 
          createArg().setValue( "-f=" + forceShowTrace );
      } 
   
      public void execute() 
          throws BuildException  { 
  
          final int size = m_tests.size();
  
          for( int i = 0; i < size; i ++ ) {
              createArg().setValue( m_tests.elementAt( i ).toString() );
          }
  
          super.execute();
      } 
  } 
   
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: avalon-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: avalon-dev-help@jakarta.apache.org


Mime
View raw message