@Override
	void toHtml() throws IOException {
		writeLinks();
		writeln(BR);

		writeTitle("mbeans.png", getString("MBeans"));

		writeTree();
	}
@Test
	public void testToHtml() throws IOException, JMException {
		final MBeanServer mBeanServer = ManagementFactory.getPlatformMBeanServer();
		final List<ObjectName> mBeans = new ArrayList<>();
		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());

			// test name avec "|"
			final ObjectInstance mBean5 = mBeanServer.registerMBean(new GlobalRequestProcessor(),
					new ObjectName("testseparator" + MBeans.ATTRIBUTES_SEPARATOR
							+ "testseparator:type=X"));
			mBeans.add(mBean5.getObjectName());

			/* cette utilisation de java.lang.reflect ne fonctionne plus avec Java 17 sans add-opens javax.management
			 // on force à null une des descriptions de bean et une des descriptions d'attribut
			final MBeanInfo mbeanInfo = mBeanServer.getMBeanInfo(mBeans.get(0));
			setFieldValue(mbeanInfo, "description", null);
			final MBeanAttributeInfo mbeanAttributeInfo0 = mbeanInfo.getAttributes()[0];
			// même description que le nom de l'attribut
			setFieldValue(mbeanAttributeInfo0, "description", "maxThreads");
			final MBeanAttributeInfo mbeanAttributeInfo1 = mbeanInfo.getAttributes()[1];
			setFieldValue(mbeanAttributeInfo1, "description", null);
			 */

			// register another mbeanServer
			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);
		} finally {
			for (final ObjectName registeredMBean : mBeans) {
				mBeanServer.unregisterMBean(registeredMBean);
			}
		}
	}