@Test public void test004() throws Exception { J2V8Handler h = new J2V8Handler( readFile("../../src/main/resources/js/j2v8test04.js", Charset.defaultCharset()), 1); h.init(); assertEquals(30, h.getCommitInterval()); assertEquals(false, h.getTerminateOnBadData()); assertEquals(false, h.getTerminateOnBadEval()); }
@Test public void test006() throws Exception { J2V8Handler h = new J2V8Handler( readFile("../../src/main/resources/js/j2v8test04.js", Charset.defaultCharset()), 1); h.init(); assertEquals(30, h.getCommitInterval()); assertEquals(false, h.getTerminateOnBadData()); try { h.process( readFile("../../src/main/resources/js/j2v8test04_data.js", Charset.defaultCharset())); assertEquals(true, true); } catch (Exception e) { System.err.println(e.getMessage()); assertEquals(true, false); } }
@Test public void test007() throws Exception { J2V8Handler h = new J2V8Handler( readFile("../../src/main/resources/js/j2v8test07.js", Charset.defaultCharset()), 1); h.init(); try { String data = readFile("../../src/main/resources/js/j2v8test07_data.js", Charset.defaultCharset()); long start = System.currentTimeMillis(); for (int i = 0; i < 1000000; i++) h.process(data); long elapsedTime = System.currentTimeMillis() - start; System.err.println(elapsedTime); assertEquals(true, true); } catch (Exception e) { System.err.println(e.getMessage()); assertEquals(true, false); } }
@BeforeClass public static void setUpBeforeClass() throws java.lang.Exception { J2V8Handler.addCallbackFactory(new KeyValueStoreCallbackFactory(new HashKeyValueStoreStub<>())); }