Package com.google.gson

Examples of com.google.gson.JsonObject.addProperty()


     */
    @Test
    public void types() throws Exception {
        DataModelDefinition<Simple> def = new SimpleDataModelDefinition<Simple>(Simple.class);
        JsonObject json = new JsonObject();
        json.addProperty("boolean_value", true);
        json.addProperty("byte_value", (byte) 100);
        json.addProperty("short_value", (short) 200);
        json.addProperty("long_value", 300L);
        json.addProperty("big_integer_value", new BigInteger("123456"));
        json.addProperty("float_value", 1.0f);
View Full Code Here


    @Test
    public void types() throws Exception {
        DataModelDefinition<Simple> def = new SimpleDataModelDefinition<Simple>(Simple.class);
        JsonObject json = new JsonObject();
        json.addProperty("boolean_value", true);
        json.addProperty("byte_value", (byte) 100);
        json.addProperty("short_value", (short) 200);
        json.addProperty("long_value", 300L);
        json.addProperty("big_integer_value", new BigInteger("123456"));
        json.addProperty("float_value", 1.0f);
        json.addProperty("double_value", 1.5d);
View Full Code Here

        for (FlowScript flowScript : script.getAllFlows()) {
            JsonObject jobflow = analyzeJobflow(flowScript);
            jobflows.add(jobflow);
        }
        JsonObject batch = new JsonObject();
        batch.addProperty("id", script.getId());
        batch.add("jobflows", jobflows);
        return batch;
    }

    private static JsonObject analyzeJobflow(FlowScript flowScript) {
View Full Code Here

                    || phase == ExecutionPhase.CLEANUP) {
                phases.add(new JsonPrimitive(phase.getSymbol()));
            }
        }
        JsonObject jobflow = new JsonObject();
        jobflow.addProperty("id", flowScript.getId());
        jobflow.add("blockers", toJsonArray(flowScript.getBlockerIds()));
        jobflow.add("phases", phases);
        return jobflow;
    }
View Full Code Here

     * @throws Exception if failed
     */
    @Test
    public void status_waiting() throws Exception {
        JsonObject result = new JsonObject();
        result.addProperty("status", "waiting");
        result.addProperty("jrid", "testing");
        JsonHandler handler = new JsonHandler(result);
        server.register("/jobs/testing", handler);

        HttpJobClient client = new HttpJobClient(baseUrl);
View Full Code Here

     */
    @Test
    public void status_waiting() throws Exception {
        JsonObject result = new JsonObject();
        result.addProperty("status", "waiting");
        result.addProperty("jrid", "testing");
        JsonHandler handler = new JsonHandler(result);
        server.register("/jobs/testing", handler);

        HttpJobClient client = new HttpJobClient(baseUrl);

View Full Code Here

     * @throws Exception if failed
     */
    @Test
    public void status_running() throws Exception {
        JsonObject result = new JsonObject();
        result.addProperty("status", "running");
        result.addProperty("jrid", "testing");
        JsonHandler handler = new JsonHandler(result);
        server.register("/jobs/testing", handler);

        HttpJobClient client = new HttpJobClient(baseUrl);
View Full Code Here

     */
    @Test
    public void status_running() throws Exception {
        JsonObject result = new JsonObject();
        result.addProperty("status", "running");
        result.addProperty("jrid", "testing");
        JsonHandler handler = new JsonHandler(result);
        server.register("/jobs/testing", handler);

        HttpJobClient client = new HttpJobClient(baseUrl);

View Full Code Here

     * @throws Exception if failed
     */
    @Test
    public void status_completed() throws Exception {
        JsonObject result = new JsonObject();
        result.addProperty("status", "completed");
        result.addProperty("jrid", "testing");
        result.addProperty("exitCode", "1");

        JsonHandler handler = new JsonHandler(result);
        server.register("/jobs/testing", handler);
View Full Code Here

     */
    @Test
    public void status_completed() throws Exception {
        JsonObject result = new JsonObject();
        result.addProperty("status", "completed");
        result.addProperty("jrid", "testing");
        result.addProperty("exitCode", "1");

        JsonHandler handler = new JsonHandler(result);
        server.register("/jobs/testing", handler);

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.