@Test
    void testDuplicateNamesInDoc() {
        try {
            ApplicationBuilder.createFromString(
                    "search duplicatenamesindoc {\n" +
                            "  document {\n" +
                            "    field foo type int {\n" +
                            "      indexing: attribute\n" +
                            "    }\n" +
                            "    field fOo type string {\n" +
                            "      indexing: index\n" +
                            "    }\n" +
                            "  }\n" +
                            "}");
            fail("Should throw exception.");
        } catch (Exception e) {
            assertTrue(e.getMessage().matches(".*Duplicate.*"));
        }
    }
Tests that "name" is not allowed as name for a field.

And that duplicate names are not allowed. 

@author Lars Christian Jensen
config-model/src/test/java/com/yahoo/schema/NameFieldCheckTestCase.java