Examples of InterfaceElement


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

  // 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)
    {
      fail("The testAssertionInterface1012 method only reported one error for an interface that specifies two relative style defaults.");
    }
View Full Code Here

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

    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) {
      fail("Assertion Interface1010 threw WSDLException.");
View Full Code Here

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

    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) {
      fail("Assertion Interface1010 threw WSDLException.");
View Full Code Here

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

    } 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);
    } catch(WSDLException e) {
      fail("Assertion Interface1010 threw WSDLException.");
View Full Code Here

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

      descEl.setTargetNamespace(new URI("http://testnamespace"));
    } catch(URISyntaxException e) {
      // Do nothing.
    }
   
    InterfaceElement interfac = descEl.addInterfaceElement();
    interfac.setName(new NCName("name"));
    InterfaceElement interfac2 = descEl.addInterfaceElement();
    interfac2.setName(new NCName("name"));
    // Need to create an extended interface otherwise the component model treats the
    // two interfaces as equal and only adds one to the set.
    InterfaceElement interfac3 = descEl.addInterfaceElement();
    interfac3.setName(new NCName("name3"));
    interfac2.addExtendedInterfaceName(interfac3.getName());
     
    try {
      assertion.validate(descComp, wodenContext);
    } catch(WSDLException e) {
      fail("Assertion Interface1010 threw WSDLException.");
View Full Code Here

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

      DescriptionElement descEl = factory.newDescription();
      Description descComp = descEl.toComponent();
      descEl.setTargetNamespace(namespace1);
     
      // Create an interface element, name it and add to the description element
      InterfaceElement interfac = descEl.addInterfaceElement();
      interfac.setName(name1);
     
      // Create another interface element, name it and add to the description element
      InterfaceElement interfac2 = descEl.addInterfaceElement();
      interfac2.setName(name2);

      interfac.addExtendedInterfaceName(interfac2.getName());
     
      InterfaceElement interfac3 = descEl.addInterfaceElement();
      interfac3.setName(name3);
     
      interfac.addExtendedInterfaceName(interfac3.getName());
     
      InterfaceElement interfac4 = descEl.addInterfaceElement();
      interfac4.setName(name4);
     
      interfac2.addExtendedInterfaceName(interfac4.getName());
       
      descComp.getInterfaces(); //init Interface's ref to its Description, needed for interface extension
   
    if(!val.testAssertionInterface1009((Interface)interfac, reporter))
    {
View Full Code Here

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

   
    // Test that the method returns true if the message content model is #any and the element declaration is empty.
  try
  {
      DescriptionElement descEl = factory.newDescription();
      InterfaceElement interfac = descEl.addInterfaceElement();
      InterfaceOperationElement oper = interfac.addInterfaceOperationElement();
    InterfaceMessageReferenceElement interfaceMessageReference = oper.addInterfaceMessageReferenceElement();
    interfaceMessageReference.setElement(QNameTokenUnion.ANY);

      Description descComp = descEl.toComponent(); //initialise Interface's ref to its Description
      InterfaceMessageReference msgRefComp =
        descComp.getInterfaces()[0].getInterfaceOperations()[0].getInterfaceMessageReferences()[0];
     
      if(!val.testAssertionInterfaceMessageReference1028((InterfaceMessageReferenceImpl)msgRefComp, reporter))
    {
      fail("The testAssertionInterfaceMessageReference1028 method returned false for an interface message reference with the message content model #any and an empty element declaration.");
    }
  }
  catch(WSDLException e)
  {
    fail("There was a problem running the test assertion method " + e);
  }
   
    // Test that the method returns true if the message content model is #none and the element declaration is empty.
  try
  {
      DescriptionElement descEl = factory.newDescription();
      InterfaceElement interfac = descEl.addInterfaceElement();
      InterfaceOperationElement oper = interfac.addInterfaceOperationElement();
      InterfaceMessageReferenceElement interfaceMessageReference = oper.addInterfaceMessageReferenceElement();
      interfaceMessageReference.setElement(QNameTokenUnion.NONE);

      Description descComp = descEl.toComponent(); //initialise Interface's ref to its Description
      InterfaceMessageReference msgRefComp =
View Full Code Here

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

 
  // Test that the assertion returns true for an interface fault reference list with one entry.
  try
  {
      DescriptionElement descEl = factory.newDescription();
      InterfaceElement interfac = descEl.addInterfaceElement();
    InterfaceFaultElement fault = interfac.addInterfaceFaultElement();
      fault.setName(name1);
      InterfaceOperationElement oper = interfac.addInterfaceOperationElement();
     
    InterfaceFaultReferenceElement faultReference = oper.addInterfaceFaultReferenceElement();
    faultReference.setRef(name1QN);
    faultReference.setMessageLabel(MessageLabel.IN);

     
      descEl.toComponent().getInterfaces(); //init Interface's ref to its Description
     
    if(!val.testAssertionInterfaceFaultReference1039(new InterfaceFaultReference[]{(InterfaceFaultReferenceImpl)faultReference}, reporter))
    {
      fail("The testAssertionInterfaceFaultReference1039 method returned false for an interface fault reference that is the only interface fault reference defined.");
    }
  }
  catch(WSDLException e)
  {
    fail("There was a problem running the test assertion method " + e);
  }
 
  // Test that the assertion returns true for two interface fault references that have both different
  // faults and different message labels.
  try
  {
      DescriptionElement descEl = factory.newDescription();
      InterfaceElement interfac = descEl.addInterfaceElement();
      InterfaceFaultElement fault = interfac.addInterfaceFaultElement();
      fault.setName(name1);
      InterfaceFaultElement fault2 = interfac.addInterfaceFaultElement();
      fault2.setName(name2);
      InterfaceOperationElement oper = interfac.addInterfaceOperationElement();
         
    InterfaceFaultReferenceElement faultReference = oper.addInterfaceFaultReferenceElement();
    faultReference.setRef(name1QN);
    faultReference.setMessageLabel(MessageLabel.IN);
      InterfaceFaultReferenceElement faultReference2 = oper.addInterfaceFaultReferenceElement();
    faultReference2.setRef(name2QN);
    faultReference2.setMessageLabel(MessageLabel.OUT);
     
      descEl.toComponent().getInterfaces(); //init Interface's ref to its Description
     
    if(!val.testAssertionInterfaceFaultReference1039(new InterfaceFaultReference[]{(InterfaceFaultReferenceImpl)faultReference, (InterfaceFaultReferenceImpl)faultReference2}, reporter))
    {
      fail("The testAssertionInterfaceFaultReference1039 method returned false for two interface fault references that have different faults and message labels.");
    }
  }
  catch(WSDLException e)
  {
    fail("There was a problem running the test assertion method " + e);
  }
 
  // Test that the assertion returns true for two interface fault references that have the same fault
  // but different message labels
  try
  {
      DescriptionElement descEl = factory.newDescription();
      InterfaceElement interfac = descEl.addInterfaceElement();
      InterfaceFaultElement fault = interfac.addInterfaceFaultElement();
      fault.setName(name1);
      InterfaceOperationElement oper = interfac.addInterfaceOperationElement();
         
      InterfaceFaultReferenceElement faultReference = oper.addInterfaceFaultReferenceElement();
      faultReference.setRef(name1QN);
      faultReference.setMessageLabel(MessageLabel.IN);
      InterfaceFaultReferenceElement faultReference2 = oper.addInterfaceFaultReferenceElement();
      faultReference2.setRef(name1QN);
      faultReference2.setMessageLabel(MessageLabel.OUT);
     
      descEl.toComponent().getInterfaces(); //init Interface's ref to its Description
     
    if(!val.testAssertionInterfaceFaultReference1039(new InterfaceFaultReference[]{(InterfaceFaultReferenceImpl)faultReference, (InterfaceFaultReferenceImpl)faultReference2}, reporter))
    {
      fail("The testAssertionInterfaceFaultReference1039 method returned false for two interface fault references that have the same fault but different message labels.");
    }
  }
  catch(WSDLException e)
  {
    fail("There was a problem running the test assertion method " + e);
  }
 
  // Test that the assertion returns true for two interface fault references that have the same
  // message label but different faults.
  try
  {
      DescriptionElement descEl = factory.newDescription();
      InterfaceElement interfac = descEl.addInterfaceElement();
      InterfaceFaultElement fault = interfac.addInterfaceFaultElement();
      fault.setName(name1);
      InterfaceFaultElement fault2 = interfac.addInterfaceFaultElement();
      fault2.setName(name2);
      InterfaceOperationElement oper = interfac.addInterfaceOperationElement();
             
      InterfaceFaultReferenceElement faultReference = oper.addInterfaceFaultReferenceElement();
      faultReference.setRef(name1QN);
      faultReference.setMessageLabel(MessageLabel.IN);
      InterfaceFaultReferenceElement faultReference2 = oper.addInterfaceFaultReferenceElement();
      faultReference2.setRef(name2QN);
      faultReference2.setMessageLabel(MessageLabel.IN);
     
      descEl.toComponent().getInterfaces(); //init Interface's ref to its Description
     
    if(!val.testAssertionInterfaceFaultReference1039(new InterfaceFaultReference[]{(InterfaceFaultReferenceImpl)faultReference, (InterfaceFaultReferenceImpl)faultReference2}, reporter))
    {
      fail("The testAssertionInterfaceFaultReference1039 method returned false for two interface fault references that have different faults but the same message labels.");
    }
  }
  catch(WSDLException e)
  {
    fail("There was a problem running the test assertion method " + e);
  }
 
  // Test that the assertion returns false for two interface fault references that have the same
  // fault and message label.
  try
  {
      DescriptionElement descEl = factory.newDescription();
      descEl.setTargetNamespace(namespace1);
      InterfaceElement interfac = descEl.addInterfaceElement();
      interfac.setName(name1);
      InterfaceFaultElement fault = interfac.addInterfaceFaultElement();
      fault.setName(name1);
      InterfaceOperationElement oper = interfac.addInterfaceOperationElement();
         
      InterfaceFaultReferenceElement faultReference = oper.addInterfaceFaultReferenceElement();
      faultReference.setRef(name1QN);
      faultReference.setMessageLabel(MessageLabel.IN);
      InterfaceFaultReferenceElement faultReference2 = oper.addInterfaceFaultReferenceElement();
      faultReference2.setRef(name1QN);
      faultReference2.setMessageLabel(MessageLabel.IN);
     
      descEl.toComponent().getInterfaces(); //init Interface's ref to its Description
     
    if(val.testAssertionInterfaceFaultReference1039(new InterfaceFaultReference[]{(InterfaceFaultReferenceImpl)faultReference, (InterfaceFaultReferenceImpl)faultReference2}, reporter))
    {
      fail("The testAssertionInterfaceFaultReference1039 method returned true for two interface fault references that have the same fault and message label.");
    }
  }
  catch(WSDLException e)
  {
    fail("There was a problem running the test assertion method " + e);
  }
 
  // Test that the method returns true for an interface fault reference with a null message label.
  try
  {
      DescriptionElement descEl = factory.newDescription();
      descEl.setTargetNamespace(namespace1);
      InterfaceElement interfac = descEl.addInterfaceElement();
      InterfaceFaultElement fault = interfac.addInterfaceFaultElement();
      fault.setName(name1);
      InterfaceOperationElement oper = interfac.addInterfaceOperationElement();

      InterfaceFaultReferenceElement faultReference = oper.addInterfaceFaultReferenceElement();
      faultReference.setRef(name1QN);
     
      descEl.toComponent().getInterfaces(); //init Interface's ref to its Description
     
    if(!val.testAssertionInterfaceFaultReference1039(new InterfaceFaultReference[]{(InterfaceFaultReferenceImpl)faultReference}, reporter))
    {
      fail("The testAssertionInterfaceFaultReference1039 method returned false for an interface fault references with a null message labels.");
    }
  }
  catch(WSDLException e)
  {
    fail("There was a problem running the test assertion method " + e);
  }
 
  // Test that the method returns true for an interface fault reference with a null fault.
  try
  {
      DescriptionElement descEl = factory.newDescription();
      descEl.setTargetNamespace(namespace1);
      InterfaceElement interfac = descEl.addInterfaceElement();
      InterfaceOperationElement oper = interfac.addInterfaceOperationElement();
     
      InterfaceFaultReferenceElement faultReference = oper.addInterfaceFaultReferenceElement();
      faultReference.setMessageLabel(MessageLabel.IN);
     
      descEl.toComponent().getInterfaces(); //init Interface's ref to its Description
     
    if(!val.testAssertionInterfaceFaultReference1039(new InterfaceFaultReference[]{(InterfaceFaultReferenceImpl)faultReference}, reporter))
    {
      fail("The testAssertionInterfaceFaultReference1039 method returned false for ano interface fault reference that has a null fault.");
    }
  }
  catch(WSDLException e)
  {
    fail("There was a problem running the test assertion method " + e);
  }
 
  // Test that the method returns false for two interface fault references that have the same
  // fault/message label and a third interface fault reference that has a null fault and is
  // defined second.
  try
  {
      DescriptionElement descEl = factory.newDescription();
      descEl.setTargetNamespace(namespace1);
      InterfaceElement interfac = descEl.addInterfaceElement();
      interfac.setName(name1);
      InterfaceFaultElement fault = interfac.addInterfaceFaultElement();
      fault.setName(name1);
      InterfaceOperationElement oper = interfac.addInterfaceOperationElement();
         
      InterfaceFaultReferenceElement faultReference = oper.addInterfaceFaultReferenceElement();
      faultReference.setRef(name1QN);
      faultReference.setMessageLabel(MessageLabel.IN);
      InterfaceFaultReferenceElement faultReference2 = oper.addInterfaceFaultReferenceElement();
View Full Code Here

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

        // Description...
      DescriptionElement fDescElement = factory.newDescription();
     
      // Interface
      InterfaceElement fInterfaceElement = fDescElement.addInterfaceElement();
    fInterfaceElement.setName(new NCName("interface1"));
   
       // Service...
      ServiceElement fServiceElement = fDescElement.addServiceElement();
      fServiceElement.setName(new NCName("service1"));
      fServiceElement.setInterfaceName(new QName("interface1"));
View Full Code Here

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

    // check the default:
    Interface[] ifArray = fInterface.getExtendedInterfaces();
    assertEquals("Retrieved Extended Interface group should be empty if none set -", 0, ifArray.length);
     
    // create further InterfaceElements and name them
    InterfaceElement xife1 = fDescriptionElement.addInterfaceElement();
    InterfaceElement xife2 = fDescriptionElement.addInterfaceElement();
    xife1.setName(new NCName("extendedI1"));
    xife2.setName(new NCName("extendedI2"));
    fInterfaceElement.addExtendedInterfaceName(new QName("extendedI1"));
    fInterfaceElement.addExtendedInterfaceName(new QName("extendedI2"));
   
    // getExtendedInterfaces()
    fDescription = fDescriptionElement.toComponent();
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.