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

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


    public OperationListModel()
    {
      for( int c = 0; c < getModelItem().getMockOperationCount(); c++ )
      {
        WsdlMockOperation mockOperation = getModelItem().getMockOperationAt( c );
        mockOperation.addPropertyChangeListener( this );

        operations.add( mockOperation );
      }

      getModelItem().addMockServiceListener( this );
View Full Code Here


            for( MessageExchange me : result.getMessageExchanges() )
            {
              if( me.isDiscarded() )
                continue;

              WsdlMockOperation mockOperation = mockService.getMockOperation( me.getOperation() );
              if( mockOperation == null )
                mockOperation = mockService.addNewMockOperation( ( WsdlOperation )me.getOperation() );

              WsdlMockResponse mockResponse = mockOperation.addNewMockResponse( "Recorded Test Response "
                  + ( ++cnt ), false );
              mockResponse.setResponseContent( me.getResponseContent() );

              Attachment[] requestAttachments = me.getResponseAttachments();
              if( requestAttachments != null )
View Full Code Here

        {
          WsdlMonitorMessageExchange me = tableModel.getMessageExchangeAt( row );
          if( me.getOperation() == null )
            continue;

          WsdlMockOperation mockOperation = mockService.getMockOperation( me.getOperation() );
          if( mockOperation == null )
            mockOperation = mockService.addNewMockOperation( me.getOperation() );

          WsdlMockResponse mockResponse = mockOperation
              .addNewMockResponse( "Monitor Response " + ( ++cnt ), false );
          mockResponse.setResponseContent( me.getResponseContent() );

          Attachment[] requestAttachments = me.getResponseAttachments();
          if( requestAttachments != null )
View Full Code Here

      {
        WsdlOperation operation = ( WsdlOperation )iface.getOperationAt( i );
        if( !operations.contains( operation.getName() ) )
          continue;

        WsdlMockOperation mockOperation = ( WsdlMockOperation )mockService.addNewMockOperation( operation );
        if( mockOperation != null )
          mockOperation.addNewMockResponse( "Response 1", true );
      }

      if( dialog.getBooleanValue( Form.ADD_ENDPOINT ) )
      {
        iface.addEndpoint( mockService.getLocalEndpoint() );
View Full Code Here

    mockService.setPort( 9081 );
    mockService.setPath( "/testmock" );

    WsdlOperation operation = ( WsdlOperation )iface.getOperationAt( 0 );
    WsdlMockOperation mockOperation = ( WsdlMockOperation )mockService.addNewMockOperation( operation );
    WsdlMockResponse mockResponse = mockOperation.addNewMockResponse( "Test Response", true );
    mockResponse.setResponseContent( "Tjohoo!" );

    mockService.start();

    String endpoint = "http://" + mockService.getHost() + ":" + mockService.getPort() + mockService.getPath();
View Full Code Here

  public void perform( WsdlMockResponse mockResponse, Object param )
  {
    if( UISupport.confirm( "Delete MockResponse [" + mockResponse.getName() + "] from MockOperation ["
        + mockResponse.getMockOperation().getName() + "]", getName() ) )
    {
      WsdlMockOperation operation = ( WsdlMockOperation )mockResponse.getMockOperation();
      operation.removeMockResponse( mockResponse );
    }
  }
View Full Code Here

    String name = UISupport.prompt( "Specify name of cloned MockResponse", getName(),
        "Copy of " + mockResponse.getName() );
    if( name == null )
      return;

    WsdlMockOperation mockOperation = mockResponse.getMockOperation();
    mockOperation.beforeSave();
    MockResponseConfig config = mockOperation.getConfig().addNewResponse();
    config.set( mockResponse.getConfig().copy() );
    config.setName( name );
    WsdlMockResponse newResponse = mockOperation.addNewMockResponse( config );

    UISupport.selectAndShow( newResponse );
  }
View Full Code Here

      UISupport.showErrorMessage( "MockService [" + mockService.getName() + "] already has a MockOperation for ["
          + 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() ) )
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

        return;
      }
    }

    WsdlMockService mockService = null;
    WsdlMockOperation mockOperation = ( WsdlMockOperation )param;
    if( mockOperation != null )
      mockService = mockOperation.getMockService();

    WsdlProject project = request.getOperation().getInterface().getProject();

    while( mockService == null )
    {
      if( project.getMockServiceCount() > 0 )
      {
        String[] mockServices = ModelSupport.getNames( project.getMockServiceList(),
            new String[] { CREATE_MOCKSUITE_OPTION } );

        // prompt
        String option = UISupport.prompt( "Select MockService for MockOperation", title, mockServices );
        if( option == null )
          return;

        mockService = project.getMockServiceByName( option );
      }

      // create new mocksuite?
      if( mockService == null )
      {
        String mockServiceName = UISupport.prompt( "Enter name of new MockService", title, "MockService "
            + ( project.getMockServiceCount() + 1 ) );
        if( mockServiceName == null || mockServiceName.trim().length() == 0 )
          return;

        mockService = project.addNewMockService( mockServiceName );
      }

      mockOperation = mockService.getMockOperation( request.getOperation() );
      if( mockOperation != null )
      {
        Boolean retval = UISupport.confirmOrCancel( "MockService [" + mockService.getName()
            + "] already has a MockOperation for [" + request.getOperation().getName()
            + "],\r\nShould MockResponse be added to this MockOperation instead", "Add Request to MockService" );

        if( retval == null )
          return;

        if( !retval.booleanValue() )
          mockService = null;
      }
    }

    // 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();
View Full Code Here

TOP

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

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.