@Test
public void parseInvalidRootElement() throws Exception {

    StringBuilder string0 = new StringBuilder(200)
        .append("<?xml version=\"1.0\"?>\n")
        .append("<operation2 type=\"submit\">\n")
        .append("</operation2>\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.INVALID_XML, e.getErrorCode());
        Assert.assertThat(e.getMessage(), CoreMatchers.containsString("Root element must be an [operation]"));
        Assert.assertNull(e.getOperation());
    }
}