Package org.switchyard.component.test.mixins.http

Examples of org.switchyard.component.test.mixins.http.HTTPMixIn.sendString()


            }
            HTTPMixIn http = new HTTPMixIn();
            http.initialize();
            String endpointURL = "http://localhost:" + port + "/http-binding/quote";
            System.out.println(" Request: " + endpointURL + " -> " + args[0]);
            String response = http.sendString(endpointURL, args[0], HTTPMixIn.HTTP_POST);
            System.out.println("Response: " + response);
        }
    }
}
View Full Code Here


        } else {
            command = args[0];
            HTTPMixIn http = new HTTPMixIn();
            http.initialize();
            if (command.equals("new")) {
                String response = http.sendString(baseUrl + "/inventory", "", HTTPMixIn.HTTP_GET);
                if (response.equals("false")) {
                    http.sendString(baseUrl + "/inventory/create", "", HTTPMixIn.HTTP_OPTIONS);
                }
                System.out.println(http.sendString(baseUrl + "/order", "", HTTPMixIn.HTTP_POST));
            } else if (command.equals("get")) {
View Full Code Here

            HTTPMixIn http = new HTTPMixIn();
            http.initialize();
            if (command.equals("new")) {
                String response = http.sendString(baseUrl + "/inventory", "", HTTPMixIn.HTTP_GET);
                if (response.equals("false")) {
                    http.sendString(baseUrl + "/inventory/create", "", HTTPMixIn.HTTP_OPTIONS);
                }
                System.out.println(http.sendString(baseUrl + "/order", "", HTTPMixIn.HTTP_POST));
            } else if (command.equals("get")) {
                if (args.length != 2) {
                    System.out.println("No orderId found!");
View Full Code Here

            if (command.equals("new")) {
                String response = http.sendString(baseUrl + "/inventory", "", HTTPMixIn.HTTP_GET);
                if (response.equals("false")) {
                    http.sendString(baseUrl + "/inventory/create", "", HTTPMixIn.HTTP_OPTIONS);
                }
                System.out.println(http.sendString(baseUrl + "/order", "", HTTPMixIn.HTTP_POST));
            } else if (command.equals("get")) {
                if (args.length != 2) {
                    System.out.println("No orderId found!");
                    System.out.println("Usage: get <orderId>");
                }
View Full Code Here

            } else if (command.equals("get")) {
                if (args.length != 2) {
                    System.out.println("No orderId found!");
                    System.out.println("Usage: get <orderId>");
                }
                System.out.println(http.sendString(baseUrl + "/order/" + args[1], "", HTTPMixIn.HTTP_GET));
            } else if (command.equals("add")) {
                if (args.length < 2) {
                    System.out.println("No orderId found!");
                    System.out.println("Usage: get <orderId> <itemId> <quantity>");
                }
View Full Code Here

                    + "            <itemId>" + args[2] + "</itemId>"
                    + "         </item>"
                    + "         <quantity>" + args[3] + "</quantity>"
                    + "     </orderItem>"
                    + "</order>";
                System.out.println(http.sendString(baseUrl + "/order/item", order, HTTPMixIn.HTTP_PUT));
            } else if (command.equals("del")) {
                if (args.length < 2) {
                    System.out.println("No orderId found!");
                    System.out.println("Usage: get <orderId> <itemId>");
                }
View Full Code Here

                }
                if (args.length < 3) {
                    System.out.println("No itemId found!");
                    System.out.println("Usage: get <orderId> <itemId>");
                }
                System.out.println(http.sendString(baseUrl + "/order/" + args[1] + ":" + args[2], "", HTTPMixIn.HTTP_DELETE));
            }
        }
    }
}
View Full Code Here

        http.initialize();

        String request = JAXBUtil.marshal(new GreetingRequest(reader.readLine()));
        System.out.println("Sending request\n" + request);
        String port = System.getProperty("org.switchyard.component.http.client.port", "8080");
        String reply = http.sendString("http://localhost:" + port + "/camel-binding", request, HTTPMixIn.HTTP_POST);
        System.out.println("Received response\n" + reply);
    }

}
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.