diff -r c9208633ed4e java.j2seproject/src/org/netbeans/modules/java/j2seproject/J2SEActionProvider.java --- a/java.j2seproject/src/org/netbeans/modules/java/j2seproject/J2SEActionProvider.java Thu Aug 07 16:02:01 2008 +0200 +++ b/java.j2seproject/src/org/netbeans/modules/java/j2seproject/J2SEActionProvider.java Thu Aug 07 20:32:12 2008 +0200 @@ -482,19 +482,14 @@ FileObject[] files = findTestSourcesForSources(context); targetNames = setupDebugTestSingle(p, files); } - else if ( command.equals( SingleMethod.COMMAND_RUN_SINGLE_METHOD ) ) { + else if ( command.equals( SingleMethod.COMMAND_RUN_SINGLE_METHOD ) + || command.equals( SingleMethod.COMMAND_DEBUG_SINGLE_METHOD ) ) { SingleMethod[] methodSpecs = findTestMethods(context); if ((methodSpecs == null) || (methodSpecs.length != 1)) { return new String[0]; } - targetNames = setupRunSingleTestMethod(p, methodSpecs[0]); - } - else if ( command.equals( SingleMethod.COMMAND_DEBUG_SINGLE_METHOD ) ) { - SingleMethod[] methodSpecs = findTestMethods(context); - if ((methodSpecs == null) || (methodSpecs.length != 1)) { - return new String[0]; - } - targetNames = setupDebugSingleTestMethod(p, methodSpecs[0]); + boolean debug = command.equals(SingleMethod.COMMAND_DEBUG_SINGLE_METHOD); + targetNames = setupRunSingleTestMethod(p, methodSpecs[0], debug); } else if ( command.equals( JavaProjectConstants.COMMAND_DEBUG_FIX ) ) { FileObject[] files = findSources( context ); @@ -785,32 +780,16 @@ return new String[] {"debug-test"}; // NOI18N } - private String[] setupRunSingleTestMethod(Properties p, SingleMethod methodSpec) { - return setupTestSingle(p, new FileObject[] {methodSpec.getFile()}); - - //FileObject[] testSrcPath = project.getTestSourceRoots().getRoots(); - //FileObject testFile = methodSpec.getFile(); - //FileObject root = getRoot(testSrcPath, testFile); - //String relPath = FileUtil.getRelativePath(root, testFile); - //String className = getClassName(relPath); - //p.setProperty("javac.includes", relPath); // NOI18N - //p.setProperty("test.class", className); // NOI18N - //p.setProperty("test.method", methodSpec.getMethodName()); // NOI18N - //return new String[] {"test-single-method"}; // NOI18N - } - - private String[] setupDebugSingleTestMethod(Properties p, SingleMethod methodSpec) { - return setupDebugTestSingle(p, new FileObject[] {methodSpec.getFile()}); - - //FileObject[] testSrcPath = project.getTestSourceRoots().getRoots(); - //FileObject testFile = methodSpec.getFile(); - //FileObject root = getRoot(testSrcPath, testFile); - //String relPath = FileUtil.getRelativePath(root, testFile); - //String className = getClassName(relPath); - //p.setProperty("javac.includes", relPath); // NOI18N - //p.setProperty("test.class", className); // NOI18N - //p.setProperty("test.method", methodSpec.getMethodName()); // NOI18N - //return new String[] {"debug-test-method"}; // NOI18N + private String[] setupRunSingleTestMethod(Properties p, SingleMethod methodSpec, boolean debug) { + FileObject[] testSrcPath = project.getTestSourceRoots().getRoots(); + FileObject testFile = methodSpec.getFile(); + FileObject root = getRoot(testSrcPath, testFile); + String relPath = FileUtil.getRelativePath(root, testFile); + String className = getClassName(relPath); + p.setProperty("javac.includes", relPath); // NOI18N + p.setProperty("test.class", className); // NOI18N + p.setProperty("test.method", methodSpec.getMethodName()); // NOI18N + return new String[] {debug ? "debug-test" : "test-single"}; // NOI18N } private static String getClassName(String relPath) { @@ -854,12 +833,8 @@ return fos != null && fos.length == 1; } else if (command.equals(SingleMethod.COMMAND_RUN_SINGLE_METHOD) || command.equals(SingleMethod.COMMAND_DEBUG_SINGLE_METHOD)) { - if (isCompileOnSaveEnabled(J2SEProjectProperties.DISABLE_COMPILE_ON_SAVE)) { - SingleMethod[] methodSpecs = findTestMethods(context); - return (methodSpecs != null) && (methodSpecs.length == 1); - } else { - return false; - } + SingleMethod[] methodSpecs = findTestMethods(context); + return (methodSpecs != null) && (methodSpecs.length == 1); } else { // other actions are global return true; diff -r c9208633ed4e 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 Thu Aug 07 16:02:01 2008 +0200 +++ b/java.j2seproject/src/org/netbeans/modules/java/j2seproject/resources/build-impl.xsl Thu Aug 07 20:32:12 2008 +0200 @@ -2,7 +2,7 @@ + + + + ${ant.home} + patches/*.jar + + + + + + + + + + + + + + + + + + -debug-start-debuggee-test-method,-debug-start-debuggee-test-class