Package test.implementation.util.support

Examples of test.implementation.util.support.Trivial2MBean


   public void testContextAccess() throws Exception
   {
      MBeanServer server = MBeanServerFactory.createMBeanServer();
      ObjectName oname   = new ObjectName("test:test=test");
     
      Trivial2MBean mbean = (Trivial2MBean)MBeanProxy.create(
            Trivial2.class, Trivial2MBean.class, oname, server
      );
   
      ProxyContext ctx = (ProxyContext)mbean; 
     
View Full Code Here


      MBeanServer server2 = MBeanServerFactory.createMBeanServer();
      ObjectName oname1   = new ObjectName("test:name=target");
      ObjectName oname2   = new ObjectName("test:name=proxy");
     
      // createMBean on server1 and retrieve a proxy to it
      Trivial2MBean mbean = (Trivial2MBean)MBeanProxy.create(
            Trivial2.class, Trivial2MBean.class, oname1, server1
      );
     
      //bind the proxy to server2
      server2.registerMBean(mbean, oname2);
View Full Code Here

   public void testSimultaneousTypedAndDetypedInvocations() throws Exception
   {
      MBeanServer server = MBeanServerFactory.createMBeanServer();
      ObjectName oname   = new ObjectName("test:test=test");
     
      Trivial2MBean mbean = (Trivial2MBean)MBeanProxy.create(
            Trivial2.class, Trivial2MBean.class, oname,server
      );
     
      // typed proxy interface
      mbean.setSomething("Kissa");
      assertTrue(mbean.getSomething().equals("Kissa"));
     
      // detyped proxy interface
      DynamicMBean mbean2 = (DynamicMBean)mbean;
      mbean2.setAttribute(new Attribute("Something", "Koira"));
      assertTrue(mbean2.getAttribute("Something").equals("Koira"));
     
      // direct local server invocation
      server.setAttribute(oname, new Attribute("Something", "Kissa"));
      assertTrue(server.getAttribute(oname, "Something").equals("Kissa"));
           
      // typed proxy interface invocation
      mbean.doOperation();
      assertTrue(mbean.isOperationInvoked());
     
      mbean.reset();
     
      // detyped proxy invocation
      mbean2.invoke("doOperation", null, null);
      assertTrue(((Boolean)mbean2.getAttribute("OperationInvoked")).booleanValue());
     
View Full Code Here

   public void testContextAccessToMBeanServer() throws Exception
   {
      MBeanServer server = MBeanServerFactory.createMBeanServer();
      ObjectName oname   = new ObjectName("test:test=test");
     
      Trivial2MBean mbean = (Trivial2MBean)MBeanProxy.create(
            Trivial2.class, Trivial2MBean.class, oname, server
      );
     
      // query the server this mbean is registered to
      ProxyContext ctx = (ProxyContext)mbean;
View Full Code Here

   public void testContextAccess() throws Exception
   {
      MBeanServer server = MBeanServerFactory.createMBeanServer();
      ObjectName oname   = new ObjectName("test:test=test");
     
      Trivial2MBean mbean = (Trivial2MBean)MBeanProxy.create(
            Trivial2.class, Trivial2MBean.class, oname, server
      );
   
      ProxyContext ctx = (ProxyContext)mbean; 
     
View Full Code Here

      MBeanServer server2 = MBeanServerFactory.createMBeanServer();
      ObjectName oname1   = new ObjectName("test:name=target");
      ObjectName oname2   = new ObjectName("test:name=proxy");
     
      // createMBean on server1 and retrieve a proxy to it
      Trivial2MBean mbean = (Trivial2MBean)MBeanProxy.create(
            Trivial2.class, Trivial2MBean.class, oname1, server1
      );
     
      //bind the proxy to server2
      server2.registerMBean(mbean, oname2);
View Full Code Here

   public void testSimultaneousTypedAndDetypedInvocations() throws Exception
   {
      MBeanServer server = MBeanServerFactory.createMBeanServer();
      ObjectName oname   = new ObjectName("test:test=test");
     
      Trivial2MBean mbean = (Trivial2MBean)MBeanProxy.create(
            Trivial2.class, Trivial2MBean.class, oname,server
      );
     
      // typed proxy interface
      mbean.setSomething("Kissa");
      assertTrue(mbean.getSomething().equals("Kissa"));
     
      // detyped proxy interface
      DynamicMBean mbean2 = (DynamicMBean)mbean;
      mbean2.setAttribute(new Attribute("Something", "Koira"));
      assertTrue(mbean2.getAttribute("Something").equals("Koira"));
     
      // direct local server invocation
      server.setAttribute(oname, new Attribute("Something", "Kissa"));
      assertTrue(server.getAttribute(oname, "Something").equals("Kissa"));
           
      // typed proxy interface invocation
      mbean.doOperation();
      assertTrue(mbean.isOperationInvoked());
     
      mbean.reset();
     
      // detyped proxy invocation
      mbean2.invoke("doOperation", null, null);
      assertTrue(((Boolean)mbean2.getAttribute("OperationInvoked")).booleanValue());
     
View Full Code Here

   public void testContextAccessToMBeanServer() throws Exception
   {
      MBeanServer server = MBeanServerFactory.createMBeanServer();
      ObjectName oname   = new ObjectName("test:test=test");
     
      Trivial2MBean mbean = (Trivial2MBean)MBeanProxy.create(
            Trivial2.class, Trivial2MBean.class, oname, server
      );
     
      // query the server this mbean is registered to
      ProxyContext ctx = (ProxyContext)mbean;
View Full Code Here

TOP

Related Classes of test.implementation.util.support.Trivial2MBean

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.