public void detect_plugins_compiled_for_bad_java_version() throws Exception {
thrown.expect(SonarException.class);
thrown.expectMessage("The plugin checkstyle is not supported with Java 1.");
ClassWorld world = mock(ClassWorld.class);
when(world.newRealm(anyString(), any(ClassLoader.class))).thenThrow(new UnsupportedClassVersionError());
classloaders = new PluginClassloaders(getClass().getClassLoader(), world);
DefaultPluginMetadata checkstyle = DefaultPluginMetadata.create("checkstyle")
.setMainClass("org.sonar.plugins.checkstyle.CheckstylePlugin")