Examples of JsonPrimitive


Examples of com.google.gson.JsonPrimitive

            Assert.assertTrue(obj instanceof JsonObject);
            JsonObject o = (JsonObject)obj;

            JsonObject expected = new JsonObject();
            expected.add("fieldName", new JsonPrimitive("_time"));
            expected.add("label", new JsonPrimitive("My Label"));
            expected.add("owner", new JsonPrimitive("BaseEvent"));
            expected.addProperty("type", "timestamp");
            expected.addProperty("period", "day");

            Assert.assertEquals(expected, o);
        }
View Full Code Here

Examples of com.google.gson.JsonPrimitive

            Assert.assertTrue(obj instanceof JsonObject);
            JsonObject o = (JsonObject)obj;

            Assert.assertTrue(o.has("fieldName"));
            Assert.assertEquals(new JsonPrimitive("epsilon"), o.get("fieldName"));

            Assert.assertTrue(o.has("owner"));
            Assert.assertEquals(new JsonPrimitive("test_data"), o.get("owner"));

            Assert.assertTrue(o.has("type"));
            Assert.assertEquals(new JsonPrimitive("number"), o.get("type"));

            Assert.assertTrue(o.has("display"));
            Assert.assertEquals(new JsonPrimitive("all"), o.get("display"));
        }
    }
View Full Code Here

Examples of com.google.gson.JsonPrimitive

            Assert.assertTrue(obj instanceof JsonObject);
            JsonObject o = (JsonObject)obj;

            Assert.assertTrue(o.has("fieldName"));
            Assert.assertEquals(new JsonPrimitive("epsilon"), o.get("fieldName"));

            Assert.assertTrue(o.has("owner"));
            Assert.assertEquals(new JsonPrimitive("test_data"), o.get("owner"));

            Assert.assertTrue(o.has("type"));
            Assert.assertEquals(new JsonPrimitive("number"), o.get("type"));

            Assert.assertTrue(o.has("display"));
            Assert.assertEquals(new JsonPrimitive("ranges"), o.get("display"));

            JsonObject ranges = new JsonObject();
            ranges.add("start", new JsonPrimitive("0"));
            ranges.add("end", new JsonPrimitive("100"));
            ranges.add("size", new JsonPrimitive("20"));
            ranges.add("maxNumberOf", new JsonPrimitive("5"));
            Assert.assertTrue(o.has("ranges"));
            Assert.assertEquals(ranges, o.get("ranges"));
        }
    }
View Full Code Here

Examples of com.google.gson.JsonPrimitive

            Assert.assertTrue(obj instanceof JsonObject);
            JsonObject o = (JsonObject)obj;

            JsonObject expected = new JsonObject();
            expected.add("fieldName", new JsonPrimitive("has_boris"));
            expected.add("owner", new JsonPrimitive("test_data"));
            expected.addProperty("type", "boolean");
            expected.addProperty("trueLabel", "is_true");
            expected.addProperty("falseLabel", "is_false");

            Assert.assertEquals(expected, o);
View Full Code Here

Examples of com.google.gson.JsonPrimitive

        for (PivotColumnSplit prs : pivotSpecification.getColumnSplits()) {
            Assert.assertTrue(prs instanceof TimestampPivotColumnSplit);
            JsonObject found = prs.toJson();

            JsonObject expected = new JsonObject();
            expected.add("fieldName", new JsonPrimitive("_time"));
            expected.add("owner", new JsonPrimitive("BaseEvent"));
            expected.addProperty("type", "timestamp");
            expected.addProperty("period", "day");

            Assert.assertEquals(expected, found);
        }
View Full Code Here

Examples of com.google.gson.JsonPrimitive

        PivotSpecification pivotArgs = dataModelObject.createPivotSpecification();

        JsonObject root = pivotArgs.toJson();

        Assert.assertTrue(root.has("dataModel"));
        Assert.assertEquals(new JsonPrimitive(dataModelObject.getDataModel().getName()), root.get("dataModel"));

        Assert.assertTrue(root.has("baseClass"));
        Assert.assertEquals(new JsonPrimitive(dataModelObject.getName()), root.get("baseClass"));
    }
View Full Code Here

Examples of com.google.gson.JsonPrimitive

            JsonElement obj = pf.toJson();
            Assert.assertTrue(obj instanceof JsonObject);
            JsonObject o = (JsonObject)obj;

            Assert.assertTrue(o.has("fieldName"));
            Assert.assertEquals(new JsonPrimitive("has_boris"), o.get("fieldName"));

            Assert.assertTrue(o.has("type"));
            Assert.assertEquals(new JsonPrimitive("boolean"), o.get("type"));

            Assert.assertTrue(o.has("comparator"));
            Assert.assertEquals(new JsonPrimitive("="), o.get("comparator"));

            Assert.assertTrue(o.has("compareTo"));
            Assert.assertEquals(new JsonPrimitive(true), o.get("compareTo"));
        }
    }
View Full Code Here

Examples of com.google.gson.JsonPrimitive

            JsonElement obj = pf.toJson();
            Assert.assertTrue(obj instanceof JsonObject);
            JsonObject o = (JsonObject)obj;

            Assert.assertTrue(o.has("fieldName"));
            Assert.assertEquals(new JsonPrimitive("host"), o.get("fieldName"));

            Assert.assertTrue(o.has("type"));
            Assert.assertEquals(new JsonPrimitive("string"), o.get("type"));

            Assert.assertTrue(o.has("comparator"));
            Assert.assertEquals(new JsonPrimitive("contains"), o.get("comparator"));

            Assert.assertTrue(o.has("compareTo"));
            Assert.assertEquals(new JsonPrimitive("abc"), o.get("compareTo"));
        }
    }
View Full Code Here

Examples of com.google.gson.JsonPrimitive

            JsonElement obj = pf.toJson();
            Assert.assertTrue(obj instanceof JsonObject);
            JsonObject o = (JsonObject)obj;

            Assert.assertTrue(o.has("fieldName"));
            Assert.assertEquals(new JsonPrimitive("hostip"), o.get("fieldName"));

            Assert.assertTrue(o.has("type"));
            Assert.assertEquals(new JsonPrimitive("ipv4"), o.get("type"));

            Assert.assertTrue(o.has("comparator"));
            Assert.assertEquals(new JsonPrimitive("startsWith"), o.get("comparator"));

            Assert.assertTrue(o.has("compareTo"));
            Assert.assertEquals(new JsonPrimitive("192.168"), o.get("compareTo"));
        }
    }
View Full Code Here

Examples of com.google.gson.JsonPrimitive

            JsonElement obj = pf.toJson();
            Assert.assertTrue(obj instanceof JsonObject);
            JsonObject o = (JsonObject)obj;

            Assert.assertTrue(o.has("fieldName"));
            Assert.assertEquals(new JsonPrimitive("epsilon"), o.get("fieldName"));

            Assert.assertTrue(o.has("type"));
            Assert.assertEquals(new JsonPrimitive("number"), o.get("type"));

            Assert.assertTrue(o.has("comparator"));
            Assert.assertEquals(new JsonPrimitive(">="), o.get("comparator"));

            Assert.assertTrue(o.has("compareTo"));
            Assert.assertEquals(new JsonPrimitive((double)2.3), o.get("compareTo"));
        }
    }
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.