예제 #1
0
 protected Key executeExpression(String expr) {
   DKV.write_barrier();
   try {
     int i = UNIQUE.getAndIncrement();
     Key key = Exec.exec(expr, "RBigResult" + i);
     return key;
   } catch (PositionedException e) {
     System.out.println(e.report(expr));
     e.printStackTrace();
     assertTrue(false);
     return null;
   }
 }
예제 #2
0
 protected void testExecFail(String expr, int errorPos) {
   DKV.write_barrier();
   int keys = H2O.store_size();
   try {
     int i = UNIQUE.getAndIncrement();
     System.err.println("result" + (new Integer(i).toString()) + ": " + expr);
     Key key = Exec.exec(expr, "result" + (new Integer(i).toString()));
     UKV.remove(key);
     assertTrue("An exception should have been thrown.", false);
   } catch (ParserException e) {
     assertTrue(false);
   } catch (EvaluationException e) {
     if (errorPos != -1) assertEquals(errorPos, e._pos);
   }
   DKV.write_barrier();
   assertEquals("Keys were not properly deleted for expression " + expr, keys, H2O.store_size());
 }