Ejemplo n.º 1
0
 public void testShouldExportServiceManifestAsJaxBObject() throws JAXBException {
   System.out.println("JaxbExport of manifest invoked.");
   String providerId = getManifest().getServiceProviderId();
   // export to jaxb
   JaxBServiceManifest manifestAsJaxbObject = getManifest().toJaxB();
   // check if exported field "manifestID" matches with original
   assertEquals(
       "converted field mismatch.", providerId, manifestAsJaxbObject.getServiceProviderId());
 }
Ejemplo n.º 2
0
 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());
   }
 }