Package org.eclipse.wst.wsi.internal.core.analyzer

Examples of org.eclipse.wst.wsi.internal.core.analyzer.AssertionFailException


        {
          faultsFound = true;
          // If there is at least one mime:multipartRelated element,
          // the assertion failed
          if (containsMimeMultiparts(faults))
            throw new AssertionFailException("The binding operation is \""
              + bindingOperation.getName() + "\".");
        }
      }

      // If the binding does not contain wsdl:fault elements,
View Full Code Here


          // If there is not exactly one mime:part element containing
          // a soapbind:body child, the assertion failed
          if (!containsOneSoapBody(inputMultiparts))
          {
            throw new AssertionFailException("The invalid "
                + "mime:multipartRelated element is in the wsdl:input of the \""
                + bindingOperation.getName() + "\" binding operation.");
          }
        }

        // If the wsdl:output contains mime:multipartRelated elements
        if (!outputMultiparts.isEmpty())
        {
          multipartsFound = true;

          // If there is not exactly one mime:part element containing
          // a soapbind:body child, the assertion failed
          if (!containsOneSoapBody(outputMultiparts))
          {
            throw new AssertionFailException("The invalid "
                + "mime:multipartRelated element is in the wsdl:output of the \""
                + bindingOperation.getName() + "\" binding operation.");
          }
        }
View Full Code Here

      {
        if (!this.validator.checkPartAttributes(bindingMatch, "useInput", "useType")
          || !this.validator.checkPartAttributes(bindingMatch, "useOutput", "useType"))
        {
          // this should never happen
          throw new AssertionFailException("diagnostic: internal processing error!");
        }
      }
      catch (AssertionFailException e)
      {
        result = AssertionResult.RESULT_FAILED;
View Full Code Here

      }
    }

    catch (WSIException we)
    {
      throw new AssertionFailException("problem getting WSDL defintions namespace");
    }

    /*
    // Get the default namespace
    String schemaUsed = def.getNamespace("");
View Full Code Here

            attributeName = part.getTypeName();
          }

          if (attributeName == null)
          {
            throw new AssertionFailException(
              "Name of operation that failed: "
                + op.getName()
                + "\n"
                + op.toString()
                + "\n"
                + "\nName of message that failed: "
                + msg.getQName()
                + "\n"
                + msg.toString());
          }
        }
      }
      catch (NullPointerException n)
      {
        // no parts found - this qualifies an assertion failure
        throw new AssertionFailException(n.toString());
      }
    }
    return true; // tests successful
  }
View Full Code Here

          // If not true that all the wsdl:partS are bound,
          // the assertion failed
          if (!inputParts
            .containsAll(portTypeInput.getMessage().getParts().keySet()))
          {
            throw new AssertionFailException("The wsdl:input of the \""
              + bindingOperation.getName() + "\" binding operation does not "
              + "bind all the corresponding wsdl:partS.");
          }
        }

        // If the corresponding wsdl:output exists in wsdl:portType
        // and includes the message attribute
        if (portTypeOutput != null && portTypeOutput.getMessage() != null)
        {
          // Getting the list of all the parts bound by wsdl:output's child elements
          List outputParts = getBindingParts(
            bindingOperation.getBindingOutput().getExtensibilityElements(),
            portTypeOutput.getMessage());
          // If not true that all the wsdl:partS are bound,
          // the assertion failed
          if (!outputParts
            .containsAll(portTypeOutput.getMessage().getParts().keySet()))
          {
            throw new AssertionFailException("The wsdl:output of the \""
              + bindingOperation.getName() + "\" binding operation does not "
              + "bind all the corresponding wsdl:partS.");
          }
        }

        // IF there are wsdl:faultS in the wsdl:portType operation
        if (!bindingOperation.getOperation().getFaults().isEmpty())
        {
          // Collecting all the soap:fault names
          List faultNames = new ArrayList();
          Collection faults = bindingOperation.getBindingFaults().values();
          // Going through all the wsdl:faultS
          Iterator it = faults.iterator();
          while (it.hasNext())
          {
            // Getting wsdl:fault's extensibility elements
            List extElems = ((BindingFault) it.next()).getExtensibilityElements();
            for (int j = 0; j < extElems.size(); j++)
            {
              if (((ExtensibilityElement)extElems.get(j))
                .getElementType().equals(WSDL_SOAP_FAULT))
              {
                faultNames.add(((SOAPFault)extElems.get(j)).getName());
              }
            }
          }
          // Going through all the soap:headerfaultS
          faultNames.addAll(findAllHeaderFaults(bindingOperation));
          // If not true that all the wsdl:faultS are bound,
          // the assertion failed
          if (!faultNames.containsAll(
            bindingOperation.getOperation().getFaults().keySet()))
          {
              throw new AssertionFailException("The binding operation \""
                  + bindingOperation.getName() + "\" does not "
                  + "bind all the corresponding wsdl:faultS.");
          }
        }
      }
View Full Code Here

      // If a namespace URI is relative or invalid, the assertion failed
      URI uri = new URI(im.getNamespaceURI());
      if (!uri.isAbsolute())
      {
        throw new AssertionFailException(
          im.getNamespaceURI() + " is relative URI.");
      }
    }
    catch (AssertionNotApplicableException anae)
    {
View Full Code Here

            // If there is an invalid mime:content element
            MIMEContent imc = getInvalidMimeContent(
                inputMimeContents, portTypeInput.getMessage());
            if (imc != null)
            {
              throw new AssertionFailException("The mime:content element in "
                + "the wsdl:input of the \"" + bindingOperation.getName()
                + "\" that binds the \"" + imc.getPart()
                + "\" wsdl:part uses the invalid content type \""
                + imc.getType() + "\". ");
            }
          }
        }

        // If the wsdl:output contains mime:content elements
        if (!outputMimeContents.isEmpty())
        {
          Output portTypeOutput = bindingOperation.getOperation().getOutput();
          // If the corresponding wsdl:output exists in wsdl:portType
          // and includes the message attribute
          if (portTypeOutput != null && portTypeOutput.getMessage() != null)
          {
            // If there is an invalid mime:content element
            MIMEContent imc = getInvalidMimeContent(
              outputMimeContents, portTypeOutput.getMessage());
            if (imc != null)
            {
              throw new AssertionFailException("The mime:content element in "
                + "the wsdl:output of the \"" + bindingOperation.getName()
                + "\" that binds the \"" + imc.getPart()
                + "\" wsdl:part uses the invalid content type \""
                + imc.getType() + "\". ");
            }
View Full Code Here

        {
          this.validator.messageIsDocLitSchemaValid(entryContext);
        }
        catch (Exception e)
        {
          throw new AssertionFailException(e.getMessage());
        }
        throw new AssertionPassException();
      }

      /* soap message is not doc-lit so try :
       * Rpc-lit
       */
      BindingOperation[] rpcBindingOperations =
        this.validator.getMatchingBindingOps(
          WSIConstants.ATTRVAL_SOAP_BIND_STYLE_RPC,
          bindings);

      // Determine if there is an operation match
      BindingOperation rcpOpMatch =
        this.validator.getOperationMatch(
          entryContext.getEntry().getEntryType(),
          messageDoc,
          rpcBindingOperations);
      if (rcpOpMatch != null)
      {
        // Determine if the parts match
        rcpOpMatch =
          this.validator.getOperationPartsMatch(
            entryContext.getEntry().getEntryType(),
            messageDoc,
            rpcBindingOperations);
      }

      if (rcpOpMatch == null)
      {
        //not matched with rpc either. Prepare assertion failure.
        StringBuffer rpcOperationList = new StringBuffer();
        for (int i = 0; i < rpcBindingOperations.length; i++)
        {
          rpcOperationList.append(rpcBindingOperations[i].toString() + "\n");
        }

        StringBuffer docOperationList = new StringBuffer();
        for (int i = 0; i < docBindingOperations.length; i++)
        {
          docOperationList.append(docBindingOperations[i].toString() + "\n");
        }

        throw new AssertionFailException(
          "--MESSAGE:\n"
            + entryContext.getMessageEntry().getMessage()
            + "\n--CANDIDATE RPC STYLE OPERATIONS ("
            + (rpcBindingOperations.length != 0
              ? (rpcBindingOperations.length + "):\n" + rpcOperationList)
View Full Code Here

                        if (nextAttr
                          .getNamespaceURI()
                          .equals(WSIConstants.NS_URI_SOAP))
                        {
                          // found unexpected qname
                          throw new AssertionFailException(
                            entryContext.getMessageEntry().getMessage());
                        }
                      }
                    }
                  }
View Full Code Here

TOP

Related Classes of org.eclipse.wst.wsi.internal.core.analyzer.AssertionFailException

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.