Skip to content
This repository has been archived by the owner on Mar 27, 2024. It is now read-only.

Commit

Permalink
Fixed several tests and removed old, now unnecessary test classes.
Browse files Browse the repository at this point in the history
  • Loading branch information
jdeyton committed Aug 4, 2015
1 parent 1b0cca3 commit aa3a5d6
Show file tree
Hide file tree
Showing 10 changed files with 307 additions and 497 deletions.
Expand Up @@ -231,7 +231,7 @@ public void widgetDisposed(DisposeEvent e) {
* An exception is thrown if the {@link IPlot} implementation
* cannot be rendered.
*/
public int addPlot(URI uri) throws Exception {
public int addPlot(URI uri) {
int index = -1;

// Try to create a plot if there is space available.
Expand All @@ -243,7 +243,10 @@ public int addPlot(URI uri) throws Exception {
if (provider.openDialog(getShell(), uri) == Window.OK) {
plot = provider.getSelectedPlot();
}
} else {
System.err.println("Rejecting plot because not enough space");
}


// If a plot could be created, try to draw it.
if (plot != null) {
Expand All @@ -256,11 +259,13 @@ public int addPlot(URI uri) throws Exception {
logger.warn(getClass().getName() + " Exception! "
+ "Error while attempting to draw a plot for the file \""
+ uri.getPath() + "\".", e);
System.err.println("Exception while drawing plot");
return index;
}

// Add the plot to the list.
index = plots.size();
System.err.println("Drawing plot with index " + index);
plots.add(plot);
plotComposites.add(plotComposite);

Expand All @@ -274,6 +279,8 @@ public int addPlot(URI uri) throws Exception {

// Since a new plot was added, refresh the grid layout.
refreshLayout();
} else {
System.err.println("Rejecting plot because is null");
}

return index;
Expand Down

This file was deleted.

Expand Up @@ -12,7 +12,6 @@
package org.eclipse.ice.viz.service.connections.test;

import org.eclipse.ice.viz.service.connections.ConnectionPlot;
import org.eclipse.ice.viz.service.connections.ConnectionPlotRender;
import org.eclipse.ice.viz.service.connections.IVizConnection;
import org.junit.Ignore;
import org.junit.Test;
Expand Down
Expand Up @@ -17,12 +17,19 @@
import java.io.File;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.HashSet;
import java.util.Set;

import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.eclipse.ice.viz.service.IPlot;
import org.eclipse.ice.viz.service.connections.ConnectionPlot;
import org.eclipse.ice.viz.service.connections.ConnectionPlotComposite;
import org.eclipse.ice.viz.service.connections.ConnectionVizService;
import org.eclipse.ice.viz.service.connections.IVizConnectionManager;
import org.eclipse.ice.viz.service.connections.VizConnection;
import org.eclipse.ice.viz.service.connections.VizConnectionManager;
import org.eclipse.ice.viz.service.preferences.CustomScopedPreferenceStore;
import org.eclipse.swt.widgets.Composite;
import org.junit.Before;
import org.junit.Test;

Expand All @@ -45,11 +52,6 @@ public class ConnectionVizServiceTester {
* The viz service that will be tested.
*/
private ConnectionVizService<FakeClient> service;
/**
* A handle to the viz service that will be tested, but cast to its actual
* type.
*/
private FakeConnectionVizService fakeService;

/**
* A string containing the characters "localhost".
Expand Down Expand Up @@ -86,22 +88,54 @@ public void beforeEachTest() {
path = "";
node.put(name, host + "," + port + "," + path);

// Create the fake viz service.
fakeService = new FakeConnectionVizService() {
// Create a connection viz service.
service = new ConnectionVizService<FakeClient>() {

@Override
public String getName() {
return "Fake Connection Viz Service";
}

@Override
public String getVersion() {
return "0.0";
}

@Override
protected IVizConnectionManager<FakeClient> createConnectionManager() {
return new VizConnectionManager<FakeClient>() {
@Override
protected VizConnection<FakeClient> createConnection(
String name, String preferences) {
return new FakeVizConnection();
}
};
}

@Override
protected ConnectionPlot<FakeClient> createConnectionPlot() {
FakeConnectionPlot plot = (FakeConnectionPlot) super.createConnectionPlot();
plot.plotTypes.put("track", new String[] { "1", "2" });
return plot;
return new ConnectionPlot<FakeClient>() {
@Override
protected ConnectionPlotComposite<FakeClient> createPlotComposite(
Composite parent) {
// This shouldn't be called.
return null;
}
};
}

@Override
protected String getConnectionPreferencesNodeId() {
return NODE_ID;
}

@Override
protected Set<String> findSupportedExtensions() {
Set<String> extensions = new HashSet<String>();
extensions.add("csv");
return extensions;
}
};
fakeService.supportedExtensions.add("csv");
service = fakeService;

// Add a remote connection after creating the service.
name = "magic sword";
Expand Down

This file was deleted.

This file was deleted.

0 comments on commit aa3a5d6

Please sign in to comment.