Package com.eviware.soapui.model.testsuite

Examples of com.eviware.soapui.model.testsuite.TestProperty


      {
        if( parameterMutations.containsKey( param ) )
          if( parameterMutations.get( param ).size() > 0 )
          {

            TestProperty property = getTestStep().getProperties().get( param.getName() );
            String value = context.expand( property.getValue() );
            if( param.getXpath() == null || param.getXpath().trim().length() == 0 )
            {
              testStep.getProperties().get( param.getName() )
                  .setValue( parameterMutations.get( param ).get( 0 ) );
              params.put( param.getLabel(), parameterMutations.get( param ).get( 0 ) );
              parameterMutations.get( param ).remove( 0 );
            }
            else
            {
              // no value, do nothing.
              if( value == null || value.trim().equals( "" ) )
                continue;
              if( XmlUtils.seemsToBeXml( value ) )
              // try
              {
                // XmlObjectTreeModel model = new XmlObjectTreeModel(
                // property.getSchemaType().getTypeSystem(),
                // XmlObject.Factory.parse( value ) );
                XmlObjectTreeModel model = new XmlObjectTreeModel( property.getSchemaType().getTypeSystem(),
                    XmlUtils.createXmlObject( value ) );
                XmlTreeNode[] nodes = model.selectTreeNodes( context.expand( param.getXpath() ) );
                for( XmlTreeNode node : nodes )
                  node.setValue( 1, parameterMutations.get( param ).get( 0 ) );
                params.put( param.getLabel(), parameterMutations.get( param ).get( 0 ) );
                parameterMutations.get( param ).remove( 0 );

                testStep.getProperties().get( param.getName() ).setValue( model.getXmlObject().toString() );

              }
            }
            break;
          }
      }
    }
    else
    {
      for( TestProperty property : testStep.getPropertyList() )
      {

        String value = context.expand( property.getValue() );
        if( XmlUtils.seemsToBeXml( value ) )
        {
          XmlObjectTreeModel model = null;
          // model = new XmlObjectTreeModel(
          // property.getSchemaType().getTypeSystem(),
          // XmlObject.Factory.parse( value ) );
          model = new XmlObjectTreeModel( property.getSchemaType().getTypeSystem(),
              XmlUtils.createXmlObject( value ) );

          for( SecurityCheckedParameter param : getParameterHolder().getParameterList() )
          {
            if( param.getXpath() == null || param.getXpath().trim().length() == 0 )
            {
              testStep.getProperties().get( param.getName() )
                  .setValue( parameterMutations.get( param ).get( 0 ) );
              params.put( param.getLabel(), parameterMutations.get( param ).get( 0 ) );
              parameterMutations.get( param ).remove( 0 );
            }
            else
            {
              // no value, do nothing.
              if( value == null || value.trim().equals( "" ) )
                continue;
              if( param.getName().equals( property.getName() ) )
              {
                XmlTreeNode[] nodes = model.selectTreeNodes( context.expand( param.getXpath() ) );
                if( parameterMutations.containsKey( param ) )
                  if( parameterMutations.get( param ).size() > 0 )
                  {
                    for( XmlTreeNode node : nodes )
                      node.setValue( 1, parameterMutations.get( param ).get( 0 ) );
                    params.put( param.getLabel(), parameterMutations.get( param ).get( 0 ) );
                    parameterMutations.get( param ).remove( 0 );
                  }
              }
            }
          }
          if( model != null )
            property.setValue( model.getXmlObject().toString() );

        }
      }
    }
View Full Code Here


    // for each parameter
    for( SecurityCheckedParameter parameter : getParameterHolder().getParameterList() )
    {
      if( parameter.isChecked() )
      {
        TestProperty property = getTestStep().getProperties().get( parameter.getName() );
        // check parameter does not have any xpath
        if( parameter.getXpath() == null || parameter.getXpath().trim().length() == 0 )
        {
          /*
           * parameter xpath is not set ignore than ignore this parameter
           */
        }
        else
        {
          // we have xpath but do we have xml which need to mutate
          // ignore if there is no value, since than we'll get exception
          if( !( property.getValue() == null && property.getDefaultValue() == null ) )
          {
            // get value of that property
            String value = context.expand( property.getValue() );

            // we have something that looks like xpath, or hope so.

            // XmlObjectTreeModel model = new XmlObjectTreeModel(
            // property.getSchemaType().getTypeSystem(),
            // XmlObject.Factory.parse( value ) );
            XmlObjectTreeModel model = new XmlObjectTreeModel( property.getSchemaType().getTypeSystem(),
                XmlUtils.createXmlObject( value ) );
            XmlTreeNode[] nodes = model.selectTreeNodes( context.expand( parameter.getXpath() ) );

            if( nodes.length > 0 && !( nodes[0] instanceof AttributeXmlTreeNode ) )
            {
View Full Code Here

    List<XPathReference> result = new ArrayList<XPathReference>();

    if( StringUtils.hasContent( getPath() ) )
    {
      TestModelItem testStep = getAssertable().getTestStep();
      TestProperty property = testStep instanceof WsdlTestRequestStep ? testStep.getProperty( "Response" )
          : testStep.getProperty( "Request" );
      result.add( new XPathReferenceImpl( "XQuery for " + getName() + " XQueryContainsAssertion in "
          + testStep.getName(), property, this, "path" ) );
    }
View Full Code Here

    return result;
  }

  public String getPropertyValue( String name )
  {
    TestProperty property = getProperty( name );
    return property == null ? null : property.getValue();
  }
View Full Code Here

    return property == null ? null : property.getValue();
  }

  public TestProperty removeProperty( String propertyName )
  {
    TestProperty property = getProperty( propertyName );
    if( property != null )
    {
      if( property instanceof PropertiesStepProperty && ( ( PropertiesStepProperty )property ).isVirtualProperty() )
      {
        return property;
View Full Code Here

    return new HashSet<String>( Arrays.asList( getPropertyNames() ) );
  }

  public TestProperty put( String key, TestProperty value )
  {
    TestProperty result = addProperty( key );
    result.setValue( value.getValue() );
    return result;
  }
View Full Code Here

      {
        String teststepname = name.substring( 0, ix );
        TestStep refTestStep = context.getTestCase().getTestStepByName( teststepname );
        if( refTestStep != null )
        {
          TestProperty property = refTestStep.getProperty( name.substring( ix + 1 ) );
          if( property != null && !property.isReadOnly() )
          {
            property.setValue( value.toString() );
            return;
          }
        }
      }
    }
View Full Code Here

    int cnt = 0;
    Enumeration<?> names = props.propertyNames();
    while( names.hasMoreElements() )
    {
      String name = names.nextElement().toString();
      TestProperty property = getProperty( name );
      if( property != null )
      {
        property.setValue( props.get( name ).toString() );
        cnt++ ;
      }
      else if( createMissing )
      {
        addProperty( name ).setValue( props.get( name ).toString() );
View Full Code Here

  public TestProperty addProperty( String name )
  {
    String oldLabel = getLabel();

    TestProperty property = propertyHolderSupport.addProperty( name );
    notifyPropertyChanged( WsdlTestStep.LABEL_PROPERTY, oldLabel, getLabel() );

    return property;
  }
View Full Code Here

  public TestProperty removeProperty( String propertyName )
  {
    String oldLabel = getLabel();

    TestProperty result = propertyHolderSupport.removeProperty( propertyName );
    notifyPropertyChanged( WsdlTestStep.LABEL_PROPERTY, oldLabel, getLabel() );
    return result;
  }
View Full Code Here

TOP

Related Classes of com.eviware.soapui.model.testsuite.TestProperty

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.