From 25c480efd18b83d486cc616340f1dcd921de24c8 Mon Sep 17 00:00:00 2001 From: Andrew Branson Date: Wed, 16 Apr 2014 17:46:43 +0200 Subject: Do assert falses and reasons rather than throwing exceptions --- src/test/java/LauncherTest.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/test/java/LauncherTest.java') diff --git a/src/test/java/LauncherTest.java b/src/test/java/LauncherTest.java index 8abba93..a3217b1 100644 --- a/src/test/java/LauncherTest.java +++ b/src/test/java/LauncherTest.java @@ -31,8 +31,8 @@ public class LauncherTest { Logger.msg("Testing valid startup args"); props = AbstractMain.readC2KArgs(args); - assert "MemoryOnlyClusterStorage".equals(props.get("ClusterStorage")); - assert "1553".equals(props.get("ItemServer.Proxy.port")); + assert "MemoryOnlyClusterStorage".equals(props.get("ClusterStorage")) : "Config file properties not loaded"; + assert "1553".equals(props.get("ItemServer.Proxy.port")) : "Connect file properties not loaded"; } public void testWrongConfigFileName() throws Exception { @@ -40,7 +40,7 @@ public class LauncherTest { args[5] = "filenotfound"; try { props = AbstractMain.readC2KArgs(args); - throw new Exception("Invalid connect file not detected"); + assert false: "Invalid connect file not detected"; } catch (BadArgumentsException ex) { } } @@ -49,7 +49,7 @@ public class LauncherTest { args[7] = "alsonotfound"; try { props = AbstractMain.readC2KArgs(args); - throw new Exception("Invalid connect file not detected"); + assert false : "Invalid connect file not detected"; } catch (BadArgumentsException ex) { } } @@ -59,7 +59,7 @@ public class LauncherTest { args[1] = LauncherTest.class.getResource("server.conf").getPath(); try { props = AbstractMain.readC2KArgs(args); - throw new Exception("Missing connect file not detected"); + assert false: "Missing connect file not detected"; } catch (BadArgumentsException ex) { } } @@ -69,7 +69,7 @@ public class LauncherTest { args[1] = LauncherTest.class.getResource("test.clc").getPath(); try { props = AbstractMain.readC2KArgs(args); - throw new Exception("Missing config file not detected"); + assert false: "Missing config file not detected"; } catch (BadArgumentsException ex) { } } } -- cgit v1.2.3