Package fr.imag.adele.apam.apform.impl.handlers

Examples of fr.imag.adele.apam.apform.impl.handlers.PropertyInjectionHandler$Description


    /**
     * Test for the test-suite/documents/good/XsImport-2G W3C test.
     */
    public void testXsImport2GFromOM(){
      try{
        Description desc = omWSDLReader.readWSDL("http://dev.w3.org/cvsweb/~checkout~/2002/ws/desc/test-suite/documents/good/XsImport-2G/reservationDetails.wsdl");
        assertNotNull("Description is null.", desc);
        assertFalse("The good XsImport-2G test returned errors. " + handler.getSummaryOfMessageKeys(), handler.messageHasBeenReported());
      }
      catch(Exception e){
        fail("Unable to read WSDL document because of " + e);
View Full Code Here


    /**
     * Test for the test-suite/documents/good/XsImport-3G W3C test.
     */
    public void testXsImport3GFromOM(){
      try{
        Description desc = omWSDLReader.readWSDL("http://dev.w3.org/cvsweb/~checkout~/2002/ws/desc/test-suite/documents/good/XsImport-3G/reservationDetails.wsdl");
        assertNotNull("Description is null.", desc);
        assertFalse("The good XsImport-3G test returned errors. " + handler.getSummaryOfMessageKeys(), handler.messageHasBeenReported());
      }
      catch(Exception e){
        fail("Unable to read WSDL document because of " + e);
View Full Code Here

   
    // Test that the assertion returns true for an interace that extends no other interfaces.
  try
  {
      DescriptionElement descEl = factory.newDescription();
      Description descComp = descEl.toComponent();
      InterfaceImpl interfac = (InterfaceImpl)descEl.addInterfaceElement();
    if(!val.testAssertionInterface1009(interfac, reporter))
    {
      fail("The testAssertionInterface1009 method returned false for an interface that extends no other interfaces.");
    }
  }
  catch(WSDLException e)
  {
    fail("There was a problem running the test assertion method " + e);
  }
 
  // Test that the assertion returns true if the interface is not in the direct or indirect list.
  try
  {
      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))
    {
      fail("The testAssertionInterface1009 method returned false for an interface that is not in the list of exteneded interfaces.");
    }
  }
  catch(WSDLException e)
  {
    fail("There was a problem running the test assertion method " + e);
  }
 
  // Test that the assertion returns false if the interface is in the direct list.
  try
  {
    DescriptionElement descEl = factory.newDescription();
    Description descComp = descEl.toComponent();
      descEl.setTargetNamespace(namespace1);
    InterfaceImpl interfac = (InterfaceImpl)descEl.addInterfaceElement();
      interfac.setName(name1);
      InterfaceImpl interfac2 = (InterfaceImpl)descEl.addInterfaceElement();
      interfac2.setName(name2);
      InterfaceImpl interfac3 = (InterfaceImpl)descEl.addInterfaceElement();
      interfac3.setName(name3);
      interfac.addExtendedInterfaceName(interfac.getName());
      interfac.addExtendedInterfaceName(interfac2.getName());
      interfac.addExtendedInterfaceName(interfac3.getName());
     
      descComp.getInterfaces(); //init Interface's ref to its Description, needed for interface extension
   
    if(val.testAssertionInterface1009(interfac, reporter))
    {
      fail("The testAssertionInterface1009 method returned true for an interface that is in the direct extended interface list.");
    }
  }
  catch(Exception e)
  {
    fail("There was a problem running the test assertion method " + e);
  }
 
  // Test that the assertion returns false if the interface is in the indirect list.
  try
  {
      DescriptionElement descEl = factory.newDescription();
      Description descComp = descEl.toComponent();
      InterfaceImpl interfac = (InterfaceImpl)descEl.addInterfaceElement();
      interfac.setName(name1);
      InterfaceImpl interfac2 = (InterfaceImpl)descEl.addInterfaceElement();
      interfac2.setName(name2);
      InterfaceImpl interfac3 = (InterfaceImpl)descEl.addInterfaceElement();
      interfac3.setName(name3);
      interfac.addExtendedInterfaceName(interfac2.getName());
      interfac.addExtendedInterfaceName(interfac3.getName());
      interfac2.addExtendedInterfaceName(interfac.getName());
     
      descComp.getInterface(interfac.getName()); //to ensure the Interface can reference its containing Description
   
    if(val.testAssertionInterface1009(interfac, reporter))
    {
      fail("The testAssertionInterface1009 method returned true for an interface that is in the indirect extended interface list.");
    }
View Full Code Here

      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 =
        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 #none and an empty element declaration.");
    }
View Full Code Here

       
        URL wsdlURL = getClass().getClassLoader().getResource(fWsdlPath);
        assertNotNull("Failed to find the WSDL document on the classpath using the path: " + fWsdlPath + ".",
                wsdlURL);
       
        Description descComp = fReader.readWSDL(wsdlURL.toString());
        assertNotNull("The reader did not return a WSDL description.", descComp);
       
        fBindings = descComp.getBindings();
        assertEquals("The Description should contain 2 Binding components.", 2, fBindings.length);      
  }
View Full Code Here

      //Set errorHandler
      omWSDLReader.getErrorReporter().setErrorHandler(new TestErrorHandler());
    }

    public void testReadValidWSDL20FromOM(){
        Description desc = null;
        try{
          URL wsdlURL = getClass().getClassLoader().getResource("org/apache/woden/primer-hotelReservationService.wsdl");
          desc = omWSDLReader.readWSDL(wsdlURL.toString());
        }
        catch(WSDLException e){
View Full Code Here

            e.getMessage().indexOf("WSDL501") > -1);
        }
    }
   
    public void testReadEmbeddedWSDLSourceFromOM() {
        Description desc = null;
        //Load in a WSDL 2.0 file
        URL wsdlURL = getClass().getClassLoader().getResource("org/apache/woden/embeded.xml");

        //Good Tests.
        String[] goodFragids = new String[]{
View Full Code Here

   * Test that the assertion passes for an interface that
   * extends no other interfaces.
   */
  public void testNoInterfaceExtension() {
    DescriptionElement descEl = factory.newDescription();
    Description descComp = descEl.toComponent();
    descEl.setTargetNamespace(URI.create("http://testnamespace"));
   
    InterfaceElement interfac = descEl.addInterfaceElement();
    interfac.setName(new NCName("name"));
   
    // init Interface's ref to its Description, needed for interface extension.
    descComp.getInterfaces();
    try {
      assertion.validate(interfac, wodenContext);
    } catch(WSDLException e){
      fail("Assertion Interface1009 threw a WSDLException.");
    }
View Full Code Here

  /**
   * 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.
      descComp.getInterfaces();
     
      try {
        assertion.validate(interfac, wodenContext);
      } catch(WSDLException e) {
        fail("Assertion Interface1009 threw a WSDLException.");
View Full Code Here

  /**
   * 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());
       
    // init Interface's ref to its Description, needed for interface extension.
    descComp.getInterfaces();
     
    try {
      assertion.validate(interfac, wodenContext);
    } catch(WSDLException e){
      fail("Assertion Interface1009 threw a WSDLException.");
View Full Code Here

TOP

Related Classes of fr.imag.adele.apam.apform.impl.handlers.PropertyInjectionHandler$Description

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.