예제 #1
0
 @Test
 public void test6() throws ParseException {
   varStr = "'abc.a'|f1:\"a'b|c,\"|f2:bec,xz";
   parser = new FilterParser(varStr);
   parser.parse();
   assertEquals("'abc.a'", parser.getVariable());
   assertEquals(2, parser.getFilters().size());
   assertEquals("f1", parser.getFilters().get(0));
   assertEquals("\"a'b|c,\"", parser.getArgss().get(0)[0]);
   assertEquals("bec", parser.getArgss().get(1)[0]);
   assertEquals(2, parser.getArgss().get(1).length);
 }
예제 #2
0
 @Test(expected = ParseException.class)
 public void test2() throws ParseException {
   varStr = "abc.a|f1:'abc\",b|f2";
   parser = new FilterParser(varStr);
   parser.parse();
   assertEquals("abc.a", parser.getVariable());
   assertEquals(2, parser.getFilters().size());
   assertEquals(2, parser.getArgss().get(0).length);
 }
예제 #3
0
 @Test
 public void test5() throws ParseException {
   varStr = "'abc.a'|f1:\"a'b|c,\",b|f2";
   parser = new FilterParser(varStr);
   parser.parse();
   assertEquals("'abc.a'", parser.getVariable());
   assertEquals(2, parser.getFilters().size());
   assertEquals(2, parser.getArgss().get(0).length);
 }
예제 #4
0
 @Test
 public void test1() throws ParseException {
   varStr = "abc.a|f1:abc,b|f2";
   parser = new FilterParser(varStr);
   parser.parse();
   assertEquals("abc.a", parser.getVariable());
   assertEquals(2, parser.getFilters().size());
   assertEquals(2, parser.getArgss().get(0).length);
 }