From e4caf10734abee12cb22f0d077531b0e2ee7cf73 Mon Sep 17 00:00:00 2001
From: Nelson Tavares de Sousa <ntd@informatik.uni-kiel.de>
Date: Mon, 23 Mar 2015 12:35:12 +0100
Subject: [PATCH] reduced lines in test case

---
 .../java/teetime/framework/ExceptionHandling.java | 15 ++++-----------
 1 file changed, 4 insertions(+), 11 deletions(-)

diff --git a/src/test/java/teetime/framework/ExceptionHandling.java b/src/test/java/teetime/framework/ExceptionHandling.java
index 4029d695..8e4681cb 100644
--- a/src/test/java/teetime/framework/ExceptionHandling.java
+++ b/src/test/java/teetime/framework/ExceptionHandling.java
@@ -10,8 +10,8 @@ import teetime.framework.exceptionHandling.TestListener;
 
 public class ExceptionHandling {
 
-	Class<TestListener> listener;
-	Analysis analysis;
+	private Class<TestListener> listener;
+	private Analysis analysis;
 
 	@Before
 	public void newInstances() {
@@ -19,16 +19,9 @@ public class ExceptionHandling {
 		analysis = new Analysis(new ExceptionTestConfiguration(), listener);
 	}
 
-	@Test(timeout = 5000)
+	@Test(timeout = 5000, expected = RuntimeException.class)
 	public void exceptionPassingAndTermination() {
-		boolean exceptionByExecute = false;
-
-		try {
-			analysis.execute();
-		} catch (RuntimeException e) {
-			exceptionByExecute = true;
-		}
-		assertTrue(exceptionByExecute); // thread was killed
+		analysis.execute();
 		assertEquals(TestListener.exceptionInvoked, 2); // listener did not kill thread to early
 	}
 
-- 
GitLab