ASF Bugzilla – Attachment 17809 Details for
Bug 38811
Support JUnit 4
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
Manual test case
ant38799-test.sh (text/plain), 3.13 KB, created by
Jesse Glick
on 2006-02-28 22:06:42 UTC
(
hide
)
Description:
Manual test case
Filename:
MIME Type:
Creator:
Jesse Glick
Created:
2006-02-28 22:06:42 UTC
Size:
3.13 KB
patch
obsolete
>#!/bin/sh >ant165=/space/ant165 >ant17=/space/src/ant/dist >junit3=/space/src/nb_all/junit/external/junit-3.8.1.jar >junit4=/space/misclibs/junit4.0/junit-4.0.jar >jdk4=/space/jdk1.4 >jdk5=/space/jdk1.5 >cd /tmp >cat > OxymoronTest.java <<'EOF' >public class OxymoronTest extends junit.framework.TestCase { > public OxymoronTest(String name) { > super(name); > } > public void testOxymoron() { > assertTrue("truth", true); > } > public void testNonsense() { > assertTrue("mistake", false); > } > public void testBogosity() { > throw new NullPointerException("oops"); > } >} >EOF >$jdk4/bin/javac -classpath $junit3 OxymoronTest.java || exit >cat > OxymoronTest4.java <<'EOF' >public class OxymoronTest4 { > @org.junit.Test > public void oxymoron() { > org.junit.Assert.assertTrue("truth", true); > } > @org.junit.Test > public void nonsense() { > org.junit.Assert.assertTrue("mistake", false); > } > @org.junit.Test > public void bogosity() { > throw new NullPointerException("oops"); > } >} >EOF >$jdk5/bin/javac -classpath $junit4 OxymoronTest4.java || exit >cat > Formatter.java <<'EOF' >import junit.framework.*; >import java.io.OutputStream; >import org.apache.tools.ant.BuildException; >import org.apache.tools.ant.taskdefs.optional.junit.*; >public class Formatter implements JUnitResultFormatter { > public void startTestSuite(JUnitTest suite) throws BuildException {} > public void endTestSuite(JUnitTest suite) throws BuildException {} > public void setOutput(OutputStream out) {} > public void setSystemOutput(String out) {} > public void setSystemError(String err) {} > public void startTest(Test t) {} > public void endTest(Test t) {} > public void addFailure(Test t, AssertionFailedError e) {} > public void addError(Test t, Throwable e) {} >} >EOF >$jdk4/bin/javac -classpath $junit3:$ant165/lib/ant-junit.jar:$ant165/lib/ant.jar Formatter.java || exit >cat > runsometest.xml <<'EOF' ><project name="runsometest" default="test"> > <target name="test"> > <junit fork="${fork}" showoutput="true"> > <test name="OxymoronTest"/> > <test name="OxymoronTest4"/> > <classpath> > <pathelement location="."/> > <pathelement location="${junit.jar}"/> > </classpath> > <formatter usefile="false" type="plain"/> > <formatter classname="Formatter" extension="" if="formatter"/> > </junit> > </target> ></project> >EOF >for ant in $ant165 $ant17 > do > for junit in $junit3 $junit4 > do > for jdk in $jdk4 $jdk5 > do ># for explicitcp in "" "-Djunit.jar=$junit" > for explicitcp in "" > do ># for syscp in "" $junit > for syscp in $junit > do ># for fork in true false > for fork in true > do ># for formatter in "" "-Dformatter=true" > for formatter in "" > do > cmd="CLASSPATH=$syscp JAVA_HOME=$jdk $ant/bin/ant -f runsometest.xml -Dfork=$fork $explicitcp $formatter" > echo ----------------------------------------------------------- > echo "$cmd" > echo ----------------------------------------------------------- > eval "$cmd" > echo > done > done > done > done > done > done >done
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 38811
: 17809