List of usage examples for java.lang UnsupportedClassVersionError UnsupportedClassVersionError
public UnsupportedClassVersionError()
UnsupportedClassVersionError
with no detail message. From source file:org.sonar.core.plugins.PluginClassloadersTest.java
@Test 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(null).setKey("checkstyle") .setMainClass("org.sonar.plugins.checkstyle.CheckstylePlugin") .addDeployedFile(getFile("sonar-checkstyle-plugin-2.8.jar")); classloaders.init(Arrays.<PluginMetadata>asList(checkstyle)); }