Search in sources :

Example 11 with FabricMBean

use of io.fabric8.jolokia.facade.mbeans.FabricMBean in project fabric8 by jboss-fuse.

the class FabricMBeanFacadeTest method getFabricMBean.

private FabricMBean getFabricMBean() {
    JolokiaFabricConnector connector = JolokiaFabricConnector.getFabricConnector(userName, password, url);
    FabricMBean mBeanFacade = new FabricMBean(connector);
    return mBeanFacade;
}
Also used : FabricMBean(io.fabric8.jolokia.facade.mbeans.FabricMBean)

Example 12 with FabricMBean

use of io.fabric8.jolokia.facade.mbeans.FabricMBean in project fabric8 by jboss-fuse.

the class FabricMBeanFacadeTest method testVersions.

@Test
public void testVersions() {
    // this can only be run if you have a fabric running...
    Assume.assumeTrue(Boolean.valueOf(System.getProperty("hasFabric")));
    FabricMBean facade = getFabricMBean();
    String json = facade.versions();
    try {
        Collection<VersionDTO> versions = Helpers.getObjectMapper().readValue(json, TypeFactory.defaultInstance().constructParametricType(Collection.class, VersionDTO.class));
        Assume.assumeNotNull(versions);
        for (Object version : versions) {
            System.out.println(version);
        }
    } catch (Exception e) {
        e.printStackTrace();
    }
}
Also used : FabricMBean(io.fabric8.jolokia.facade.mbeans.FabricMBean) Collection(java.util.Collection) Test(org.junit.Test)

Aggregations

FabricMBean (io.fabric8.jolokia.facade.mbeans.FabricMBean)12 Test (org.junit.Test)10 Collection (java.util.Collection)7 FabricServiceFacade (io.fabric8.jolokia.facade.facades.FabricServiceFacade)1