From: Tuukka Lehtonen Date: Fri, 30 Aug 2019 12:12:53 +0000 (+0300) Subject: Report non-existent .sts tests using error logger instead of NPE crash X-Git-Tag: v1.43.0~136^2~84 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F78%2F3178%2F1;p=simantics%2Fplatform.git Report non-existent .sts tests using error logger instead of NPE crash gitlab #367 Change-Id: I55408e6b8b539bb3775e7ff5afc7f32323e32eb2 --- diff --git a/bundles/org.simantics.db.testing/src/org/simantics/db/testing/base/SCLScriptTestBase.java b/bundles/org.simantics.db.testing/src/org/simantics/db/testing/base/SCLScriptTestBase.java index 459be8d4a..511af6dc3 100644 --- a/bundles/org.simantics.db.testing/src/org/simantics/db/testing/base/SCLScriptTestBase.java +++ b/bundles/org.simantics.db.testing/src/org/simantics/db/testing/base/SCLScriptTestBase.java @@ -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();