// the urls used here are relative to the location of the build.xml
final URL MLET_URL = new URL(location, "etc/tests/ArchiveList.mlet");
MBeanServer server = MBeanServerFactory.createMBeanServer();
MLet mlet = new MLet();
ObjectName name = new ObjectName("test:name=mlet");
try
{
server.registerMBean(mlet, name);
server.invoke(name, "getMBeansFromURL",
new Object[] { MLET_URL.toString() },
new String[] { String.class.getName() }
);
Class c = null;
try
{
c = mlet.loadClass("org.jboss.test.jmx.compliance.loading.support.AClass");
}
catch (ClassNotFoundException e)
{
URL[] urls = mlet.getURLs();
fail("FAILS IN RI: SUN JMX RI builds a malformed URL from an MLet text file URL '" +
MLET_URL + "' resulting into MLET codebase URL '" + urls[0] + "' and therefore fails " +
"to load the required classes from the Java archive.");
}