Пример #1
0
 @Test
 public void testSyntaxError() throws RecognitionException, IOException {
   try {
     Schema.parse("a, b:word, a:text, d:text");
     fail("Should have thrown syntax error");
   } catch (SchemaParseException e) {
     assertTrue(e.getMessage().contains("Syntax error"));
   }
 }
Пример #2
0
 @Test
 public void testMultipleDefinition() throws RecognitionException, IOException {
   try {
     Schema.parse("a:numeric, b:word, a:text, d:text");
     fail("Should have thrown syntax error");
   } catch (SchemaParseException e) {
     assertTrue(e.getMessage().contains("multiply defined"));
   }
 }