diff -r 69f5314b6791 java.j2seproject/nbproject/project.properties
--- a/java.j2seproject/nbproject/project.properties Wed Feb 29 13:42:26 2012 +0100
+++ b/java.j2seproject/nbproject/project.properties Thu Mar 01 04:22:26 2012 +0100
@@ -52,5 +52,6 @@
test-unit-sys-prop.test.bridge.jar=${cluster}/ant/nblib/bridge.jar
test-unit-sys-prop.test.ant.home=${cluster}/ant
test-unit-sys-prop.test.junit.jar=${nb_all}/libs.junit4/external/junit-4.10.jar
+test-unit-sys-prop.test.testng.jar=${nb_all}/testng/external/testng-6.4.1beta.jar
extra.module.files=ant/extra/org-netbeans-modules-java-j2seproject-copylibstask.jar
jnlp.indirect.jars=ant/extra/org-netbeans-modules-java-j2seproject-copylibstask.jar
diff -r 69f5314b6791 java.j2seproject/src/org/netbeans/modules/java/j2seproject/resources/build-impl.xsl
--- a/java.j2seproject/src/org/netbeans/modules/java/j2seproject/resources/build-impl.xsl Wed Feb 29 13:42:26 2012 +0100
+++ b/java.j2seproject/src/org/netbeans/modules/java/j2seproject/resources/build-impl.xsl Thu Mar 01 04:22:26 2012 +0100
@@ -2,7 +2,7 @@
- tests.failed
- tests.failed
- ${build.dir}
+
+
+
+ test.bag
+ @{includes}
+ @{testincludes}
+ @{excludes}
+
+
+ mixed
+ true
+ ${work.dir}
+ tests.failed
+ @{testmethods}
+ test.bag
+ ${build.test.results.dir}
+
+ TestNG tests
${platform.java}
-
-
-
- @{includes}
- @{testincludes}
- @{excludes}
-
-
-
+
-
-
-
-
+
+
-
-
+
+
+
+
+
+
+
+ test-debug
+ http://www.netbeans.org/ns/j2se-project/3
+
+ testClass
+ ${main.class}
+
+
+ testMethod
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -1012,7 +1049,7 @@
- -pre-init,-init-private,-init-libraries,-init-user,-init-project,-do-init,-post-init,-init-check,-init-macrodef-property,-init-macrodef-javac,-init-macrodef-junit,-init-macrodef-nbjpda,-init-macrodef-debug,-init-macrodef-java,-init-presetdef-jar,-init-ap-cmdline
+ -pre-init,-init-private,-init-libraries,-init-user,-init-project,-do-init,-post-init,-init-check,-init-macrodef-property,-init-macrodef-javac,-init-macrodef-test,-init-macrodef-test-debug,-init-macrodef-nbjpda,-init-macrodef-debug,-init-macrodef-java,-init-presetdef-jar,-init-ap-cmdline
@@ -1515,21 +1552,31 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
-
+
-
-
-
-
+
+
@@ -1628,7 +1675,7 @@
=========================
- JUNIT COMPILATION SECTION
+ TEST COMPILATION SECTION
=========================
@@ -1736,7 +1783,7 @@
=======================
- JUNIT EXECUTION SECTION
+ TEST EXECUTION SECTION
=======================
@@ -1749,7 +1796,7 @@
have.tests
init,compile-test,-pre-test-run
-
+
@@ -1794,7 +1841,7 @@
have.tests
init,compile-test-single,-pre-test-run-single
Must select some files in the IDE or set test.includes
-
+
@@ -1810,7 +1857,7 @@
=======================
- JUNIT DEBUGGING SECTION
+ TEST DEBUGGING SECTION
=======================
@@ -1818,22 +1865,9 @@
have.tests
init,compile-test
Must select one file in the IDE or set test.class
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
+
@@ -2070,8 +2104,12 @@
+
+
+
+
${}
diff -r 69f5314b6791 java.j2seproject/test/unit/src/org/netbeans/modules/java/j2seproject/BuildImplTest.java
--- a/java.j2seproject/test/unit/src/org/netbeans/modules/java/j2seproject/BuildImplTest.java Wed Feb 29 13:42:26 2012 +0100
+++ b/java.j2seproject/test/unit/src/org/netbeans/modules/java/j2seproject/BuildImplTest.java Thu Mar 01 04:22:26 2012 +0100
@@ -90,6 +90,7 @@
}
private File junitJar;
+ private File testNGJar;
@Override protected Level logLevel() {
return Level.FINE;
@@ -105,6 +106,10 @@
assertNotNull("must set test.junit.jar", junitJarProp);
junitJar = new File(junitJarProp);
assertTrue("file " + junitJar + " exists", junitJar.isFile());
+ String tngJarProp = System.getProperty("test.testng.jar");
+ assertNotNull("must set test.testng.jar", tngJarProp);
+ testNGJar = new File(tngJarProp);
+ assertTrue("file " + testNGJar + " exists", testNGJar.isFile());
MockLookup.setLayersAndInstances(new IOP(), new IFL());
}
@@ -156,7 +161,7 @@
private Properties getProperties() {
Properties p = new Properties();
- p.setProperty("libs.junit.classpath", junitJar.getAbsolutePath());
+ p.setProperty("libs.junit.classpath", testNGJar.getAbsolutePath() + ":" + junitJar.getAbsolutePath());
return p;
}
@@ -613,7 +618,8 @@
p.setProperty("javac.includes", "pkg/SomeTest.java");
p.setProperty("test.includes", "pkg/SomeTest.java");
assertBuildSuccess(ActionUtils.runTarget(buildXml, new String[] {"test-single"}, p));
- assertOutput("Testsuite: pkg.SomeTest");
+ assertTrue("wrong default suite name", output.contains("testRunSingleTestWithDep"));
+ assertTrue("wrong tests executed", output.contains("Total tests run: 1, Failures: 0, Skips: 0"));
}
public void testSubprojects() throws Exception {