예제 #1
0
 @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);
   }
 }
예제 #2
0
 @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);
   }
 }