@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")); } }
@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")); } }