本文整理汇总了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);
}
示例2: threw
import org.mozilla.javascript.drivers.ShellTest; //导入依赖的package包/类
@Override
public final void threw(Throwable t) {
Assert.fail(ShellTest.getStackTrace(t));
}
示例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();
}
}
示例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();
}
}
示例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();
}
}