# HG changeset patch # User sundar # Date 1409053877 -19800 # Node ID ec63f6d0eee4a3eae3a6ab7fc10230b0ce3c80dd # Parent 66c7c54fe70c5172dc4ca68f392be8c2ee9cc733 8056050: runExternalJsTest method in test/jdk/nashorn/internal/runtime/ClassFilter.java slows down "ant test" Reviewed-by: attila, jlaskey diff -r 66c7c54fe70c -r ec63f6d0eee4 nashorn/test/src/jdk/nashorn/internal/runtime/ClassFilterTest.java --- a/nashorn/test/src/jdk/nashorn/internal/runtime/ClassFilterTest.java Tue Aug 26 11:45:36 2014 +0200 +++ b/nashorn/test/src/jdk/nashorn/internal/runtime/ClassFilterTest.java Tue Aug 26 17:21:17 2014 +0530 @@ -38,10 +38,15 @@ import static org.testng.Assert.fail; public class ClassFilterTest { + private static final String NASHORN_CODE_CACHE = "nashorn.persistent.code.cache"; + private static final String CLASSFILTER_CODE_CACHE = "build/classfilter_nashorn_code_cache"; - private final String codeCache = "build/nashorn_code_cache"; - - @Test + // @Test + // This test takes too much time for basic "ant clean test" run. + // Given that "allow-all-java-classes" is equivalent to no java class + // filter and external tests don't access any java, not sure if this + // test contributes much. We need faster "ant clean test" cycle for + // developers. public void runExternalJsTest() { String[] paths = new String[]{ "test/script/basic/compile-octane.js", @@ -107,7 +112,18 @@ @Test public void persistentCacheTest() { - System.setProperty("nashorn.persistent.code.cache", codeCache); + final String oldCodeCache = System.getProperty(NASHORN_CODE_CACHE); + System.setProperty(NASHORN_CODE_CACHE, CLASSFILTER_CODE_CACHE); + try { + persistentCacheTestImpl(); + } finally { + if (oldCodeCache != null) { + System.setProperty(NASHORN_CODE_CACHE, oldCodeCache); + } + } + } + + private void persistentCacheTestImpl() { NashornScriptEngineFactory factory = new NashornScriptEngineFactory(); ScriptEngine engine = factory.getScriptEngine( new String[]{"--persistent-code-cache"},