Package org.apache.woden.wsdl20.xml

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


    /*
     * @see org.apache.woden.wsdl20.xml.InterfaceElement#getInterfaceFaultElement(javax.xml.namespace.QName)
     */
    public InterfaceFaultElement getInterfaceFaultElement(QName faultName)
    {
        InterfaceFaultElement fault = null;
       
        if(faultName != null)
        {
            InterfaceFaultElement tempFault = null;
            for(Iterator i=fInterfaceFaultElements.iterator(); i.hasNext(); )
            {
                tempFault = (InterfaceFaultElement)i.next();
                if(faultName.equals(tempFault.getName()))
                {
                    fault = tempFault;
                    break;
                }
            }
View Full Code Here


  // 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);
View Full Code Here

  {
      DescriptionElement descEl = factory.newDescription();
      descEl.setTargetNamespace(namespace1);
      InterfaceElement interfac = descEl.addInterfaceElement();
      interfac.setName(name1);
      InterfaceFaultElement interfaceFault = interfac.addInterfaceFaultElement();
      interfaceFault.setName(name3);
      InterfaceOperationElement interfaceOperation = interfac.addInterfaceOperationElement();
      interfaceOperation.setName(name4);
      InterfaceFaultReferenceElement interfaceFaultReference = interfaceOperation.addInterfaceFaultReferenceElement();
      interfaceFaultReference.setMessageLabel(MessageLabel.IN);
      interfaceFaultReference.setRef(name3QN);
      BindingElement binding = descEl.addBindingElement();
      binding.setName(name2);
      binding.setInterfaceName(name1QN);
      BindingOperationElement bindingOperation = binding.addBindingOperationElement();
      bindingOperation.setRef(name4QN);
      BindingFaultReferenceElement bindingFaultReference = bindingOperation.addBindingFaultReferenceElement();

      bindingFaultReference.setMessageLabel(MessageLabel.IN);
      bindingFaultReference.setRef(name3QN);
         
    if(!val.testAssertionBindingFaultReference1055(descEl.toComponent().getBindings()[0].getBindingOperations()[0].getBindingFaultReferences(), reporter))
    {
      fail("The testAssertionBindingFaultReference1055 method returned false with one valid binding fault reference defined.");
    }
  }
  catch(WSDLException e)
  {
    fail("There was a problem running the test assertion method " + e);
  }
 
  // Test that the assertion returns true when there are two binding fault references defined with
  // unique interface fault references.
  try
  {
      DescriptionElement descEl = factory.newDescription();
      descEl.setTargetNamespace(namespace1);
      InterfaceElement interfac = descEl.addInterfaceElement();
      interfac.setName(name1);
      InterfaceFaultElement interfaceFault = interfac.addInterfaceFaultElement();
      interfaceFault.setName(name3);
      InterfaceOperationElement interfaceOperation = interfac.addInterfaceOperationElement();
      interfaceOperation.setName(name4);
      InterfaceFaultReferenceElement interfaceFaultReference = interfaceOperation.addInterfaceFaultReferenceElement();
      interfaceFaultReference.setMessageLabel(MessageLabel.IN);
      interfaceFaultReference.setRef(name3QN);
      InterfaceFaultReferenceElement interfaceFaultReference2 = interfaceOperation.addInterfaceFaultReferenceElement();
      interfaceFaultReference2.setMessageLabel(MessageLabel.OUT);
      interfaceFaultReference2.setRef(name3QN);
      BindingElement binding = descEl.addBindingElement();
      binding.setName(name2);
      binding.setInterfaceName(name1QN);
      BindingOperationElement bindingOperation = binding.addBindingOperationElement();
      bindingOperation.setRef(name4QN);
      BindingFaultReferenceElement bindingFaultReference = bindingOperation.addBindingFaultReferenceElement();
      bindingFaultReference.setMessageLabel(MessageLabel.IN);
      bindingFaultReference.setRef(name3QN);
      BindingFaultReferenceElement bindingFaultReference2 = bindingOperation.addBindingFaultReferenceElement();
      bindingFaultReference2.setMessageLabel(MessageLabel.OUT);
      bindingFaultReference2.setRef(name3QN);
         
    if(!val.testAssertionBindingFaultReference1055(descEl.toComponent().getBindings()[0].getBindingOperations()[0].getBindingFaultReferences(), reporter))
    {
      fail("The testAssertionBindingFaultReference1055 method returned false with two valid binding fault references defined.");
    }
  }
  catch(WSDLException e)
  {
    fail("There was a problem running the test assertion method " + e);
  }
 
 
  // Test that the assertion returns false when there are two binding fault references define with
  // the same interface fault reference.
  try
  {
      DescriptionElement descEl = factory.newDescription();
      descEl.setTargetNamespace(namespace1);
      InterfaceElement interfac = descEl.addInterfaceElement();
      interfac.setName(name1);
      InterfaceFaultElement interfaceFault = interfac.addInterfaceFaultElement();
      interfaceFault.setName(name3);
      InterfaceOperationElement interfaceOperation = interfac.addInterfaceOperationElement();
      interfaceOperation.setName(name4);
      InterfaceFaultReferenceElement interfaceFaultReference = interfaceOperation.addInterfaceFaultReferenceElement();
      interfaceFaultReference.setMessageLabel(MessageLabel.IN);
      interfaceFaultReference.setRef(name3QN);
View Full Code Here

  {
      DescriptionElement descEl = factory.newDescription();
      descEl.setTargetNamespace(namespace1);
      InterfaceElement interfac = descEl.addInterfaceElement();
      interfac.setName(name1);
      InterfaceFaultElement interfaceFault = interfac.addInterfaceFaultElement();
      interfaceFault.setName(name2);
      InterfaceOperationElement interfaceOper = interfac.addInterfaceOperationElement();
      interfaceOper.setName(name1);
      InterfaceFaultReferenceElement interfaceFaultReference = interfaceOper.addInterfaceFaultReferenceElement();
      interfaceFaultReference.setRef(name2QN);
      interfaceFaultReference.setMessageLabel(MessageLabel.IN);
View Full Code Here

  {
      DescriptionElement descEl = factory.newDescription();
      descEl.setTargetNamespace(namespace1);
      InterfaceElement interfac = descEl.addInterfaceElement();
      interfac.setName(name1);
      InterfaceFaultElement interfaceFault = interfac.addInterfaceFaultElement();
      interfaceFault.setName(name2);
     
      BindingElement binding = descEl.addBindingElement();
      binding.setInterfaceName(name1QN);
      BindingFaultElement bindingFault = binding.addBindingFaultElement();
    bindingFault.setRef(name2QN);
     
      descEl.toComponent().getBindings(); //init Binding's ref to its Description
     
      if(!val.testAssertionBindingFault1050(new BindingFault[]{(BindingFaultImpl)bindingFault}, reporter))
    {
      fail("The testAssertionBindingFault1050 method returned false for an list of binding faults that contains only one binding.");
    }
  }
  catch(WSDLException e)
  {
    fail("There was a problem running the test assertion method " + e);
  }
 
  // Test that the assertion returns true for a list of binding faults that contains no duplicate interface fault references.
  try
  {
      DescriptionElement descEl = factory.newDescription();
      descEl.setTargetNamespace(namespace1);
      InterfaceElement interfac = descEl.addInterfaceElement();
      interfac.setName(name1);
      InterfaceFaultElement interfaceFault = interfac.addInterfaceFaultElement();
      interfaceFault.setName(name1);
      InterfaceFaultElement interfaceFault2 = interfac.addInterfaceFaultElement();
      interfaceFault2.setName(name2);
      InterfaceFaultElement interfaceFault3 = interfac.addInterfaceFaultElement();
      interfaceFault.setName(name3);
     
      BindingElement binding = descEl.addBindingElement();
      binding.setInterfaceName(name1QN);
      BindingFaultElement bindingFault = binding.addBindingFaultElement();
    bindingFault.setRef(name1QN);
      BindingFaultElement bindingFault2 = binding.addBindingFaultElement();
    bindingFault2.setRef(name2QN);
      BindingFaultElement bindingFault3 = binding.addBindingFaultElement();
    bindingFault3.setRef(name3QN);
   
      descEl.toComponent().getBindings(); //init Binding's ref to its Description
     
    BindingFault[] bindingFaults = new BindingFault[]{(BindingFaultImpl)bindingFault, (BindingFaultImpl)bindingFault2, (BindingFaultImpl)bindingFault3};
   
    if(!val.testAssertionBindingFault1050(bindingFaults, reporter))
    {
      fail("The testAssertionBindingFault1050 method returned false for a list of binding faults that contains no duplicate interface fault references.");
    }
  }
  catch(WSDLException e)
  {
    fail("There was a problem running the test assertion method " + e);
  }
 
  // Test that the assertion returns false for two binding faults that are defined with the same interface fault reference.
  try
  {
      DescriptionElement descEl = factory.newDescription();
      descEl.setTargetNamespace(namespace1);
      InterfaceElement interfac = descEl.addInterfaceElement();
      interfac.setName(name1);
      InterfaceFaultElement interfaceFault = interfac.addInterfaceFaultElement();
      interfaceFault.setName(name1);
      InterfaceFaultElement interfaceFault2 = interfac.addInterfaceFaultElement();
      interfaceFault2.setName(name2);
     
      BindingElement binding = descEl.addBindingElement();
      binding.setInterfaceName(name1QN);
      BindingFaultElement bindingFault = binding.addBindingFaultElement();
      bindingFault.setRef(name1QN);
View Full Code Here

    DescriptionElement desc = factory.newDescription();
        InterfaceElement interfaceElement = desc.addInterfaceElement();
    InterfaceOperationElement interfaceOperationElement = interfaceElement.addInterfaceOperationElement();

    // Add an InterfaceFault to the InterfaceElement
    InterfaceFaultElement faultElement = interfaceElement.addInterfaceFaultElement();
    faultElement.setName(new NCName("Fault1"));
   
    // create the InterfaceFaultReference to test
    InterfaceFaultReferenceElement faultReference = interfaceOperationElement.addInterfaceFaultReferenceElement();
    faultReference.setRef(new QName("Fault1"));
   
View Full Code Here

    bindingElement.setName(new NCName("binding1"));
   
    InterfaceElement interfaceElement = descriptionElement.addInterfaceElement();
    interfaceElement.setName(new NCName("interface1"));
   
    InterfaceFaultElement iffElement = interfaceElement.addInterfaceFaultElement();
    iffElement.setName(new NCName("fault1"));

    // Create the BindingOperationElement->BindingFaultReferenceElement hierarchy
    BindingOperationElement bopElement = bindingElement.addBindingOperationElement();
    bopElement.setRef(new QName("operation1"));
    fFaultElement = bindingElement.addBindingFaultElement();
View Full Code Here

    BindingElement bindingElement = descriptionElement.addBindingElement();
    bindingElement.setInterfaceName(new QName("interface1"));
   
    InterfaceElement interfaceElement = descriptionElement.addInterfaceElement();
    interfaceElement.setName(new NCName("interface1"));
    InterfaceFaultElement ife = interfaceElement.addInterfaceFaultElement();
    ife.setName(new NCName("Fault1Ref"));
   
    InterfaceOperationElement ifopElement = interfaceElement.addInterfaceOperationElement();
    ifopElement.setName(new NCName("operation1"));
    InterfaceFaultReferenceElement iffrElement = ifopElement.addInterfaceFaultReferenceElement();
    iffrElement.setMessageLabel(new NCName("Fault1MessageLabel"));
View Full Code Here

    InterfaceFault[] iffArray = fInterface.getInterfaceFaults();
    assertNotNull("Expected an array of InterfaceFaults -", iffArray);
    assertEquals("Retrieved InterfaceFault group should be empty if none set -", 0, iffArray.length);

    // create some InterfaceFaults
    InterfaceFaultElement iffe1 = fInterfaceElement.addInterfaceFaultElement();
    InterfaceFaultElement iffe2 = fInterfaceElement.addInterfaceFaultElement();

    // getInterfaceFaults()
    fDescription = fDescriptionElement.toComponent();
    fInterface = fDescription.getInterface(new QName(INTF_NAME));
    iffArray = fInterface.getInterfaceFaults();
View Full Code Here

        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"));
       
       
        fDescription = fDescriptionElement.toComponent();
        Interface intface = fDescription.getInterface(new QName("Interface"));
       
View Full Code Here

TOP

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

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.