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

项目:code404    文件:MozillaSuiteTest.java   
public static File getTestDir() throws IOException {
    File testDir = null;
    if (System.getProperty("mozilla.js.tests") != null) {
        testDir = new File(System.getProperty("mozilla.js.tests"));
    } else {
        URL url = StandardTests.class.getResource(".");
        String path = url.getFile();
        int jsIndex = path.lastIndexOf("/js");
        if (jsIndex == -1) {
            throw new IllegalStateException("You aren't running the tests "+
                "from within the standard mozilla/js directory structure");
        }
        path = path.substring(0, jsIndex + 3).replace('/', File.separatorChar);
        path = path.replace("%20", " ");
        testDir = new File(path, "tests");
    }
    if (!testDir.isDirectory()) {
        throw new FileNotFoundException(testDir + " is not a directory");
    }
    return testDir;
}
项目:rhino-jscover    文件:MozillaSuiteTest.java   
public static File getTestDir() throws IOException {
    File testDir = null;
    if (System.getProperty("mozilla.js.tests") != null) {
        testDir = new File(System.getProperty("mozilla.js.tests"));
    } else {
        URL url = StandardTests.class.getResource(".");
        String path = url.getFile();
        int jsIndex = path.lastIndexOf("/js");
        if (jsIndex == -1) {
            throw new IllegalStateException("You aren't running the tests "+
                "from within the standard mozilla/js directory structure");
        }
        path = path.substring(0, jsIndex + 3).replace('/', File.separatorChar);
        path = path.replace("%20", " ");
        testDir = new File(path, "tests");
    }
    if (!testDir.isDirectory()) {
        throw new FileNotFoundException(testDir + " is not a directory");
    }
    return testDir;
}
项目:astor    文件:MozillaSuiteTest.java   
public static File getTestDir() throws IOException {
    File testDir = null;
    if (System.getProperty("mozilla.js.tests") != null) {
        testDir = new File(System.getProperty("mozilla.js.tests"));
    } else {
        URL url = StandardTests.class.getResource(".");
        String path = url.getFile();
        int jsIndex = path.lastIndexOf("/js");
        if (jsIndex == -1) {
            throw new IllegalStateException("You aren't running the tests "+
                "from within the standard mozilla/js directory structure");
        }
        path = path.substring(0, jsIndex + 3).replace('/', File.separatorChar);
        path = path.replace("%20", " ");
        testDir = new File(path, "tests");
    }
    if (!testDir.isDirectory()) {
        throw new FileNotFoundException(testDir + " is not a directory");
    }
    return testDir;
}
项目:Rhino-Prov-Mod    文件:MozillaSuiteTest.java   
public static File getTestDir() throws IOException {
    File testDir = null;
    if (System.getProperty("mozilla.js.tests") != null) {
        testDir = new File(System.getProperty("mozilla.js.tests"));
    } else {
        URL url = StandardTests.class.getResource(".");
        String path = url.getFile();
        int jsIndex = path.lastIndexOf("/js");
        if (jsIndex == -1) {
            throw new IllegalStateException("You aren't running the tests "+
                "from within the standard mozilla/js directory structure");
        }
        path = path.substring(0, jsIndex + 3).replace('/', File.separatorChar);
        path = path.replace("%20", " ");
        testDir = new File(path, "tests");
    }
    if (!testDir.isDirectory()) {
        throw new FileNotFoundException(testDir + " is not a directory");
    }
    return testDir;
}