Package com.eviware.soapui.model.iface

Examples of com.eviware.soapui.model.iface.SubmitContext


  }

  protected Submit doSubmit() throws SubmitException
  {

    SubmitContext submitContext = new WsdlTestRunContext( getModelItem() );
    if( !amfRequestTestStep.initAmfRequest( submitContext ) )
    {
      throw new SubmitException( "AMF request is not initialised properly !" );
    }
View Full Code Here


    {
      SoapUI.getThreadPool().execute( new Runnable()
      {
        public void run()
        {
          SubmitContext context = new WsdlTestRunContext( getModelItem() );
          statusBar.setIndeterminate( true );
          amfRequestTestStep.initAmfRequest( context );

          if( context.getProperty( AMFRequest.AMF_SCRIPT_ERROR ) != null )
          {
            UISupport.showInfoMessage( ( ( Throwable )context.getProperty( AMFRequest.AMF_SCRIPT_ERROR ) )
                .getMessage() );
          }
          else
          {
            UISupport.showInfoMessage( scriptInfo( context ) );

          }
          statusBar.setIndeterminate( false );
          amfRequestTestStep.getAMFRequest().clearArguments();
        }

        @SuppressWarnings( "unchecked" )
        private String scriptInfo( SubmitContext context )
        {
          HashMap<String, Object> parameters = ( HashMap<String, Object> )context
              .getProperty( AMFRequest.AMF_SCRIPT_PARAMETERS );
          HashMap<String, Object> amfHeaders = ( HashMap<String, Object> )context
              .getProperty( AMFRequest.AMF_SCRIPT_HEADERS );
          StringBuilder sb = new StringBuilder();
          sb.append( "parameters " + ( parameters != null ? parameters.toString() : "" ) );
          sb.append( "\n" );
          sb.append( "amfHeaders " + ( amfHeaders != null ? amfHeaders.toString() : "" ) );
View Full Code Here

        }

        public void actionPerformed(ActionEvent e) {
            SoapUI.getThreadPool().execute(new Runnable() {
                public void run() {
                    SubmitContext context = new WsdlTestRunContext(getModelItem());
                    statusBar.setIndeterminate(true);
                    amfRequestTestStep.initAmfRequest(context);

                    if (context.getProperty(AMFRequest.AMF_SCRIPT_ERROR) != null) {
                        UISupport.showInfoMessage(((Throwable) context.getProperty(AMFRequest.AMF_SCRIPT_ERROR))
                                .getMessage());
                    } else {
                        UISupport.showInfoMessage(scriptInfo(context));

                    }
                    statusBar.setIndeterminate(false);
                    amfRequestTestStep.getAMFRequest().clearArguments();
                }

                @SuppressWarnings("unchecked")
                private String scriptInfo(SubmitContext context) {
                    HashMap<String, Object> parameters = (HashMap<String, Object>) context
                            .getProperty(AMFRequest.AMF_SCRIPT_PARAMETERS);
                    HashMap<String, Object> amfHeaders = (HashMap<String, Object>) context
                            .getProperty(AMFRequest.AMF_SCRIPT_HEADERS);
                    StringBuilder sb = new StringBuilder();
                    sb.append("parameters " + (parameters != null ? parameters.toString() : ""));
                    sb.append("\n");
                    sb.append("amfHeaders " + (amfHeaders != null ? amfHeaders.toString() : ""));
View Full Code Here

        }
    }

    protected Submit doSubmit() throws SubmitException {

        SubmitContext submitContext = new WsdlTestRunContext(getModelItem());
        if (!amfRequestTestStep.initAmfRequest(submitContext)) {
            throw new SubmitException("AMF request is not initialised properly !");
        }

        Analytics.trackAction(SoapUIActions.RUN_TEST_STEP.getActionName(), "StepType", "AMF");
View Full Code Here

        userParameter.setValue("billy");

        String originalPath = "/original/{user}";
        restRequest.setPath(originalPath);

        SubmitContext submitContext = submitRequest(restRequest, originalPath);
        HttpResponse response = makeResponseFor(restRequest, "/original/billy");
        restRequest.setResponse(response, submitContext);

        assertThat(mediaTypeHandler.createXmlRepresentation(response), containsString("/original/billy"));
    }
View Full Code Here

    }

    private HttpResponse submitRequestAndReceiveResponse(RestRequest restRequest, String originalPath) throws Exception {
        restRequest.setPath(originalPath);

        SubmitContext submitContext = submitRequest(restRequest, originalPath);
        HttpResponse response = makeResponseFor(restRequest, originalPath);
        // this simulates that we receive a response
        restRequest.setResponse(response, submitContext);
        return response;
    }
View Full Code Here

        restRequest.setResponse(response, submitContext);
        return response;
    }

    private SubmitContext submitRequest(RestRequest restRequest, String originalPath) throws URISyntaxException, URIException, Request.SubmitException {
        SubmitContext submitContext = new WsdlSubmitContext(restRequest);
        HttpRequestBase httpMethod = mock(HttpRequestBase.class);
        submitContext.setProperty(BaseHttpRequestTransport.HTTP_METHOD, httpMethod);
        submitContext.setProperty(BaseHttpRequestTransport.REQUEST_URI, new URI(ENDPOINT + originalPath));
        restRequest.submit(submitContext, false);
        return submitContext;
    }
View Full Code Here

    @Test
    public void processesRequestCorrectly() throws Exception {
        StringToStringsMap emptyHeaders = new StringToStringsMap();
        AbstractHttpRequest request = prepareRequestWithHeaders(emptyHeaders);
        SubmitContext submitContext = new StubbedSubmitContext(request);

        httpTransport.sendRequest(submitContext, request);
        assertThat(methodExecuted, is(notNullValue()));
        assertThat(contextUsed, is(notNullValue()));
    }
View Full Code Here

    public void expandsPropertiesInHeaderName() throws Exception {
        StringToStringsMap headers = new StringToStringsMap();
        String headerValue = "The value";
        headers.add("Header-for-${request}", headerValue);
        AbstractHttpRequest request = prepareRequestWithHeaders(headers);
        SubmitContext submitContext = new StubbedSubmitContext(request);
        String requestName = "Fin-fin request";
        submitContext.setProperty("request", requestName);

        httpTransport.sendRequest(submitContext, request);
        String expectedHeaderName = "Header-for-" + requestName;
        Header[] modifiedHeaders = methodExecuted.getHeaders(expectedHeaderName);
        assertThat(modifiedHeaders.length, is(1));
View Full Code Here


    private SubmitContext createSubmitContext() throws SoapUIException {
        WsdlTestRequestStep requestStep = ModelItemFactory.makeTestRequestStep();
        requestStep.getTestCase().setPropertyValue("StoreType", "shoe_Store");
        SubmitContext context = new WsdlSubmitContext(requestStep);

        context.setProperty(BaseHttpRequestTransport.REQUEST_CONTENT, REQUEST_CONTENT);
        return context;
    }
View Full Code Here

TOP

Related Classes of com.eviware.soapui.model.iface.SubmitContext

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.