Package com.eviware.soapui.support.xml.XmlObjectTreeModel

Examples of com.eviware.soapui.support.xml.XmlObjectTreeModel.XmlTreeNode


          treeNodes = model.selectTreeNodes( context.expand( scp.getXpath() ) );

          if( treeNodes.length > 0 )
          {
            XmlTreeNode mynode = treeNodes[0];

            // work only for simple types
            if( mynode.isLeaf() )
            {
              mynode.setValue( 1, value );

              if( strategy.equals( StrategyTypeConfig.ONE_BY_ONE ) )
              {
                PropertyMutation oneByOnePropertyMutation = new PropertyMutation();
                oneByOnePropertyMutation.setPropertyName( scp.getName() );
                oneByOnePropertyMutation.setPropertyValue( unescapEscaped( model.getXmlObject().toString() ) );
                stsmap.put( scp.getLabel(), mynode.getNodeText() );
                oneByOnePropertyMutation.setMutatedParameters( stsmap );
                oneByOnePropertyMutation.updateRequestProperty( testStepCopy );
                oneByOnePropertyMutation.setTestStep( testStepCopy );
                oneByOnePropertyMutation.addMutation( context );
              }
              else
              {
                allAtOncePropertyMutation.setPropertyName( scp.getName() );
                allAtOncePropertyMutation.setPropertyValue( unescapEscaped( model.getXmlObject().toString() ) );
                stsmap.put( scp.getLabel(), mynode.getNodeText() );
                allAtOncePropertyMutation.setMutatedParameters( stsmap );
                allAtOncePropertyMutation.updateRequestProperty( testStepCopy );
                allAtOncePropertyMutation.setTestStep( testStepCopy );

              }
View Full Code Here


        }
        treeNodes = model.selectTreeNodes( context.expand( scp.getXpath() ) );

        if( treeNodes.length > 0 )
        {
          XmlTreeNode mynode = treeNodes[0];

          if( mynode.isLeaf() )
          {
            if( mynode.getSchemaType() != null && mynode.getSchemaType().getEnumerationValues() != null
                && mynode.getSchemaType().getEnumerationValues().length > 0 )
            {
              EnumerationValues nodeInfo = new EnumerationValues( mynode.getSchemaType().getBaseType()
                  .getShortJavaName() );
              for( XmlAnySimpleType s : mynode.getSchemaType().getEnumerationValues() )
              {
                nodeInfo.addValue( s.getStringValue() );
              }
              updateEnumNodeValue( mynode, nodeInfo );
              stsmap.put( scp.getLabel(), mynode.getNodeText() );
              // addToUpdated( context, scp.getLabel(),
              // mynode.getNodeText() );
              if( strategy.equals( StrategyTypeConfig.ONE_BY_ONE ) )
              {
                PropertyMutation pm = new PropertyMutation();
                pm.setPropertyName( scp.getName() );
                pm.setPropertyValue( model.getXmlObject().toString() );
                stsmap = new StringToStringMap();
                stsmap.put( scp.getLabel(), mynode.getNodeText() );
                pm.setMutatedParameters( stsmap );
                addMutation( context, pm );
              }
            }
            else
            {
              SchemaTypeImpl simpleType = ( SchemaTypeImpl )mynode.getSchemaType();
              XmlObjectTreeModel model2 = new XmlObjectTreeModel( simpleType.getTypeSystem(),
                  simpleType.getParseObject() );
              extractRestrictions( model2, context, mynode, model, scp, stsmap );
            }
          }
View Full Code Here

      XmlObjectTreeModel model, SecurityCheckedParameter scp, StringToStringMap stsmap )
  {
    String baseType = null;
    for( int i = 0; i < node.getChildCount(); i++ )
    {
      XmlTreeNode mynode = node.getChild( i );

      if( "xsd:restriction".equals( mynode.getParent().getNodeName() ) )
      {
        if( mynode.getNodeName().equals( "@base" ) )
        {
          baseType = mynode.getNodeText();
        }
        else
        {
          createMutation( baseType, mynode, context, nodeToUpdate, model, scp, stsmap );
        }
View Full Code Here

          model = SecurityScanUtil.getXmlObjectTreeModel( testStep, scp );
          XmlTreeNode[] treeNodes = null;
          treeNodes = model.selectTreeNodes( context.expand( scp.getXpath() ) );
          if( treeNodes.length > 0 )
          {
            XmlTreeNode mynode = treeNodes[0];
            String fuzzed = fuzzedValue();
            mynode.setValue( 1, fuzzed );
            parameters.put( scp.getLabel(), fuzzed );
          }
          updateRequestProperty( testStep, scp.getName(), model.getXmlObject().toString() );

        }
View Full Code Here

            model = SecurityScanUtil.getXmlObjectTreeModel( testStep, scp );
            XmlTreeNode[] treeNodes = null;
            treeNodes = model.selectTreeNodes( context.expand( scp.getXpath() ) );
            if( treeNodes.length > 0 )
            {
              XmlTreeNode mynode = treeNodes[0];
              mynode.setValue( 1, parameters.get( scp.getLabel() ) );
            }
            updateRequestProperty( testStep, scp.getName(), model.getXmlObject().toString() );

          }
          else
View Full Code Here

  /*
   * used for testing
   */
  private void printNode( NodeInfo node )
  {
    XmlTreeNode mynode = node.node;

    System.out.println( mynode.getNodeName() );
    System.out.println( node.getType() );
    System.out.println( node.xpath );
  }
View Full Code Here

  TreeMap<String, NodeInfo> getElements( XmlTreeNode rootXmlTreeNode )
  {
    TreeMap<String, NodeInfo> result = new TreeMap<String, NodeInfo>();
    for( int cnt = 0; cnt < rootXmlTreeNode.getChildCount(); cnt++ )
    {
      XmlTreeNode xmlTreeNodeChild = ( XmlTreeNode )rootXmlTreeNode.getChild( cnt );

      if( xmlTreeNodeChild.getChildCount() > 0 )
        result.putAll( getElements( rootXmlTreeNode.getChild( cnt ) ) );
      else
      {
        if( xmlTreeNodeChild.getSchemaType() != null && xmlTreeNodeChild.getSchemaType().isPrimitiveType() )
          result.put( xmlTreeNodeChild.getDomNode().getLocalName(), new NodeInfo( rootXmlTreeNode.getChild( cnt ) ) );
      }
    }
    return result;
  }
View Full Code Here

  private void getNextChild( XmlTreeNode node )
  {
    for( int i = 0; i < node.getChildCount(); i++ )
    {
      XmlTreeNode mynode = node.getChild( i );

      if( mynode.getSchemaType() != null && mynode.getSchemaType().getEnumerationValues() != null
          && mynode.getSchemaType().getEnumerationValues().length > 0 )
      {
        EnumerationValues nodeInfo = new EnumerationValues( mynode.getSchemaType().getBaseType().getShortJavaName() );
        for( XmlAnySimpleType s : mynode.getSchemaType().getEnumerationValues() )
        {
          nodeInfo.addValue( s.getStringValue() );
        }

        updateNodeValue( mynode, nodeInfo );
View Full Code Here

  {
    String baseType = null;

    for( int i = 0; i < node.getChildCount(); i++ )
    {
      XmlTreeNode mynode = node.getChild( i );

      if( "xsd:restriction".equals( mynode.getParent().getNodeName() ) )
      {
        if( mynode.getNodeName().equals( "@base" ) )
        {
          baseType = mynode.getNodeText();
          restrictionsList.add( "type = " + baseType );
        }
        else
        {
          String nodeName = mynode.getNodeName();
          String nodeValue = mynode.getChild( 0 ).getNodeText();
          restrictionsList.add( nodeName + " = " + nodeValue );
        }
      }
      getRestrictions( mynode, restrictionsList );
    }
View Full Code Here

  {
    String baseType = null;

    for( int i = 0; i < node.getChildCount(); i++ )
    {
      XmlTreeNode mynode = node.getChild( i );

      if( mynode.getNodeName().equals( "@base" ) )
      {
        baseType = mynode.getNodeText();
        if( baseType.contains( ":" ) )
        {
          baseType = baseType.substring( baseType.indexOf( ":" ) + 1 );
        }
        restrictionsList.add( "type = " + baseType );
View Full Code Here

TOP

Related Classes of com.eviware.soapui.support.xml.XmlObjectTreeModel.XmlTreeNode

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.