Skip to content
Snippets Groups Projects
Commit 6e45b562 authored by nie's avatar nie
Browse files

Added the new kieker-jar and modified the code to suit this new jar; Advanced...

Added the new kieker-jar and modified the code to suit this new jar; Advanced the ClassLoader; Modified code within the xhtml-files; Started with the dependency-choosing for a single project.
parent 778d1f18
No related branches found
No related tags found
No related merge requests found
Showing
with 184 additions and 124 deletions
No preview for this file type
...@@ -3,9 +3,9 @@ ...@@ -3,9 +3,9 @@
<action> <action>
<actionName>run</actionName> <actionName>run</actionName>
<goals> <goals>
<goal>package</goal>
<goal>jetty:run</goal> <goal>jetty:run</goal>
</goals> </goals>
</action> </action>
</actions> </actions>
...@@ -20,12 +20,16 @@ ...@@ -20,12 +20,16 @@
package kieker.webgui.beans.application; package kieker.webgui.beans.application;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.List; import java.util.List;
import javax.faces.bean.ApplicationScoped; import javax.faces.bean.ApplicationScoped;
import javax.faces.bean.ManagedBean; import javax.faces.bean.ManagedBean;
import kieker.analysis.model.analysisMetaModel.MIDependency; import kieker.analysis.model.analysisMetaModel.MIDependency;
import kieker.common.logging.Log;
import kieker.common.logging.LogFactory;
import kieker.webgui.common.FileManager; import kieker.webgui.common.FileManager;
import kieker.webgui.common.PluginClassLoader; import kieker.webgui.common.PluginClassLoader;
...@@ -39,7 +43,10 @@ import org.primefaces.model.UploadedFile; ...@@ -39,7 +43,10 @@ import org.primefaces.model.UploadedFile;
@ManagedBean @ManagedBean
@ApplicationScoped @ApplicationScoped
public class AvailableDependenciesBean { public class AvailableDependenciesBean {
/**
* The logger within this class.
*/
private static final Log LOG = LogFactory.getLog(AvailableDependenciesBean.class);
/** /**
* The list containing the depenencies. * The list containing the depenencies.
*/ */
...@@ -80,8 +87,12 @@ public class AvailableDependenciesBean { ...@@ -80,8 +87,12 @@ public class AvailableDependenciesBean {
break; break;
} }
} }
PluginClassLoader.getInstance().addURL(dependency.getFilePath()); try {
PluginClassLoader.getInstance().addURL(new URL("file", "localhost", dependency.getFilePath()));
this.dependencies.add(dependency); this.dependencies.add(dependency);
} catch (final MalformedURLException ex) {
AvailableDependenciesBean.LOG.error("Could not add the dependency to the ClassLoader.", ex);
}
} }
} }
} }
...@@ -96,8 +107,13 @@ public class AvailableDependenciesBean { ...@@ -96,8 +107,13 @@ public class AvailableDependenciesBean {
synchronized (this) { synchronized (this) {
final boolean result = FileManager.getInstance().deleteDependency(dependency); final boolean result = FileManager.getInstance().deleteDependency(dependency);
if (result) { if (result) {
PluginClassLoader.getInstance().removeURL(dependency.getFilePath());
this.dependencies.remove(dependency); this.dependencies.remove(dependency);
try {
PluginClassLoader.getInstance().removeURL(new URL("file", "localhost", dependency.getFilePath()));
this.dependencies.remove(dependency);
} catch (final MalformedURLException ex) {
AvailableDependenciesBean.LOG.error("Could not remove the dependency from the ClassLoader.", ex);
}
} }
} }
} }
......
...@@ -19,12 +19,14 @@ ...@@ -19,12 +19,14 @@
***************************************************************************/ ***************************************************************************/
package kieker.webgui.beans.application; package kieker.webgui.beans.application;
import java.io.File;
import java.util.List; import java.util.List;
import javax.faces.bean.ApplicationScoped; import javax.faces.bean.ApplicationScoped;
import javax.faces.bean.ManagedBean; import javax.faces.bean.ManagedBean;
import javax.faces.context.FacesContext; import javax.faces.context.FacesContext;
import kieker.analysis.model.analysisMetaModel.MIDependency;
import kieker.analysis.model.analysisMetaModel.MIPlugin; import kieker.analysis.model.analysisMetaModel.MIPlugin;
import kieker.analysis.model.analysisMetaModel.MIProject; import kieker.analysis.model.analysisMetaModel.MIProject;
import kieker.analysis.model.analysisMetaModel.impl.MAnalysisMetaModelFactory; import kieker.analysis.model.analysisMetaModel.impl.MAnalysisMetaModelFactory;
...@@ -107,11 +109,15 @@ public class AvailableProjectsBean { ...@@ -107,11 +109,15 @@ public class AvailableProjectsBean {
for (final MIProject project : this.projects) { for (final MIProject project : this.projects) {
final TreeNode projectNode = new DefaultTreeNode("project", project, root); final TreeNode projectNode = new DefaultTreeNode("project", project, root);
new DefaultTreeNode("dependencies", "Dependencies", projectNode); final TreeNode dependenciesNode = new DefaultTreeNode("dependencies", "Dependencies", projectNode);
final TreeNode usedPluginsNode = new DefaultTreeNode("usedPlugins", "Used Plugins", projectNode); final TreeNode usedPluginsNode = new DefaultTreeNode("usedPlugins", "Used Plugins", projectNode);
for (final MIPlugin plugin : project.getPlugins()) { for (final MIPlugin plugin : project.getPlugins()) {
new DefaultTreeNode("usedPlugin", plugin.getClassname(), usedPluginsNode); new DefaultTreeNode("usedPlugin", plugin.getClassname(), usedPluginsNode);
} }
for (final MIDependency dependency : project.getDependencies()) {
new DefaultTreeNode("dependencies", new File(dependency.getFilePath()).getName(), dependenciesNode);
}
} }
return root; return root;
......
...@@ -29,11 +29,8 @@ import javax.faces.context.FacesContext; ...@@ -29,11 +29,8 @@ import javax.faces.context.FacesContext;
import kieker.analysis.model.analysisMetaModel.MIDependency; import kieker.analysis.model.analysisMetaModel.MIDependency;
import kieker.analysis.model.analysisMetaModel.MIProject; import kieker.analysis.model.analysisMetaModel.MIProject;
import kieker.webgui.beans.application.AvailableDependenciesBean;
import kieker.webgui.beans.session.SelectedProjectBean; import kieker.webgui.beans.session.SelectedProjectBean;
import org.primefaces.model.DualListModel;
/** /**
* This bean contains the currently choosen dependencies. * This bean contains the currently choosen dependencies.
* *
...@@ -44,23 +41,11 @@ import org.primefaces.model.DualListModel; ...@@ -44,23 +41,11 @@ import org.primefaces.model.DualListModel;
@RequestScoped @RequestScoped
public class SelectedDependenciesBean { public class SelectedDependenciesBean {
/** private List<MIDependency> dependencies;
* A dual model containing all available dependencies and the currently choosen one.
*/
private DualListModel<MIDependency> dependencies;
/**
* The currently selected project.
*/
private final MIProject project; private final MIProject project;
/**
* Creates a new instance of this class.
*/
public SelectedDependenciesBean() { public SelectedDependenciesBean() {
final List<MIDependency> source = new ArrayList<MIDependency>(); this.dependencies = new ArrayList<MIDependency>();
final List<MIDependency> target = new ArrayList<MIDependency>();
this.dependencies = new DualListModel<MIDependency>(source, target);
final FacesContext context = FacesContext.getCurrentInstance(); final FacesContext context = FacesContext.getCurrentInstance();
...@@ -71,49 +56,94 @@ public class SelectedDependenciesBean { ...@@ -71,49 +56,94 @@ public class SelectedDependenciesBean {
} else { } else {
this.project = null; this.project = null;
} }
/* Get all available libs. */
final AvailableDependenciesBean availDepBean = context.getApplication().evaluateExpressionGet(context, "#{availableDependenciesBean}",
AvailableDependenciesBean.class);
this.dependencies.getSource().clear();
if (availDepBean != null) {
this.dependencies.getSource().addAll(availDepBean.getDependencies());
}
this.dependencies.getTarget().clear();
/* Now move the already selected to the right side. */
if (this.project != null) {
final List<MIDependency> projectLibs = this.project.getDependencies();
for (final MIDependency lib : projectLibs) {
this.dependencies.getSource().remove(lib);
this.dependencies.getTarget().add(lib);
}
}
} }
/** //
* Delivers the stored dependencies within this bean. // /**
* // * A dual model containing all available dependencies and the currently choosen one.
* @return The dependencies dual model. // */
*/ // private DualListModel<MIDependency> dependencies;
public final DualListModel<MIDependency> getDependencies() { // /**
// * The currently selected project.
// */
// private final MIProject project;
//
// /**
// * Creates a new instance of this class.
// */
// public SelectedDependenciesBean() {
// final List<MIDependency> source = new ArrayList<MIDependency>();
// final List<MIDependency> target = new ArrayList<MIDependency>();
//
// this.dependencies = new DualListModel<MIDependency>(source, target);
//
// final FacesContext context = FacesContext.getCurrentInstance();
//
// final SelectedProjectBean selProjBean = context.getApplication().evaluateExpressionGet(context, "#{selectedProjectBean}",
// SelectedProjectBean.class);
// if (selProjBean != null) {
// this.project = selProjBean.getSelectedProject();
// } else {
// this.project = null;
// }
//
// /* Get all available libs. */
//
// final AvailableDependenciesBean availDepBean = context.getApplication().evaluateExpressionGet(context, "#{availableDependenciesBean}",
// AvailableDependenciesBean.class);
// this.dependencies.getSource().clear();
// if (availDepBean != null) {
// this.dependencies.getSource().addAll(availDepBean.getDependencies());
// }
// this.dependencies.getTarget().clear();
//
// /* Now move the already selected to the right side. */
// if (this.project != null) {
// final List<MIDependency> projectLibs = this.project.getDependencies();
// for (final MIDependency lib : projectLibs) {
// this.dependencies.getSource().remove(lib);
// this.dependencies.getTarget().add(lib);
// }
// }
// }
//
// /**
// * Delivers the stored dependencies within this bean.
// *
// * @return The dependencies dual model.
// */
// public final DualListModel<MIDependency> getDependencies() {
// return this.dependencies;
// }
//
// /**
// * Sets the dependencies to be stored within this bean to a new value.
// *
// * @param dependencies
// * The new dependencies dual model.
// */
// public final void setDependencies(final DualListModel<MIDependency> dependencies) {
// this.dependencies = dependencies;
// /* Remember the selected libs. */
// if (this.project != null) {
// this.project.getDependencies().clear();
// this.project.getDependencies().addAll(dependencies.getTarget());
// }
// }
public List<MIDependency> getDependencies() {
return this.dependencies; return this.dependencies;
} }
/** public void setDependencies(final List<MIDependency> dependencies) {
* Sets the dependencies to be stored within this bean to a new value.
*
* @param dependencies
* The new dependencies dual model.
*/
public final void setDependencies(final DualListModel<MIDependency> dependencies) {
this.dependencies = dependencies; this.dependencies = dependencies;
}
/* Remember the selected libs. */ public void submit() {
// TODO Error while executing this method
if (this.project != null) { if (this.project != null) {
this.project.getDependencies().clear(); this.project.getDependencies().clear();
this.project.getDependencies().addAll(dependencies.getTarget()); this.project.getDependencies().addAll(this.dependencies);
} }
} }
......
...@@ -144,7 +144,7 @@ public final class FileManager { ...@@ -144,7 +144,7 @@ public final class FileManager {
final File fileProject = new File(dirProject, projectName + FileManager.EXTENSION); final File fileProject = new File(dirProject, projectName + FileManager.EXTENSION);
try { try {
final AnalysisController controller = new AnalysisController(project); final AnalysisController controller = new AnalysisController(project);
return controller.saveToFile(fileProject, projectName); return controller.saveToFile(fileProject);
} catch (final Exception ex) { } catch (final Exception ex) {
FileManager.LOG.error("Could not save project '" + projectName + "'."); FileManager.LOG.error("Could not save project '" + projectName + "'.");
return false; return false;
......
...@@ -21,6 +21,11 @@ ...@@ -21,6 +21,11 @@
package kieker.webgui.common; package kieker.webgui.common;
import java.net.URL; import java.net.URL;
import java.net.URLClassLoader;
import java.util.HashMap;
import java.util.Iterator;
import kieker.analysis.AnalysisController;
/** /**
* This singleton class is responsible for the dynamic loading of classes. * This singleton class is responsible for the dynamic loading of classes.
...@@ -29,6 +34,7 @@ import java.net.URL; ...@@ -29,6 +34,7 @@ import java.net.URL;
* plugin objects have to be created. * plugin objects have to be created.
* *
* @author Nils Christian Ehmke * @author Nils Christian Ehmke
* @version 1.0
*/ */
public final class PluginClassLoader { public final class PluginClassLoader {
...@@ -36,6 +42,10 @@ public final class PluginClassLoader { ...@@ -36,6 +42,10 @@ public final class PluginClassLoader {
* The singleton instance of this class. * The singleton instance of this class.
*/ */
private static final PluginClassLoader INSTANCE = new PluginClassLoader(); private static final PluginClassLoader INSTANCE = new PluginClassLoader();
/**
* This list contains a class loader for each url added to this class loader.
*/
private final HashMap<URL, URLClassLoader> classLoaders = new HashMap<URL, URLClassLoader>();
/** /**
* The default constructor of this class. * The default constructor of this class.
...@@ -47,20 +57,23 @@ public final class PluginClassLoader { ...@@ -47,20 +57,23 @@ public final class PluginClassLoader {
/** /**
* This method can be used to add an url to the class loader. * This method can be used to add an url to the class loader.
* *
* @param fileName * @param url
* The file name of the dependency to be added. * The URL of the dependency to be added.
*/ */
public void addURL(final String fileName) { public void addURL(final URL url) {
// TODO Implement final URLClassLoader newClassLoader = new URLClassLoader(new URL[] { url }, AnalysisController.class.getClassLoader());
synchronized (this) {
this.classLoaders.put(url, newClassLoader);
}
} }
/** /**
* This method can be used to remove an url from the class loader. * This method can be used to remove an url from the class loader.
* *
* @param fileName * @param url
* The file name of the dependency to be removed. * The URL of the dependency to be added.
*/ */
public void removeURL(final String fileName) { public void removeURL(final URL url) {
// TODO Implement // TODO Implement
} }
...@@ -80,9 +93,24 @@ public final class PluginClassLoader { ...@@ -80,9 +93,24 @@ public final class PluginClassLoader {
* @param name * @param name
* The name of the class to be loaded. * The name of the class to be loaded.
* @return The class. * @return The class.
* @throws ClassNotFoundException
* If a class with the given name could not be found.
*/ */
public Class<?> loadClass(final String name) { public Class<?> loadClass(final String name) throws ClassNotFoundException {
// TODO Implement synchronized (this) {
return null; /* Run through all available class loaders and try to find the correct class. */
final Iterator<URLClassLoader> classLoaderIter = this.classLoaders.values().iterator();
while (classLoaderIter.hasNext()) {
final URLClassLoader currClassLoader = classLoaderIter.next();
/* If no exception is thrown, we found the correct class and return it. Otherwise we continue the search. */
try {
final Class<?> resultingClass = currClassLoader.loadClass(name);
return resultingClass;
} catch (final ClassNotFoundException ex) {
}
}
}
/* We were not able to found any class and throw an exception. */
throw new ClassNotFoundException();
} }
} }
...@@ -22,15 +22,13 @@ package kieker.webgui.common; ...@@ -22,15 +22,13 @@ package kieker.webgui.common;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.net.URL; import java.net.URL;
import java.net.URLClassLoader;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Enumeration; import java.util.Enumeration;
import java.util.List; import java.util.List;
import java.util.jar.JarEntry; import java.util.jar.JarEntry;
import java.util.jar.JarFile; import java.util.jar.JarFile;
import kieker.analysis.AnalysisController;
import kieker.analysis.plugin.port.Plugin; import kieker.analysis.plugin.annotation.Plugin;
/** /**
* @author Nils Christian Ehmke * @author Nils Christian Ehmke
...@@ -53,13 +51,7 @@ public final class PluginFinder { ...@@ -53,13 +51,7 @@ public final class PluginFinder {
* exception occured. * exception occured.
*/ */
public static List<Class<?>> getAllPluginsWithinJar(final URL url) { public static List<Class<?>> getAllPluginsWithinJar(final URL url) {
URLClassLoader classLoader = null;
try { try {
/*
* Get a classloader and make sure that it has the system class
* loader as parent and that it knows the url.
*/
classLoader = new URLClassLoader(new URL[] { url }, AnalysisController.class.getClassLoader());
/* /*
* Open the jar file and run through all entries within this file. * Open the jar file and run through all entries within this file.
*/ */
...@@ -75,7 +67,7 @@ public final class PluginFinder { ...@@ -75,7 +67,7 @@ public final class PluginFinder {
/* /*
* Try to find a class with the same name. * Try to find a class with the same name.
*/ */
final Class<?> c = classLoader.loadClass(name); final Class<?> c = PluginClassLoader.getInstance().loadClass(name);
/* /*
* If it is a class and has the annotation - put it into our * If it is a class and has the annotation - put it into our
* list. * list.
...@@ -87,18 +79,10 @@ public final class PluginFinder { ...@@ -87,18 +79,10 @@ public final class PluginFinder {
/* Ignore error. */ /* Ignore error. */
} }
} }
//jarFile.close(); jarFile.close();
return result; return result;
} catch (final IOException ex) { } catch (final IOException ex) {
ex.printStackTrace(); ex.printStackTrace();
} finally {
/*try {
if (classLoader != null) {
classLoader.close();
}
} catch (IOException ex) {
ex.printStackTrace();
}*/
} }
return null; return null;
} }
......
...@@ -19,8 +19,8 @@ ...@@ -19,8 +19,8 @@
***************************************************************************/ ***************************************************************************/
package kieker.webgui.converter; package kieker.webgui.converter;
import java.io.File;
import java.net.MalformedURLException; import java.net.MalformedURLException;
import java.net.URL;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
...@@ -104,8 +104,8 @@ public class MIDependencyToCountPluginsConverter implements Converter { ...@@ -104,8 +104,8 @@ public class MIDependencyToCountPluginsConverter implements Converter {
return ""; return "";
} else { } else {
/* Try to find the library within the cache. */ /* Try to find the library within the cache. */
if (this.cache.containsKey((MIDependency) o)) { if (this.cache.containsKey(o)) {
return this.cache.get((MIDependency) o); return this.cache.get(o);
} }
/* If the cache is too big, remove one of the objects. */ /* If the cache is too big, remove one of the objects. */
if (this.cache.size() > MIDependencyToCountPluginsConverter.MAX_CACHE_SIZE) { if (this.cache.size() > MIDependencyToCountPluginsConverter.MAX_CACHE_SIZE) {
...@@ -113,7 +113,7 @@ public class MIDependencyToCountPluginsConverter implements Converter { ...@@ -113,7 +113,7 @@ public class MIDependencyToCountPluginsConverter implements Converter {
} }
String result; String result;
try { try {
result = Integer.toString(PluginFinder.getAllPluginsWithinJar(new File(((MIDependency) o).getFilePath()).toURL()).size()); result = Integer.toString(PluginFinder.getAllPluginsWithinJar(new URL("file", "localhost", ((MIDependency) o).getFilePath())).size());
} catch (final MalformedURLException ex) { } catch (final MalformedURLException ex) {
result = ""; result = "";
} catch (final NullPointerException ex) { } catch (final NullPointerException ex) {
......
...@@ -17,9 +17,11 @@ ...@@ -17,9 +17,11 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
***************************************************************************/ ***************************************************************************/
package kieker.webgui.converter; package kieker.webgui.converter;
import java.io.File; import java.io.File;
import java.util.HashMap;
import javax.faces.component.UIComponent; import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext; import javax.faces.context.FacesContext;
...@@ -29,8 +31,7 @@ import javax.faces.convert.FacesConverter; ...@@ -29,8 +31,7 @@ import javax.faces.convert.FacesConverter;
import kieker.analysis.model.analysisMetaModel.MIDependency; import kieker.analysis.model.analysisMetaModel.MIDependency;
/** /**
* This converter can be used to convert an instance of <i>MIDependency</i> to a * This converter can be used to convert an instance of <i>MIDependency</i> to a human readable string, but <b>not</b> vice versa.
* human readable string, but <b>not</b> vice versa.
* *
* @author Nils Christian Ehmke * @author Nils Christian Ehmke
* @version 1.0 * @version 1.0
...@@ -47,7 +48,9 @@ public class MIDependencyToStringConverter implements Converter { ...@@ -47,7 +48,9 @@ public class MIDependencyToStringConverter implements Converter {
* Creates a new instance of this class. * Creates a new instance of this class.
*/ */
public MIDependencyToStringConverter() { public MIDependencyToStringConverter() {
/* No code necessary. */ /*
* No code necessary.
*/
} }
/** /**
...@@ -56,11 +59,10 @@ public class MIDependencyToStringConverter implements Converter { ...@@ -56,11 +59,10 @@ public class MIDependencyToStringConverter implements Converter {
* @param fc * @param fc
* The FacesContext for the request being processed. * The FacesContext for the request being processed.
* @param uic * @param uic
* The component with which this model object value is * The component with which this model object value is associated.
* associated.
* @param string * @param string
* The string to be converted. * The string to be converted.
* @return null * @return null;
*/ */
@Override @Override
public Object getAsObject(final FacesContext fc, final UIComponent uic, final String string) { public Object getAsObject(final FacesContext fc, final UIComponent uic, final String string) {
...@@ -68,18 +70,15 @@ public class MIDependencyToStringConverter implements Converter { ...@@ -68,18 +70,15 @@ public class MIDependencyToStringConverter implements Converter {
} }
/** /**
* This method converts the given object (on condition that it is an * This method converts the given object (on condition that it is an instance of the class <code>MIDependency</code>) to a human readable string.
* instance of the class <code>MIDependency</code>) to a human readable string.
* *
* @param fc * @param fc
* The FacesContext for the request being processed. * The FacesContext for the request being processed.
* @param uic * @param uic
* The component with which this model object value is * The component with which this model object value is associated.
* associated.
* @param o * @param o
* The object to be converted. * The object to be converted.
* @return A human readable represantation of the given object or null, of * @return A human readable represantation of the given object or null, of the object is from the wrong class.
* the object is from the wrong class.
*/ */
@Override @Override
public String getAsString(final FacesContext fc, final UIComponent uic, final Object o) { public String getAsString(final FacesContext fc, final UIComponent uic, final Object o) {
......
...@@ -18,9 +18,7 @@ ...@@ -18,9 +18,7 @@
<!-- The control panel to get back. --> <!-- The control panel to get back. -->
<h:form> <h:form>
Click Click
<p:commandLink ajax="false" action="/main"> <h:link outcome="/main">here</h:link>
<h:outputText value="here" />
</p:commandLink>
to get back to the main menu. to get back to the main menu.
</h:form> </h:form>
</p:layoutUnit> </p:layoutUnit>
......
...@@ -15,24 +15,22 @@ ...@@ -15,24 +15,22 @@
<p:layout fullPage="true"> <p:layout fullPage="true">
<p:layoutUnit header="Navigation" position="north" collapsible="true" resizable="true"> <p:layoutUnit header="Navigation" position="north" collapsible="true" resizable="true">
<!-- The control panel to get back. --> <!-- The control panel to get back. -->
<h:form>
Click Click
<p:commandLink ajax="false" action="/main"> <h:link outcome="/main">here</h:link>
<h:outputText value="here" />
</p:commandLink>
to get back to the main menu. to get back to the main menu.
</h:form>
</p:layoutUnit> </p:layoutUnit>
<p:layoutUnit header="Currently used Dependencies" position="center" > <p:layoutUnit header="Currently used Dependencies" position="center" >
<h:form>
<p:selectManyCheckbox value="#{selectedDependenciesBean.dependencies}"
layout="pageDirection">
<f:selectItems value="#{availableDependenciesBean.dependencies}" />
</p:selectManyCheckbox>
<p:spacer width="0px" height="20px"/>
<div align="center"> <div align="center">
<p:pickList id="pickList" value="#{selectedDependenciesBean.dependencies}" var="dependency" <p:commandButton ajax="false" value="Submit" actionListener="#{selectedDependenciesBean.submit()}"/>
itemLabel="#{dependency.getFilePath()}" itemValue="#{dependency}"
converter="kieker.webgui.converter.MIDependencyToStringConverter" >
<f:facet name="sourceCaption">Available</f:facet>
<f:facet name="targetCaption">Project</f:facet>
</p:pickList>
</div> </div>
</h:form>
</p:layoutUnit> </p:layoutUnit>
</p:layout> </p:layout>
......
...@@ -20,12 +20,13 @@ ...@@ -20,12 +20,13 @@
package kieker.webgui.common; package kieker.webgui.common;
import java.io.File;
import java.net.MalformedURLException; import java.net.MalformedURLException;
import java.net.URL;
import java.util.List; import java.util.List;
import junit.framework.Assert; import junit.framework.Assert;
import junit.framework.TestCase; import junit.framework.TestCase;
import org.junit.Test; import org.junit.Test;
/** /**
...@@ -43,8 +44,8 @@ public class PluginFinderTest extends TestCase { ...@@ -43,8 +44,8 @@ public class PluginFinderTest extends TestCase {
public void testKiekerJarContainsPlugins() { public void testKiekerJarContainsPlugins() {
/* It can be assumed that the kieker jar contains at least one plugin. */ /* It can be assumed that the kieker jar contains at least one plugin. */
try { try {
final List<Class<?>> availableKiekerPlugins = PluginFinder.getAllPluginsWithinJar(new File("lib/kieker-1.5-SNAPSHOT.jar").toURL()); PluginClassLoader.getInstance().addURL(new URL("file", "localhost", "lib/kieker-1.5-SNAPSHOT.jar"));
final List<Class<?>> availableKiekerPlugins = PluginFinder.getAllPluginsWithinJar(new URL("file", "localhost", "lib/kieker-1.5-SNAPSHOT.jar"));
Assert.assertTrue("Kieker-Jar seems to contain no plugins.", availableKiekerPlugins.size() > 0); Assert.assertTrue("Kieker-Jar seems to contain no plugins.", availableKiekerPlugins.size() > 0);
} catch (final MalformedURLException ex) { } catch (final MalformedURLException ex) {
Assert.fail("Exception occured."); Assert.fail("Exception occured.");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment