Ignore:
Timestamp:
02/17/14 10:58:11 (10 years ago)
Author:
mwindhouwer
Message:

M src/test/resources/schema/general-component-schema.xsd

  • added a Schematron rule to test if there are no multiple references to the same component among siblings

A src/test/resources/docs/CLARINWebService_faulty-9.xml
M src/test/java/clarin/cmdi/schema/cmd/TestCMDValidate.java

  • added test on faulty document with a double component reference
File:
1 edited

Legend:

Unmodified
Added
Removed
  • ComponentRegistry/trunk/CMDValidate/src/test/java/clarin/cmdi/schema/cmd/TestCMDValidate.java

    r2011 r4524  
    158158        assertEquals("An attribute has the same name ('Service') as its element or component! Please, consider to rename one of them.",message.text);
    159159    }
     160
     161    @Test
     162    public void invalid_9() throws Exception {
     163        assertFalse(validate("CLARINWebService_faulty-9.xml"));
     164
     165        final List<Message> messages = cmdValidator.getMessages();
     166        assertEquals(1, messages.size());
     167        Message message = messages.get(0);
     168        assertTrue(message.error);
     169        assertEquals("/CMD_ComponentSpec[1]/CMD_Component[1]/CMD_Component[1]/CMD_Component[2]/CMD_Component[1]/CMD_Component[2]/CMD_Component[3]", message.location);
     170        assertEquals("empty(preceding-sibling::CMD_Component[@ComponentId=current()/@ComponentId])", message.test);
     171        assertNotNull(message.text);
     172    }
     173
    160174}
Note: See TracChangeset for help on using the changeset viewer.