Package com.google.gson

Examples of com.google.gson.JsonElement


        pivotSpec.addFilter("hostip", IPv4Comparison.STARTS_WITH, "192.168");

        Assert.assertEquals(1, pivotSpec.getFilters().size());
        for (PivotFilter pf : pivotSpec.getFilters()) {
            Assert.assertTrue(pf instanceof IPv4PivotFilter);
            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"));
View Full Code Here


        pivotSpec.addFilter("epsilon", NumberComparison.AT_LEAST, 2.3);

        Assert.assertEquals(1, pivotSpec.getFilters().size());
        for (PivotFilter pf : pivotSpec.getFilters()) {
            Assert.assertTrue(pf instanceof NumberPivotFilter);
            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"));
View Full Code Here

        pivotSpecification.addFilter("epsilon", "host", SortDirection.ASCENDING, 500, StatsFunction.AVERAGE);

        Assert.assertEquals(1, pivotSpecification.getFilters().size());
        for (PivotFilter pf : pivotSpecification.getFilters()) {
            Assert.assertTrue(pf instanceof LimitPivotFilter);
            JsonElement obj = pf.toJson();

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

            Assert.assertTrue(o.has("fieldName"));
View Full Code Here

        pivotSpecification.addRowSplit("epsilon", "My Label");

        Assert.assertEquals(1, pivotSpecification.getRowSplits().size());
        for (PivotRowSplit prs : pivotSpecification.getRowSplits()) {
            Assert.assertTrue(prs instanceof NumberPivotRowSplit);
            JsonElement obj = prs.toJson();

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

            Assert.assertTrue(o.has("fieldName"));
View Full Code Here

        pivotSpecification.addRowSplit("epsilon", "My Label", 0, 100, 20, 5);

        Assert.assertEquals(1, pivotSpecification.getRowSplits().size());
        for (PivotRowSplit prs : pivotSpecification.getRowSplits()) {
            Assert.assertTrue(prs instanceof RangePivotRowSplit);
            JsonElement obj = prs.toJson();

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

            Assert.assertTrue(o.has("fieldName"));
View Full Code Here

        pivotSpecification.addRowSplit("has_boris", "My Label", "is_true", "is_false");

        Assert.assertEquals(1, pivotSpecification.getRowSplits().size());
        for (PivotRowSplit prs : pivotSpecification.getRowSplits()) {
            Assert.assertTrue(prs instanceof BooleanPivotRowSplit);
            JsonElement obj = prs.toJson();

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

            JsonObject expected = new JsonObject();
View Full Code Here

        pivotSpecification.addRowSplit("_time", "My Label", TimestampBinning.DAY);

        Assert.assertEquals(1, pivotSpecification.getRowSplits().size());
        for (PivotRowSplit prs : pivotSpecification.getRowSplits()) {
            Assert.assertTrue(prs instanceof TimestampPivotRowSplit);
            JsonElement obj = prs.toJson();

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

            JsonObject expected = new JsonObject();
View Full Code Here

        pivotSpecification.addRowSplit("host", "My Label");

        Assert.assertEquals(1, pivotSpecification.getRowSplits().size());
        for (PivotRowSplit prs : pivotSpecification.getRowSplits()) {
            Assert.assertTrue(prs instanceof StringPivotRowSplit);
            JsonElement found = prs.toJson();

            JsonObject expected = new JsonObject();
            expected.addProperty("fieldName", "host");
            expected.addProperty("label", "My Label");
            expected.addProperty("owner", "BaseEvent");
View Full Code Here

        pivotSpecification.addColumnSplit("epsilon");

        Assert.assertEquals(1, pivotSpecification.getColumnSplits().size());
        for (PivotColumnSplit prs : pivotSpecification.getColumnSplits()) {
            Assert.assertTrue(prs instanceof NumericPivotColumnSplit);
            JsonElement obj = prs.toJson();

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

            Assert.assertTrue(o.has("fieldName"));
View Full Code Here

        pivotSpecification.addColumnSplit("epsilon", 0, 100, 20, 5);

        Assert.assertEquals(1, pivotSpecification.getColumnSplits().size());
        for (PivotColumnSplit prs : pivotSpecification.getColumnSplits()) {
            Assert.assertTrue(prs instanceof RangePivotColumnSplit);
            JsonElement obj = prs.toJson();

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

            Assert.assertTrue(o.has("fieldName"));
View Full Code Here

TOP

Related Classes of com.google.gson.JsonElement

Copyright © 2018 www.massapicom. 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.