Package org.weakref.jmx.testing

Examples of org.weakref.jmx.testing.TestingMBeanServer


    @Override
    public void configure(Binder binder)
    {
        binder.disableCircularProxies();

        binder.bind(MBeanServer.class).toInstance(new TestingMBeanServer());
    }
View Full Code Here


        bucketedClassName = ObjectName.getInstance(PACKAGE_NAME, "name", "BucketedClass");
        nestedBucketedClassName = ObjectName.getInstance(PACKAGE_NAME, "name", "NestedBucketedClass");
        flattenBucketedClassName = ObjectName.getInstance(PACKAGE_NAME, "name", "FlattenBucketedClass");
        deepBucketedClassName = ObjectName.getInstance(PACKAGE_NAME, "name", "DeepBucketedClass");

        jmxMbeanServer = new TestingMBeanServer();
        Guice.createInjector(new TestingModule());
        baseMbeanCount = jmxMbeanServer.getMBeanCount();
        jmxMbeanServer = null;
    }
View Full Code Here

    }

    @BeforeMethod
    public void setup()
    {
        jmxMbeanServer = new TestingMBeanServer();
    }
View Full Code Here

    @Override
    public void configure(Binder binder)
    {
        binder.disableCircularProxies();

        binder.bind(MBeanServer.class).toInstance(new TestingMBeanServer());
    }
View Full Code Here

        throws Exception
    {
        final Named name1 = Names.named("bean1");
        final Named name2 = Names.named("bean2");

        final TestingMBeanServer tms = new TestingMBeanServer();

        final Module m1 = new MBeanModule() {
            @Override
            protected void configureMBeans() {
                export(Key.get(Bean.class, name1)).as("bean1:name=bean1");
            }
        };

        final Module m2 = new MBeanModule() {
            @Override
            protected void configureMBeans() {
                export(Key.get(Bean.class, name2)).as("bean2:name=bean2");
            }
        };

        Guice.createInjector(Stage.PRODUCTION,
                             m1,
                             m2,
                             new AbstractModule() {
                                 @Override
                                 public void configure() {
                                     bind(MBeanServer.class).toInstance(tms);
                                     bind(Bean.class).annotatedWith(name1).toInstance(new Bean("name1"));
                                     bind(Bean.class).annotatedWith(name2).toInstance(new Bean("name2"));
                                 }
                             });

        Assert.assertEquals(2, tms.getMBeanCount().intValue());
        Assert.assertNotNull(tms.getMBeanInfo(new ObjectName("bean1:name=bean1")));
        Assert.assertNotNull(tms.getMBeanInfo(new ObjectName("bean2:name=bean2")));
    }
View Full Code Here

    @BeforeMethod
    void setup()
            throws IOException, MalformedObjectNameException, NotBoundException
    {
        server = new TestingMBeanServer();

        objects = new ArrayList<NamedObject>(2);
        objects.add(NamedObject.of(getUniqueObjectName(), new SimpleObject()));
        objects.add(NamedObject.of(getUniqueObjectName(), new CustomAnnotationObject()));
        objects.add(NamedObject.of(getUniqueObjectName(), new FlattenObject()));
View Full Code Here

TOP

Related Classes of org.weakref.jmx.testing.TestingMBeanServer

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.