diff --git a/Kieker.WebGUI/.classpath b/Kieker.WebGUI/.classpath index 595a5bf4f25946f35d122d0c250b79c689cc4693..e61646eedbbc3a5d427d3f68234ca6b94bb5102c 100644 --- a/Kieker.WebGUI/.classpath +++ b/Kieker.WebGUI/.classpath @@ -1,6 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <classpath> <classpathentry kind="src" output="target/classes" path="src/main/java"/> + <classpathentry kind="src" path="src/test/java"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/> <classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"/> <classpathentry kind="output" path="target/classes"/> diff --git a/Kieker.WebGUI/pom.xml b/Kieker.WebGUI/pom.xml index 0af10d5873f02380a6e9d112e52c493684a553ff..f5c753a3bd05bccb62b52126badb2c8c8c87eed2 100644 --- a/Kieker.WebGUI/pom.xml +++ b/Kieker.WebGUI/pom.xml @@ -66,6 +66,11 @@ <artifactId>maven-pmd-plugin</artifactId> <version>2.6</version> </dependency> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>4.10</version> + </dependency> <dependency> <groupId>javax</groupId> <artifactId>javaee-web-api</artifactId> diff --git a/Kieker.WebGUI/src/test/java/kieker/webgui/common/PluginFinderTest.java b/Kieker.WebGUI/src/test/java/kieker/webgui/common/PluginFinderTest.java new file mode 100644 index 0000000000000000000000000000000000000000..26cb9b6ae80b5b8bea3008e22d7149035535eac4 --- /dev/null +++ b/Kieker.WebGUI/src/test/java/kieker/webgui/common/PluginFinderTest.java @@ -0,0 +1,53 @@ +/*************************************************************************** + * Copyright 2012 by + * + Christian-Albrechts-University of Kiel + * + Department of Computer Science + * + Software Engineering Group + * and others. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ***************************************************************************/ + +package kieker.webgui.common; + +import java.io.File; +import java.net.MalformedURLException; +import java.util.List; + +import junit.framework.Assert; +import junit.framework.TestCase; +import org.junit.Test; + +/** + * @author Nils Christian Ehmke + * @version 1.0 + */ +public class PluginFinderTest extends TestCase { + + /** + * Creates a new instance of this class. + */ + public PluginFinderTest() {} + + @Test + public void testKiekerJarContainsPlugins() { + /* It can be assumed that the kieker jar contains at least one plugin. */ + try { + final List<Class<?>> availableKiekerPlugins = PluginFinder.getAllPluginsWithinJar(new File("lib/kieker-1.5-SNAPSHOT.jar").toURL()); + + Assert.assertTrue("Kieker-Jar seems to contain no plugins.", availableKiekerPlugins.size() > 0); + } catch (final MalformedURLException ex) { + Assert.fail("Exception occured."); + } + } +}