Package com.eviware.soapui.impl.wsdl.mock

Examples of com.eviware.soapui.impl.wsdl.mock.WsdlMockResponse


          + operation.getName() + "]" );
      return false;
    }

    WsdlMockOperation mockOperation = mockService.addNewMockOperation( operation );
    WsdlMockResponse mockResponse = mockOperation.addNewMockResponse( "Response 1", false );

    if( operation.isBidirectional() )
      mockResponse.setResponseContent( operation.createResponse( true ) );

    if( UISupport.confirm( "Open MockResponse editor?", getName() ) )
    {
      SoapUI.getDesktop().showDesktopPanel( mockResponse );
    }
View Full Code Here


    Object result = UISupport.prompt( "Select Operation to Mock", "New MockOperation", operations.toArray() );
    if( result != null )
    {
      WsdlMockOperation mockOperation = mockService.addNewMockOperation( ( ( OperationWrapper )result )
          .getOperation() );
      WsdlMockResponse mockResponse = mockOperation.addNewMockResponse( "Response 1", true );
      UISupport.selectAndShow( mockResponse );
    }
  }
View Full Code Here

        else
        {
          for( int c = 0; c < target.getMockResponseCount(); c++ )
          {
            String msg = req;
            WsdlMockResponse mockResponse = target.getMockResponseAt( c );

            if( dialog.getBooleanValue( Form.KEEP_EXISTING ) )
            {
              msg = XmlUtils.transferValues( mockResponse.getResponseContent(), req );
            }

            mockResponse.setResponseContent( msg );
          }
        }
      }
    }
  }
View Full Code Here

    // add mockoperation
    if( mockOperation == null )
      mockOperation = mockService.addNewMockOperation( request.getOperation() );

    WsdlMockResponse mockResponse = mockOperation.addNewMockResponse(
        "Response " + ( 1 + mockOperation.getMockResponseCount() ), false );

    // add expected response if available
    if( request != null && request.getResponse() != null )
    {
      WsdlResponse response = request.getResponse();
      mockResponse.setResponseContent( response.getContentAsString() );

      Attachment[] attachments = response.getAttachments();
      for( Attachment attachment : attachments )
      {
        mockResponse.addAttachment( attachment );
      }

      if( mockResponse.getResponseHeaders() != null && mockResponse.getResponseHeaders().size() > 0
          && UISupport.confirm( "Add current Response HTTP Headers to MockResponse", title ) )
        mockResponse.setResponseHeaders( response.getResponseHeaders() );
    }
    else
    {
      mockResponse.setResponseContent( request.getOperation().createResponse( true ) );
    }

    if( UISupport.confirm( "Open MockResponse editor?", title ) )
    {
      SoapUI.getDesktop().showDesktopPanel( mockResponse );
View Full Code Here

      WsdlMockResult lastMockResult = getMockOperation().getLastMockResult();
      WsdlMockRequest mockRequest = lastMockResult == null ? null : lastMockResult.getMockRequest();

      try
      {
        WsdlMockResponse retVal = selectMockResponse( mockRequest, null );
        UISupport.showInfoMessage( "Script returned [" + ( retVal == null ? "null" : retVal.getName() ) + "]" );
      }
      catch( Exception e1 )
      {
        UISupport.showErrorMessage( e1 );
      }
View Full Code Here

      throw new DispatchException( "Missing dispatch XPath expression" );

    String[] values = XmlUtils.selectNodeValues( xmlObject, path );
    for( String value : values )
    {
      WsdlMockResponse mockResponse = getMockOperation().getMockResponseByName( value );
      if( mockResponse != null )
        return mockResponse;
    }

    return null;
View Full Code Here

        return;
      }

      try
      {
        WsdlMockResponse retVal = selectMockResponse( lastMockResult.getMockRequest(), null );
        UISupport.showInfoMessage( "XPath Selection returned [" + ( retVal == null ? "null" : retVal.getName() )
            + "]" );
      }
      catch( Exception e1 )
      {
        SoapUI.logError( e1 );
View Full Code Here

            if( value.equals( XmlUtils.getValueForMatch( cursor ) ) )
            {
              request.getRequestContext().put( "usedQueryMatch", query.getName() );

              WsdlMockResponse resp = null;
              for( MockResponse mockResponse : this.getMockOperation().getMockResponses() )
              {
                if( query.getResponse().equals( mockResponse.getName() ) )
                {
                  resp = ( WsdlMockResponse )mockResponse;
View Full Code Here

    synchronized( result.getMockOperation() )
    {
      if( currentDispatchIndex >= getMockOperation().getMockResponseCount() )
        currentDispatchIndex = 0;

      WsdlMockResponse mockResponse = getMockOperation().getMockResponseAt( currentDispatchIndex );

      currentDispatchIndex++ ;
      return mockResponse;
    }
  }
View Full Code Here

        return mockResult == null ? new StringToStringsMap() : mockResult.getResponseHeaders();
    }

    public WsdlOperation getOperation() {
        if (mockResponse != null && mockResponse instanceof WsdlMockResponse) {
            WsdlMockResponse wsdlMockResponse = (WsdlMockResponse) mockResponse;
            if (mockResult.getMockOperation() != null) {
                return (WsdlOperation) mockResult.getMockOperation().getOperation();
            }

            return wsdlMockResponse.getMockOperation().getOperation();
        }
        return null;
    }
View Full Code Here

TOP

Related Classes of com.eviware.soapui.impl.wsdl.mock.WsdlMockResponse

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.