Package com.eviware.soapui.impl.wsdl.submit.transports.http

Examples of com.eviware.soapui.impl.wsdl.submit.transports.http.HttpResponse


  public void afterSubmit( Submit submit, SubmitContext context )
  {
    if( submit.getResponse() == null )
      return;
    HttpResponse httpResponse = ( HttpResponse )submit.getResponse();
    String content = httpResponse.getContentAsXml();
    if( content == null || content.equals( "<xml/>" ) )
      return;
    XmlObject xml;
    try
    {
      URL url = httpResponse.getURL();
      String defaultNamespace = null;
      if( url != null )
      {
        defaultNamespace = url.getProtocol() + "://" + url.getHost();
      }
View Full Code Here


  private Component buildContent()
  {
    contentPanel = new JPanel( new BorderLayout() );

    contentEditor = JXEditTextArea.createJavaScriptEditor();
    HttpResponse response = httpRequest.getResponse();
    if( response != null )
      setEditorContent( response );

    contentPanel.add( new JScrollPane( contentEditor ) );
    contentEditor.setEditable( false );
View Full Code Here

    addProperty( new DefaultTestStepProperty( "RawRequest", true, this )
    {
      @Override
      public String getValue()
      {
        HttpResponse response = testRequest.getResponse();
        return response == null ? null : response.getRequestContent();
      }
    } );
  }
View Full Code Here

    RestRequestStepResult testStepResult = new RestRequestStepResult( this );

    try
    {
      submit = testRequest.submit( runContext, false );
      HttpResponse response = ( HttpResponse )submit.getResponse();

      if( submit.getStatus() != Submit.Status.CANCELED )
      {
        if( submit.getStatus() == Submit.Status.ERROR )
        {
          testStepResult.setStatus( TestStepStatus.FAILED );
          testStepResult.addMessage( submit.getError().toString() );

          testRequest.setResponse( null, runContext );
        }
        else if( response == null )
        {
          testStepResult.setStatus( TestStepStatus.FAILED );
          testStepResult.addMessage( "Request is missing response" );

          testRequest.setResponse( null, runContext );
        }
        else
        {
          runContext.setProperty( AssertedXPathsContainer.ASSERTEDXPATHSCONTAINER_PROPERTY, testStepResult );
          testRequest.setResponse( response, runContext );

          testStepResult.setTimeTaken( response.getTimeTaken() );
          testStepResult.setSize( response.getContentLength() );
          testStepResult.setResponse( response );

          switch( testRequest.getAssertionStatus() )
          {
          case FAILED :
            testStepResult.setStatus( TestStepStatus.FAILED );
            break;
          case VALID :
            testStepResult.setStatus( TestStepStatus.OK );
            break;
          case UNKNOWN :
            testStepResult.setStatus( TestStepStatus.UNKNOWN );
            break;
          }
        }
      }
      else
      {
        testStepResult.setStatus( TestStepStatus.CANCELED );
        testStepResult.addMessage( "Request was canceled" );
      }

      if( response != null )
      {
        testStepResult.setRequestContent( response.getRequestContent() );
        testStepResult.addProperty( "URL", response.getURL() == null ? "<missing>" : response.getURL().toString() );
        testStepResult.addProperty( "Method", String.valueOf( response.getMethod() ) );
        testStepResult.addProperty( "StatusCode", String.valueOf( response.getStatusCode() ) );
        testStepResult.addProperty( "HTTP Version", response.getHttpVersion() );
      }
      else
      {
        testStepResult.addMessage( "Missing Response" );
        testStepResult.setRequestContent( testRequest.getRequestContent() );
View Full Code Here

    addProperty( new DefaultTestStepProperty( "RawRequest", true, this )
    {
      @Override
      public String getValue()
      {
        HttpResponse response = testRequest.getResponse();
        return response == null ? null : response.getRequestContent();
      }
    } );

    initRestTestRequest();
View Full Code Here

    RestRequestStepResult testStepResult = new RestRequestStepResult( this );

    try
    {
      submit = testRequest.submit( runContext, false );
      HttpResponse response = ( HttpResponse )submit.getResponse();

      if( submit.getStatus() != Submit.Status.CANCELED )
      {
        if( submit.getStatus() == Submit.Status.ERROR )
        {
          testStepResult.setStatus( TestStepStatus.FAILED );
          testStepResult.addMessage( submit.getError().toString() );

          testRequest.setResponse( null, runContext );
        }
        else if( response == null )
        {
          testStepResult.setStatus( TestStepStatus.FAILED );
          testStepResult.addMessage( "Request is missing response" );

          testRequest.setResponse( null, runContext );
        }
        else
        {
          runContext.setProperty( AssertedXPathsContainer.ASSERTEDXPATHSCONTAINER_PROPERTY, testStepResult );
          testRequest.setResponse( response, runContext );

          testStepResult.setTimeTaken( response.getTimeTaken() );
          testStepResult.setSize( response.getContentLength() );
          testStepResult.setResponse( response );

          switch( testRequest.getAssertionStatus() )
          {
          case FAILED :
            testStepResult.setStatus( TestStepStatus.FAILED );
            break;
          case VALID :
            testStepResult.setStatus( TestStepStatus.OK );
            break;
          case UNKNOWN :
            testStepResult.setStatus( TestStepStatus.UNKNOWN );
            break;
          }
        }
      }
      else
      {
        testStepResult.setStatus( TestStepStatus.CANCELED );
        testStepResult.addMessage( "Request was canceled" );
      }

      if( response != null )
      {
        testStepResult.setRequestContent( response.getRequestContent() );
        testStepResult.addProperty( "URL", response.getURL() == null ? "<missing>" : response.getURL().toString() );
        testStepResult.addProperty( "Method", String.valueOf( response.getMethod() ) );
        testStepResult.addProperty( "StatusCode", String.valueOf( response.getStatusCode() ) );
        testStepResult.addProperty( "HTTP Version", response.getHttpVersion() );
      }
      else
        testStepResult.setRequestContent( testRequest.getRequestContent() );
    }
    catch( SubmitException e )
View Full Code Here

    public boolean beforeSubmit(Submit submit, SubmitContext context) {
        return true;
    }

    public void afterSubmit(Submit submit, SubmitContext context) {
        HttpResponse response = (HttpResponse) submit.getResponse();
        if (response != null && enableRecordingCheckBox.isSelected()) {
            if (HttpUtils.isErrorStatus(response.getStatusCode())) {
                extractRepresentation(response, RestRepresentation.Type.FAULT);
            } else {
                extractRepresentation(response, RestRepresentation.Type.RESPONSE);
            }
        }
View Full Code Here

    public boolean beforeSubmit(Submit submit, SubmitContext context) {
        return true;
    }

    public void afterSubmit(Submit submit, SubmitContext context) {
        HttpResponse response = (HttpResponse) submit.getResponse();
        if (response != null && enableRecordingCheckBox.isSelected()) {
            extractRepresentation(response);
        }
    }
View Full Code Here

    public MessagePart[] getResponseParts() {
        return new MessagePart[0];
    }

    public String getResponseContentAsXml() {
        HttpResponse response = getResponse();
        if (response == null) {
            return null;
        }

        return response.getContentAsXml();
    }
View Full Code Here

    public HttpResponse getResponse() {
        return response;
    }

    public void setResponse(HttpResponse response, SubmitContext context) {
        HttpResponse oldResponse = getResponse();
        this.response = response;

        notifyPropertyChanged(RESPONSE_PROPERTY, oldResponse, response);
    }
View Full Code Here

TOP

Related Classes of com.eviware.soapui.impl.wsdl.submit.transports.http.HttpResponse

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.