Package org.jboss.test.jmx.xmbean

Examples of org.jboss.test.jmx.xmbean.CustomType


      server.invoke(aps, "apmRemove", new Object[] { customMBean }, new String[] { "java.lang.String" });
      try
      {
         deploy(testService);
         ObjectName target = new ObjectName(customMBean);
         CustomType ct = new CustomType(777, 888);
         // Attribute must be set and persisted
         server.setAttribute(target, new Attribute("Attr", ct));
         // redeploy
         undeploy(testService);
         // this fails if deserialization of the custom attribute fails
         deploy(testService);
         // otherwise we should be aple to read back the persisted attribute
         ct = (CustomType)server.getAttribute(target, "Attr");
         assertTrue("CustomType.x == 777", ct.getX() == 777);
         assertTrue("CustomType.y == 888", ct.getY() == 888);
         // Cleanup persisted image
         server.invoke(aps, "apmRemove", new Object[] { customMBean }, new String[] { "java.lang.String" });         
      }
      catch (Exception e)
      {
View Full Code Here


         server.setAttribute(user2Name, attr2Info);
         attr2 = (Integer) server.getAttribute(user2Name, "Attr2");
         assertTrue("Attr2 == 51", attr2.intValue() == 51);

         // Validate that Attr3 is read-write
         CustomType attr3 = (CustomType) server.getAttribute(user2Name, "Attr3");
         getLog().info("Attr3: "+attr3);
         assertTrue("Attr3 == 15", attr3.toString().equals("{10.20}"));
         Attribute attr3Info = new Attribute("Attr3", new CustomType(11, 22));
         server.setAttribute(user2Name, attr3Info);
         attr3 = (CustomType) server.getAttribute(user2Name, "Attr3");
         assertTrue("Attr3 == 51", attr3.toString().equals("{11.22}"));

         // Validate that HashCode is read-only
         Integer hash = (Integer) server.getAttribute(user2Name, "HashCode");
         getLog().info("HashCode: "+hash);
         Attribute hashInfo = new Attribute("HashCode", new Integer(12345));
View Full Code Here

         server.setAttribute(user2Name, attr2Info);
         attr2 = (Integer) server.getAttribute(user2Name, "Attr2");
         assertTrue("Attr2 == 51", attr2.intValue() == 51);

         // Validate that Attr3 is read-write
         CustomType attr3 = (CustomType) server.getAttribute(user2Name, "Attr3");
         getLog().info("Attr3: "+attr3);
         assertTrue("Attr3 == 15", attr3.toString().equals("{10.20}"));
         Attribute attr3Info = new Attribute("Attr3", new CustomType(11, 22));
         server.setAttribute(user2Name, attr3Info);
         attr3 = (CustomType) server.getAttribute(user2Name, "Attr3");
         assertTrue("Attr3 == 51", attr3.toString().equals("{11.22}"));

         // Validate that HashCode is read-only
         Integer hash = (Integer) server.getAttribute(user2Name, "HashCode");
         getLog().info("HashCode: "+hash);
         Attribute hashInfo = new Attribute("HashCode", new Integer(12345));
View Full Code Here

TOP

Related Classes of org.jboss.test.jmx.xmbean.CustomType

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.