@Test public void testToHtml() throws IOException, JMException { final MBeanServer mBeanServer = ManagementFactory.getPlatformMBeanServer(); final List<ObjectName> mBeans = new ArrayList<ObjectName>(); try { final ObjectInstance mBean1 = mBeanServer.registerMBean(new ThreadPool(), new ObjectName("Catalina:type=ThreadPool")); mBeans.add(mBean1.getObjectName()); final ObjectInstance mBean2 = mBeanServer.registerMBean(new GlobalRequestProcessor(), new ObjectName("Catalina:type=GlobalRequestProcessor,name=http-8080")); mBeans.add(mBean2.getObjectName()); final ObjectInstance mBean3 = mBeanServer.registerMBean(new GlobalRequestProcessor(), new ObjectName("Catalina:type=GlobalRequestProcessor,name=http-8090")); mBeans.add(mBean3.getObjectName()); final ObjectInstance mBean4 = mBeanServer.registerMBean(new EmptyAttribute(), new ObjectName("java.lang:type=Object")); mBeans.add(mBean4.getObjectName()); final ObjectInstance mBean5 = mBeanServer.registerMBean(new GlobalRequestProcessor(), new ObjectName("testseparator" + MBeans.ATTRIBUTES_SEPARATOR + "testseparator:type=X")); mBeans.add(mBean5.getObjectName()); final MBeanInfo mbeanInfo = mBeanServer.getMBeanInfo(mBeans.get(0)); setFieldValue(mbeanInfo, "description", null); final MBeanAttributeInfo mbeanAttributeInfo0 = mbeanInfo.getAttributes()[0]; setFieldValue(mbeanAttributeInfo0, "description", "maxThreads"); final MBeanAttributeInfo mbeanAttributeInfo1 = mbeanInfo.getAttributes()[1]; setFieldValue(mbeanAttributeInfo1, "description", null); MBeanServerFactory.createMBeanServer("jboss"); final StringWriter writer = new StringWriter(); final List<MBeanNode> mbeans = MBeans.getAllMBeanNodes(); final HtmlMBeansReport report = new HtmlMBeansReport(mbeans, writer); report.toHtml(); assertNotEmptyAndClear(writer); } catch (final IllegalAccessException e) { throw new IllegalStateException(e); } finally { for (final ObjectName registeredMBean : mBeans) { mBeanServer.unregisterMBean(registeredMBean); } } }
@Override void toHtml() throws IOException { writeLinks(); writeln(BR); writeTitle("mbeans.png", getString("MBeans")); writeTree(); }
HtmlMBeansReport extends HtmlAbstractReport { @Override void toHtml() throws IOException { writeLinks(); writeln(BR); writeTitle("mbeans.png", getString("MBeans")); writeTree(); } }
HtmlMBeansReport extends HtmlAbstractReport { @Override void toHtml() throws IOException { writeLinks(); writeln(BR); writeTitle("mbeans.png", getString("MBeans")); writeTree(); } HtmlMBeansReport(List<MBeanNode> mbeans, Writer writer); }
HtmlMBeansReport extends HtmlAbstractReport { @Override void toHtml() throws IOException { writeLinks(); writeln(BR); writeTitle("mbeans.png", getString("MBeans")); writeTree(); } HtmlMBeansReport(List<MBeanNode> mbeans, Writer writer);  }
HtmlMBeansReport extends HtmlAbstractReport { @Override void toHtml() throws IOException { writeLinks(); writeln(BR); writeTitle("mbeans.png", getString("MBeans")); writeTree(); } HtmlMBeansReport(List<MBeanNode> mbeans, Writer writer);   }