@Test
public void parseErrorResponse() throws Exception {

    StringBuilder string0 = new StringBuilder(200)
        .append("<?xml version=\"1.0\"?>\n")
        .append("<operation type=\"submit\">\n")
        .append(" <error code=\"1001\" message=\"This is a test message\" />\n")
        .append("</operation>\n")
        .append("");
    ByteArrayInputStream is = new ByteArrayInputStream(string0.toString().getBytes());
    SxmpParser parser = new SxmpParser();
    Operation operation = parser.parse(is);
    Assert.assertEquals(Operation.Type.SUBMIT, operation.getType());
    Assert.assertEquals(true, operation.isResponse());
    ErrorResponse errorResponse = (ErrorResponse)operation;
    Assert.assertEquals(new Integer(1001), errorResponse.getErrorCode());
    Assert.assertEquals("This is a test message", errorResponse.getErrorMessage());
}