Examples of DescriptionElement


Examples of org.apache.woden.wsdl20.xml.DescriptionElement

 
  /**
   * Test that the assertion fails if the interface is in the direct list.
   */
  public void testInterfaceExtendsItselfDirectly() throws Exception {
    DescriptionElement descEl = factory.newDescription();
    Description descComp = descEl.toComponent();
        descEl.setTargetNamespace(URI.create("http://testnamespace"));
     
        InterfaceElement interfac = descEl.addInterfaceElement();
    interfac.setName(new NCName("name1"));
   
      interfac.addExtendedInterfaceName(interfac.getName());
       
      // init Interface's ref to its Description, needed for interface extension.
View Full Code Here

Examples of org.apache.woden.wsdl20.xml.DescriptionElement

 
  /**
   * Test that the assertion fails if the interface is in the indirect list.
   */
  public void testInterfaceExtendsItselfIndirectly() {
    DescriptionElement descEl = factory.newDescription();
    Description descComp = descEl.toComponent();
        descEl.setTargetNamespace(URI.create("http://testnamespace"));
       
        InterfaceElement interfac = descEl.addInterfaceElement();
    interfac.setName(new NCName("name1"));
    InterfaceImpl interfac2 = (InterfaceImpl)descEl.addInterfaceElement();
    interfac2.setName(new NCName("name2"));
       
    interfac.addExtendedInterfaceName(interfac2.getName());
    interfac2.addExtendedInterfaceName(interfac.getName());
       
View Full Code Here

Examples of org.apache.woden.wsdl20.xml.DescriptionElement

  /**
   * Test that the assertion passes if the interface is not
   * in the direct or indirect list of extended interfaces.
   */
  public void testInterfaceExtendsOtherInterfaces() {
    DescriptionElement descEl = factory.newDescription();
    Description descComp = descEl.toComponent();
       
        descEl.setTargetNamespace(URI.create("http://testnamespace"));
       
    // Create an interface, set it to extend to other interfaces and have
    // one of those interfaces extend a fourth interface.
    InterfaceElement interfac = descEl.addInterfaceElement();
    interfac.setName(new NCName("name1"));
       
    InterfaceElement interfac2 = descEl.addInterfaceElement();
    interfac2.setName(new NCName("name2"));

    interfac.addExtendedInterfaceName(interfac2.getName());
       
    InterfaceElement interfac3 = descEl.addInterfaceElement();
    interfac3.setName(new NCName("name3"));
       
    interfac.addExtendedInterfaceName(interfac3.getName());
       
    InterfaceElement interfac4 = descEl.addInterfaceElement();
    interfac4.setName(new NCName("name4"));
       
    interfac2.addExtendedInterfaceName(interfac4.getName());
         
    // init Interface's ref to its Description, needed for interface extension.
View Full Code Here

Examples of org.apache.woden.wsdl20.xml.DescriptionElement

  {
  // Test that no error is reported with an absolute IRI.
  handler.reset();
  try
  {
    DescriptionElement desc = WSDLFactory.newInstance().newDescription();
    desc.setTargetNamespace(new URI("http://www.sample.org"));
   
    if(!val.testAssertionDescription1006(desc, reporter))
    {
    fail("A message was reported for a description element with an absolute IRI.");
    }
  }
  catch(Exception e)
  {
    fail("There was a problem while testing an absolute IRI.");
  }
 
    // Test that error Description-1006 is reported for a relative IRI.
  handler.reset();
  try
  {
    DescriptionElement desc = WSDLFactory.newInstance().newDescription();
    desc.setTargetNamespace(new URI("//www.sample.org"));
    boolean isValid = val.testAssertionDescription1006(desc, reporter);
    if(isValid)
    {
    fail("No message was reported for a description element with the relative IRI //www.sample.org.");
    }
View Full Code Here

Examples of org.apache.woden.wsdl20.xml.DescriptionElement

   
  // Test that a schema without any style defaults is valid.
  handler.reset();
    try
  {
      DescriptionElement desc = factory.newDescription();
      InterfaceElement interfaceElem = desc.addInterfaceElement();
    if(!val.testAssertionInterface1012(interfaceElem, reporter))
    {
      fail("The testAssertionInterface1012 method returned false for an interface that specifies no style defaults.");
    }
  }
  catch(WSDLException e)
    {
    fail("There was a problem running the test assertion method " + e);
  }
 
    // Test that a schema with an absolute style default is valid.
  handler.reset();
  try
  {
          DescriptionElement desc = factory.newDescription();
      InterfaceElement interfaceElem = desc.addInterfaceElement();
    interfaceElem.addStyleDefaultURI(absoluteURI);
    if(!val.testAssertionInterface1012(interfaceElem, reporter))
    {
      fail("The testAssertionInterface1012 method returned false for an interface that specifies one absolute style default.");
    }
    }
  catch(WSDLException e)
  {
    fail("There was a problem running the test assertion method " + e);
    }
 
    // Test that a schema with a relative style default is not valid.
  handler.reset();
  try
  {
      DescriptionElement desc = factory.newDescription();
    InterfaceElement interfaceElem = desc.addInterfaceElement();
    interfaceElem.addStyleDefaultURI(relativeURI);
    if(val.testAssertionInterface1012(interfaceElem, reporter))
    {
      fail("The testAssertionInterface1012 method returned true for an interface that specifies one relative style default.");
    }
    }
  catch(WSDLException e)
  {
    fail("There was a problem running the test assertion method " + e);
    }
 
    // Test that a schema with an absolute style default and a relative sytle default is not valid.
  handler.reset();
  try
  {
      DescriptionElement desc = factory.newDescription();
      InterfaceElement interfaceElem = desc.addInterfaceElement();
    interfaceElem.addStyleDefaultURI(absoluteURI);
    interfaceElem.addStyleDefaultURI(relativeURI);
    if(val.testAssertionInterface1012(interfaceElem, reporter))
    {
      fail("The testAssertionInterface1012 method returned true for an interface that specifies an absolute style default and a relative style default.");
    }
    }
  catch(WSDLException e)
  {
    fail("There was a problem running the test assertion method " + e);
    }
 
    // Test that a schema with two relative style defaults returns two error messages
  handler.reset();
  try
  {
      DescriptionElement desc = factory.newDescription();
      InterfaceElement interfaceElem = desc.addInterfaceElement();
    interfaceElem.addStyleDefaultURI(relativeURI);
    interfaceElem.addStyleDefaultURI(relativeURI2);
    val.testAssertionInterface1012(interfaceElem, reporter);
    if(handler.numErrors != 2)
    {
View Full Code Here

Examples of org.apache.woden.wsdl20.xml.DescriptionElement

   
    // Test that a null namespace returns true.
  handler.reset();
    try
  {
      DescriptionElement descElem = factory.newDescription();
      TypesElement types = descElem.addTypesElement();
      types.addSchema(schema);
     
    if(!val.testAssertionSchema1066(descElem, null, reporter))
    {
      fail("The testAssertionSchema1066 method returned false for a null namespace.");
    }
  }
  catch(WSDLException e)
    {
    fail("There was a problem running the test assertion method " + e);
  }
 
  // Test that a reference to a namespace that is defined inline
  // does not return an error.
  handler.reset();
    try
  {
      DescriptionElement descElem = factory.newDescription();
      TypesElement types = descElem.addTypesElement();
      types.addSchema(schema);
     
    if(!val.testAssertionSchema1066(descElem, new QName("http://www.sample.org", "myElement"), reporter))
    {
      fail("The testAssertionSchema1066 method returned false for a namespace that has been defined inline.");
    }
  }
  catch(WSDLException e)
    {
    fail("There was a problem running the test assertion method " + e);
  }
 
    // Test that a reference to a namespace that is imported
  // does not return an error.
  handler.reset();
    try
  {
      DescriptionElement descElem = factory.newDescription();
      TypesElement typesImported = descElem.addTypesElement();
      ImportedSchema importedSchema = new ImportedSchemaImpl();
      importedSchema.setSchemaDefinition(xs1);
      importedSchema.setNamespace(schemaNS);
      typesImported.addSchema(importedSchema);
     
    if(!val.testAssertionSchema1066(descElem, new QName("http://www.sample.org", "myElement"), reporter))
    {
      fail("The testAssertionSchema1066 method returned false for a namespace that has been imported.");
    }
  }
  catch(WSDLException e)
    {
    fail("There was a problem running the test assertion method " + e);
  }
 
    // Test that a reference to the XML Schema namespace does not return an error.
  handler.reset();
    try
  {
      DescriptionElement descElem = factory.newDescription();
      //descElem.setTypesElement(types);
     
    if(!val.testAssertionSchema1066(descElem, new QName(Constants.TYPE_XSD_2001, "myElement"), reporter))
    {
      fail("The testAssertionSchema1066 method returned false for the XML Schema namespace.");
    }
  }
  catch(WSDLException e)
    {
    fail("There was a problem running the test assertion method " + e);
  }
 
    // Test that a reference to a namespace that has not been defined inline or imported returns an error.
  // This test also checks that the method functions correctly with no defined types element.
  handler.reset();
    try
  {
      DescriptionElement descElem = factory.newDescription();
      //descElem.setTypesElement(types);
     
    if(val.testAssertionSchema1066(descElem, new QName("http://www.sample2.org", "myElement"), reporter))
    {
      fail("The testAssertionSchema1066 method returned true for a namespace that is not available..");
    }
  }
  catch(WSDLException e)
    {
    fail("There was a problem running the test assertion method " + e);
  }
 
  // Test that a reference to an inline schema that does not define a
  // target namespace (the targetNamespace is null) does not return an
  // error.
  handler.reset();
    try
  {
      DescriptionElement descElem = factory.newDescription();
      TypesElement typesImported = descElem.addTypesElement();
      InlinedSchema inlinedSchema = new InlinedSchemaImpl();
      typesImported.addSchema(inlinedSchema);
      InlinedSchema inlinedSchema2 = new InlinedSchemaImpl();
      inlinedSchema2.setNamespace(schemaNS);
      typesImported.addSchema(inlinedSchema2);
View Full Code Here

Examples of org.apache.woden.wsdl20.xml.DescriptionElement

  /**
   * Test that the assertion passes for an empty list of interfaces.
   */
  public void testNoInterfaces() {
    DescriptionElement descEl = factory.newDescription();
    Description descComp = descEl.toComponent();
       
    try {
      descEl.setTargetNamespace(new URI("http://testnamespace"));
    } catch(URISyntaxException e) {
      // Do nothing.
    }
       
    try {
View Full Code Here

Examples of org.apache.woden.wsdl20.xml.DescriptionElement

 
  /**
   * Test that the assertion passes when only one interface is defined.
   */
  public void testOneInterface() {
    DescriptionElement descEl = factory.newDescription();
    Description descComp = descEl.toComponent();
       
    try {
      descEl.setTargetNamespace(new URI("http://testnamespace"));
    } catch(URISyntaxException e) {
      // Do nothing.
    }
    InterfaceElement interfac = descEl.addInterfaceElement();
    interfac.setName(new NCName("name1"));
   
    try {
      assertion.validate(descComp, wodenContext);
    } catch(WSDLException e) {
View Full Code Here

Examples of org.apache.woden.wsdl20.xml.DescriptionElement

 
  /**
   * Test that the assertion passes for a list of interfaces that contains no duplicate names.
   */
  public void testMultipleInterfaceNoDuplicateNames() {
    DescriptionElement descEl = factory.newDescription();
    Description descComp = descEl.toComponent();
       
    try {
      descEl.setTargetNamespace(new URI("http://testnamespace"));
    } catch(URISyntaxException e) {
      // Do nothing.
    }
    InterfaceElement interfac = descEl.addInterfaceElement();
    interfac.setName(new NCName("name1"));
    InterfaceElement interfac2 = descEl.addInterfaceElement();
    interfac2.setName(new NCName("name2"));
    InterfaceElement interfac3 = descEl.addInterfaceElement();
    interfac3.setName(new NCName("name3"));
     
    try {
      assertion.validate(descComp, wodenContext);
    } catch(WSDLException e) {
View Full Code Here

Examples of org.apache.woden.wsdl20.xml.DescriptionElement

 
  /**
   * Test that the assertion fails for two interfaces that are defined with the same NCName object.
   */
  public void testDuplicateInterfaceNCNames() {
    DescriptionElement descEl = factory.newDescription();
    Description descComp = descEl.toComponent();
       
    try {
      descEl.setTargetNamespace(new URI("http://testnamespace"));
    } catch(URISyntaxException e) {
      // Do nothing.
    }
   
    NCName name = new NCName("name");
    InterfaceElement interfac = descEl.addInterfaceElement();
    interfac.setName(name);
    InterfaceElement interfac2 = descEl.addInterfaceElement();
    interfac2.setName(name);
    // Need to create an extended interface otherwise the component model treats the
    // two interfaces as equal and only adds one to the set.
    InterfaceImpl interfac3 = (InterfaceImpl)descEl.addInterfaceElement();
    interfac3.setName(new NCName("name3"));
    interfac2.addExtendedInterfaceName(interfac3.getName());
     
    try {
      assertion.validate(descComp, wodenContext);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.