Package com.eviware.soapui.impl.wsdl.support.assertions

Examples of com.eviware.soapui.impl.wsdl.support.assertions.AssertedXPathsContainer


      // XmlObject xml = XmlObject.Factory.parse( response, options );
      XmlObject xml = XmlUtils.createXmlObject( response, options );
      String expandedPath = PropertyExpander.expandProperties( context, path );
      XmlObject[] items = xml.selectPath( expandedPath );
      AssertedXPathsContainer assertedXPathsContainer = ( AssertedXPathsContainer )context
          .getProperty( AssertedXPathsContainer.ASSERTEDXPATHSCONTAINER_PROPERTY );

      XmlObject contentObj = null;
      String expandedContent = PropertyExpander.expandProperties( context, expectedContent );

      // stupid check for text selection for those situation that the
      // selected
      // text actually contains xml which should be compared as a string.
      if( !expandedPath.endsWith( "text()" ) )
      {
        try
        {
          // contentObj = XmlObject.Factory.parse( expandedContent, options
          // );
          contentObj = XmlUtils.createXmlObject( expandedContent, options );
        }
        catch( Exception e )
        {
          // this is ok.. it just means that the content to match is not
          // xml
          // but
          // (hopefully) just a string
        }
      }

      if( items.length == 0 )
        throw new Exception( "Missing content for xpath [" + path + "] in " + type );

      options.setSavePrettyPrint();
      options.setSaveOuter();

      for( int c = 0; c < items.length; c++ )
      {
        try
        {
          AssertedXPathImpl assertedXPathImpl = null;
          if( assertedXPathsContainer != null )
          {
            String xpath = XmlUtils.createAbsoluteXPath( items[c].getDomNode() );
            if( xpath != null )
            {
              XmlObject xmlObj = items[c]; // XmlObject.Factory.parse(
              // items[c].xmlText( options
              // ) );

              assertedXPathImpl = new AssertedXPathImpl( this, xpath, xmlObj );
              assertedXPathsContainer.addAssertedXPath( assertedXPathImpl );
            }
          }

          if( contentObj == null )
          {
View Full Code Here


            // XmlObject xml = XmlObject.Factory.parse( response, options );
            XmlObject xml = XmlUtils.createXmlObject(response, options);
            String expandedPath = PropertyExpander.expandProperties(context, path);
            XmlObject[] items = xml.selectPath(expandedPath);
            AssertedXPathsContainer assertedXPathsContainer = (AssertedXPathsContainer) context
                    .getProperty(AssertedXPathsContainer.ASSERTEDXPATHSCONTAINER_PROPERTY);

            XmlObject contentObj = null;
            String expandedContent = PropertyExpander.expandProperties(context, expectedContent);

            // stupid check for text selection for those situation that the
            // selected
            // text actually contains xml which should be compared as a string.
            if (!expandedPath.endsWith("text()")) {
                try {
                    // contentObj = XmlObject.Factory.parse( expandedContent, options
                    // );
                    contentObj = XmlUtils.createXmlObject(expandedContent, options);
                } catch (Exception e) {
                    // this is ok.. it just means that the content to match is not
                    // xml
                    // but
                    // (hopefully) just a string
                }
            }

            if (items.length == 0) {
                throw new Exception("Missing content for xpath [" + path + "] in " + type);
            }

            options.setSavePrettyPrint();
            options.setSaveOuter();

            for (int c = 0; c < items.length; c++) {
                try {
                    AssertedXPathImpl assertedXPathImpl = null;
                    if (assertedXPathsContainer != null) {
                        String xpath = XmlUtils.createAbsoluteXPath(items[c].getDomNode());
                        if (xpath != null) {
                            XmlObject xmlObj = items[c];
                            assertedXPathImpl = new AssertedXPathImpl(this, xpath, xmlObj);
                            assertedXPathsContainer.addAssertedXPath(assertedXPathImpl);
                        }
                    }

                    if (contentObj == null) {
                        if (items[c] instanceof XmlAnySimpleType && !(items[c] instanceof XmlQName)) {
View Full Code Here

TOP

Related Classes of com.eviware.soapui.impl.wsdl.support.assertions.AssertedXPathsContainer

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.