Examples of MockHttpResponse


Examples of org.jboss.resteasy.mock.MockHttpResponse

      POJOResourceFactory noDefaults = new POJOResourceFactory(LocatingResource.class);
      dispatcher.getRegistry().addResourceFactory(noDefaults);

      {
         MockHttpRequest request = MockHttpRequest.get("/subresource/subresource/subresource/basic");
         MockHttpResponse response = new MockHttpResponse();

         dispatcher.invoke(request, response);

         Assert.assertEquals(HttpServletResponse.SC_OK, response.getStatus());
         Assert.assertEquals("basic", response.getContentAsString());
      }

   }
View Full Code Here

Examples of org.jboss.resteasy.mock.MockHttpResponse

      {

         System.out.println("Expect to see WARN about not injecting in subresources");

         MockHttpRequest request = MockHttpRequest.get("/subresource/testContextParam");
         MockHttpResponse response = new MockHttpResponse();

         dispatcher.invoke(request, response);

         Assert.assertEquals(204, response.getStatus());
      }

   }
View Full Code Here

Examples of org.locationtech.udig.catalog.wmsc.server.MockHttpResponse

        && (request.getProperties().get(GetFeatureInfoRequest.QUERY_Y).equals("200"))) {
        String success = "SUCCESS";
       
        ByteArrayInputStream input = new ByteArrayInputStream(success.getBytes());
       
        HTTPResponse response = new MockHttpResponse( input, "text/html");
        return new GetFeatureInfoResponse( response );
      }
     
      String failure = "FAILURE";
     
      ByteArrayInputStream input = new ByteArrayInputStream(failure.getBytes());
      HTTPResponse response = new MockHttpResponse( input, "text/html");
     
      return new GetFeatureInfoResponse( response );
    }
View Full Code Here

Examples of org.rendersnake.test.MockHttpResponse

import junit.framework.TestCase;

public class DebugServletCanvasTest extends TestCase {

    public void testRenderCount() throws IOException {
        DebugHtmlCanvas html = new DebugHtmlCanvas(new MockHttpRequest(), new MockHttpResponse(), new StringWriter());
        html.render(new PersonalPage());
        assertEquals(3, html.renderCount);
    }
View Full Code Here

Examples of org.rendersnake.test.MockHttpResponse

        html.render(new PersonalPage());
        assertEquals(3, html.renderCount);
    }

    public void testRenderCountDisabled() throws IOException {
        DebugHtmlCanvas html = new DebugHtmlCanvas(new MockHttpRequest(), new MockHttpResponse(), new StringWriter());
        html.enabled = false;
        html.render(new PersonalPage());
        assertEquals(0, html.renderCount);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.