diff -r 69f5314b6791 -r 954bbd3f3558 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 Mon Mar 19 20:12:34 2012 +0100
@@ -1,6 +1,6 @@
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
#
-# Copyright 1997-2010 Oracle and/or its affiliates. All rights reserved.
+# Copyright 1997-2012 Oracle and/or its affiliates. All rights reserved.
#
# Oracle and Java are registered trademarks of Oracle and/or its affiliates.
# Other names may be trademarks of their respective owners.
@@ -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}/libs.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 -r 954bbd3f3558 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 Mon Mar 19 20:12:34 2012 +0100
@@ -2,7 +2,7 @@
+ tests.failed
+ tests.failed
+ ${build.dir}
+
+ ${platform.java}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ junit
+ http://www.netbeans.org/ns/j2se-project/3
+
+ includes
+ ${includes}
+
+
+ excludes
+ ${excludes}
+
+
+ testincludes
+ **
+
+
+ testmethods
+
+
+
+ customize
+ true
+
@@ -700,23 +797,387 @@
@{excludes}
-
-
-
-
-
+
+
+
+
+
+ testng
+ http://www.netbeans.org/ns/j2se-project/3
+
+ includes
+ ${includes}
+
+
+ excludes
+ ${excludes}
+
+
+ testincludes
+ **
+
+
+ testmethods
+
+
+
+ customize
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ${testng.mode}
+ true
+ ${work.dir}
+ tests.failed
+ ${testng.methods.arg}
+ ${build.test.results.dir}
+
+ TestNG tests
+
+ ${platform.java}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ test-impl
+ http://www.netbeans.org/ns/j2se-project/3
+
+ includes
+ ${includes}
+
+
+ excludes
+ ${excludes}
+
+
+ testincludes
+ **
+
+
+ testmethods
+
+
+
+ customize
+ true
+ true
+
+
+ No tests executed.
+
+
+
+
+
+
+ test-impl
+ http://www.netbeans.org/ns/j2se-project/3
+
+ includes
+ ${includes}
+
+
+ excludes
+ ${excludes}
+
+
+ testincludes
+ **
+
+
+ testmethods
+
+
+
+ customize
+ true
+ true
+
+
+
+
+
+
+
+
+
+
+
+ test-impl
+ http://www.netbeans.org/ns/j2se-project/3
+
+ includes
+ ${includes}
+
+
+ excludes
+ ${excludes}
+
+
+ testincludes
+ **
+
+
+ testmethods
+
+
+
+ customize
+ true
+ true
+
+
+
+
+
+
+
+
+
+
+
+ test
+ http://www.netbeans.org/ns/j2se-project/3
+
+ includes
+ ${includes}
+
+
+ excludes
+ ${excludes}
+
+
+ testincludes
+ **
+
+
+ testmethods
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ junit-debug
+ http://www.netbeans.org/ns/j2se-project/3
+
+ testClass
+ ${main.class}
+
+
+ testMethod
+
+
+
+ customize2
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ test-debug-impl
+ http://www.netbeans.org/ns/j2se-project/3
+
+ testClass
+ ${main.class}
+
+
+ testMethod
+
+
+
+ customize2
+ true
+ true
+
+
+
+
+
+
+
+
+
+
+
+ testng-debug
+ http://www.netbeans.org/ns/j2se-project/3
+
+ testClass
+ ${main.class}
+
+
+ testMethod
+
+
+
+ customize2
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ test-debug-impl
+ http://www.netbeans.org/ns/j2se-project/3
+
+ testClass
+ ${main.class}
+
+
+ testMethod
+
+
+
+ customize2
+ true
+ true
+
+
+
+
+
+
+
+
+
+
+
+ test-debug
+ http://www.netbeans.org/ns/j2se-project/3
+
+ testClass
+ ${main.class}
+
+
+ testMethod
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -1012,7 +1473,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
@@ -1628,7 +2089,7 @@
=========================
- JUNIT COMPILATION SECTION
+ TEST COMPILATION SECTION
=========================
@@ -1736,7 +2197,7 @@
=======================
- JUNIT EXECUTION SECTION
+ TEST EXECUTION SECTION
=======================
@@ -1749,7 +2210,7 @@
have.tests
init,compile-test,-pre-test-run
-
+
@@ -1794,7 +2255,7 @@
have.tests
init,compile-test-single,-pre-test-run-single
Must select some files in the IDE or set test.includes
-
+
@@ -1808,9 +2269,28 @@
Run single unit test.
+
+ have.tests
+ init,compile-test-single,-pre-test-run-single
+ Must select some files in the IDE or set test.class
+ Must select some method in the IDE or set test.method
+
+
+
+
+ have.tests
+ init,compile-test-single,-pre-test-run-single,-do-test-run-single-method
+ Some tests failed; see details above.
+
+
+
+ init,compile-test-single,-pre-test-run-single,-do-test-run-single-method,-post-test-run-single-method
+ Run single unit test.
+
+
=======================
- JUNIT DEBUGGING SECTION
+ TEST DEBUGGING SECTION
=======================
@@ -1818,24 +2298,16 @@
have.tests
init,compile-test
Must select one file in the IDE or set test.class
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+ have.tests
+ init,compile-test
+ Must select one file in the IDE or set test.class
+
+
+
netbeans.home+have.tests
init,compile-test
@@ -1846,6 +2318,10 @@
init,compile-test-single,-debug-start-debugger-test,-debug-start-debuggee-test
+
+ init,compile-test-single,-debug-start-debugger-test,-debug-start-debuggee-test-method
+
+
netbeans.home
init,-pre-debug-fix,compile-test-single
@@ -2070,6 +2546,7 @@
+
${}
@@ -2084,6 +2561,7 @@
+
diff -r 69f5314b6791 -r 954bbd3f3558 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 Mon Mar 19 20:12:34 2012 +0100
@@ -1,7 +1,7 @@
/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
- * Copyright 1997-2010 Oracle and/or its affiliates. All rights reserved.
+ * Copyright 1997-2012 Oracle and/or its affiliates. All rights reserved.
*
* Oracle and Java are registered trademarks of Oracle and/or its affiliates.
* Other names may be trademarks of their respective owners.
@@ -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 {