throw new RuntimeException(t);
}
}
public void loadPluginDescriptors() throws Exception {
PluginDescriptor descriptor_jmx = loadPluginDescriptor(DESCRIPTOR_JMX);
assertJmxTypes();
PluginDescriptor descriptor_tomcat = loadPluginDescriptor(DESCRIPTOR_TOMCAT);
assert this.metadataManager.getEmbeddedExtensions(descriptor_tomcat.getName()).isEmpty(); // jbossas not yet registered
assertTomcatTypes();
PluginDescriptor descriptor_jbossas = loadPluginDescriptor(DESCRIPTOR_JBOSSAS);
assertJBossASTypes();
PluginDescriptor descriptor_hibernate = loadPluginDescriptor(DESCRIPTOR_HIBERNATE);
assertHibernateTypes();
PluginDescriptor descriptor_customjmx = loadPluginDescriptor(DESCRIPTOR_CUSTOMJMX);
assertCustomJmxTypes();
outputAllTypes();
PluginDependencyGraph graph = new PluginDependencyGraph();
AgentPluginDescriptorUtil.addPluginToDependencyGraph(graph, descriptor_jmx);
AgentPluginDescriptorUtil.addPluginToDependencyGraph(graph, descriptor_tomcat);
AgentPluginDescriptorUtil.addPluginToDependencyGraph(graph, descriptor_jbossas);
AgentPluginDescriptorUtil.addPluginToDependencyGraph(graph, descriptor_hibernate);
AgentPluginDescriptorUtil.addPluginToDependencyGraph(graph, descriptor_customjmx);
assert graph.isComplete(null);
// these are not extended via embedded extension model
assert this.metadataManager.getEmbeddedExtensions(descriptor_jmx.getName()).isEmpty();
assert this.metadataManager.getEmbeddedExtensions(descriptor_jbossas.getName()).isEmpty();
assert this.metadataManager.getEmbeddedExtensions(descriptor_hibernate.getName()).isEmpty();
assert this.metadataManager.getEmbeddedExtensions(descriptor_customjmx.getName()).isEmpty();
// tomcat plugin is extended by the jbossas plugin via the embedded extension model
assert this.metadataManager.getEmbeddedExtensions(descriptor_tomcat.getName()).size() == 1;
assert this.metadataManager.getEmbeddedExtensions(descriptor_tomcat.getName()).containsKey(
descriptor_jbossas.getName());
// deploy another plugin that extends the tomcat plugin so we can see multiple extensions returned
PluginDescriptor descriptor_customext = loadPluginDescriptor(DESCRIPTOR_CUSTOM_EXT);
assert this.metadataManager.getEmbeddedExtensions(descriptor_tomcat.getName()).size() == 2;
assert this.metadataManager.getEmbeddedExtensions(descriptor_tomcat.getName()).containsKey(
descriptor_jbossas.getName());
assert this.metadataManager.getEmbeddedExtensions(descriptor_tomcat.getName()).containsKey(
descriptor_customext.getName());
}