Package com.adactus.mpeg21.xml.schema

Examples of com.adactus.mpeg21.xml.schema.ValidatingDocumentSource


  }
 
  public void testSimple() throws Throwable {
    byte[] file = getFileContent("src/test/resources/xml/SimpleDigitalItem.xml");
   
    DIDLType didl = factory.unmarshal("UTF-8", new ByteArrayInputStream(file));
    assertFalse(didl.getChildren().isEmpty());
   
    int id = digitalItemDeclarartionsManager.addDigitalItem(didl);

    try {
      DIDLType persisted = digitalItemDeclarartionsManager.getDigitalItem(id);
      assertNotNull(persisted);
     
      factory.marshall(persisted, new ByteArrayOutputStream(), null); // validates
    } finally {   
      digitalItemDeclarartionsManager.removeDigitalItem(id);
View Full Code Here


  public DIDLType getDigitalItem(int id) {
    return mEm.find(DIDLType.class, id);
  }

  public boolean removeDigitalItem(int id) {
    DIDLType didl = getDigitalItem(id);
    if(didl == null) {
      return false;
    }
   
    mEm.remove(didl);
View Full Code Here

 
  public void testSimple() throws Exception {
    byte[] file = getFileContent("src/test/resources/xml/SimpleDigitalItem.xml");
    validateDigitalItemDeclaration(file, "UTF-8");
   
    DIDLType didl = factory.unmarshal("UTF-8", new ByteArrayInputStream(file));
   
    ByteArrayOutputStream bout = new ByteArrayOutputStream();
    factory.marshall(didl, bout, null);
   
    System.out.println(new String(bout.toByteArray()));
View Full Code Here

 
  public void testMedium() throws Exception {
    byte[] file = getFileContent("src/test/resources/xml/MediumDigitalItem.xml");
    validateDigitalItemDeclaration(file, "UTF-8");
   
    DIDLType didl = factory.unmarshal("UTF-8", new ByteArrayInputStream(file));
   
    ByteArrayOutputStream bout = new ByteArrayOutputStream();
    factory.marshall(didl, bout, null);
   
    System.out.println(new String(bout.toByteArray()));
View Full Code Here

  }

  public void testComplex() throws Throwable {
    byte[] file = getFileContent("src/test/resources/xml/ComplexDigitalItem.xml");
   
    DIDLType didl = factory.unmarshal("UTF-8", new ByteArrayInputStream(file));
    assertFalse(didl.getChildren().isEmpty());
   
    int id = digitalItemDeclarartionsManager.addDigitalItem(didl);

    try {
      DIDLType persisted = digitalItemDeclarartionsManager.getDigitalItem(id);
      assertNotNull(persisted);
     
      factory.marshall(persisted, new ByteArrayOutputStream(), null); // validates
    } finally {   
      digitalItemDeclarartionsManager.removeDigitalItem(id);
View Full Code Here

 
  public void testComplex() throws Exception {
    byte[] file = getFileContent("src/test/resources/xml/ComplexDigitalItem.xml");
    validateDigitalItemDeclaration(file, "UTF-8");

    DIDLType didl = factory.unmarshal("UTF-8", new ByteArrayInputStream(file));
   
    ByteArrayOutputStream bout = new ByteArrayOutputStream();
    factory.marshall(didl, bout, null);
   
    System.out.println(new String(bout.toByteArray()));
View Full Code Here

 
 
  public void testSimple() throws Throwable {
    byte[] file = getFileContent("src/test/resources/xml/SimpleDigitalItem.xml");
   
    DIDLType didl = factory.unmarshal("UTF-8", new ByteArrayInputStream(file));
    assertFalse(didl.getChildren().isEmpty());
   
    int id = digitalItemDeclarartionsWebsService.addDigitalItem(didl);

    try {
      DIDLType persisted = digitalItemDeclarartionsWebsService.getDigitalItem(id);
      assertNotNull(persisted);
     
      factory.marshall(persisted, new ByteArrayOutputStream(), null); // validates
    } finally {   
      digitalItemDeclarartionsWebsService.removeDigitalItem(id);
View Full Code Here

  }

  public void testComplex() throws Throwable {
    byte[] file = getFileContent("src/test/resources/xml/ComplexDigitalItem.xml");
   
    DIDLType didl = factory.unmarshal("UTF-8", new ByteArrayInputStream(file));
    assertFalse(didl.getChildren().isEmpty());
   
    int id = digitalItemDeclarartionsWebsService.addDigitalItem(didl);

    try {
      DIDLType persisted = digitalItemDeclarartionsWebsService.getDigitalItem(id);
      assertNotNull(persisted);
     
      factory.marshall(persisted, new ByteArrayOutputStream(), null); // validates
    } finally {   
      digitalItemDeclarartionsWebsService.removeDigitalItem(id);
View Full Code Here

   
    ServiceDelegate service = provider.createServiceDelegate(wsdlURL, wrappedServiceQName, this.getClass());

    System.out.println("Web service accessed as " + service.getServiceName());
   
    DigitalItemDeclarartionsWebsServiceRemote digitalItemDeclarartionsWebsService = service.getPort(DigitalItemDeclarartionsWebsServiceRemote.class);

    System.out.println("Web service port accessed");

    if(localTCPMonPort != -1) { // redirect the client
      BindingProvider bp = (BindingProvider)digitalItemDeclarartionsWebsService;
View Full Code Here

   *
   * @throws Exception
   */
 
  public void testFactory() throws Exception {
    DigitalItemDeclarationsDocumentSource digitalItemDeclarationsDocumentSource = new DigitalItemDeclarationsDocumentSource("src/main/resources/schema/didmodel.xsd", "src/main/resources/schema/didl.xsd");
   
    digitalItemDeclarationsDocumentSource.validate(getFileContent("src/test/resources/xml/ComplexDigitalItem.xml"), "UTF-8");
    digitalItemDeclarationsDocumentSource.validate(getFileContent("src/test/resources/xml/MediumDigitalItem.xml"), "UTF-8");
    digitalItemDeclarationsDocumentSource.validate(getFileContent("src/test/resources/xml/ComplexDigitalItem.xml"), "UTF-8");
  }
View Full Code Here

TOP

Related Classes of com.adactus.mpeg21.xml.schema.ValidatingDocumentSource

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.