Report non-existent .sts tests using error logger instead of NPE crash 78/3178/1
authorTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Fri, 30 Aug 2019 12:12:53 +0000 (15:12 +0300)
committerTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Fri, 30 Aug 2019 12:12:53 +0000 (15:12 +0300)
gitlab #367

Change-Id: I55408e6b8b539bb3775e7ff5afc7f32323e32eb2

bundles/org.simantics.db.testing/src/org/simantics/db/testing/base/SCLScriptTestBase.java

index 459be8d4a62228c70c52430c143c0459242706db..511af6dc3d3ec05e5646d25ed872e06d57740b0c 100644 (file)
@@ -81,8 +81,12 @@ public class SCLScriptTestBase extends FreshDatabaseTest {
 
         String testName = resolveTestName();
         TestRunnable runnable = testRunnables.get(testName);
-        long start = System.nanoTime(); 
+        if (runnable == null) {
+            LOGGER.error("SCL Test Suite file (.sts) for test {} cannot be found from test repository.", testName);
+            return;
+        }
 
+        long start = System.nanoTime(); 
         if (timeout > -1) {
             LOGGER.info("Running test {} with a timeout of {} seconds", testName, timeout); //$NON-NLS-1$
             Timer timer = new Timer();