diff options
author | Jon Bratseth <bratseth@gmail.com> | 2022-05-16 23:55:36 +0200 |
---|---|---|
committer | Jon Bratseth <bratseth@gmail.com> | 2022-05-16 23:55:36 +0200 |
commit | 48cd2507f132fdc376a721d05fdf6f55b4358fdd (patch) | |
tree | 37b502cbc7957f25eebf2a58cf9b085509966a9d /config-model/src/test/java/com | |
parent | e2f707a511fd320d41d6ab33fb75ebbc4b4c54fe (diff) |
Rename to SchemaParser
Diffstat (limited to 'config-model/src/test/java/com')
-rw-r--r-- | config-model/src/test/java/com/yahoo/searchdefinition/parser/SchemaParserTestCase.java (renamed from config-model/src/test/java/com/yahoo/searchdefinition/parser/IntermediateParserTestCase.java) | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/parser/IntermediateParserTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/parser/SchemaParserTestCase.java index 1e0c554af81..17d94639d87 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/parser/IntermediateParserTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/parser/SchemaParserTestCase.java @@ -10,20 +10,22 @@ import java.io.File; import org.junit.Test; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotEquals; +import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertThrows; /** * @author arnej */ -public class IntermediateParserTestCase { +public class SchemaParserTestCase { ParsedSchema parseString(String input) throws Exception { var deployLogger = new BaseDeployLogger(); var modelProperties = new TestProperties(); var stream = new SimpleCharStream(input); try { - var parser = new IntermediateParser(stream, deployLogger, modelProperties); + var parser = new SchemaParser(stream, deployLogger, modelProperties); return parser.schema(); } catch (ParseException pe) { throw new ParseException(stream.formatException(pe.getMessage())); @@ -60,7 +62,7 @@ public class IntermediateParserTestCase { } @Test - public void multiple_documents_disallowed() throws Exception { + public void multiple_documents_disallowed() { String input = joinLines ("schema foo {", " document foo {", @@ -85,11 +87,10 @@ public class IntermediateParserTestCase { } void checkFileParses(String fileName) throws Exception { - System.err.println("TRY parsing: "+fileName); var schema = parseFile(fileName); - assertTrue(schema != null); - assertTrue(schema.name() != null); - assertTrue(! schema.name().equals("")); + assertNotNull(schema); + assertNotNull(schema.name()); + assertNotEquals("", schema.name()); } @Test |