Exemplo n.º 1
0
 @Test
 public void testRequest() throws Exception {
   FacesRequest request = environment.createFacesRequest("http://localhost/test.jsf?foo=bar");
   assertNotNull(request.execute());
   String contentAsString = request.getConnection().getContentAsString();
   assertFalse(contentAsString.contains(Bean.TEST_SCRIPT));
   FacesRequest request2 = submit(request).submit();
   request2.execute();
   String content2 = request2.getConnection().getContentAsString();
   assertFalse(content2.contains(Bean.TEST_SCRIPT));
 }
Exemplo n.º 2
0
 private FacesRequest submit(FacesRequest request) throws MalformedURLException {
   FacesRequest request2 =
       request
           .submit()
           .withParameter("helloForm:input", "BAZ")
           .withParameter("helloForm:command", "Ok");
   request2.execute();
   String content2 = request2.getConnection().getContentAsString();
   assertTrue(content2.contains(Bean.TEST_SCRIPT));
   return request2;
 }