Commit 9b965b85 authored by Robert Smith's avatar Robert Smith
Browse files

Fixed tests



Updated ItemTester to work with the changes to .csv file handling for
Resources.
Signed-off-by: Robert Smith's avatarRobert Smith <smithrw@ornl.gov>
parent e2c353c3
......@@ -129,8 +129,17 @@ public class ResourceHandlerTester {
assertEquals(descTwo, vizResource.getDescription());
}
/**
* A simple implementation of an IVizServiceFactory that simply holds a single VizService.
*
* @author Robert Smith
*
*/
private class TestVizServiceFactory extends BasicVizServiceFactory {
/**
* The single VizService that the factory will contain
*/
IVizService service;
@Override
......
......@@ -9,14 +9,18 @@ Import-Package: com.spotify.docker.client,
org.apache.http.conn;version="4.3.4",
org.bouncycastle.openssl;version="1.51.0",
org.eclipse.eavp.viz.datastructures.VizObject,
org.eclipse.eavp.viz.service,
org.eclipse.eavp.viz.service.csv,
org.eclipse.eavp.viz.service.mesh.datastructures,
org.eclipse.eavp.viz.service.visit,
org.eclipse.ice.core.iCore,
org.eclipse.ice.datastructures.entry,
org.eclipse.ice.io.serializable,
org.eclipse.ice.item,
org.eclipse.ice.item.action,
org.eclipse.ice.persistence.xml,
org.osgi.framework;version="1.6.0"
org.osgi.framework;version="1.6.0",
gov.lbnl.visit.swt
Require-Bundle: org.junit;bundle-version="4.8.1"
Bundle-Vendor: Oak Ridge National Laboratory
......@@ -39,6 +39,11 @@ import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.eavp.viz.service.BasicVizServiceFactory;
import org.eclipse.eavp.viz.service.IVizService;
import org.eclipse.eavp.viz.service.IVizServiceFactory;
import org.eclipse.eavp.viz.service.csv.CSVVizService;
import org.eclipse.eavp.viz.service.visit.VisItVizService;
import org.eclipse.ice.datastructures.ICEObject.ICEJAXBHandler;
import org.eclipse.ice.datastructures.entry.FileEntry;
import org.eclipse.ice.datastructures.entry.IEntry;
......@@ -971,6 +976,12 @@ public class ItemTester implements ItemListener {
String separator = System.getProperty("file.separator");
String userDir = System.getProperty("user.home") + separator
+ "ICETests" + separator + "itemData";
// Set up a basic factory with a CSVVizService for the test
IVizServiceFactory factory = new TestVizServiceFactory();
factory.register(new CSVVizService());
org.eclipse.ice.datastructures.internal.VizServiceFactoryHolder
.setVizServiceFactory(factory);
// Setup the project
try {
......@@ -1282,4 +1293,47 @@ public class ItemTester implements ItemListener {
updated = true;
}
/**
* A simple implementation of an IVizServiceFactory that simply holds csv and VisIt VizServices.
*
* @author Robert Smith
*
*/
private class TestVizServiceFactory extends BasicVizServiceFactory {
/**
* The CSV service
*/
IVizService csvService;
/**
* THe VisIt service
*/
IVizService visitService;
@Override
public IVizService get(String name) {
if(name.equals(csvService.getName())){
return csvService;
} else {
return visitService;
}
}
@Override
public String[] getServiceNames() {
String[] names = new String[] { csvService.getName() , visitService.getName()};
return names;
}
@Override
public void register(IVizService service) {
//Ignore the input and simple create the two preset services
csvService = new CSVVizService();
visitService = new VisItVizService();
}
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment