Please use the Apache issue tracking system for new NetBeans issues (https://issues.apache.org/jira/projects/NETBEANS0/issues) !!
View | Details | Raw Unified | Return to bug 124313 | Differences between
and this patch

Collapse All | Expand All

(-)j2ee.clientproject/src/org/netbeans/modules/j2ee/clientproject/resources/build-impl.xsl (-1 / +1 lines)
 Lines 2368-2374    Link Here 
2368
            <target name="-do-test-run">
2368
            <target name="-do-test-run">
2369
                <xsl:attribute name="if">have.tests</xsl:attribute>
2369
                <xsl:attribute name="if">have.tests</xsl:attribute>
2370
                <xsl:attribute name="depends">init,compile-test,-pre-test-run</xsl:attribute>
2370
                <xsl:attribute name="depends">init,compile-test,-pre-test-run</xsl:attribute>
2371
                <carproject:test testincludes="**/*Test.java"/>
2371
                <carproject:test testincludes="**/*Test.java" includes="${{includes}}"/>
2372
            </target>
2372
            </target>
2373
            
2373
            
2374
            <target name="-post-test-run">
2374
            <target name="-post-test-run">
(-)j2ee.ejbjarproject/src/org/netbeans/modules/j2ee/ejbjarproject/resources/build-impl.xsl (-1 / +1 lines)
 Lines 2345-2351    Link Here 
2345
            <target name="-do-test-run">
2345
            <target name="-do-test-run">
2346
                <xsl:attribute name="if">have.tests</xsl:attribute>
2346
                <xsl:attribute name="if">have.tests</xsl:attribute>
2347
                <xsl:attribute name="depends">init,compile-test,-pre-test-run</xsl:attribute>
2347
                <xsl:attribute name="depends">init,compile-test,-pre-test-run</xsl:attribute>
2348
                <ejbjarproject2:test testincludes="**/*Test.java"/>
2348
                <ejbjarproject2:test testincludes="**/*Test.java" includes="${{includes}}"/>
2349
            </target>
2349
            </target>
2350
            
2350
            
2351
            <target name="-post-test-run">
2351
            <target name="-post-test-run">
(-)java.api.common/manifest.mf (-1 / +1 lines)
 Lines 1-4    Link Here 
1
Manifest-Version: 1.0
1
Manifest-Version: 1.0
2
OpenIDE-Module: org.netbeans.modules.java.api.common/0
2
OpenIDE-Module: org.netbeans.modules.java.api.common/0
3
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/java/api/common/resources/Bundle.properties
3
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/java/api/common/resources/Bundle.properties
4
OpenIDE-Module-Specification-Version: 1.67
4
OpenIDE-Module-Specification-Version: 1.68
(-)java.api.common/nbproject/project.xml (-1 / +1 lines)
 Lines 11-17    Link Here 
11
                    <compile-dependency/>
11
                    <compile-dependency/>
12
                    <run-dependency>
12
                    <run-dependency>
13
                        <release-version>3</release-version>
13
                        <release-version>3</release-version>
14
                        <specification-version>3.73</specification-version>
14
                        <specification-version>3.74</specification-version>
15
                    </run-dependency>
15
                    </run-dependency>
16
                </dependency>
16
                </dependency>
17
                <dependency>
17
                <dependency>
(-)java.api.common/src/org/netbeans/modules/java/api/common/project/BaseActionProvider.java (-37 / +130 lines)
 Lines 475-487    Link Here 
475
                if (targetNames == null) {
475
                if (targetNames == null) {
476
                    return;
476
                    return;
477
                }
477
                }
478
                final String command2execute;
479
                if(COMMAND_TEST_SINGLE.equals(command) && targetNames.length == 1 && targetNames[0].equals(COMMAND_TEST)) {
480
                    //multiple files or package(s) selected so we need to call test target instead of test-single
481
                    command2execute = COMMAND_TEST;
482
                    p.put("nb.internal.action.name", command2execute);
483
                } else {
484
                    command2execute = command;
485
                }
478
                if (isCompileOnSaveEnabled) {
486
                if (isCompileOnSaveEnabled) {
479
                    if (COMMAND_BUILD.equals(command) && !allowAntBuild()) {
487
                    if (COMMAND_BUILD.equals(command2execute) && !allowAntBuild()) {
480
                        showBuildActionWarning(context);
488
                        showBuildActionWarning(context);
481
                        return ;
489
                        return ;
482
                    }
490
                    }
483
                    Map<String, Object> execProperties = new HashMap<String, Object>();
491
                    Map<String, Object> execProperties = new HashMap<String, Object>();
484
                    execProperties.put("nb.internal.action.name", command);
492
                    execProperties.put("nb.internal.action.name", command2execute);
485
493
486
                    copyMultiValue(ProjectProperties.RUN_JVM_ARGS, execProperties);
494
                    copyMultiValue(ProjectProperties.RUN_JVM_ARGS, execProperties);
487
                    prepareWorkDir(execProperties);
495
                    prepareWorkDir(execProperties);
 Lines 508-514    Link Here 
508
                                String url = p.getProperty("applet.url");
516
                                String url = p.getProperty("applet.url");
509
                                execProperties.put("applet.url", url);
517
                                execProperties.put("applet.url", url);
510
                                execProperties.put(JavaRunner.PROP_EXECUTE_FILE, file);
518
                                execProperties.put(JavaRunner.PROP_EXECUTE_FILE, file);
511
                                prepareSystemProperties(execProperties, command, context, false);
519
                                prepareSystemProperties(execProperties, command2execute, context, false);
512
                                task =
520
                                task =
513
                                JavaRunner.execute(targetNames[0], execProperties);
521
                                JavaRunner.execute(targetNames[0], execProperties);
514
                            }
522
                            }
 Lines 517-566    Link Here 
517
                        }
525
                        }
518
                        return;
526
                        return;
519
                    }
527
                    }
520
                    if (!isServerExecution() && (COMMAND_RUN.equals(command) || COMMAND_DEBUG.equals(command) || COMMAND_DEBUG_STEP_INTO.equals(command) || COMMAND_PROFILE.equals(command))) {
528
                    if (!isServerExecution() && (COMMAND_RUN.equals(command2execute) || COMMAND_DEBUG.equals(command2execute) || COMMAND_DEBUG_STEP_INTO.equals(command2execute) || COMMAND_PROFILE.equals(command2execute))) {
521
                        prepareSystemProperties(execProperties, command, context, false);
529
                        prepareSystemProperties(execProperties, command2execute, context, false);
522
                        AtomicReference<ExecutorTask> _task = new AtomicReference<ExecutorTask>();
530
                        AtomicReference<ExecutorTask> _task = new AtomicReference<ExecutorTask>();
523
                        bypassAntBuildScript(command, context, execProperties, _task);
531
                        bypassAntBuildScript(command2execute, context, execProperties, _task);
524
                        task = _task.get();
532
                        task = _task.get();
525
                        return ;
533
                        return ;
526
                    }
534
                    }
527
                    // for example RUN_SINGLE Java file with Servlet must be run on server and not locally
535
                    // for example RUN_SINGLE Java file with Servlet must be run on server and not locally
528
                    boolean serverExecution = p.getProperty(PROPERTY_RUN_SINGLE_ON_SERVER) != null;
536
                    boolean serverExecution = p.getProperty(PROPERTY_RUN_SINGLE_ON_SERVER) != null;
529
                    p.remove(PROPERTY_RUN_SINGLE_ON_SERVER);
537
                    p.remove(PROPERTY_RUN_SINGLE_ON_SERVER);
530
                    if (!serverExecution && (COMMAND_RUN_SINGLE.equals(command) || COMMAND_DEBUG_SINGLE.equals(command) || COMMAND_PROFILE_SINGLE.equals(command))) {
538
                    if (!serverExecution && (COMMAND_RUN_SINGLE.equals(command2execute) || COMMAND_DEBUG_SINGLE.equals(command2execute) || COMMAND_PROFILE_SINGLE.equals(command2execute))) {
531
                        prepareSystemProperties(execProperties, command, context, false);
539
                        prepareSystemProperties(execProperties, command2execute, context, false);
532
                        if (COMMAND_RUN_SINGLE.equals(command)) {
540
                        if (COMMAND_RUN_SINGLE.equals(command2execute)) {
533
                            execProperties.put(JavaRunner.PROP_CLASSNAME, p.getProperty("run.class"));
541
                            execProperties.put(JavaRunner.PROP_CLASSNAME, p.getProperty("run.class"));
534
                        } else if (COMMAND_DEBUG_SINGLE.equals(command)) {
542
                        } else if (COMMAND_DEBUG_SINGLE.equals(command2execute)) {
535
                            execProperties.put(JavaRunner.PROP_CLASSNAME, p.getProperty("debug.class")); 
543
                            execProperties.put(JavaRunner.PROP_CLASSNAME, p.getProperty("debug.class")); 
536
                        } else {
544
                        } else {
537
                            execProperties.put(JavaRunner.PROP_CLASSNAME, p.getProperty("profile.class"));
545
                            execProperties.put(JavaRunner.PROP_CLASSNAME, p.getProperty("profile.class"));
538
                        }
546
                        }
539
                        AtomicReference<ExecutorTask> _task = new AtomicReference<ExecutorTask>();
547
                        AtomicReference<ExecutorTask> _task = new AtomicReference<ExecutorTask>();
540
                        bypassAntBuildScript(command, context, execProperties, _task);
548
                        bypassAntBuildScript(command2execute, context, execProperties, _task);
541
                        task = _task.get();
549
                        task = _task.get();
542
                        return;
550
                        return;
543
                    }
551
                    }
544
                    String buildDir = evaluator.getProperty(ProjectProperties.BUILD_DIR);
552
                    String buildDir = evaluator.getProperty(ProjectProperties.BUILD_DIR);
545
                    if (COMMAND_TEST_SINGLE.equals(command) || COMMAND_DEBUG_TEST_SINGLE.equals(command) || COMMAND_PROFILE_TEST_SINGLE.equals(command)) {
553
                    if (COMMAND_TEST_SINGLE.equals(command2execute) || COMMAND_DEBUG_TEST_SINGLE.equals(command2execute) || COMMAND_PROFILE_TEST_SINGLE.equals(command2execute)) {
546
                        @SuppressWarnings("MismatchedReadAndWriteOfArray")
554
                        @SuppressWarnings("MismatchedReadAndWriteOfArray")
547
                        FileObject[] files = findTestSources(context, true);
555
                        FileObject[] files = findTestSources(context, true);
556
                        if(files == null) {
557
                            //user invoked "Test Package" action on a package with one test class
558
                            files = findTestSources(context);
559
                        }
548
                        try {
560
                        try {
549
                            prepareSystemProperties(execProperties, command, context, true);
561
                            prepareSystemProperties(execProperties, command2execute, context, true);
550
                            execProperties.put(JavaRunner.PROP_EXECUTE_FILE, files[0]);
562
                            execProperties.put(JavaRunner.PROP_EXECUTE_FILE, files[0]);
551
                            if (buildDir != null) { // #211543
563
                            if (buildDir != null) { // #211543
552
                                execProperties.put("tmp.dir", updateHelper.getAntProjectHelper().resolvePath(buildDir));
564
                                execProperties.put("tmp.dir", updateHelper.getAntProjectHelper().resolvePath(buildDir));
553
                            }
565
                            }
554
                            updateJavaRunnerClasspath(command, execProperties);
566
                            updateJavaRunnerClasspath(command2execute, execProperties);
555
                            task =
567
                            task =
556
                            JavaRunner.execute(command.equals(COMMAND_TEST_SINGLE) ? JavaRunner.QUICK_TEST : (COMMAND_DEBUG_TEST_SINGLE.equals(command) ? JavaRunner.QUICK_TEST_DEBUG :JavaRunner.QUICK_TEST_PROFILE),
568
                            JavaRunner.execute(command2execute.equals(COMMAND_TEST_SINGLE) ? JavaRunner.QUICK_TEST : (COMMAND_DEBUG_TEST_SINGLE.equals(command2execute) ? JavaRunner.QUICK_TEST_DEBUG :JavaRunner.QUICK_TEST_PROFILE),
557
                                               execProperties);
569
                                               execProperties);
558
                        } catch (IOException ex) {
570
                        } catch (IOException ex) {
559
                            Exceptions.printStackTrace(ex);
571
                            Exceptions.printStackTrace(ex);
560
                        }
572
                        }
561
                        return;
573
                        return;
562
                    }
574
                    }
563
                    if (SingleMethod.COMMAND_RUN_SINGLE_METHOD.equals(command) || SingleMethod.COMMAND_DEBUG_SINGLE_METHOD.equals(command)) {
575
                    if (SingleMethod.COMMAND_RUN_SINGLE_METHOD.equals(command2execute) || SingleMethod.COMMAND_DEBUG_SINGLE_METHOD.equals(command2execute)) {
564
                        SingleMethod methodSpec = findTestMethods(context)[0];
576
                        SingleMethod methodSpec = findTestMethods(context)[0];
565
                        try {
577
                        try {
566
                            execProperties.put("methodname", methodSpec.getMethodName());//NOI18N
578
                            execProperties.put("methodname", methodSpec.getMethodName());//NOI18N
 Lines 568-576    Link Here 
568
                            if (buildDir != null) {
580
                            if (buildDir != null) {
569
                                execProperties.put("tmp.dir",updateHelper.getAntProjectHelper().resolvePath(buildDir));
581
                                execProperties.put("tmp.dir",updateHelper.getAntProjectHelper().resolvePath(buildDir));
570
                            }
582
                            }
571
                            updateJavaRunnerClasspath(command, execProperties);
583
                            updateJavaRunnerClasspath(command2execute, execProperties);
572
                            task =
584
                            task =
573
                            JavaRunner.execute(command.equals(SingleMethod.COMMAND_RUN_SINGLE_METHOD) ? JavaRunner.QUICK_TEST : JavaRunner.QUICK_TEST_DEBUG,
585
                            JavaRunner.execute(command2execute.equals(SingleMethod.COMMAND_RUN_SINGLE_METHOD) ? JavaRunner.QUICK_TEST : JavaRunner.QUICK_TEST_DEBUG,
574
                                                  execProperties);
586
                                                  execProperties);
575
                        } catch (IOException ex) {
587
                        } catch (IOException ex) {
576
                            Exceptions.printStackTrace(ex);
588
                            Exceptions.printStackTrace(ex);
 Lines 578-589    Link Here 
578
                        return;
590
                        return;
579
                    }
591
                    }
580
                }
592
                }
581
                collectStartupExtenderArgs(p, command);
593
                collectStartupExtenderArgs(p, command2execute);
582
                Set<String> concealedProperties = collectAdditionalProperties(p, command, context);
594
                Set<String> concealedProperties = collectAdditionalProperties(p, command2execute, context);
583
                if (targetNames.length == 0) {
595
                if (targetNames.length == 0) {
584
                    targetNames = null;
596
                    targetNames = null;
585
                }
597
                }
586
                if (isCompileOnSaveEnabled && !NO_SYNC_COMMANDS.contains(command)) {
598
                if (isCompileOnSaveEnabled && !NO_SYNC_COMMANDS.contains(command2execute)) {
587
                    p.put("nb.wait.for.caches", "true");
599
                    p.put("nb.wait.for.caches", "true");
588
                }
600
                }
589
                final Callback cb = getCallback();
601
                final Callback cb = getCallback();
 Lines 599-605    Link Here 
599
                        DialogDisplayer.getDefault().notify(nd);
611
                        DialogDisplayer.getDefault().notify(nd);
600
                    } else {
612
                    } else {
601
                        if (cb2 != null) {
613
                        if (cb2 != null) {
602
                            cb2.antTargetInvocationStarted(command, context);
614
                            cb2.antTargetInvocationStarted(command2execute, context);
603
                        }
615
                        }
604
                        try {
616
                        try {
605
                            task = ActionUtils.runTarget(buildFo, targetNames, p, concealedProperties);
617
                            task = ActionUtils.runTarget(buildFo, targetNames, p, concealedProperties);
 Lines 615-633    Link Here 
615
                                        }
627
                                        }
616
                                    } finally {
628
                                    } finally {
617
                                        if (cb2 != null) {
629
                                        if (cb2 != null) {
618
                                            cb2.antTargetInvocationFinished(command, context, task.result());
630
                                            cb2.antTargetInvocationFinished(command2execute, context, task.result());
619
                                        }
631
                                        }
620
                                    }
632
                                    }
621
                                }
633
                                }
622
                            });
634
                            });
623
                        } catch (IOException ex) {
635
                        } catch (IOException ex) {
624
                            if (cb2 != null) {
636
                            if (cb2 != null) {
625
                                cb2.antTargetInvocationFailed(command, context);
637
                                cb2.antTargetInvocationFailed(command2execute, context);
626
                            }
638
                            }
627
                            throw ex;
639
                            throw ex;
628
                        } catch (RuntimeException ex) {
640
                        } catch (RuntimeException ex) {
629
                            if (cb2 != null) {
641
                            if (cb2 != null) {
630
                                cb2.antTargetInvocationFailed(command, context);
642
                                cb2.antTargetInvocationFailed(command2execute, context);
631
                            }
643
                            }
632
                            throw ex;
644
                            throw ex;
633
                        }
645
                        }
 Lines 792-802    Link Here 
792
            targetNames = getCommands().get(command);
804
            targetNames = getCommands().get(command);
793
        } else if ( command.equals( COMMAND_TEST_SINGLE ) ) {
805
        } else if ( command.equals( COMMAND_TEST_SINGLE ) ) {
794
            p.setProperty("ignore.failing.tests", "true");  //NOI18N
806
            p.setProperty("ignore.failing.tests", "true");  //NOI18N
795
            final FileObject[] files = findTestSources(context, true);
807
            final FileObject[] files = findTestSources(context);
796
            if (files == null) {
808
            if (files == null) {
797
                return null;
809
                return null;
798
            }
810
            }
811
            if(files.length == 1) {
812
                //one file or a package containing one file selected
799
            targetNames = setupTestSingle(p, files);            
813
            targetNames = setupTestSingle(p, files);            
814
            } else {
815
                //multiple files or package(s) selected
816
                targetNames = setupTestFilesOrPackages(p, files);
817
            }
800
        } else if ( command.equals( COMMAND_DEBUG_TEST_SINGLE ) ) {
818
        } else if ( command.equals( COMMAND_DEBUG_TEST_SINGLE ) ) {
801
            final FileObject[] files = findTestSources(context, true);
819
            final FileObject[] files = findTestSources(context, true);
802
            if (files == null) {
820
            if (files == null) {
 Lines 1366-1371    Link Here 
1366
        return new String[] {"test-single"}; // NOI18N
1384
        return new String[] {"test-single"}; // NOI18N
1367
    }
1385
    }
1368
1386
1387
    private String[] setupTestFilesOrPackages(Properties p, FileObject[] files) {
1388
        if (files != null) {
1389
            FileObject root = getRoot(projectTestRoots.getRoots(), files[0]);
1390
            p.setProperty("includes", ActionUtils.antIncludesList(files, root)); // NOI18N
1391
        }
1392
        return new String[]{"test"}; // NOI18N
1393
    }
1394
1369
    private String[] setupDebugTestSingle(Properties p, FileObject[] files) {
1395
    private String[] setupDebugTestSingle(Properties p, FileObject[] files) {
1370
        FileObject[] testSrcPath = projectTestRoots.getRoots();
1396
        FileObject[] testSrcPath = projectTestRoots.getRoots();
1371
        FileObject root = getRoot(testSrcPath, files[0]);
1397
        FileObject root = getRoot(testSrcPath, files[0]);
 Lines 1443-1450    Link Here 
1443
                    || findSourcesAndPackages( context, projectTestRoots.getRoots()) != null;
1469
                    || findSourcesAndPackages( context, projectTestRoots.getRoots()) != null;
1444
        }
1470
        }
1445
        else if ( command.equals( COMMAND_TEST_SINGLE ) ) {
1471
        else if ( command.equals( COMMAND_TEST_SINGLE ) ) {
1446
            FileObject[] fos = findTestSources(context, true);
1472
            FileObject[] fos = findTestSources(context);
1447
            return fos != null && fos.length == 1;
1473
            return fos != null;
1448
        }
1474
        }
1449
        else if ( command.equals( COMMAND_DEBUG_TEST_SINGLE ) ) {
1475
        else if ( command.equals( COMMAND_DEBUG_TEST_SINGLE ) ) {
1450
            FileObject[] fos = findTestSources(context, true);
1476
            FileObject[] fos = findTestSources(context, true);
 Lines 1545-1553    Link Here 
1545
     */
1571
     */
1546
    @org.netbeans.api.annotations.common.SuppressWarnings("PZLA_PREFER_ZERO_LENGTH_ARRAYS")
1572
    @org.netbeans.api.annotations.common.SuppressWarnings("PZLA_PREFER_ZERO_LENGTH_ARRAYS")
1547
    private @CheckForNull FileObject[] findSources(Lookup context) {
1573
    private @CheckForNull FileObject[] findSources(Lookup context) {
1574
        return findSources(context, true, false);
1575
    }
1576
    
1577
    /**
1578
     * Find selected source files
1579
     *
1580
     * @param context the lookup in which files should be found
1581
     * @param strict if true, all files in the selection have to be accepted
1582
     * @param findInPackages if true, all files under a selected package in the selection will also be checked
1583
     */
1584
    @org.netbeans.api.annotations.common.SuppressWarnings("PZLA_PREFER_ZERO_LENGTH_ARRAYS")
1585
    private @CheckForNull FileObject[] findSources(Lookup context, boolean strict, boolean findInPackages) {
1548
        FileObject[] srcPath = projectSourceRoots.getRoots();
1586
        FileObject[] srcPath = projectSourceRoots.getRoots();
1549
        for (int i=0; i< srcPath.length; i++) {
1587
        for (int i=0; i< srcPath.length; i++) {
1550
            FileObject[] files = ActionUtils.findSelectedFiles(context, srcPath[i], ".java", true); // NOI18N
1588
            FileObject[] files = ActionUtils.findSelectedFiles(context, srcPath[i], ".java", strict, findInPackages); // NOI18N
1551
            if (files != null) {
1589
            if (files != null) {
1552
                return files;
1590
                return files;
1553
            }
1591
            }
 Lines 1588-1612    Link Here 
1588
     */
1626
     */
1589
    @org.netbeans.api.annotations.common.SuppressWarnings("PZLA_PREFER_ZERO_LENGTH_ARRAYS")
1627
    @org.netbeans.api.annotations.common.SuppressWarnings("PZLA_PREFER_ZERO_LENGTH_ARRAYS")
1590
    private @CheckForNull FileObject[] findTestSources(Lookup context, boolean checkInSrcDir) {
1628
    private @CheckForNull FileObject[] findTestSources(Lookup context, boolean checkInSrcDir) {
1629
        return findTestSources(context, checkInSrcDir, true, false);
1630
    }
1631
    
1632
    /**
1633
     * Find selected tests and/or tests which belong to selected source files
1634
     *
1635
     * @param context the lookup in which files should be found
1636
     * @param checkInSrcDir if true, tests which belong to selected source files will be searched for
1637
     * @param strict if true, all files in the selection have to be accepted
1638
     * @param findInPackages if true, all files under a selected package in the selection will also be checked
1639
     */
1640
    @org.netbeans.api.annotations.common.SuppressWarnings("PZLA_PREFER_ZERO_LENGTH_ARRAYS")
1641
    private @CheckForNull FileObject[] findTestSources(Lookup context, boolean checkInSrcDir, boolean strict, boolean findInPackages) {
1591
        //XXX: Ugly, should be rewritten
1642
        //XXX: Ugly, should be rewritten
1592
        FileObject[] testSrcPath = projectTestRoots.getRoots();
1643
        FileObject[] testSrcPaths = projectTestRoots.getRoots();
1593
        for (int i=0; i< testSrcPath.length; i++) {
1644
        for (FileObject testSrcPath : testSrcPaths) {
1594
            FileObject[] files = ActionUtils.findSelectedFiles(context, testSrcPath[i], ".java", true); // NOI18N
1645
            FileObject[] files = ActionUtils.findSelectedFiles(context, testSrcPath, ".java", strict, findInPackages); // NOI18N
1595
            if (files != null) {
1646
            if (files != null) {
1596
                return files;
1647
                return files;
1597
            }
1648
            }
1598
        }
1649
        }
1599
        if (checkInSrcDir && testSrcPath.length>0) {
1650
        if (checkInSrcDir && testSrcPaths.length>0) {
1600
            FileObject[] files = findSources (context);
1651
            FileObject[] files = findSources (context, strict, findInPackages);
1601
            if (files != null) {
1652
            if (files != null) {
1602
                //Try to find the test under the test roots
1653
                //Try to find the test under the test roots
1603
                FileObject srcRoot = getRoot(projectSourceRoots.getRoots(),files[0]);
1654
                FileObject srcRoot = getRoot(projectSourceRoots.getRoots(),files[0]);
1604
                for (int i=0; i<testSrcPath.length; i++) {
1655
                for (FileObject testSrcPath : testSrcPaths) {
1605
                    FileObject[] files2 = ActionUtils.regexpMapFiles(files,srcRoot, SRCDIRJAVA, testSrcPath[i], SUBST, true);
1656
                    FileObject[] files2 = ActionUtils.regexpMapFiles(files, srcRoot, SRCDIRJAVA, testSrcPath, SUBST, strict);
1606
                    if (files2 != null) {
1657
                    if (files2 != null) {
1607
                        return files2;
1658
                        return files2;
1608
                    }
1659
                    }
1609
                    FileObject[] files2NG = ActionUtils.regexpMapFiles(files, srcRoot, SRCDIRJAVA, testSrcPath[i], SUBSTNG, true);
1660
                    FileObject[] files2NG = ActionUtils.regexpMapFiles(files, srcRoot, SRCDIRJAVA, testSrcPath, SUBSTNG, strict);
1610
                    if (files2NG != null) {
1661
                    if (files2NG != null) {
1611
                        return files2NG;
1662
                        return files2NG;
1612
                    }
1663
                    }
 Lines 1616-1621    Link Here 
1616
        return null;
1667
        return null;
1617
    }
1668
    }
1618
1669
1670
    /**
1671
     * Find selected tests and tests which belong to selected source files
1672
     * when package(s) or multiple files are selected.
1673
     *
1674
     * @param context the lookup in which files should be found
1675
     */
1676
    @org.netbeans.api.annotations.common.SuppressWarnings("PZLA_PREFER_ZERO_LENGTH_ARRAYS")
1677
    private @CheckForNull FileObject[] findTestSources(Lookup context) {
1678
        FileObject[] sourcesFOs = findSources(context, true, true);
1679
        FileObject[] testSourcesFOs = findTestSources(context, false, true, true);
1680
        HashSet<FileObject> testFiles = new HashSet<>();
1681
        if(testSourcesFOs == null) {
1682
            return findTestSources(context, true, true, true);
1683
        } else {
1684
            if(sourcesFOs == null) {
1685
                return testSourcesFOs;
1686
            } else {
1687
                testFiles.addAll(Arrays.asList(testSourcesFOs));
1688
                //Try to find the test under the test roots
1689
                FileObject srcRoot = getRoot(projectSourceRoots.getRoots(),sourcesFOs[0]);
1690
                for (FileObject testRoot : projectTestRoots.getRoots()) {
1691
                    FileObject[] files2 = ActionUtils.regexpMapFiles(sourcesFOs, srcRoot, SRCDIRJAVA, testRoot, SUBST, true);
1692
                    if (files2 != null) {
1693
                        for (FileObject fo : files2) {
1694
                            if(!testFiles.contains(fo)) {
1695
                                testFiles.add(fo);
1696
                            }
1697
                        }
1698
                    }
1699
                    FileObject[] files2NG = ActionUtils.regexpMapFiles(sourcesFOs, srcRoot, SRCDIRJAVA, testRoot, SUBSTNG, true);
1700
                    if (files2NG != null) {
1701
                        for (FileObject fo : files2NG) {
1702
                            if(!testFiles.contains(fo)) {
1703
                                testFiles.add(fo);
1704
                            }
1705
                        }
1706
                    }
1707
                }
1708
            }
1709
        }
1710
        return testFiles.isEmpty() ? null : testFiles.toArray(new FileObject[testFiles.size()]);
1711
    }
1619
1712
1620
    /**
1713
    /**
1621
     * Finds single method specification objects corresponding to JUnit test
1714
     * Finds single method specification objects corresponding to JUnit test
(-)java.j2seproject/src/org/netbeans/modules/java/j2seproject/resources/build-impl.xsl (-1 / +1 lines)
 Lines 2397-2403    Link Here 
2397
            <target name="-do-test-run">
2397
            <target name="-do-test-run">
2398
                <xsl:attribute name="if">have.tests</xsl:attribute>
2398
                <xsl:attribute name="if">have.tests</xsl:attribute>
2399
                <xsl:attribute name="depends">init,compile-test,-pre-test-run</xsl:attribute>
2399
                <xsl:attribute name="depends">init,compile-test,-pre-test-run</xsl:attribute>
2400
                <j2seproject3:test testincludes="**/*Test.java"/>
2400
                <j2seproject3:test testincludes="**/*Test.java" includes="${{includes}}"/>
2401
            </target>
2401
            </target>
2402
            
2402
            
2403
            <target name="-post-test-run">
2403
            <target name="-post-test-run">
(-)java.project/src/org/netbeans/spi/java/project/support/ui/Bundle.properties (+4 lines)
 Lines 75-77    Link Here 
75
ACSD_excludesLabel=Excludes pattern
75
ACSD_excludesLabel=Excludes pattern
76
ACSN_IncludeExcludeVisualizerPanel=Include Exclude Panel
76
ACSN_IncludeExcludeVisualizerPanel=Include Exclude Panel
77
ACSD_IncludeExcludeVisualizerPanel=Include and Exclude patterns for project
77
ACSD_IncludeExcludeVisualizerPanel=Include and Exclude patterns for project
78
79
# Name of package action
80
# {0} - # of selected packages
81
LBL_TestPackageAction_Name=T&est {0,choice,0#Package|1#Package|1<Packages}
(-)java.project/src/org/netbeans/spi/java/project/support/ui/PackageViewChildren.java (+4 lines)
 Lines 99-104    Link Here 
99
import org.openide.util.Exceptions;
99
import org.openide.util.Exceptions;
100
import org.openide.util.ImageUtilities;
100
import org.openide.util.ImageUtilities;
101
import org.openide.util.Lookup;
101
import org.openide.util.Lookup;
102
import org.openide.util.NbBundle;
102
import org.openide.util.NbBundle.Messages;
103
import org.openide.util.NbBundle.Messages;
103
import org.openide.util.RequestProcessor;
104
import org.openide.util.RequestProcessor;
104
import org.openide.util.WeakListeners;
105
import org.openide.util.WeakListeners;
 Lines 133-138    Link Here 
133
    private final RequestProcessor.Task visibility_refresh;
134
    private final RequestProcessor.Task visibility_refresh;
134
    private FileChangeListener wfcl;    // Weak listener on the system filesystem
135
    private FileChangeListener wfcl;    // Weak listener on the system filesystem
135
    private ChangeListener wvqcl;       // Weak listener on the VisibilityQuery
136
    private ChangeListener wvqcl;       // Weak listener on the VisibilityQuery
137
    private final Action testPackageAction;
136
138
137
    /**
139
    /**
138
     * Creates children based on a single source root.
140
     * Creates children based on a single source root.
 Lines 142-147    Link Here 
142
        
144
        
143
        // Sem mas dat cache a bude to uplne nejrychlejsi na svete
145
        // Sem mas dat cache a bude to uplne nejrychlejsi na svete
144
        names2nodes = Collections.synchronizedMap(new TreeMap<String,Object>());
146
        names2nodes = Collections.synchronizedMap(new TreeMap<String,Object>());
147
        testPackageAction = FileSensitiveActions.fileCommandAction(ActionProvider.COMMAND_TEST_SINGLE, NbBundle.getMessage(PackageViewChildren.class, "LBL_TestPackageAction_Name"), null);
145
        this.root = group.getRootFolder();
148
        this.root = group.getRootFolder();
146
        this.group = group;
149
        this.group = group;
147
        visibility_refresh = VISIBILITY_CHANGE_RP.create(new Runnable() {
150
        visibility_refresh = VISIBILITY_CHANGE_RP.create(new Runnable() {
 Lines 757-762    Link Here 
757
                        else if ( superActions[i] instanceof FileSystemAction ) {
760
                        else if ( superActions[i] instanceof FileSystemAction ) {
758
                            actionList.add (null); // insert separator and new action
761
                            actionList.add (null); // insert separator and new action
759
                            actionList.add (FileSensitiveActions.fileCommandAction(ActionProvider.COMMAND_COMPILE_SINGLE, LBL_CompilePackage_Action(), null));                           
762
                            actionList.add (FileSensitiveActions.fileCommandAction(ActionProvider.COMMAND_COMPILE_SINGLE, LBL_CompilePackage_Action(), null));                           
763
                            actionList.add (testPackageAction);
760
                            actionList.addAll((List<Action>) org.openide.util.Utilities.actionsForPath("Projects/package/Actions"));
764
                            actionList.addAll((List<Action>) org.openide.util.Utilities.actionsForPath("Projects/package/Actions"));
761
                        }
765
                        }
762
                        
766
                        
(-)maven/src/org/netbeans/modules/maven/execute/ActionToGoalUtils.java (+45 lines)
 Lines 46-54    Link Here 
46
import java.io.IOException;
46
import java.io.IOException;
47
import java.io.StringReader;
47
import java.io.StringReader;
48
import java.io.StringWriter;
48
import java.io.StringWriter;
49
import java.net.URI;
49
import java.util.ArrayList;
50
import java.util.ArrayList;
51
import java.util.Collection;
50
import java.util.Collections;
52
import java.util.Collections;
51
import java.util.HashMap;
53
import java.util.HashMap;
54
import java.util.HashSet;
52
import java.util.Iterator;
55
import java.util.Iterator;
53
import java.util.List;
56
import java.util.List;
54
import java.util.Map;
57
import java.util.Map;
 Lines 72-78    Link Here 
72
import org.netbeans.spi.project.ActionProvider;
75
import org.netbeans.spi.project.ActionProvider;
73
import org.openide.filesystems.FileObject;
76
import org.openide.filesystems.FileObject;
74
import org.openide.filesystems.FileUtil;
77
import org.openide.filesystems.FileUtil;
78
import org.openide.loaders.DataObject;
75
import org.openide.util.Lookup;
79
import org.openide.util.Lookup;
80
import org.openide.util.Utilities;
76
import org.openide.windows.InputOutput;
81
import org.openide.windows.InputOutput;
77
82
78
/**
83
/**
 Lines 169-179    Link Here 
169
            rc.setActivatedProfiles(acts);
174
            rc.setActivatedProfiles(acts);
170
            Map<String, String> props = new HashMap<String, String>(rc.getProperties());
175
            Map<String, String> props = new HashMap<String, String>(rc.getProperties());
171
            props.putAll(configs.getActiveConfiguration().getProperties());
176
            props.putAll(configs.getActiveConfiguration().getProperties());
177
            if (ActionProvider.COMMAND_TEST_SINGLE.equals(action)) {
178
                String testProperty = props.get("test");
179
                // multiple files were selected from both source and test packages and "Test Files" action was invoked on them
180
                if (testProperty != null && testProperty.equals("${packageClassName}")) {
181
                    Collection<? extends FileObject> candidates = lookup.lookupAll(FileObject.class);
182
                    if (candidates.isEmpty()) { // should not be for DataNode selections, but for compatibility
183
                        Collection<? extends DataObject> compatibilityCandidates = lookup.lookupAll(DataObject.class);
184
                        if (compatibilityCandidates.isEmpty()) {// shortcut - just not a file selection at all
185
                            List<FileObject> _candidates = new ArrayList<FileObject>();
186
                            for (DataObject d : compatibilityCandidates) {
187
                                _candidates.add(d.getPrimaryFile());
188
                            }
189
                            candidates = _candidates;
190
                        }
191
                    }
192
                    HashSet<String> test = new HashSet<String>();
193
                    addSelectedFiles(project, false, candidates, test);
194
                    addSelectedFiles(project, true, candidates, test);
195
                    String toString = test.toString().replace(" ", "");
196
                    props.put("test", toString.substring(1, toString.length() - 1));
197
                }
198
            }
172
            rc.addProperties(props);
199
            rc.addProperties(props);
173
        }
200
        }
174
        return rc;
201
        return rc;
175
    }
202
    }
176
203
204
    private static void addSelectedFiles(NbMavenProjectImpl project, boolean testRoots, Collection<? extends FileObject> candidates, HashSet<String> test) {
205
        URI[] roots = project.getSourceRoots(testRoots);
206
        for (URI uri : roots) {
207
            FileObject root = FileUtil.toFileObject(Utilities.toFile(uri));
208
            for (FileObject candidate : candidates) {
209
                String relativePath = FileUtil.getRelativePath(root, candidate);
210
                if (relativePath != null) {
211
                    if(testRoots) {
212
                        relativePath = relativePath.replace(".java", "").replace('/', '.');
213
                    } else {
214
                        relativePath = relativePath.replace(".java", "Test").replace('/', '.');
215
                    }
216
                    test.add(relativePath);
217
                }
218
            }
219
        }
220
    }
221
177
    public static boolean isActionEnable(String action, NbMavenProjectImpl project, Lookup lookup) {
222
    public static boolean isActionEnable(String action, NbMavenProjectImpl project, Lookup lookup) {
178
       
223
       
179
        M2ConfigProvider configs = project.getLookup().lookup(M2ConfigProvider.class);
224
        M2ConfigProvider configs = project.getLookup().lookup(M2ConfigProvider.class);
(-)o.apache.tools.ant.module/apichanges.xml (+18 lines)
 Lines 110-115    Link Here 
110
110
111
    <changes>
111
    <changes>
112
112
113
	<change id="ActionUtils.findSelectedFiles">
114
            <api name="general"/>
115
            <summary>Added findSelectedFiles(Lookup context, FileObject dir, String suffix, boolean strict, boolean findInPackages) method </summary>
116
            <version major="3" minor="74"/>
117
            <date day="15" month="11" year="2013"/>
118
            <author login="theofanis"/>
119
            <compatibility addition="yes"/>
120
            <description>
121
                <p>
122
                    Ability to find a file selection also in FileObjects found in
123
                    context that represent folders depending on the value of the
124
                    findInPackages parameter. The old method is bridged into the new one.    
125
                </p>
126
            </description>
127
            <class package="org.apache.tools.ant.module.api.support" name="ActionUtils"/>            
128
            <issue number="124313"/>
129
        </change>
130
113
        <change id="setConcealedProperties">
131
        <change id="setConcealedProperties">
114
            <api name="general"/>
132
            <api name="general"/>
115
            <summary>Added <code>AntTargetExecutor.Env.setConcealedProperties</code></summary>
133
            <summary>Added <code>AntTargetExecutor.Env.setConcealedProperties</code></summary>
(-)o.apache.tools.ant.module/nbproject/project.properties (-1 / +1 lines)
 Lines 42-48    Link Here 
42
42
43
javac.compilerargs=-Xlint:unchecked
43
javac.compilerargs=-Xlint:unchecked
44
javac.source=1.7
44
javac.source=1.7
45
spec.version.base=3.73.0
45
spec.version.base=3.74.0
46
compile.ant.jar=${ant.core.lib}
46
compile.ant.jar=${ant.core.lib}
47
src-bridge.cp.extra=build/classes:${compile.ant.jar}
47
src-bridge.cp.extra=build/classes:${compile.ant.jar}
48
extra.module.files=\
48
extra.module.files=\
(-)o.apache.tools.ant.module/src/org/apache/tools/ant/module/api/support/ActionUtils.java (-1 / +66 lines)
 Lines 154-159    Link Here 
154
     * @see <a href="@org-netbeans-modules-projectapi@/org/netbeans/spi/project/ActionProvider.html#isActionEnabled(java.lang.String,%20org.openide.util.Lookup)"><code>ActionProvider.isActionEnabled(...)</code></a>
154
     * @see <a href="@org-netbeans-modules-projectapi@/org/netbeans/spi/project/ActionProvider.html#isActionEnabled(java.lang.String,%20org.openide.util.Lookup)"><code>ActionProvider.isActionEnabled(...)</code></a>
155
     */
155
     */
156
    public static FileObject[] findSelectedFiles(Lookup context, FileObject dir, String suffix, boolean strict) {
156
    public static FileObject[] findSelectedFiles(Lookup context, FileObject dir, String suffix, boolean strict) {
157
        return findSelectedFiles(context, dir, suffix, strict, false);
158
    }
159
    
160
    /**
161
     * Convenience method to find a file selection in a selection (context).
162
     * All files must exist on disk (according to {@link FileUtil#toFile}).
163
     * If a constraining directory is supplied, they must also be contained in it.
164
     * If a constraining file suffix is supplied, the base names of the files
165
     * must end with that suffix.
166
     * The return value is null if there are no matching files; or if the strict
167
     * parameter is true and some of the files in the selection did not match
168
     * the constraints (disk files, directory, and/or suffix).
169
     * <p class="nonnormative">
170
     * Typically {@link org.openide.loaders.DataNode}s will form a node selection
171
     * which will be placed in the context. This method does <em>not</em> directly
172
     * look for nodes in the selection; but generally the lookups of the nodes in
173
     * a node selection are spliced into the context as well, so the {@link FileObject}s
174
     * should be available. A corollary of not checking nodes directly is that any
175
     * nodes in the context which do not correspond to files at all (i.e. do not have
176
     * {@link FileObject} in their lookup) are ignored, even with the strict parameter on;
177
     * and that multiple nodes in the context with the same associated file are treated
178
     * as a single entry.
179
     * </p>
180
     * @param context a selection as provided to e.g. <code>ActionProvider.isActionEnabled(...)</code>
181
     * @param dir a constraining parent directory, or null to not check for a parent directory
182
     * @param suffix a file suffix (e.g. <samp>.java</samp>) to constrain files by,
183
     *               or null to not check suffixes
184
     * @param strict if true, all files in the selection have to be accepted
185
     * @param findInPackages if true, all files under any package in the selection will also be checked
186
     * @return a nonempty selection of disk files, or null
187
     * @see <a href="@org-netbeans-modules-projectapi@/org/netbeans/spi/project/ActionProvider.html#isActionEnabled(java.lang.String,%20org.openide.util.Lookup)"><code>ActionProvider.isActionEnabled(...)</code></a>
188
     */
189
    public static FileObject[] findSelectedFiles(Lookup context, FileObject dir, String suffix, boolean strict, boolean findInPackages) {
157
        if (dir != null && !dir.isFolder()) {
190
        if (dir != null && !dir.isFolder()) {
158
            throw new IllegalArgumentException("Not a folder: " + dir); // NOI18N
191
            throw new IllegalArgumentException("Not a folder: " + dir); // NOI18N
159
        }
192
        }
 Lines 173-179    Link Here 
173
            candidates = _candidates;
206
            candidates = _candidates;
174
        }
207
        }
175
        Collection<FileObject> files = new LinkedHashSet<FileObject>(); // #50644: remove dupes
208
        Collection<FileObject> files = new LinkedHashSet<FileObject>(); // #50644: remove dupes
209
        Collection<FileObject> selectedFiles = findSelectedFiles(candidates, dir, suffix, strict, findInPackages);
210
        if(selectedFiles != null) {
211
            files.addAll(selectedFiles);
212
        }
213
        
214
        if (findInPackages) {
215
            Collection<FileObject> packageCandidates = new ArrayList<>();
176
        for (FileObject f : candidates) {
216
        for (FileObject f : candidates) {
217
                if (f.isFolder()) {
218
                    FileObject[] children = f.getChildren();
219
                    for (FileObject child : children) {
220
                        if (child.isData()) {
221
                            packageCandidates.add(child);
222
                        }
223
                    }
224
                }
225
            }
226
            Collection<FileObject> selectedFilesInPackages = findSelectedFiles(packageCandidates, dir, suffix, strict, findInPackages);
227
            if (selectedFilesInPackages != null) {
228
                files.addAll(selectedFilesInPackages);
229
            }
230
        }
231
        if (files.isEmpty()) {
232
            return null;
233
        }
234
        return files.toArray(new FileObject[files.size()]);
235
    }
236
    
237
    private static Collection<FileObject> findSelectedFiles(Collection<? extends FileObject> candidates, FileObject dir, String suffix, boolean strict, boolean findInPackages) {
238
        Collection<FileObject> files = new LinkedHashSet<>(); // #50644: remove dupes
239
        for (FileObject f : candidates) {
177
            if (f.hasExt("form")) {
240
            if (f.hasExt("form")) {
178
                continue; // #206309
241
                continue; // #206309
179
            }
242
            }
 Lines 190-202    Link Here 
190
            if (matches) {
253
            if (matches) {
191
                files.add(f);
254
                files.add(f);
192
            } else if (strict) {
255
            } else if (strict) {
256
                if(!findInPackages) {
193
                return null;
257
                return null;
194
            }
258
            }
195
        }
259
        }
260
        }
196
        if (files.isEmpty()) {
261
        if (files.isEmpty()) {
197
            return null;
262
            return null;
198
        }
263
        }
199
        return files.toArray(new FileObject[files.size()]);
264
        return files;
200
    }
265
    }
201
    
266
    
202
    /**
267
    /**
(-)o.apache.tools.ant.module/test/unit/src/org/apache/tools/ant/module/api/support/ActionUtilsTest.java (-3 / +13 lines)
 Lines 71-78    Link Here 
71
    }
71
    }
72
    
72
    
73
    private FileObject dir, f1, f1form, f2, subdir, f3, fx, subdir2, f3a, f4, subsubdir, f5, f5a;
73
    private FileObject dir, f1, f1form, f2, subdir, f3, fx, subdir2, f3a, f4, subsubdir, f5, f5a;
74
    private DataObject d1, d2, d3, dx;
74
    private DataObject d1, d2, d3, dx, d4;
75
    private Node n1, n2, n3, nx;
75
    private Node n1, n2, n3, nx, n4;
76
    
76
    
77
    @Override
77
    @Override
78
    protected void setUp() throws Exception {
78
    protected void setUp() throws Exception {
 Lines 95-104    Link Here 
95
        d2 = DataObject.find(f2);
95
        d2 = DataObject.find(f2);
96
        d3 = DataObject.find(f3);
96
        d3 = DataObject.find(f3);
97
        dx = DataObject.find(fx);
97
        dx = DataObject.find(fx);
98
        d4 = DataObject.find(subdir2);
98
        n1 = d1.getNodeDelegate();
99
        n1 = d1.getNodeDelegate();
99
        n2 = d2.getNodeDelegate();
100
        n2 = d2.getNodeDelegate();
100
        n3 = d3.getNodeDelegate();
101
        n3 = d3.getNodeDelegate();
101
        nx = dx.getNodeDelegate();
102
        nx = dx.getNodeDelegate();
103
        n4 = d4.getNodeDelegate();
102
    }
104
    }
103
    
105
    
104
    public void testFindSelectedFiles() throws Exception {
106
    public void testFindSelectedFiles() throws Exception {
 Lines 119-124    Link Here 
119
        assertEquals("duplicates removed #2 (cf. #50644)", Arrays.asList(new FileObject[] {f1, f2}), filesFrom(new Node[] {n1, n2, n1}, null, null, true));
121
        assertEquals("duplicates removed #2 (cf. #50644)", Arrays.asList(new FileObject[] {f1, f2}), filesFrom(new Node[] {n1, n2, n1}, null, null, true));
120
        assertEquals("two selected files", Arrays.asList(new FileObject[] {f1, f2}), files2List(ActionUtils.findSelectedFiles(Lookups.fixed(f1, f2), null, null, true)));
122
        assertEquals("two selected files", Arrays.asList(new FileObject[] {f1, f2}), files2List(ActionUtils.findSelectedFiles(Lookups.fixed(f1, f2), null, null, true)));
121
        assertEquals("one form, one selection", Collections.singletonList(f1), files2List(ActionUtils.findSelectedFiles(Lookups.fixed(f1, f1form), null, ".data", true)));
123
        assertEquals("one form, one selection", Collections.singletonList(f1), files2List(ActionUtils.findSelectedFiles(Lookups.fixed(f1, f1form), null, ".data", true)));
124
        assertEquals("one selected directory", Collections.singletonList(subdir2), filesFrom(new Node[] {n4}, subdir2, null, true, false));
125
        assertEquals("one selected directory, two selected files", Arrays.asList(new FileObject[] {subdir2, f5, f4}), filesFrom(new Node[] {n4}, subdir2, null, true, true));
126
        assertEquals("zero selection", null, filesFrom(new Node[] {n4}, subdir2, ".data", true, false));
127
        assertEquals("two selected files", Arrays.asList(new FileObject[] {f5, f4}), filesFrom(new Node[] {n4}, subdir2, "data", true, true));
122
    }
128
    }
123
    
129
    
124
    private static Lookup context(Node[] sel) {
130
    private static Lookup context(Node[] sel) {
 Lines 131-139    Link Here 
131
    }
137
    }
132
    
138
    
133
    private static List<FileObject> filesFrom(Node[] sel, FileObject dir, String suffix, boolean strict) {
139
    private static List<FileObject> filesFrom(Node[] sel, FileObject dir, String suffix, boolean strict) {
134
        return files2List(ActionUtils.findSelectedFiles(context(sel), dir, suffix, strict));
140
        return filesFrom(sel, dir, suffix, strict, false);
135
    }
141
    }
136
    
142
    
143
    private static List<FileObject> filesFrom(Node[] sel, FileObject dir, String suffix, boolean strict, boolean findInPackages) {
144
        return files2List(ActionUtils.findSelectedFiles(context(sel), dir, suffix, strict, findInPackages));
145
    }
146
    
137
    public void testAntIncludesList() throws Exception {
147
    public void testAntIncludesList() throws Exception {
138
        assertEquals("2 includes", "f1.data,sub/f3.data", ActionUtils.antIncludesList(new FileObject[] {f1, f3}, dir));
148
        assertEquals("2 includes", "f1.data,sub/f3.data", ActionUtils.antIncludesList(new FileObject[] {f1, f3}, dir));
139
        assertEquals("1 include", "f1.data", ActionUtils.antIncludesList(new FileObject[] {f1}, dir));
149
        assertEquals("1 include", "f1.data", ActionUtils.antIncludesList(new FileObject[] {f1}, dir));
(-)projectui/src/org/netbeans/modules/project/ui/actions/Bundle.properties (-1 / +3 lines)
 Lines 80-88    Link Here 
80
LBL_RunMainProjectAction_Name=&Run {0,choice,-1#Main Project|0#Project|1#Project ({1})|1<{0} Projects}
80
LBL_RunMainProjectAction_Name=&Run {0,choice,-1#Main Project|0#Project|1#Project ({1})|1<{0} Projects}
81
81
82
82
83
# Name of 1-off actions
84
# {0} - # of selected files
83
LBL_RunSingleAction_Name=Run &File
85
LBL_RunSingleAction_Name=Run &File
84
# {0,choice,0#File|1#"{1}"|1<Files}
86
# {0,choice,0#File|1#"{1}"|1<Files}
85
LBL_TestSingleAction_Name=T&est File
87
LBL_TestSingleAction_Name=T&est {0,choice,0#File|1#File|1<Files}
86
#{0,choice,0#File|1#"{1}"|1<Files}
88
#{0,choice,0#File|1#"{1}"|1<Files}
87
89
88
# OpenProject.java
90
# OpenProject.java
(-)web.project/src/org/netbeans/modules/web/project/resources/build-impl.xsl (-1 / +1 lines)
 Lines 2665-2671    Link Here 
2665
            <target name="-do-test-run">
2665
            <target name="-do-test-run">
2666
                <xsl:attribute name="if">have.tests</xsl:attribute>
2666
                <xsl:attribute name="if">have.tests</xsl:attribute>
2667
                <xsl:attribute name="depends">init,compile-test,-pre-test-run</xsl:attribute>
2667
                <xsl:attribute name="depends">init,compile-test,-pre-test-run</xsl:attribute>
2668
                <webproject2:test testincludes="**/*Test.java"/>
2668
                <webproject2:test testincludes="**/*Test.java" includes="${{includes}}"/>
2669
            </target>
2669
            </target>
2670
            
2670
            
2671
            <target name="-post-test-run">
2671
            <target name="-post-test-run">

Return to bug 124313
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo