Package org.jolokia.converter.util

Examples of org.jolokia.converter.util.CompositeTypeAndJson


        }
    }

    @Test(expectedExceptions = IllegalArgumentException.class,expectedExceptionsMessageRegExp = ".*JSONObject.*")
    public void compositeTypeWithWrongJson() throws OpenDataException {
        CompositeTypeAndJson taj = new CompositeTypeAndJson(
                STRING,"verein","FCN"

        );
        converter.convertToObject(taj.getType(),"[ 12, 15, 16]");
    }
View Full Code Here


        converter.convertToObject(taj.getType(),"[ 12, 15, 16]");
    }

    @Test(expectedExceptions = IllegalArgumentException.class,expectedExceptionsMessageRegExp = ".*praesident.*")
    public void compositeTypeWithWrongKey() throws OpenDataException {
        CompositeTypeAndJson taj = new CompositeTypeAndJson(
                STRING,"verein","FCN"

        );
        converter.convertToObject(taj.getType(),"{ \"praesident\": \"hoeness\"}");
    }
View Full Code Here

        converter.convertToObject(taj.getType(),"{ \"praesident\": \"hoeness\"}");
    }

    @Test(expectedExceptions = IllegalArgumentException.class,expectedExceptionsMessageRegExp = ".*parse.*")
    public void invalidJson() throws OpenDataException {
        CompositeTypeAndJson taj = new CompositeTypeAndJson(
                STRING,"verein","FCN"

        );
        converter.convertToObject(taj.getType(),"{ \"praesident\":");
    }
View Full Code Here

        extract(true, data, null, "noKnownAttribute");
    }


    private TabularData prepareMxMBeanMapData() throws OpenDataException, MalformedObjectNameException {
        CompositeTypeAndJson ctj = new CompositeTypeAndJson(
                STRING, "key", null,
                OBJECTNAME, "value", null
        );

        TabularTypeAndJson taj = new TabularTypeAndJson(new String[]{"key"}, ctj);
        TabularData data = new TabularDataSupport(taj.getType());

        CompositeData cd = new CompositeDataSupport(ctj.getType(), new String[]{"key", "value"},
                                                    new Object[]{"key1", new ObjectName("test:type=bla")});
        data.put(cd);
        cd = new CompositeDataSupport(ctj.getType(), new String[]{"key", "value"},
                                                    new Object[]{"key2", new ObjectName("java.lang:type=Memory")});
        data.put(cd);
        return data;
    }
View Full Code Here

        converter.convertToObject(taj.getType(),"{ \"praesident\":");
    }

    @Test(expectedExceptions = IllegalArgumentException.class,expectedExceptionsMessageRegExp = ".*JSONAware.*")
    public void invalidJson2() throws OpenDataException {
        CompositeTypeAndJson taj = new CompositeTypeAndJson(
                STRING,"verein","FCN"

        );
        converter.convertToObject(taj.getType(),"2");
    }
View Full Code Here

    @Test
    public void tabularTypeForMXBeanMapsComplex() throws OpenDataException {
        TabularTypeAndJson inner = getSampleTabularTypeForMXBeanMap();
        TabularTypeAndJson taj = new TabularTypeAndJson(
                new String[]{"key"},
                new CompositeTypeAndJson(
                        STRING, "key", null,
                        inner.getType(), "value", null
                )
        );
View Full Code Here

    }


    @Test
    public void extractMapWithComplexType() throws OpenDataException, AttributeNotFoundException {
        CompositeTypeAndJson cdj = new CompositeTypeAndJson(STRING, "name", "roland", INTEGER, "date", 1968);
        TabularData data = getMapTabularData(cdj.getType(),cdj.getCompositeData(),TEST_VALUE);

        JSONObject result = (JSONObject) extract(true,data);
        assertEquals(result.size(), 2);
        assertTrue(result.containsKey("indexNames"));
        assertTrue(result.containsKey("values"));
View Full Code Here


    private TabularTypeAndJson getSampleTabularTypeForMXBeanMap() throws OpenDataException {
        return new TabularTypeAndJson(
                    new String[] { "key" },
                    new CompositeTypeAndJson(
                            STRING,"key","dummy",
                            STRING,"value", "dummy"
                    )
            );
    }
View Full Code Here

    private TabularType getSampleTabularTypeForComplexTabularData() throws OpenDataException {
        CompositeType keyType = new CompositeType("key","key",
                                                  new String[] { "name", "age"},
                                                  new String[] { "name", "age"},
                                                  new OpenType[] { STRING, INTEGER});
        CompositeTypeAndJson ctj = new CompositeTypeAndJson(
                keyType,"user",null,
                STRING,"street",null,
                OBJECTNAME,"oname",null
        );
        return new TabularType("test","test",ctj.getType(),new String[] {"user", "street"} );
    }
View Full Code Here


    private TabularTypeAndJson getSampleTabularType() throws OpenDataException {
        return new TabularTypeAndJson(
                    new String[] { "verein" },
                    new CompositeTypeAndJson(
                       STRING,"verein","fcn",
                       BOOLEAN,"absteiger",false
                    ),
                    "fcb",true,
                    "werder",false
View Full Code Here

TOP

Related Classes of org.jolokia.converter.util.CompositeTypeAndJson

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.