当前位置: 首页>>代码示例>>Java>>正文


Java ShellTest类代码示例

本文整理汇总了Java中org.mozilla.javascript.drivers.ShellTest的典型用法代码示例。如果您正苦于以下问题:Java ShellTest类的具体用法?Java ShellTest怎么用?Java ShellTest使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ShellTest类属于org.mozilla.javascript.drivers包,在下文中一共展示了ShellTest类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: runMozillaTest

import org.mozilla.javascript.drivers.ShellTest; //导入依赖的package包/类
@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);
}
 
开发者ID:middle2tw,项目名称:whackpad,代码行数:11,代码来源:MozillaSuiteTest.java

示例2: threw

import org.mozilla.javascript.drivers.ShellTest; //导入依赖的package包/类
@Override
public final void threw(Throwable t) {
    Assert.fail(ShellTest.getStackTrace(t));
}
 
开发者ID:middle2tw,项目名称:whackpad,代码行数:5,代码来源:MozillaSuiteTest.java

示例3: main

import org.mozilla.javascript.drivers.ShellTest; //导入依赖的package包/类
/**
 * 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();
    }
}
 
开发者ID:middle2tw,项目名称:whackpad,代码行数:55,代码来源:MozillaSuiteTest.java

示例4: main

import org.mozilla.javascript.drivers.ShellTest; //导入依赖的package包/类
/**
 * 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();
    }
}
 
开发者ID:F43nd1r,项目名称:rhino-android,代码行数:55,代码来源:MozillaSuiteTest.java

示例5: main

import org.mozilla.javascript.drivers.ShellTest; //导入依赖的package包/类
/**
 * 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();
    }
}
 
开发者ID:CyboticCatfish,项目名称:code404,代码行数:55,代码来源:MozillaSuiteTest.java


注:本文中的org.mozilla.javascript.drivers.ShellTest类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。