public void testShouldNotImportInvalidXmlBeansManifest() { XmlBeanServiceManifestDocument manifestDocument = getManifest().toXmlBeanObject(); manifestDocument.getServiceManifest().setManifestId("test"); try { Manifest.Factory.newInstance(manifestDocument); fail("An exception should have been thrown"); } catch (InvalidDocumentException e) { assertTrue("this exception was expected", true); System.out.println(e.getMessage()); } }
public void testShouldNotImportInvalidString() { String string = getManifest().toString(); string = string.replaceFirst("jboss", "test"); try { Manifest.Factory.newInstance(string); fail("An exception should have been thrown"); } catch (InvalidDocumentException e) { System.out.println("This exception was expected: " + e.getMessage()); assertTrue("this exception was expected", true); } }
public void testShouldNotImportInvalidJaxBManifest() { JaxBServiceManifest jaxb = getManifest().toJaxB(); jaxb.setManifestId("test"); try { Manifest.Factory.newInstance(jaxb); fail("An exception should have been thrown"); } catch (InvalidDocumentException e) { assertTrue("this exception was expected", true); System.out.println(e.getMessage()); } }