Permalink
Browse files

Do not die if one test fails initialization

  • Loading branch information...
1 parent 95a0d89 commit 8da7a6abb48f7f1cb25c313ce2b6c35a0dd773eb @olas committed Jul 19, 2010
Showing with 23 additions and 20 deletions.
  1. +23 −20 plugins/net.bioclipse.ds.ui/src/net/bioclipse/ds/ui/views/DSView.java
@@ -27,6 +27,7 @@
import net.bioclipse.ds.report.AbstractTestReportModel;
import net.bioclipse.ds.ui.Activator;
import net.bioclipse.ds.business.IDSManager;
+import net.bioclipse.ds.model.DSException;
import net.bioclipse.ds.model.Endpoint;
import net.bioclipse.ds.model.IDSTest;
import net.bioclipse.ds.model.ITestResult;
@@ -346,15 +347,20 @@ public void paintControl(PaintEvent e) {
protected IStatus run( IProgressMonitor monitor ) {
IDSManager ds = net.bioclipse.ds.Activator.getDefault().getJavaManager();
+
try {
- monitor.beginTask( "Initializing decision support tests", ds.getTests().size()+1 );
- monitor.worked( 1 );
- for (String testID : ds.getTests()){
- IDSTest test = ds.getTest( testID );
- monitor.subTask( "Initializing test: " + testID );
- test.initialize( monitor );
- }
-
+ monitor.beginTask( "Initializing decision support tests", ds.getTests().size()+1 );
+ monitor.worked( 1 );
+ for (String testID : ds.getTests()){
+ IDSTest test = ds.getTest( testID );
+ monitor.subTask( "Initializing test: " + testID );
+ try {
+ test.initialize( monitor );
+ } catch (Exception e) {
+ test.setTestErrorMessage("Error: "+e.getMessage());
+ }
+ }
+
Display.getDefault().asyncExec( new Runnable(){
public void run() {
@@ -398,20 +404,17 @@ public void run() {
});
-
- } catch ( Exception e1 ) {
-
- LogUtils.handleException( e1, logger, Activator.PLUGIN_ID );
-
- Display.getDefault().asyncExec( new Runnable(){
- public void run() {
- viewer.setInput(new String[]{"Error initializing tests"});
- }
- });
+ } catch (BioclipseException e1) {
+ LogUtils.handleException( e1, logger, Activator.PLUGIN_ID );
+ Display.getDefault().asyncExec( new Runnable(){
+ public void run() {
+ viewer.setInput(new String[]{"Error initializing tests"});
+ }
+ });
- return new Status(IStatus.ERROR, Activator.PLUGIN_ID,
- "All tests could not be initalized: " + e1.getMessage());
+ return new Status(IStatus.ERROR, Activator.PLUGIN_ID,
+ "All tests could not be initalized: " + e1.getMessage());
}
monitor.done();

0 comments on commit 8da7a6a

Please sign in to comment.