Package org.apache.woden

Examples of org.apache.woden.WSDLFactory


   * true if all the binding operations have unique interface
   * operations specified, false otherwise.
   */
  public void testTestAssertionBindingOperation1051()
  {
      WSDLFactory factory = null;
      try {
          factory = WSDLFactory.newInstance();
      } catch (WSDLException e) {
          fail("Can't instanciate the WSDLFactory object.");
      }
    // Test that the assertion returns true when there are no binding operations defined.
  try
  {
    if(!val.testAssertionBindingOperation1051(new BindingOperation[]{}, reporter))
    {
      fail("The testAssertionBindingOperation1051 method returned false with no binding operations defined.");
    }
  }
  catch(WSDLException e)
  {
    fail("There was a problem running the test assertion method " + e);
  }
 
  // Test that the assertion returns true when there is one binding operation defined.
  try
  {
      DescriptionElement descEl = factory.newDescription();
      InterfaceElement interfac = descEl.addInterfaceElement();
      interfac.setName(name1);
      InterfaceOperationElement interfaceOperation = interfac.addInterfaceOperationElement();
      interfaceOperation.setName(name2);
      BindingElement binding = descEl.addBindingElement();
      binding.setName(name2);
      binding.setInterfaceName(name1QN);
      BindingOperationElement bindingOperation = binding.addBindingOperationElement();
    bindingOperation.setRef(name2QN);
     
    if(!val.testAssertionBindingOperation1051(descEl.toComponent().getBindings()[0].getBindingOperations(), reporter))
    {
      fail("The testAssertionBindingOperation1051 method returned false with one valid binding operation 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 operations defined with
  // unique interface operations.
  try
  {
      DescriptionElement descEl = factory.newDescription();
      descEl.setTargetNamespace(namespace1);
      InterfaceElement interfac = descEl.addInterfaceElement();
      interfac.setName(name1);
      InterfaceOperationElement interfaceOperation = interfac.addInterfaceOperationElement();
      interfaceOperation.setName(name3);
      InterfaceOperationElement interfaceOperation2 = interfac.addInterfaceOperationElement();
      interfaceOperation2.setName(name4);
      BindingElement binding = descEl.addBindingElement();
      binding.setName(name2);
      binding.setInterfaceName(name1QN);
      BindingOperationElement bindingOperation = binding.addBindingOperationElement();
      bindingOperation.setRef(name3QN);
      BindingOperationElement bindingOperation2 = binding.addBindingOperationElement();
      bindingOperation2.setRef(name4QN);
     
    if(!val.testAssertionBindingOperation1051(descEl.toComponent().getBindings()[0].getBindingOperations(), reporter))
    {
      fail("The testAssertionBindingOperation1051 method returned false with two valid binding operations 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 operations defined with
  // the same interface operation.
  try
  {
      DescriptionElement descEl = factory.newDescription();
      descEl.setTargetNamespace(namespace1);
      InterfaceElement interfac = descEl.addInterfaceElement();
      interfac.setName(name1);
      InterfaceOperationElement interfaceOperation = interfac.addInterfaceOperationElement();
      interfaceOperation.setName(name3);
View Full Code Here


   
    public void testNSUriIsNull() throws Exception {
        URL wsdlURL = getClass().getClassLoader().getResource("testcase/documentation/extension/resources/nonamespace.wsdl");
        assertNotNull("Failed to find nonamespace.wsdl on the classpath",wsdlURL);

        WSDLFactory factory = WSDLFactory.newInstance();
        WSDLReader reader = factory.newWSDLReader();
        ErrorHandler handler = new TestErrorHandler();
        reader.setFeature(WSDLReader.FEATURE_VALIDATION, true);
        reader.getErrorReporter().setErrorHandler(handler);
        Description descComp = reader.readWSDL(wsdlURL.toString());
        assertNotNull("The reader did not return a WSDL description.", descComp);
View Full Code Here

     */
    protected void setUp() throws Exception
    {
        super.setUp();
       
        WSDLFactory factory = null;
        try {
            factory = WSDLFactory.newInstance();
        } catch (WSDLException e) {
            fail("Can't instantiate the WSDLFactory object.");
        }

        DescriptionElement desc = factory.newDescription();
        desc.addServiceElement();
      fEmptyService = desc.toComponent().getServices()[0];
    }
View Full Code Here

    /* Set up prereqs:
     * - Description containing one named Interface;
     * - Service using that same Interface.
     */
   
        WSDLFactory factory = null;
        try {
            factory = WSDLFactory.newInstance();
        } catch (WSDLException e) {
            fail("Can't instantiate the WSDLFactory object.");
        }

        // Description...
      DescriptionElement fDescElement = factory.newDescription();
     
      // Interface
      InterfaceElement fInterfaceElement = fDescElement.addInterfaceElement();
    fInterfaceElement.setName(new NCName("interface1"));
   
View Full Code Here

    /**
     * Test that the QName specified on the setName method is returned by getName.
     */
    public void testSetAndGetName() throws Exception
    {
        WSDLFactory factory = null;
        try {
            factory = WSDLFactory.newInstance();
        } catch (WSDLException e) {
            fail("Can't instantiate the WSDLFactory object.");
        }
       
        DescriptionElement descElem = factory.newDescription();
        descElem.setTargetNamespace(new URI("urn:woden"));
        ServiceElement service = descElem.addServiceElement();
        service.setName(new NCName(fQName.getLocalPart()));
        assertTrue("QName returned by ServiceElement.getName() was not the one set by setName().",
                   fQName.equals(service.getName()));
View Full Code Here

       *  Test setup :  work with the Infoset view for the creation of the
       *  necessary prerequisite partial hierarchy
       *  Note create the minimum necessary wsdl20 objects
       */
       
        WSDLFactory factory = null;
        try {
            factory = WSDLFactory.newInstance();
        } catch (WSDLException e) {
            fail("Can't instantiate the WSDLFactory object.");
        }
     
      // Description...
      DescriptionElement fDescElement = factory.newDescription();
     
      // Binding...
        fBindingQName = new QName("binding1");
      BindingElement fBindingElement = fDescElement.addBindingElement();
        fBindingNCName = new NCName("binding1");
View Full Code Here

     * @see TestCase#setUp()
     */
    protected void setUp() throws Exception
    {
        super.setUp();
        WSDLFactory factory = null;
        factory = WSDLFactory.newInstance();
        fDescriptionElement = factory.newDescription();
        fDescriptionElement.setTargetNamespace(URI.create(TNS));
      fTypesElement = fDescriptionElement.addTypesElement();
      fInlinedSchema1 = new InlinedSchemaImpl();
      fInlinedSchema2 = new InlinedSchemaImpl();
      fImportedSchema1 = new ImportedSchemaImpl();
View Full Code Here

   * TODO Need to check model structure for XmlSchema
   */

  public void testGetXmlSchemaElement() throws Exception
    {
        WSDLFactory factory = null;
        try {
            factory = WSDLFactory.newInstance();
        } catch (WSDLException e) {
            fail("Can't instantiate the WSDLFactory object.");
        }
       
    // Create the DescriptionElement->InterfaceElement->InterfaceOperationElement->InterfaceMessageReferenceElement hierarchy
    DescriptionElement descriptionElement = factory.newDescription();
    InterfaceElement interfaceElement = descriptionElement.addInterfaceElement();
    InterfaceOperationElement interfaceOperationElement = interfaceElement.addInterfaceOperationElement();
    InterfaceMessageReferenceElement messageReference = interfaceOperationElement.addInterfaceMessageReferenceElement();
   
    // Default case:
View Full Code Here

     */
    protected void setUp() throws Exception
    {
        super.setUp();
       
        WSDLFactory factory = null;
        try {
            factory = WSDLFactory.newInstance();
        } catch (WSDLException e) {
            fail("Can't instantiate the WSDLFactory object.");
        }

        fDescriptionElement = factory.newDescription();
        fBindingElement = fDescriptionElement.addBindingElement();
        fBindingElement.setName(new NCName("binding"));
        //fBinding = (Binding) fBindingElement;
        fTypeURI = new URI("http://www.w3.org/0000/00/apacheType");
        fBinding = fDescriptionElement.toComponent().getBinding(new QName("binding"));
View Full Code Here

   * Test that the (Mandatory) InterfaceFault can be successfully retrieved.
   * The fault reference is to an Interface Fault associated with the grandparent InterfaceElement.
   */
  public void testGetInterfaceFaultElement()
  {
        WSDLFactory factory = null;
        try {
            factory = WSDLFactory.newInstance();
        } catch (WSDLException e) {
            fail("Can't instantiate the WSDLFactory object.");
        }
       
    // Create the DescriptionElement->InterfaceElement->InterfaceOperationElement->InterfaceFaultReference hierarchy
        DescriptionElement desc = factory.newDescription();
    InterfaceElement interfaceElement = desc.addInterfaceElement();
    InterfaceOperationElement interfaceOperationElement = interfaceElement.addInterfaceOperationElement();

    // Add an InterfaceFault to the InterfaceElement
    InterfaceFaultElement faultElement = interfaceElement.addInterfaceFaultElement();
View Full Code Here

TOP

Related Classes of org.apache.woden.WSDLFactory

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.