private Manifest getSPManifestFromXmlObject(XmlObject xmlObject) {
    XmlBeanManifestType serviceManifestType = (XmlBeanManifestType) xmlObject;

    XmlBeanServiceManifestDocument serviceManifestDoc =
        XmlBeanServiceManifestDocument.Factory.newInstance();
    serviceManifestDoc.addNewServiceManifest().set(serviceManifestType);

    return Manifest.Factory.newInstance(serviceManifestDoc);
  }
Пример #2
0
 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());
   }
 }
Пример #3
0
 public void testShouldExportServiceManifestAsString() {
   String serviceProviderId = getManifest().getServiceProviderId();
   String manifestAsString = getManifest().toString();
   try {
     XmlBeanServiceManifestDocument parsedManifest =
         XmlBeanServiceManifestDocument.Factory.parse(manifestAsString);
     assertEquals(
         "converted field mismatch.",
         serviceProviderId,
         parsedManifest.getServiceManifest().getServiceProviderId());
   } catch (XmlException e) {
     fail("export creates invalid manifest");
     e
         .printStackTrace(); // To change body of catch statement use File | Settings | File
                             // Templates.
   }
 }
Пример #4
0
  public void testShouldExportServiceManifestAsXmlBeansObject() {

    XmlBeanServiceManifestDocument exportedXmlbeansObject = getManifest().toXmlBeanObject();
    assertNotNull(
        "manifest id not exported.", exportedXmlbeansObject.getServiceManifest().getManifestId());
  }
 @Override
 public ManifestImpl exportServiceManifest() {
   XmlBeanServiceManifestDocument doc = XmlBeanServiceManifestDocument.Factory.newInstance();
   doc.setServiceManifest(delegate.getServiceManifest());
   return new ManifestImpl(doc);
 }