Java 类org.mozilla.javascript.drivers.ShellTest 实例源码

项目:whackpad    文件:MozillaSuiteTest.java   
@Test
public void runMozillaTest() throws Exception {
    //System.out.println("Test \"" + jsFile + "\" running under optimization level " + optimizationLevel);
    final ShellContextFactory shellContextFactory =
        new ShellContextFactory();
    shellContextFactory.setOptimizationLevel(optimizationLevel);
    ShellTestParameters params = new ShellTestParameters();
    JunitStatus status = new JunitStatus();
    ShellTest.run(shellContextFactory, jsFile, params, status);
}
项目:rhino-android    文件:MozillaSuiteTest.java   
@Test
public void runMozillaTest() throws Exception {
    //System.out.println("Test \"" + jsFile + "\" running under optimization level " + optimizationLevel);
    final ShellContextFactory shellContextFactory =
        new ShellContextFactory();
    shellContextFactory.setOptimizationLevel(optimizationLevel);
    ShellTestParameters params = new ShellTestParameters();
    JunitStatus status = new JunitStatus();
    ShellTest.run(shellContextFactory, jsFile, params, status);
}
项目:code404    文件:MozillaSuiteTest.java   
@Test
public void runMozillaTest() throws Exception {
    //System.out.println("Test \"" + jsFile + "\" running under optimization level " + optimizationLevel);
    final ShellContextFactory shellContextFactory =
        new ShellContextFactory();
    shellContextFactory.setOptimizationLevel(optimizationLevel);
    ShellTestParameters params = new ShellTestParameters();
    JunitStatus status = new JunitStatus();
    ShellTest.run(shellContextFactory, jsFile, params, status);
}
项目:rhino-jscover    文件:MozillaSuiteTest.java   
@Test
public void runMozillaTest() throws Exception {
    //System.out.println("Test \"" + jsFile + "\" running under optimization level " + optimizationLevel);
    final ShellContextFactory shellContextFactory =
        new ShellContextFactory();
    shellContextFactory.setOptimizationLevel(optimizationLevel);
    ShellTestParameters params = new ShellTestParameters();
    JunitStatus status = new JunitStatus();
    ShellTest.run(shellContextFactory, jsFile, params, status);
}
项目:astor    文件:MozillaSuiteTest.java   
@Test
public void runMozillaTest() throws Exception {
    //System.out.println("Test \"" + jsFile + "\" running under optimization level " + optimizationLevel);
    final ShellContextFactory shellContextFactory =
        new ShellContextFactory();
    shellContextFactory.setOptimizationLevel(optimizationLevel);
    ShellTestParameters params = new ShellTestParameters();
    JunitStatus status = new JunitStatus();
    ShellTest.run(shellContextFactory, jsFile, params, status);
}
项目:Rhino-Prov-Mod    文件:MozillaSuiteTest.java   
@Test
public void runMozillaTest() throws Exception {
    //System.out.println("Test \"" + jsFile + "\" running under optimization level " + optimizationLevel);
    final ShellContextFactory shellContextFactory =
        new ShellContextFactory();
    shellContextFactory.setOptimizationLevel(optimizationLevel);
    ShellTestParameters params = new ShellTestParameters();
    JunitStatus status = new JunitStatus();
    ShellTest.run(shellContextFactory, jsFile, params, status);
}
项目:whackpad    文件:MozillaSuiteTest.java   
@Override
public final void threw(Throwable t) {
    Assert.fail(ShellTest.getStackTrace(t));
}
项目:whackpad    文件:MozillaSuiteTest.java   
/**
 * The main class will run all the test files that are *not* covered in
 * the *.tests files, and print out a list of all the tests that pass.
 */
public static void main(String[] args) throws IOException {
    PrintStream out = new PrintStream("fix-tests-files.sh");
    try {
        for (int i=0; i < OPT_LEVELS.length; i++) {
            int optLevel = OPT_LEVELS[i];
            File testDir = getTestDir();
            File[] allTests = 
                TestUtils.recursiveListFiles(testDir,
                    new FileFilter() {
                        public boolean accept(File pathname)
                        {
                            return ShellTest.DIRECTORY_FILTER.accept(pathname) ||
                                   ShellTest.TEST_FILTER.accept(pathname);
                        }
                });
            HashSet<File> diff = new HashSet<File>(Arrays.asList(allTests));
            File testFiles[] = getTestFiles(optLevel);
            diff.removeAll(Arrays.asList(testFiles));
            ArrayList<String> skippedPassed = new ArrayList<String>();
            int absolutePathLength = testDir.getAbsolutePath().length() + 1;
            for (File testFile: diff) {
                try {
                    (new MozillaSuiteTest(testFile, optLevel)).runMozillaTest();
                    // strip off testDir
                    String canonicalized =
                        testFile.getAbsolutePath().substring(absolutePathLength);
                    canonicalized = canonicalized.replace('\\', '/');
                    skippedPassed.add(canonicalized);
                } catch (Throwable t) {
                    // failed, so skip
                }
            }
            // "skippedPassed" now contains all the tests that are currently
            // skipped but now pass. Print out shell commands to update the
            // appropriate *.tests file.
            if (skippedPassed.size() > 0) {
                out.println("cat >> " + getTestFilename(optLevel) + " <<EOF");
                String[] sorted = skippedPassed.toArray(new String[0]);
                Arrays.sort(sorted);
                for (int j=0; j < sorted.length; j++) {
                    out.println(sorted[j]);
                }
                out.println("EOF");
            }
        }
        System.out.println("Done.");
    } finally {
        out.close();
    }
}
项目:rhino-android    文件:MozillaSuiteTest.java   
@Override
public final void threw(Throwable t) {
    Assert.fail(ShellTest.getStackTrace(t));
}
项目:rhino-android    文件:MozillaSuiteTest.java   
/**
 * The main class will run all the test files that are *not* covered in
 * the *.tests files, and print out a list of all the tests that pass.
 */
public static void main(String[] args) throws IOException {
    PrintStream out = new PrintStream("fix-tests-files.sh");
    try {
        for (int i=0; i < OPT_LEVELS.length; i++) {
            int optLevel = OPT_LEVELS[i];
            File testDir = getTestDir();
            File[] allTests =
                TestUtils.recursiveListAssets(testDir,
                    new FileFilter() {
                        public boolean accept(File pathname)
                        {
                            return ShellTest.DIRECTORY_FILTER.accept(pathname) ||
                                   ShellTest.TEST_FILTER.accept(pathname);
                        }
                });
            HashSet<File> diff = new HashSet<File>(Arrays.asList(allTests));
            File testFiles[] = getTestFiles(optLevel);
            diff.removeAll(Arrays.asList(testFiles));
            ArrayList<String> skippedPassed = new ArrayList<String>();
            int absolutePathLength = testDir.getAbsolutePath().length() + 1;
            for (File testFile: diff) {
                try {
                    (new MozillaSuiteTest(testFile, optLevel)).runMozillaTest();
                    // strip off testDir
                    String canonicalized =
                        testFile.getAbsolutePath().substring(absolutePathLength);
                    canonicalized = canonicalized.replace('\\', '/');
                    skippedPassed.add(canonicalized);
                } catch (Throwable t) {
                    // failed, so skip
                }
            }
            // "skippedPassed" now contains all the tests that are currently
            // skipped but now pass. Print out shell commands to update the
            // appropriate *.tests file.
            if (skippedPassed.size() > 0) {
                out.println("cat >> " + getTestFilename(optLevel) + " <<EOF");
                String[] sorted = skippedPassed.toArray(new String[0]);
                Arrays.sort(sorted);
                for (int j=0; j < sorted.length; j++) {
                    out.println(sorted[j]);
                }
                out.println("EOF");
            }
        }
        System.out.println("Done.");
    } finally {
        out.close();
    }
}
项目:code404    文件:MozillaSuiteTest.java   
@Override
public final void threw(Throwable t) {
    Assert.fail(ShellTest.getStackTrace(t));
}
项目:code404    文件:MozillaSuiteTest.java   
/**
 * The main class will run all the test files that are *not* covered in
 * the *.tests files, and print out a list of all the tests that pass.
 */
public static void main(String[] args) throws IOException {
    PrintStream out = new PrintStream("fix-tests-files.sh");
    try {
        for (int i=0; i < OPT_LEVELS.length; i++) {
            int optLevel = OPT_LEVELS[i];
            File testDir = getTestDir();
            File[] allTests =
                TestUtils.recursiveListFiles(testDir,
                    new FileFilter() {
                        public boolean accept(File pathname)
                        {
                            return ShellTest.DIRECTORY_FILTER.accept(pathname) ||
                                   ShellTest.TEST_FILTER.accept(pathname);
                        }
                });
            HashSet<File> diff = new HashSet<File>(Arrays.asList(allTests));
            File testFiles[] = getTestFiles(optLevel);
            diff.removeAll(Arrays.asList(testFiles));
            ArrayList<String> skippedPassed = new ArrayList<String>();
            int absolutePathLength = testDir.getAbsolutePath().length() + 1;
            for (File testFile: diff) {
                try {
                    (new MozillaSuiteTest(testFile, optLevel)).runMozillaTest();
                    // strip off testDir
                    String canonicalized =
                        testFile.getAbsolutePath().substring(absolutePathLength);
                    canonicalized = canonicalized.replace('\\', '/');
                    skippedPassed.add(canonicalized);
                } catch (Throwable t) {
                    // failed, so skip
                }
            }
            // "skippedPassed" now contains all the tests that are currently
            // skipped but now pass. Print out shell commands to update the
            // appropriate *.tests file.
            if (skippedPassed.size() > 0) {
                out.println("cat >> " + getTestFilename(optLevel) + " <<EOF");
                String[] sorted = skippedPassed.toArray(new String[0]);
                Arrays.sort(sorted);
                for (int j=0; j < sorted.length; j++) {
                    out.println(sorted[j]);
                }
                out.println("EOF");
            }
        }
        System.out.println("Done.");
    } finally {
        out.close();
    }
}
项目:rhino-jscover    文件:MozillaSuiteTest.java   
@Override
public final void threw(Throwable t) {
    Assert.fail(ShellTest.getStackTrace(t));
}
项目:rhino-jscover    文件:MozillaSuiteTest.java   
/**
 * The main class will run all the test files that are *not* covered in
 * the *.tests files, and print out a list of all the tests that pass.
 */
public static void main(String[] args) throws IOException {
    PrintStream out = new PrintStream("fix-tests-files.sh");
    try {
        for (int i=0; i < OPT_LEVELS.length; i++) {
            int optLevel = OPT_LEVELS[i];
            File testDir = getTestDir();
            File[] allTests =
                TestUtils.recursiveListFiles(testDir,
                    new FileFilter() {
                        public boolean accept(File pathname)
                        {
                            return ShellTest.DIRECTORY_FILTER.accept(pathname) ||
                                   ShellTest.TEST_FILTER.accept(pathname);
                        }
                });
            HashSet<File> diff = new HashSet<File>(Arrays.asList(allTests));
            File testFiles[] = getTestFiles(optLevel);
            diff.removeAll(Arrays.asList(testFiles));
            ArrayList<String> skippedPassed = new ArrayList<String>();
            int absolutePathLength = testDir.getAbsolutePath().length() + 1;
            for (File testFile: diff) {
                try {
                    (new MozillaSuiteTest(testFile, optLevel)).runMozillaTest();
                    // strip off testDir
                    String canonicalized =
                        testFile.getAbsolutePath().substring(absolutePathLength);
                    canonicalized = canonicalized.replace('\\', '/');
                    skippedPassed.add(canonicalized);
                } catch (Throwable t) {
                    // failed, so skip
                }
            }
            // "skippedPassed" now contains all the tests that are currently
            // skipped but now pass. Print out shell commands to update the
            // appropriate *.tests file.
            if (skippedPassed.size() > 0) {
                out.println("cat >> " + getTestFilename(optLevel) + " <<EOF");
                String[] sorted = skippedPassed.toArray(new String[0]);
                Arrays.sort(sorted);
                for (int j=0; j < sorted.length; j++) {
                    out.println(sorted[j]);
                }
                out.println("EOF");
            }
        }
        System.out.println("Done.");
    } finally {
        out.close();
    }
}
项目:astor    文件:MozillaSuiteTest.java   
@Override
public final void threw(Throwable t) {
    Assert.fail(ShellTest.getStackTrace(t));
}
项目:astor    文件:MozillaSuiteTest.java   
/**
 * The main class will run all the test files that are *not* covered in
 * the *.tests files, and print out a list of all the tests that pass.
 */
public static void main(String[] args) throws IOException {
    PrintStream out = new PrintStream("fix-tests-files.sh");
    try {
        for (int i=0; i < OPT_LEVELS.length; i++) {
            int optLevel = OPT_LEVELS[i];
            File testDir = getTestDir();
            File[] allTests =
                TestUtils.recursiveListFiles(testDir,
                    new FileFilter() {
                        public boolean accept(File pathname)
                        {
                            return ShellTest.DIRECTORY_FILTER.accept(pathname) ||
                                   ShellTest.TEST_FILTER.accept(pathname);
                        }
                });
            HashSet<File> diff = new HashSet<File>(Arrays.asList(allTests));
            File testFiles[] = getTestFiles(optLevel);
            diff.removeAll(Arrays.asList(testFiles));
            ArrayList<String> skippedPassed = new ArrayList<String>();
            int absolutePathLength = testDir.getAbsolutePath().length() + 1;
            for (File testFile: diff) {
                try {
                    (new MozillaSuiteTest(testFile, optLevel)).runMozillaTest();
                    // strip off testDir
                    String canonicalized =
                        testFile.getAbsolutePath().substring(absolutePathLength);
                    canonicalized = canonicalized.replace('\\', '/');
                    skippedPassed.add(canonicalized);
                } catch (Throwable t) {
                    // failed, so skip
                }
            }
            // "skippedPassed" now contains all the tests that are currently
            // skipped but now pass. Print out shell commands to update the
            // appropriate *.tests file.
            if (skippedPassed.size() > 0) {
                out.println("cat >> " + getTestFilename(optLevel) + " <<EOF");
                String[] sorted = skippedPassed.toArray(new String[0]);
                Arrays.sort(sorted);
                for (int j=0; j < sorted.length; j++) {
                    out.println(sorted[j]);
                }
                out.println("EOF");
            }
        }
        System.out.println("Done.");
    } finally {
        out.close();
    }
}
项目:Rhino-Prov-Mod    文件:MozillaSuiteTest.java   
@Override
public final void threw(Throwable t) {
    Assert.fail(ShellTest.getStackTrace(t));
}
项目:Rhino-Prov-Mod    文件:MozillaSuiteTest.java   
/**
 * The main class will run all the test files that are *not* covered in
 * the *.tests files, and print out a list of all the tests that pass.
 */
public static void main(String[] args) throws IOException {
    PrintStream out = new PrintStream("fix-tests-files.sh");
    try {
        for (int i=0; i < OPT_LEVELS.length; i++) {
            int optLevel = OPT_LEVELS[i];
            File testDir = getTestDir();
            File[] allTests =
                TestUtils.recursiveListFiles(testDir,
                    new FileFilter() {
                        public boolean accept(File pathname)
                        {
                            return ShellTest.DIRECTORY_FILTER.accept(pathname) ||
                                   ShellTest.TEST_FILTER.accept(pathname);
                        }
                });
            HashSet<File> diff = new HashSet<File>(Arrays.asList(allTests));
            File testFiles[] = getTestFiles(optLevel);
            diff.removeAll(Arrays.asList(testFiles));
            ArrayList<String> skippedPassed = new ArrayList<String>();
            int absolutePathLength = testDir.getAbsolutePath().length() + 1;
            for (File testFile: diff) {
                try {
                    (new MozillaSuiteTest(testFile, optLevel)).runMozillaTest();
                    // strip off testDir
                    String canonicalized =
                        testFile.getAbsolutePath().substring(absolutePathLength);
                    canonicalized = canonicalized.replace('\\', '/');
                    skippedPassed.add(canonicalized);
                } catch (Throwable t) {
                    // failed, so skip
                }
            }
            // "skippedPassed" now contains all the tests that are currently
            // skipped but now pass. Print out shell commands to update the
            // appropriate *.tests file.
            if (skippedPassed.size() > 0) {
                out.println("cat >> " + getTestFilename(optLevel) + " <<EOF");
                String[] sorted = skippedPassed.toArray(new String[0]);
                Arrays.sort(sorted);
                for (int j=0; j < sorted.length; j++) {
                    out.println(sorted[j]);
                }
                out.println("EOF");
            }
        }
        System.out.println("Done.");
    } finally {
        out.close();
    }
}