diff -r 69f5314b6791 -r e46792d3fa86 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 Tue Mar 13 13:56:32 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}/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 e46792d3fa86 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 Tue Mar 13 13:56:32 2012 +0100 @@ -2,7 +2,7 @@ + tests.failed + @{testmethods} + ${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 + + + + + + + + + + + + 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 + + + + + + @{includes} + @{testincludes} + @{excludes} + + + + org.testng.annotations. + + + + + + + + + + @{includes} + @{testincludes} + @{excludes} + + + + + org.testng.annotations. + + + + + + + + + + + + + + + + ${basedir}/${ + + }/* + + + * + + + + + + + + + ${basedir}/${ + + }/* + + + * + + + + + + + + + + + + + + + ${basedir}/${ + + }/* + + + * + + + + + + + + + ${basedir}/${ + + }/* + + + * + + + + + + + + + + + + + + + + + + + + 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 +1522,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 +2138,7 @@ ========================= - JUNIT COMPILATION SECTION + TEST COMPILATION SECTION ========================= @@ -1736,7 +2246,7 @@ ======================= - JUNIT EXECUTION SECTION + TEST EXECUTION SECTION ======================= @@ -1749,7 +2259,7 @@ have.tests init,compile-test,-pre-test-run - + @@ -1794,7 +2304,7 @@ have.tests init,compile-test-single,-pre-test-run-single Must select some files in the IDE or set test.includes - + @@ -1810,7 +2320,7 @@ ======================= - JUNIT DEBUGGING SECTION + TEST DEBUGGING SECTION ======================= @@ -1818,22 +2328,7 @@ have.tests init,compile-test Must select one file in the IDE or set test.class - - - - - - - - - - - - - - - - + @@ -2070,6 +2565,7 @@ + ${} @@ -2084,6 +2580,7 @@ + diff -r 69f5314b6791 -r e46792d3fa86 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 Tue Mar 13 13:56:32 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 {