Remove redundant def parameters.
@@ -19,7 +19,7 @@ public class DefParserNamespaceTest {
@Test
public void namespace_is_set_on_root_node() {
- DefParser parser = createParser("version=1\nnamespace=myproject.config\na string\n");
+ DefParser parser = createParser("version=1\nnamespace=myproject.config\n");
CNode root = parser.getTree();
assertThat(root.getNamespace(), is("myproject.config"));
}
@@ -34,19 +34,18 @@ public class DefParserNamespaceTest {
@Test(expected = CodegenRuntimeException.class)
public void uppercase_chars_are_not_allowed() {
- createParser("version=1\nnamespace=Foo\na string\n").getTree();
+ createParser("version=1\nnamespace=Foo\n").getTree();
}
@Test(expected = CodegenRuntimeException.class)
public void explicit_com_yahoo_prefix_is_not_allowed() {
createParser("version=1\n" +
- "namespace=com.yahoo.myproject.config\n" +
- "a string\n").getTree();
+ "namespace=com.yahoo.myproject.config\n").getTree();
}
@Test
public void spaces_are_allowed_around_equals_sign() {
- DefParser parser = createParser("version=1\nnamespace = myproject.config\na string\n");
+ DefParser parser = createParser("version=1\nnamespace = myproject.config\n");
CNode root = parser.getTree();
assertThat(root.getNamespace(), is("myproject.config"));
}
@@ -63,10 +62,10 @@ public class DefParserNamespaceTest {
@Test
public void namespace_alters_def_md5() {
- DefParser parser = createParser("version=1\na string\n");
+ DefParser parser = createParser("version=1\n");
CNode root = parser.getTree();
- parser = createParser("version=1\nnamespace=myproject.config\na string\n");
+ parser = createParser("version=1\nnamespace=myproject.config\n");
CNode namespaceRoot = parser.getTree();
assertThat(root.defMd5, not(namespaceRoot.defMd5));
@@ -76,7 +75,7 @@ public class DefParserNamespaceTest {
@Test
public void number_is_allowed_as_non_leading_char_in_namespace() throws IOException, DefParser.DefParserException {
StringBuilder sb = createDefTemplate();
- String line = "namespace=a.b.c2\nfoo int\n";
+ String line = "namespace=a.b.c2\n";
sb.append(line);
createParser(sb.toString()).parse();
}
@@ -94,12 +93,12 @@ public class DefParserNamespaceTest {
@Test
public void underscore_in_namespace_is_allowed() throws IOException, DefParser.DefParserException {
StringBuilder sb = createDefTemplate();
- String line = "namespace=a_b.c\nfoo int\n";
+ String line = "namespace=a_b.c\n";
sb.append(line);
createParser(sb.toString()).parse();
sb = createDefTemplate();
- line = "namespace=a_b.c_d\nfoo int\n";
+ line = "namespace=a_b.c_d\n";
sb.append(line);
createParser(sb.toString()).parse();
}
