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

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


      // If the envelope contains the xmlns:xml namespace declaration,
      // the assertion failed
      String incorrectElementName = getIncorrectElementName(elem);
      if (incorrectElementName != null)
      {
        throw new AssertionFailException("The name of an element containing "
          + "such namespace declaration is \"" + incorrectElementName + "\".");
      }
    }
    catch (AssertionNotApplicableException anae)
    {
View Full Code Here


      // looking for any attribute of soap:Envelope in the namespace
      // "http://schemas.xmlsoap.org/soap/envelope/"
      // If at least one attribute is found, the assertion failed
      Attr attr = getAttribute(element.getAttributes());
      if (attr != null)
        throw new AssertionFailException("soap:Envelope attribute name is "
          + attr.getName());

      // Getting the first child of soap:Envelope
      element = XMLUtils.getFirstChild(element);

      // If the child is soap:Header
      if (element != null
        && element.getLocalName().equals(XMLUtils.SOAP_ELEM_HEADER))
      {
        // looking for any attribute of soap:Header in the namespace
        // "http://schemas.xmlsoap.org/soap/envelope/"
        // If at least one attribute is found, the assertion failed
        attr = getAttribute(element.getAttributes());
        if (attr != null)
          throw new AssertionFailException("soap:Header attribute name is "
            + attr.getName());

        // Moving to the next soap:Envelope child
        element = XMLUtils.getNextSibling(element);
      }

      // If the child is soap:Body
      if (element != null
        && element.getLocalName().equals(XMLUtils.SOAP_ELEM_BODY))
      {
        // looking for any attribute of soap:Body in the namespace
        // "http://schemas.xmlsoap.org/soap/envelope/"
        // If at least one attribute is found, the assertion failed
        attr = getAttribute(element.getAttributes());
        if (attr != null)
          throw new AssertionFailException("soap:Body attribute name is "
            + attr.getName());
      }

    }
    catch (AssertionNotApplicableException anae)
View Full Code Here

              SOAPBinding soapBinding = (SOAPBinding) o;
              if (!WSIConstants
                .NS_URI_SOAP_HTTP
                .equals(soapBinding.getTransportURI()))
              {
                throw new AssertionFailException();
              }

            }
          }

          //find operation in port type
          operation = bindingOperation.getOperation();
          if (operation == null)
          {
            throw new AssertionFailException();
          }

          if (isOneWayResponse)
          {
            if (operation.getOutput() == null)
              throw new AssertionPassException();
            else
              throw new AssertionFailException();
          }

          //    check whether the response message from the log
          //  contains the output message
          NodeList soapBodyList =
            docResponse.getElementsByTagNameNS(
              WSIConstants.NS_URI_SOAP,
              XMLUtils.SOAP_ELEM_BODY);
          if ((soapBodyList == null) || (soapBodyList.getLength() == 0))
          {
            // Response does not contain any soap Body elements
            throw new AssertionFailException();
          }
          for (int i = 0; i < soapBodyList.getLength(); i++)
          {
            Element nextBodyElem = (Element) soapBodyList.item(i);
            Element soapMessageElement = XMLUtils.getFirstChild(nextBodyElem);
View Full Code Here

          entryContext.getMessageEntry().getHTTPHeaders(),
          HTTPConstants.HEADER_CONTENT_TYPE);
      if((contentType == null) ||
         !contentType.equalsIgnoreCase(WSIConstants.CONTENT_TYPE_MULTIPART))
      {
        throw new AssertionFailException("Incorrect Content-Type value \"" +
            contentType + "\" in HTTP header");
      }
    }
    catch (AssertionNotApplicableException e)
    {
View Full Code Here

      // ADD extra check here that the <soap:Fault> is a child of <soap:Envelope> ??                 
      if ((soapFaultList == null) || (soapFaultList.getLength() == 0))
      {
        // No Soap fault found.
        // Assertion failed (ADD highlight the child here ?)
        throw new AssertionFailException(
          "--- REQUEST:\n"
            + entryContext.getRequest().getMessage()
            + "\n--- RESPONSE:\n"
            + entryContext.getResponse().getMessage());
      }
View Full Code Here

                  || child.getLocalName().equalsIgnoreCase(
                    XMLUtils.SOAP_ELEM_FAULT_DETAIL))
                && (child.getNamespaceURI() != null))
              {
                // Assertion failed
                throw new AssertionFailException(
                  entryContext.getMessageEntry().getMessage());
              }
            }
          }
        }
View Full Code Here

      String str = strs[i];
     
      // check string length
      if(str.length() > 998)
      {
        throw new AssertionFailException("The length (" + str.length() +
            ") of the line (" + (i+1) + ") greater than 998");
      }
      // No octets with decimal values greater than 127
      // are allowed and neither are NULs (octets with decimal value 0).  CR
      //(decimal value 13) and LF (decimal value 10) octets only occur as
      // part of CRLF line separation sequences.
      char[] chars = str.toCharArray();
      for (int j = 0; j < chars.length; j++)
      {
        if((chars[j] > 127) || (chars[j] == 0) ||
            (chars[j] == 10) || (chars[j] == 13))
        {
          throw new AssertionFailException("The char (" + chars[j] +
              ")[code=" + (byte) chars[j] + " position=" + j +
              "] does not allows in 7bit encoding content");
        }
      }
    }
View Full Code Here

      String str = strs[i];
     
      // check string length
      if(str.length() > 998)
      {
        throw new AssertionFailException("The length (" + str.length() +
            ") of the line (" + (i+1) + ") greater than 998");
      }
      // octets with decimal values greater than 127
      // may be used.  As with "7bit data" CR and LF octets only occur as part
      // of CRLF line separation sequences and no NULs are allowed.
      char[] chars = str.toCharArray();
      for (int j = 0; j < chars.length; j++)
      {
        if((chars[j] == 0) || (chars[j] == 10) || (chars[j] == 13))
        {
          throw new AssertionFailException("The char (" + chars[j] +
              ")[code=" + (byte) chars[j] + " position=" + j +
              "] does not allows in 8bit encoding content");
        }
      }
    }
View Full Code Here

      //encoded line indicates such a non-significant ("soft")
      //line break in the encoded text.
      if(((strs[i].indexOf("\t") != -1) || (strs[i].indexOf(" ") != -1)) &&
          (strs[i].length() > 76))
      {
        throw new AssertionFailException("The length (" + strs[i].length() +
            ") of the line (" + (i+1) +
            ") greater than 76, \"soft\" line breaks must be used");
      }

      char[] chars = strs[i].toCharArray();
      for (int j = 0; j < chars.length; j++)
      {
        //(1)   (General 8bit representation) Any octet, except a CR or
        //LF that is part of a CRLF line break of the canonical
        //(standard) form of the data being encoded, may be
        //represented by an "=" followed by a two digit
        //hexadecimal representation of the octet's value.  The
        //digits of the hexadecimal alphabet, for this purpose,
        //are "0123456789ABCDEF".  Uppercase letters must be
        //used; lowercase letters are not allowed.  Thus, for
        //example, the decimal value 12 (US-ASCII form feed) can
        //be represented by "=0C", and the decimal value 61 (US-
        //ASCII EQUAL SIGN) can be represented by "=3D".  This
        //rule must be followed except when the following rules
        //allow an alternative encoding.
        // (2)   (Literal representation) Octets with decimal values of
        //33 through 60 inclusive, and 62 through 126, inclusive,
        //MAY be represented as the US-ASCII characters which
        //correspond to those octets (EXCLAMATION POINT through
        //LESS THAN, and GREATER THAN through TILDE,
        //respectively).
        if((chars[j] == 61) && (chars.length > j+2))
        {
          if(!isHex(chars[j+1]) || !isHex(chars[j+2]))
          {
            throw new AssertionFailException("the quoted char (" +
                 chars[j] + chars[j+1] + chars[j+2] + ") is incorrect");
          } else {
            j += 2;
          }
        }
        // check for space and tab
        else if((chars[j] != 9) && (chars[j] != 32))
        {
          // check invalid symbol
          if((chars[j] == 0) || (chars[j] == 10) || (chars[j] == 13) ||
             (chars[j] < 33) || (chars[j] > 126) || (chars[j] == 61))
          {
            throw new AssertionFailException("The char (" + chars[j] +
                ")[code=" + (byte) chars[j] + " position=" + j +
                "] must be quoted");
          }
        }
      }
View Full Code Here

      String str = strs[i];
     
      // check string length
      if(str.length() > 76)
      {
        throw new AssertionFailException("The length (" + str.length() +
            ") of the line (" + (i+1) + ") greater than 998");
      }
      // check for "ABCDEFGHIJKLMNOPQRSTUVWXYZabcefghijklmnopqrstuvwxyz0123456789/+"
      char[] chars = str.toCharArray();
      for (int j = 0; j < chars.length; j++)
      {
        char c = chars[i];
        if((c < 47) || (c > 122) || ((c > 57) && (c < 65)) ||
           ((c > 90) && (c < 97)))
        {
          throw new AssertionFailException("The char (" + chars[j] +
              ")[code=" + (byte) chars[j] + " position=" + j +
              "] does not allows in base64 encoding content");
        }
      }
    }
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.