From 18bb99776112706a3c3a4a5f4a9cc099b1540aa2 Mon Sep 17 00:00:00 2001 From: fros4943 Date: Wed, 5 Nov 2008 18:16:56 +0000 Subject: [PATCH] added testOK and testFailed methods accessible from test scripts --- .../sics/cooja/plugins/LogScriptEngine.java | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/tools/cooja/java/se/sics/cooja/plugins/LogScriptEngine.java b/tools/cooja/java/se/sics/cooja/plugins/LogScriptEngine.java index daf9e465e..afe69ffcc 100644 --- a/tools/cooja/java/se/sics/cooja/plugins/LogScriptEngine.java +++ b/tools/cooja/java/se/sics/cooja/plugins/LogScriptEngine.java @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: LogScriptEngine.java,v 1.4 2008/10/03 15:18:48 fros4943 Exp $ + * $Id: LogScriptEngine.java,v 1.5 2008/11/05 18:16:56 fros4943 Exp $ */ package se.sics.cooja.plugins; @@ -69,6 +69,8 @@ public class LogScriptEngine { private interface ScriptLog { public void log(String log); + public void testOK(); + public void testFailed(); } public LogScriptEngine(GUI gui, String code) { @@ -199,6 +201,24 @@ public class LogScriptEngine { scriptLogObserver.update(null, msg); } } + public void testOK() { + log("TEST OK\n"); + + if (GUI.isVisualized()) { + log("[if test was run without visualization, COOJA would now have been terminated]\n"); + } else { + gui.doQuit(false); + } + } + public void testFailed() { + log("TEST FAILED\n"); + + if (GUI.isVisualized()) { + log("[if test was run without visualization, COOJA would now have been terminated]\n"); + } else { + gui.doQuit(false); + } + } }); Hashtable hash = new Hashtable();