@Test
public void parseUnsupportedChildElement() throws Exception {

    StringBuilder string0 = new StringBuilder(200)
        .append("<?xml version=\"1.0\"?>\n")
        .append("<operation type=\"submit\">\n")
        .append("  <test></test>\n")
        .append("</operation>\n")
        .append("");
    ByteArrayInputStream is = new ByteArrayInputStream(string0.toString().getBytes());
    SxmpParser parser = new SxmpParser();
    try {
        Operation operation = parser.parse(is);
        Assert.fail();
    } catch (SxmpParsingException e) {
        // correct behavior
        Assert.assertEquals(SxmpErrorCode.UNSUPPORTED_ELEMENT, e.getErrorCode());
        Assert.assertThat(e.getMessage(), CoreMatchers.containsString("Unsupported [test] element"));
        // this should also contain an operation since the root element was parsed
        Assert.assertNotNull(e.getOperation());
        PartialOperation partial = (PartialOperation)e.getOperation();
        Assert.assertEquals(Operation.Type.SUBMIT, partial.getType());
    }
}