public void testFailOnSecondErrorFile() throws Exception {
   unmarshaller.setEventHandler(new CustomErrorValidationEventHandler());
   File file = new File(DOUBLE_ERROR_XML);
   try {
     unmarshaller.setSchema(this.schema);
     unmarshaller.unmarshal(file);
   } catch (UnmarshalException ex) {
     assertTrue(true);
     return;
   } catch (UnsupportedOperationException uoe) {
     // XDK does not support setSchema, so just pass in this case
     assertTrue(true);
     return;
   }
   fail("No Exceptions thrown.");
 }
 public void testFailOnSecondErrorInputStream() throws Exception {
   unmarshaller.setEventHandler(new CustomErrorValidationEventHandler());
   InputStream stream = ClassLoader.getSystemResourceAsStream(DOUBLE_ERROR_XML);
   try {
     unmarshaller.setSchema(this.schema);
     unmarshaller.unmarshal(stream);
   } catch (UnmarshalException ex) {
     assertTrue(true);
     return;
   } catch (UnsupportedOperationException uoe) {
     // XDK does not support setSchema, so just pass in this case
     assertTrue(true);
     return;
   }
   fail("No Exceptions thrown.");
 }
 public void testFailOnSecondErrorXMLStreamReaderWithType() throws Exception {
   InputStream stream = ClassLoader.getSystemResourceAsStream(DOUBLE_ERROR_XML);
   XMLStreamReader xmlStreamReader = createXMLStreamReader(stream);
   if (null == xmlStreamReader) {
     return;
   }
   try {
     unmarshaller.setSchema(this.schema);
     unmarshaller.setEventHandler(new CustomErrorValidationEventHandler());
     unmarshaller.unmarshal(xmlStreamReader, (Type) Employee.class);
   } catch (UnmarshalException ex) {
     assertTrue(true);
     return;
   } catch (UnsupportedOperationException uoe) {
     // XDK does not support setSchema, so just pass in this case
     assertTrue(true);
     return;
   }
   fail("No Exceptions thrown.");
 }
 public void testFailOnSecondErrorNodeWithClass() throws Exception {
   unmarshaller.setEventHandler(new CustomErrorValidationEventHandler());
   InputStream stream = ClassLoader.getSystemResourceAsStream(DOUBLE_ERROR_XML);
   XMLPlatform xmlPlatform = XMLPlatformFactory.getInstance().getXMLPlatform();
   XMLParser xmlParser = xmlPlatform.newXMLParser();
   xmlParser.setNamespaceAware(true);
   Node node = xmlParser.parse(stream);
   try {
     unmarshaller.setSchema(this.schema);
     unmarshaller.unmarshal(node, Employee.class);
   } catch (UnmarshalException ex) {
     assertTrue(true);
     return;
   } catch (UnsupportedOperationException uoe) {
     // XDK does not support setSchema, so just pass in this case
     assertTrue(true);
     return;
   }
   fail("No Exceptions thrown.");
 }
 public void testFailOnSecondErrorSAXSourceWithType() throws Exception {
   unmarshaller.setEventHandler(new CustomErrorValidationEventHandler());
   SAXParserFactory spf = SAXParserFactory.newInstance();
   spf.setNamespaceAware(true);
   SAXParser sp = spf.newSAXParser();
   XMLReader xr = sp.getXMLReader();
   InputStream stream = ClassLoader.getSystemResourceAsStream(DOUBLE_ERROR_XML);
   Source source = new SAXSource(xr, new InputSource(stream));
   try {
     unmarshaller.setSchema(this.schema);
     unmarshaller.unmarshal(source, (Type) Employee.class);
   } catch (UnmarshalException ex) {
     assertTrue(true);
     return;
   } catch (UnsupportedOperationException uoe) {
     // XDK does not support setSchema, so just pass in this case
     assertTrue(true);
     return;
   }
   fail("No Exceptions thrown.");
 }