jdk.nashorn.internal.test.framework.TestFinder.TestFactory Java Examples

The following examples show how to use jdk.nashorn.internal.test.framework.TestFinder.TestFactory. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ParallelTestRunner.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
private void suite() throws Exception {
    Locale.setDefault(new Locale(""));
    System.setOut(outputStream());

    final TestFactory<ScriptRunnable> testFactory = new TestFactory<ScriptRunnable>() {
        @Override
        public ScriptRunnable createTest(final String framework, final File testFile, final List<String> engineOptions, final Map<String, String> testOptions, final List<String> arguments) {
            return new ScriptRunnable(framework, testFile, engineOptions, testOptions, arguments);
        }

        @Override
        public void log(final String msg) {
            System.err.println(msg);
        }
    };

    TestFinder.findAllTests(tests, orphans, testFactory);

    Collections.sort(tests, new Comparator<ScriptRunnable>() {
        @Override
        public int compare(final ScriptRunnable o1, final ScriptRunnable o2) {
            return o1.testFile.compareTo(o2.testFile);
        }
    });
}
 
Example #2
Source File: ParallelTestRunner.java    From jdk8u_nashorn with GNU General Public License v2.0 6 votes vote down vote up
private void suite() throws Exception {
    Locale.setDefault(new Locale(""));
    System.setOut(outputStream());

    final TestFactory<ScriptRunnable> testFactory = new TestFactory<ScriptRunnable>() {
        @Override
        public ScriptRunnable createTest(final String framework, final File testFile, final List<String> engineOptions, final Map<String, String> testOptions, final List<String> arguments) {
            return new ScriptRunnable(framework, testFile, engineOptions, testOptions, arguments);
        }

        @Override
        public void log(final String msg) {
            System.err.println(msg);
        }
    };

    TestFinder.findAllTests(tests, orphans, testFactory);

    Collections.sort(tests, new Comparator<ScriptRunnable>() {
        @Override
        public int compare(final ScriptRunnable o1, final ScriptRunnable o2) {
            return o1.testFile.compareTo(o2.testFile);
        }
    });
}
 
Example #3
Source File: ParallelTestRunner.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
private void suite() throws Exception {
    Locale.setDefault(new Locale(""));
    System.setOut(outputStream());

    final TestFactory<ScriptRunnable> testFactory = new TestFactory<ScriptRunnable>() {
        @Override
        public ScriptRunnable createTest(final String framework, final File testFile, final List<String> engineOptions, final Map<String, String> testOptions, final List<String> arguments) {
            return new ScriptRunnable(framework, testFile, engineOptions, testOptions, arguments);
        }

        @Override
        public void log(final String msg) {
            System.err.println(msg);
        }
    };

    TestFinder.findAllTests(tests, orphans, testFactory);

    Collections.sort(tests, new Comparator<ScriptRunnable>() {
        @Override
        public int compare(final ScriptRunnable o1, final ScriptRunnable o2) {
            return o1.testFile.compareTo(o2.testFile);
        }
    });
}
 
Example #4
Source File: ParallelTestRunner.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
private void suite() throws Exception {
    Locale.setDefault(new Locale(""));
    System.setOut(outputStream());

    final TestFactory<ScriptRunnable> testFactory = new TestFactory<ScriptRunnable>() {
        @Override
        public ScriptRunnable createTest(final String framework, final File testFile, final List<String> engineOptions, final Map<String, String> testOptions, final List<String> arguments) {
            return new ScriptRunnable(framework, testFile, engineOptions, testOptions, arguments);
        }

        @Override
        public void log(final String msg) {
            System.err.println(msg);
        }
    };

    TestFinder.findAllTests(tests, orphans, testFactory);

    Collections.sort(tests, new Comparator<ScriptRunnable>() {
        @Override
        public int compare(final ScriptRunnable o1, final ScriptRunnable o2) {
            return o1.testFile.compareTo(o2.testFile);
        }
    });
}
 
Example #5
Source File: ParallelTestRunner.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
private void suite() throws Exception {
    Locale.setDefault(new Locale(""));
    System.setOut(outputStream());

    final TestFactory<ScriptRunnable> testFactory = new TestFactory<ScriptRunnable>() {
        @Override
        public ScriptRunnable createTest(String framework, File testFile, List<String> engineOptions, Map<String, String> testOptions, List<String> arguments) {
            return new ScriptRunnable(framework, testFile, engineOptions, testOptions, arguments);
        }

        @Override
        public void log(String msg) {
            System.err.println(msg);
        }
    };

    TestFinder.findAllTests(tests, orphans, testFactory);

    Collections.sort(tests, new Comparator<ScriptRunnable>() {
        @Override
        public int compare(final ScriptRunnable o1, final ScriptRunnable o2) {
            return o1.testFile.compareTo(o2.testFile);
        }
    });
}
 
Example #6
Source File: ParallelTestRunner.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
private void suite() throws Exception {
    Locale.setDefault(new Locale(""));
    System.setOut(outputStream());

    final TestFactory<ScriptRunnable> testFactory = new TestFactory<ScriptRunnable>() {
        @Override
        public ScriptRunnable createTest(final String framework, final File testFile, final List<String> engineOptions, final Map<String, String> testOptions, final List<String> arguments) {
            return new ScriptRunnable(framework, testFile, engineOptions, testOptions, arguments);
        }

        @Override
        public void log(final String msg) {
            System.err.println(msg);
        }
    };

    TestFinder.findAllTests(tests, orphans, testFactory);

    Collections.sort(tests, new Comparator<ScriptRunnable>() {
        @Override
        public int compare(final ScriptRunnable o1, final ScriptRunnable o2) {
            return o1.testFile.compareTo(o2.testFile);
        }
    });
}
 
Example #7
Source File: ParallelTestRunner.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
private void suite() throws Exception {
    Locale.setDefault(new Locale(""));
    System.setOut(outputStream());

    final TestFactory<ScriptRunnable> testFactory = new TestFactory<ScriptRunnable>() {
        @Override
        public ScriptRunnable createTest(final String framework, final File testFile, final List<String> engineOptions, final Map<String, String> testOptions, final List<String> arguments) {
            return new ScriptRunnable(framework, testFile, engineOptions, testOptions, arguments);
        }

        @Override
        public void log(final String msg) {
            System.err.println(msg);
        }
    };

    TestFinder.findAllTests(tests, orphans, testFactory);

    Collections.sort(tests, new Comparator<ScriptRunnable>() {
        @Override
        public int compare(final ScriptRunnable o1, final ScriptRunnable o2) {
            return o1.testFile.compareTo(o2.testFile);
        }
    });
}
 
Example #8
Source File: ParallelTestRunner.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
private void suite() throws Exception {
    Locale.setDefault(new Locale(""));
    System.setOut(outputStream());

    final TestFactory<ScriptRunnable> testFactory = new TestFactory<ScriptRunnable>() {
        @Override
        public ScriptRunnable createTest(final String framework, final File testFile, final List<String> engineOptions, final Map<String, String> testOptions, final List<String> arguments) {
            return new ScriptRunnable(framework, testFile, engineOptions, testOptions, arguments);
        }

        @Override
        public void log(final String msg) {
            System.err.println(msg);
        }
    };

    TestFinder.findAllTests(tests, orphans, testFactory);

    Collections.sort(tests, new Comparator<ScriptRunnable>() {
        @Override
        public int compare(final ScriptRunnable o1, final ScriptRunnable o2) {
            return o1.testFile.compareTo(o2.testFile);
        }
    });
}
 
Example #9
Source File: ParallelTestRunner.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
private void suite() throws Exception {
    Locale.setDefault(new Locale(""));
    System.setOut(outputStream());

    final TestFactory<ScriptRunnable> testFactory = new TestFactory<ScriptRunnable>() {
        @Override
        public ScriptRunnable createTest(String framework, File testFile, List<String> engineOptions, Map<String, String> testOptions, List<String> arguments) {
            return new ScriptRunnable(framework, testFile, engineOptions, testOptions, arguments);
        }

        @Override
        public void log(String msg) {
            System.err.println(msg);
        }
    };

    TestFinder.findAllTests(tests, orphans, testFactory);

    Collections.sort(tests, new Comparator<ScriptRunnable>() {
        @Override
        public int compare(final ScriptRunnable o1, final ScriptRunnable o2) {
            return o1.testFile.compareTo(o2.testFile);
        }
    });
}
 
Example #10
Source File: ScriptTest.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates a test factory for the set of .js source tests.
 *
 * @return a Object[] of test objects.
 * @throws Exception upon failure
 */
@SuppressWarnings("static-method")
@Factory
public Object[] suite() throws Exception {
    Locale.setDefault(new Locale(""));

    final List<ITest> tests = new ArrayList<>();
    final Set<String> orphans = new TreeSet<>();

    final TestFactory<ITest> testFactory = new TestFactory<ITest>() {
        @Override
        public ITest createTest(final String framework, final File testFile, final List<String> engineOptions, final Map<String, String> testOptions, final List<String> scriptArguments) {
            return new ScriptRunnable(framework, testFile, engineOptions, testOptions,  scriptArguments);
        }

        @Override
        public void log(final String msg) {
            org.testng.Reporter.log(msg, true);
        }
    };

    TestFinder.findAllTests(tests, orphans, testFactory);

    if (System.getProperty(TEST_JS_INCLUDES) == null) {
        tests.add(new OrphanTestFinder(orphans));
    }

    return tests.toArray();
}
 
Example #11
Source File: ScriptTest.java    From jdk8u_nashorn with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates a test factory for the set of .js source tests.
 *
 * @return a Object[] of test objects.
 * @throws Exception upon failure
 */
@SuppressWarnings("static-method")
@Factory
public Object[] suite() throws Exception {
    Locale.setDefault(new Locale(""));

    final List<ITest> tests = new ArrayList<>();
    final Set<String> orphans = new TreeSet<>();

    final TestFactory<ITest> testFactory = new TestFactory<ITest>() {
        @Override
        public ITest createTest(final String framework, final File testFile, final List<String> engineOptions, final Map<String, String> testOptions, final List<String> scriptArguments) {
            return new ScriptRunnable(framework, testFile, engineOptions, testOptions,  scriptArguments);
        }

        @Override
        public void log(final String msg) {
            org.testng.Reporter.log(msg, true);
        }
    };

    TestFinder.findAllTests(tests, orphans, testFactory);

    if (System.getProperty(TEST_JS_INCLUDES) == null) {
        tests.add(new OrphanTestFinder(orphans));
    }

    return tests.toArray();
}
 
Example #12
Source File: ScriptTest.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates a test factory for the set of .js source tests.
 *
 * @return a Object[] of test objects.
 */
@Factory
public Object[] suite() throws Exception {
    Locale.setDefault(new Locale(""));

    final List<ITest> tests = new ArrayList<>();
    final Set<String> orphans = new TreeSet<>();

    final TestFactory<ITest> testFactory = new TestFactory<ITest>() {
        @Override
        public ITest createTest(final String framework, final File testFile, final List<String> engineOptions, final Map<String, String> testOptions, final List<String> scriptArguments) {
            return new ScriptRunnable(framework, testFile, engineOptions, testOptions,  scriptArguments);
        }

        @Override
        public void log(String msg) {
            org.testng.Reporter.log(msg, true);
        }
    };

    TestFinder.findAllTests(tests, orphans, testFactory);

    if (System.getProperty(TEST_JS_INCLUDES) == null) {
        tests.add(new OrphanTestFinder(orphans));
    }

    return tests.toArray();
}
 
Example #13
Source File: ScriptTest.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates a test factory for the set of .js source tests.
 *
 * @return a Object[] of test objects.
 */
@Factory
public Object[] suite() throws Exception {
    Locale.setDefault(new Locale(""));

    final List<ITest> tests = new ArrayList<>();
    final Set<String> orphans = new TreeSet<>();

    final TestFactory<ITest> testFactory = new TestFactory<ITest>() {
        @Override
        public ITest createTest(final String framework, final File testFile, final List<String> engineOptions, final Map<String, String> testOptions, final List<String> scriptArguments) {
            return new ScriptRunnable(framework, testFile, engineOptions, testOptions,  scriptArguments);
        }

        @Override
        public void log(String msg) {
            org.testng.Reporter.log(msg, true);
        }
    };

    TestFinder.findAllTests(tests, orphans, testFactory);

    if (System.getProperty(TEST_JS_INCLUDES) == null) {
        tests.add(new OrphanTestFinder(orphans));
    }

    return tests.toArray();
}
 
Example #14
Source File: ScriptTest.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates a test factory for the set of .js source tests.
 *
 * @return a Object[] of test objects.
 * @throws Exception upon failure
 */
@SuppressWarnings("static-method")
@Factory
public Object[] suite() throws Exception {
    Locale.setDefault(new Locale(""));

    final List<ITest> tests = new ArrayList<>();
    final Set<String> orphans = new TreeSet<>();

    final TestFactory<ITest> testFactory = new TestFactory<ITest>() {
        @Override
        public ITest createTest(final String framework, final File testFile, final List<String> engineOptions, final Map<String, String> testOptions, final List<String> scriptArguments) {
            return new ScriptRunnable(framework, testFile, engineOptions, testOptions,  scriptArguments);
        }

        @Override
        public void log(final String msg) {
            org.testng.Reporter.log(msg, true);
        }
    };

    TestFinder.findAllTests(tests, orphans, testFactory);

    if (System.getProperty(TEST_JS_INCLUDES) == null) {
        tests.add(new OrphanTestFinder(orphans));
    }

    return tests.toArray();
}
 
Example #15
Source File: ScriptTest.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates a test factory for the set of .js source tests.
 *
 * @return a Object[] of test objects.
 * @throws Exception upon failure
 */
@SuppressWarnings("static-method")
@Factory
public Object[] suite() throws Exception {
    Locale.setDefault(new Locale(""));

    final List<ITest> tests = new ArrayList<>();
    final Set<String> orphans = new TreeSet<>();

    final TestFactory<ITest> testFactory = new TestFactory<ITest>() {
        @Override
        public ITest createTest(final String framework, final File testFile, final List<String> engineOptions, final Map<String, String> testOptions, final List<String> scriptArguments) {
            return new ScriptRunnable(framework, testFile, engineOptions, testOptions,  scriptArguments);
        }

        @Override
        public void log(final String msg) {
            org.testng.Reporter.log(msg, true);
        }
    };

    TestFinder.findAllTests(tests, orphans, testFactory);

    if (System.getProperty(TEST_JS_INCLUDES) == null) {
        tests.add(new OrphanTestFinder(orphans));
    }

    return tests.toArray();
}
 
Example #16
Source File: ScriptTest.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates a test factory for the set of .js source tests.
 *
 * @return a Object[] of test objects.
 * @throws Exception upon failure
 */
@SuppressWarnings("static-method")
@Factory
public Object[] suite() throws Exception {
    Locale.setDefault(new Locale(""));

    final List<ITest> tests = new ArrayList<>();
    final Set<String> orphans = new TreeSet<>();

    final TestFactory<ITest> testFactory = new TestFactory<ITest>() {
        @Override
        public ITest createTest(final String framework, final File testFile, final List<String> engineOptions, final Map<String, String> testOptions, final List<String> scriptArguments) {
            return new ScriptRunnable(framework, testFile, engineOptions, testOptions,  scriptArguments);
        }

        @Override
        public void log(final String msg) {
            org.testng.Reporter.log(msg, true);
        }
    };

    TestFinder.findAllTests(tests, orphans, testFactory);

    if (System.getProperty(TEST_JS_INCLUDES) == null) {
        tests.add(new OrphanTestFinder(orphans));
    }

    return tests.toArray();
}
 
Example #17
Source File: ScriptTest.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates a test factory for the set of .js source tests.
 *
 * @return a Object[] of test objects.
 * @throws Exception upon failure
 */
@SuppressWarnings("static-method")
@Factory
public Object[] suite() throws Exception {
    Locale.setDefault(new Locale(""));

    final List<ITest> tests = new ArrayList<>();
    final Set<String> orphans = new TreeSet<>();

    final TestFactory<ITest> testFactory = new TestFactory<ITest>() {
        @Override
        public ITest createTest(final String framework, final File testFile, final List<String> engineOptions, final Map<String, String> testOptions, final List<String> scriptArguments) {
            return new ScriptRunnable(framework, testFile, engineOptions, testOptions,  scriptArguments);
        }

        @Override
        public void log(final String msg) {
            org.testng.Reporter.log(msg, true);
        }
    };

    TestFinder.findAllTests(tests, orphans, testFactory);

    if (System.getProperty(TEST_JS_INCLUDES) == null) {
        tests.add(new OrphanTestFinder(orphans));
    }

    return tests.toArray();
}
 
Example #18
Source File: ScriptTest.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates a test factory for the set of .js source tests.
 *
 * @return a Object[] of test objects.
 * @throws Exception upon failure
 */
@SuppressWarnings("static-method")
@Factory
public Object[] suite() throws Exception {
    Locale.setDefault(new Locale(""));

    final List<ITest> tests = new ArrayList<>();
    final Set<String> orphans = new TreeSet<>();

    final TestFactory<ITest> testFactory = new TestFactory<ITest>() {
        @Override
        public ITest createTest(final String framework, final File testFile, final List<String> engineOptions, final Map<String, String> testOptions, final List<String> scriptArguments) {
            return new ScriptRunnable(framework, testFile, engineOptions, testOptions,  scriptArguments);
        }

        @Override
        public void log(final String msg) {
            org.testng.Reporter.log(msg, true);
        }
    };

    TestFinder.findAllTests(tests, orphans, testFactory);

    if (System.getProperty(TEST_JS_INCLUDES) == null) {
        tests.add(new OrphanTestFinder(orphans));
    }

    return tests.toArray();
}