1 17 package org.apache.tools.ant.taskdefs.optional; 18 19 import java.util.Vector ; 20 import org.apache.tools.ant.BuildException; 21 import org.apache.tools.ant.taskdefs.Java; 22 23 32 public class Test extends Java { 33 34 protected Vector m_tests = new Vector (); 35 36 37 40 protected static final class TestletEntry { 41 42 protected String m_testname = ""; 43 44 45 46 public void addText(final String testname) { 47 m_testname += testname; 48 } 49 50 51 public String toString() { 52 return m_testname; 53 } 54 } 55 56 57 public Test() { 58 setClassname("org.apache.testlet.engine.TextTestEngine"); 59 } 60 61 62 65 public TestletEntry createTestlet() { 66 final TestletEntry entry = new TestletEntry(); 67 68 m_tests.addElement(entry); 69 return entry; 70 } 71 72 73 77 78 public void setShowSuccess(final boolean showSuccess) { 79 createArg().setValue("-s=" + showSuccess); 80 } 81 82 83 87 public void setShowBanner(final String showBanner) { 88 createArg().setValue("-b=" + showBanner); 89 } 90 91 92 96 public void setShowTrace(final boolean showTrace) { 97 createArg().setValue("-t=" + showTrace); 98 } 99 100 101 public void setForceShowTrace(final boolean forceShowTrace) { 102 createArg().setValue("-f=" + forceShowTrace); 103 } 104 105 106 public void execute() 107 throws BuildException { 108 109 final int size = m_tests.size(); 110 111 for (int i = 0; i < size; i++) { 112 createArg().setValue(m_tests.elementAt(i).toString()); 113 } 114 115 super.execute(); 116 } 117 } 118 119 120 | Popular Tags |