Package org.apache.woden.wsdl20.xml

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


    // 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

         * - getAllInterfaceFaults()
         * - getFromAllInterfaceFaults(QName)
         */
       
        // create InterfaceElements and name them
        InterfaceElement ife = fDescriptionElement.addInterfaceElement();
        InterfaceElement xife1 = fDescriptionElement.addInterfaceElement();
        InterfaceElement xife2 = fDescriptionElement.addInterfaceElement();
        ife.setName(new NCName("Interface"));
        xife1.setName(new NCName("extendedI1"));
        xife2.setName(new NCName("extendedI2"));
        ife.addExtendedInterfaceName(new QName("extendedI1"));
        ife.addExtendedInterfaceName(new QName("extendedI2"));
       
        InterfaceFaultElement fault = ife.addInterfaceFaultElement();
        InterfaceFaultElement fault1 = xife1.addInterfaceFaultElement();
        InterfaceFaultElement fault2 = xife2.addInterfaceFaultElement();
        InterfaceFaultElement fault3 = xife2.addInterfaceFaultElement();
       
        fault.setName(new NCName("fault"));
        fault1.setName(new NCName("fault1"));
        fault2.setName(new NCName("fault2"));
        fault3.setName(new NCName("fault3"));
View Full Code Here

         * - getAllInterfaceOperations()
         * - getFromAllInterfaceOperations(QName)
         */
       
        // create InterfaceElements and name them
        InterfaceElement ife = fDescriptionElement.addInterfaceElement();
        InterfaceElement xife1 = fDescriptionElement.addInterfaceElement();
        InterfaceElement xife2 = fDescriptionElement.addInterfaceElement();
        ife.setName(new NCName("Interface"));
        xife1.setName(new NCName("extendedI1"));
        xife2.setName(new NCName("extendedI2"));
        ife.addExtendedInterfaceName(new QName("extendedI1"));
        ife.addExtendedInterfaceName(new QName("extendedI2"));
       
        InterfaceOperationElement oper = ife.addInterfaceOperationElement();
        InterfaceOperationElement oper1 = xife1.addInterfaceOperationElement();
        InterfaceOperationElement oper2 = xife1.addInterfaceOperationElement();
        InterfaceOperationElement oper3 = xife2.addInterfaceOperationElement();
       
        oper.setName(new NCName("oper"));
        oper1.setName(new NCName("oper1"));
        oper2.setName(new NCName("oper2"));
        oper3.setName(new NCName("oper3"));
View Full Code Here

   
            //Get undefined namespace and prefix.
            assertNull("Null was not returned when a non-existent namespace prefix was given", descriptionElement.getNamespaceURI(nonExistantPrefix));
            assertNull("Null was not returned when a non-existent namespace URI was given", descriptionElement.getNamespacePrefix(nonExistantNamespace));
   
        InterfaceElement interfaceElement = descriptionElement.addInterfaceElement();
        interfaceElement.addNamespace(prefix3, namespace3);
       
            //Get namespace and prefix on description
            uri = interfaceElement.getNamespaceURI(prefix1);
            assertEquals("Retrieved NamespaceURI does not match that set", namespace1, uri);
   
            prefix = interfaceElement.getNamespacePrefix(namespace1);
            assertEquals("Retrieved NamespacePrefix does not match that set", prefix1, prefix);
           
            //Get default namespace on description
            uri = interfaceElement.getNamespaceURI("");
            assertEquals("Default NamespaceURI does not match that set", namespace2, uri);
           
            //Get namespace and prefix on interface
            uri = interfaceElement.getNamespaceURI(prefix3);
            assertEquals("Retrieved NamespaceURI does not match that set", namespace3, uri);
   
            prefix = interfaceElement.getNamespacePrefix(namespace3);
            assertEquals("Retrieved NamespacePrefix does not match that set", prefix3, prefix);
   
            //Get undefined namespace and prefix.
            assertNull("Null was not returned when a non-existent namespace prefix was given", interfaceElement.getNamespaceURI(nonExistantPrefix));
            assertNull("Null was not returned when a non-existent namespace URI was given", interfaceElement.getNamespacePrefix(nonExistantNamespace));
       
        InterfaceFaultElement interfaceFaultElement = interfaceElement.addInterfaceFaultElement();
        interfaceFaultElement.addNamespace(prefix4, namespace4);
       
            //Get namespace and prefix on description
            uri = interfaceFaultElement.getNamespaceURI(prefix1);
            assertEquals("Retrieved NamespaceURI does not match that set", namespace1, uri);
View Full Code Here

    // Create the BindingElement<->InterfaceElement->InterfaceOperationElement->InterfaceMessageReferenceElement hierarchy
    BindingElement bindingElement = descriptionElement.addBindingElement();
    bindingElement.setInterfaceName(new QName("interface1"));
   
    InterfaceElement interfaceElement = descriptionElement.addInterfaceElement();
    interfaceElement.setName(new NCName("interface1"));

    InterfaceOperationElement ifopElement = interfaceElement.addInterfaceOperationElement();
    ifopElement.setName(new NCName("operation1"));
    InterfaceMessageReferenceElement ifmrElement = ifopElement.addInterfaceMessageReferenceElement();
    ifmrElement.setMessageLabel(new NCName("MessageRef1MessageLabel"));
       
    // Create the BindingOperationElement->BindingMessageReferenceElement hierarchy
View Full Code Here

            fail("Can't instantiate the WSDLFactory object.");
        }

    // Create and name an Interface Element
    DescriptionElement desc = factory.newDescription();
    InterfaceElement interfaceElement = desc.addInterfaceElement();
    interfaceElement.setName(new NCName("interface1"));
   
    // Create a binding from the description 
    fBindingElement = desc.addBindingElement();
    fBindingElement.setName(new NCName("binding1"));
    desc.toComponent();
    Binding binding = desc.toComponent().getBinding(new QName("binding1"));
 
    // getInterface() - interface attribute unspecified, but hierarchy in place:
    retrievedInterface = binding.getInterface();
    assertNull("Retrieved Interface should be null if interface attribute unspecified -", retrievedInterface);
   
    // getInterface() - interface attribute specified, and hierarchy in place:
    // Set the "interface" attribute to reference the new Interface Element
    // (have to recreate whole desc hierarchy as toComponent() will not rerun if already run!)
    desc = factory.newDescription();
    interfaceElement = desc.addInterfaceElement();
    interfaceElement.setName(new NCName("interface1"));
    fBindingElement = desc.addBindingElement();
    fBindingElement.setName(new NCName("binding1"));
    fBindingElement.setInterfaceName(new QName("interface1"));
   
    //fDescriptionElement.toComponent();
View Full Code Here

  // 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

  boolean isValid = true;
 
  int numInterfaceElements = interfaces.length;
  for(int i = 0; i < numInterfaceElements; i++)
  {
    InterfaceElement interfaceElem = interfaces[i];
   
    if(!testAssertionInterface1012(interfaceElem, errorReporter))
    isValid = false;
   
    if(!validateInterfaceFaults(descElement, interfaceElem.getInterfaceFaultElements(), errorReporter))
      isValid = false;
   
    if(!validateInterfaceOperations(descElement, interfaceElem.getInterfaceOperationElements(), errorReporter))
    isValid = false;
  }
 
  return isValid;
  }
View Full Code Here

     */
    public InterfaceOperationElement getInterfaceOperationElement()
    {
        InterfaceOperationElement oper = null;
        BindingElement binding = (BindingElement)getParentElement();
        InterfaceElement interfac = binding.getInterfaceElement();
        if(interfac != null) {
            InterfaceOperation operComp = ((Interface)interfac).getFromAllInterfaceOperations(fRef);
            if(operComp != null) {
                oper = operComp.toElement();
            }
View Full Code Here

TOP

Related Classes of org.apache.woden.wsdl20.xml.InterfaceElement

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.