Package com.eviware.soapui.support.types

Examples of com.eviware.soapui.support.types.StringToStringMap


      return;

    String filePath = ( ( WsdlProject )project ).getPath();

    String recent = SoapUI.getSettings().getString( RECENT_PROJECTS_SETTING, null );
    StringToStringMap history = recent == null ? new StringToStringMap() : StringToStringMap.fromXml( recent );
    history.put( filePath, project.getName() );
    SoapUI.getSettings().setString( RECENT_PROJECTS_SETTING, history.toXml() );

    DefaultActionMapping<WorkspaceImpl> mapping = new DefaultActionMapping<WorkspaceImpl>(
        ImportWsdlProjectAction.SOAPUI_ACTION_ID, null, null, false, filePath );
    mapping.setName( project.getName() );
    mapping.setDescription( "Switches to the [" + project.getName() + "] project" );
View Full Code Here


    }
  }

  public StringToStringMap getValues()
  {
    StringToStringMap values = new StringToStringMap();

    for( Iterator<String> i = components.keySet().iterator(); i.hasNext(); )
    {
      String key = i.next();
      values.put( key, getComponentValue( key ) );
    }

    return values;
  }
View Full Code Here

    return toolsForm;
  }

  public void getFormValues( Settings settings )
  {
    StringToStringMap values = new StringToStringMap();
    toolsForm.getValues( values );
    storeValues( values, settings );
  }
View Full Code Here

    getForm().setValues( getValues( settings ) );
  }

  public StringToStringMap getValues( Settings settings )
  {
    StringToStringMap toolsValues = new StringToStringMap();
    for( int i = 0; i < TOOLS.length; i++ )
    {
      toolsValues.put( TOOLS[i][0], settings.getString( TOOLS[i][1], "" ) );
    }
    return toolsValues;
  }
View Full Code Here

    return globalPropertiesForm;
  }

  public void getFormValues( Settings settings )
  {
    StringToStringMap values = new StringToStringMap();
    globalPropertiesForm.getValues( values );
    storeValues( values, settings );
  }
View Full Code Here

    return "Global Properties";
  }

  public StringToStringMap getValues( Settings settings )
  {
    StringToStringMap values = new StringToStringMap();
    values.put( ENABLE_OVERRIDE, settings.getBoolean( GlobalPropertySettings.ENABLE_OVERRIDE ) );
    return values;
  }
View Full Code Here

  public String createScriptAssertionForExists( XPathData xpathData )
  {
    String script = "import com.eviware.soapui.support.XmlHolder\n\n"
        + "def holder = new XmlHolder( messageExchange.responseContentAsXml )\n";

    StringToStringMap nsMap = xpathData.getNamespaceMap();
    for( String ns : nsMap.keySet() )
    {
      script += "holder.namespaces[\"" + nsMap.get( ns ) + "\"] = \"" + ns + "\"\n";
    }

    script += "def node = holder.getDomNode( \"" + xpathData.getPath() + "\" )\n";
    script += "\nassert node != null\n";
View Full Code Here

  public WorkspaceImpl( String path, StringToStringMap projectOptions ) throws XmlException, IOException
  {
    if( projectOptions == null )
    {
      this.projectOptions = new StringToStringMap();
    }
    else
    {
      this.projectOptions = projectOptions;
    }
View Full Code Here

    return xpathData.buildXPath( modifier );
  }

  public static XPathData createXPathData( Node node, boolean anonymous, boolean selectText, boolean absolute )
  {
    StringToStringMap nsMap = new StringToStringMap();
    List<String> pathComponents = new ArrayList<String>();

    int nsCnt = 1;

    String namespaceURI = node.getNamespaceURI();
    // if( node.getNodeType() == Node.TEXT_NODE )
    // {
    // node = node.getParentNode();
    // }
    if( node.getNodeType() == Node.ATTRIBUTE_NODE )
    {
      if( namespaceURI != null && namespaceURI.length() > 0 )
      {
        String prefix = node.getPrefix();
        if( prefix == null || prefix.length() == 0 )
          prefix = "ns" + nsCnt++ ;

        nsMap.put( namespaceURI, prefix );
        pathComponents.add( "@" + prefix + ":" + node.getLocalName() );
      }
      else
      {
        pathComponents.add( "@" + node.getLocalName() );
      }
      node = ( ( Attr )node ).getOwnerElement();
    }
    else if( node.getNodeType() == Node.DOCUMENT_NODE )
    {
      node = ( ( Document )node ).getDocumentElement();
    }
    // else if( node.getNodeType() == Node.DOCUMENT_FRAGMENT_NODE )
    // {
    // node =
    // ((DocumentFragment)node).getOwnerDocument().getDocumentElement();
    // }

    if( node.getNodeType() == Node.ELEMENT_NODE )
    {
      int index = anonymous ? 0 : findNodeIndex( node );

      String pc = null;

      namespaceURI = node.getNamespaceURI();
      if( namespaceURI != null && namespaceURI.length() > 0 )
      {
        String prefix = node.getPrefix();
        if( prefix == null || prefix.length() == 0 )
          prefix = "ns" + nsCnt++ ;

        while( !nsMap.containsKey( namespaceURI ) && nsMap.containsValue( prefix ) )
        {
          prefix = "ns" + nsCnt++ ;
        }

        nsMap.put( namespaceURI, prefix );
        pc = prefix + ":" + node.getLocalName();
      }
      else
      {
        pc = node.getLocalName();
      }

      String elementText = XmlUtils.getElementText( ( Element )node );

      // not an attribute?
      if( selectText && pathComponents.isEmpty() && elementText != null && elementText.trim().length() > 0 )
        pathComponents.add( "text()" );

      pathComponents.add( pc + ( ( index == 0 ) ? "" : "[" + index + "]" ) );
    }
    else
      return null;

    node = node.getParentNode();
    namespaceURI = node.getNamespaceURI();
    while( node != null
        && node.getNodeType() == Node.ELEMENT_NODE
        && ( absolute || ( !"Body".equals( node.getNodeName() )
            && !SoapVersion.Soap11.getEnvelopeNamespace().equals( namespaceURI ) && !SoapVersion.Soap12
            .getEnvelopeNamespace().equals( namespaceURI ) ) ) )
    {
      int index = anonymous ? 0 : findNodeIndex( node );

      String ns = nsMap.get( namespaceURI );
      String pc = null;

      if( ns == null && namespaceURI != null && namespaceURI.length() > 0 )
      {
        String prefix = node.getPrefix();
        if( prefix == null || prefix.length() == 0 )
          prefix = "ns" + nsCnt++ ;

        while( !nsMap.containsKey( namespaceURI ) && nsMap.containsValue( prefix ) )
        {
          prefix = "ns" + nsCnt++ ;
        }

        nsMap.put( namespaceURI, prefix );
        ns = nsMap.get( namespaceURI );

        pc = prefix + ":" + node.getLocalName();
      }
      else if( ns != null )
      {
View Full Code Here

    }

    public StringToStringMap getJMSProperties()
    {
      List<JMSPropertyConfig> propertyList = request.getJMSPropertiesConfig().getJMSProperties();
      StringToStringMap stringToStringMap = new StringToStringMap( propertyList.size() );
      for( JMSPropertyConfig jmsProperty : propertyList )
      {
        stringToStringMap.put( jmsProperty.getName(), jmsProperty.getValue() );
      }
      return stringToStringMap;
    }
View Full Code Here

TOP

Related Classes of com.eviware.soapui.support.types.StringToStringMap

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.