Examples of readResponse()


Examples of org.eclipse.jetty.toolchain.test.http.SimpleHttpParser.readResponse()

            OutputStream output = client.getOutputStream();
            output.write(request.getBytes("UTF-8"));
            output.flush();

            SimpleHttpParser parser = new SimpleHttpParser();
            SimpleHttpResponse response = parser.readResponse(new BufferedReader(new InputStreamReader(client.getInputStream(), "UTF-8")));

            Assert.assertTrue(latch.await(5, TimeUnit.SECONDS));
            Assert.assertEquals("500", response.getCode());
        }
    }
View Full Code Here

Examples of org.eclipse.jetty.toolchain.test.http.SimpleHttpParser.readResponse()

            output.write(request.getBytes("UTF-8"));
            output.flush();

            BufferedReader input = new BufferedReader(new InputStreamReader(client.getInputStream(), "UTF-8"));
            SimpleHttpParser parser = new SimpleHttpParser();
            SimpleHttpResponse response = parser.readResponse(input);
            Assert.assertEquals("200", response.getCode());
            Assert.assertArrayEquals(content, response.getBody().getBytes("UTF-8"));
        }
    }
View Full Code Here

Examples of org.eclipse.jetty.toolchain.test.http.SimpleHttpParser.readResponse()

                output.write(request.getBytes(StandardCharsets.UTF_8));
                output.flush();

                BufferedReader input = new BufferedReader(new InputStreamReader(socket.getInputStream(), StandardCharsets.UTF_8));
                SimpleHttpParser parser = new SimpleHttpParser();
                SimpleHttpResponse response = parser.readResponse(input);

                String location = response.getHeaders().get("location");
                Assert.assertNotNull(location);
                String schemePrefix = "http://";
                Assert.assertTrue(location.startsWith(schemePrefix));
View Full Code Here

Examples of org.eclipse.jetty.toolchain.test.http.SimpleHttpParser.readResponse()

            // Do not send the promised content, wait to idle timeout.

            socket.setSoTimeout(2 * idleTimeout);
            SimpleHttpParser parser = new SimpleHttpParser();
            BufferedReader reader = new BufferedReader(new InputStreamReader(socket.getInputStream(), "UTF-8"));
            SimpleHttpResponse response = parser.readResponse(reader);
            Assert.assertTrue(Integer.parseInt(response.getCode()) >= 500);
            String connectionHeader = response.getHeaders().get("connection");
            Assert.assertNotNull(connectionHeader);
            Assert.assertTrue(connectionHeader.contains("close"));
            Assert.assertEquals(-1, reader.read());
View Full Code Here

Examples of org.eclipse.jetty.toolchain.test.http.SimpleHttpParser.readResponse()

            // Do not send all the promised content, wait to idle timeout.

            socket.setSoTimeout(2 * idleTimeout);
            SimpleHttpParser parser = new SimpleHttpParser();
            BufferedReader reader = new BufferedReader(new InputStreamReader(socket.getInputStream(), "UTF-8"));
            SimpleHttpResponse response = parser.readResponse(reader);
            Assert.assertTrue(Integer.parseInt(response.getCode()) >= 500);
            String connectionHeader = response.getHeaders().get("connection");
            Assert.assertNotNull(connectionHeader);
            Assert.assertTrue(connectionHeader.contains("close"));
            Assert.assertEquals(-1, reader.read());
View Full Code Here

Examples of org.jboss.security.xacml.interfaces.ResponseContext.readResponse()

         byte[] resp = baos.toByteArray();
         System.out.println("RESPONSE:"+new String(resp));
         ByteArrayInputStream bis = new ByteArrayInputStream(resp);
        
         ResponseContext newRC = RequestResponseContextFactory.createResponseContext();
         newRC.readResponse(bis);
         element = (Element) newRC.getDocumentElement();
      }
      return element;
   }
View Full Code Here

Examples of unibg.overencrypt.client.OverEncryptClient.readResponse()

        OverEncryptClient client = new OverEncryptClient();
        AuthenticationClient pinManagementClient = new AuthenticationClient();
        PermissionsClient permissionsClient = new PermissionsClient();

        Response resp = client.readResponse(path);
        logger.debug("Response:\n===\n" + resp.toString() + "===");

        if (resp.getPrimitive() == ServerPrimitives.OE_DHKEYPAIRS) {
            exitWithError(1, "The user hasn't chosen a passphrase yet. "
                    + "Use the '" + new GenerateKeysCommand().getKeyword()
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.