From 1f237a354c49288c37e6b0b35dbe075d9ae176c4 Mon Sep 17 00:00:00 2001 From: WasabiFan Date: Sat, 21 Nov 2015 15:30:50 -0800 Subject: [PATCH 1/7] Add initial version of test-only exception utilities --- .../logging/SafeRobotAssertionManager.java | 31 ++++++++++++++++++ tests/xbot/common/injection/BaseWPITest.java | 4 +++ .../logging/SafeRobotAssertionTests.java | 32 +++++++++++++++++++ 3 files changed, 67 insertions(+) create mode 100644 src/xbot/common/logging/SafeRobotAssertionManager.java create mode 100644 tests/xbot/common/logging/SafeRobotAssertionTests.java diff --git a/src/xbot/common/logging/SafeRobotAssertionManager.java b/src/xbot/common/logging/SafeRobotAssertionManager.java new file mode 100644 index 00000000..c4138410 --- /dev/null +++ b/src/xbot/common/logging/SafeRobotAssertionManager.java @@ -0,0 +1,31 @@ +package xbot.common.logging; + +import java.util.Arrays; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import org.apache.log4j.Logger; + +import com.google.inject.Singleton; + +@Singleton +public class SafeRobotAssertionManager { + private boolean allowExceptions = false; + static Logger log = Logger.getLogger(SafeRobotAssertionManager.class); + + public void throwException(RuntimeException e) { + log.error(e.getMessage() + ": " + e.getCause()); + log.error("Stack trace: \n " + + Arrays.stream(e.getStackTrace()) + .map(elem -> elem.toString()) + .collect(Collectors.joining("\n "))); + + if(allowExceptions) { + throw e; + } + } + + public void setExceptionsEnabled(boolean allowException) { + this.allowExceptions = allowException; + } +} diff --git a/tests/xbot/common/injection/BaseWPITest.java b/tests/xbot/common/injection/BaseWPITest.java index 7f8f098c..674645a9 100644 --- a/tests/xbot/common/injection/BaseWPITest.java +++ b/tests/xbot/common/injection/BaseWPITest.java @@ -8,6 +8,7 @@ import com.google.inject.Injector; import xbot.common.controls.MockRobotIO; +import xbot.common.logging.SafeRobotAssertionManager; import xbot.common.properties.PropertyManager; import edu.wpi.first.wpilibj.HLUsageReporting; import edu.wpi.first.wpilibj.MockHLUsageReporting; @@ -38,6 +39,9 @@ public void setUp() { RobotState.SetImplementation(mockRobotState); propertyManager = injector.getInstance(PropertyManager.class); + + SafeRobotAssertionManager assertionMan = injector.getInstance(SafeRobotAssertionManager.class); + assertionMan.setExceptionsEnabled(true); DOMConfigurator.configure("lib/log4jConfig/log4j4unitTesting.xml"); } diff --git a/tests/xbot/common/logging/SafeRobotAssertionTests.java b/tests/xbot/common/logging/SafeRobotAssertionTests.java new file mode 100644 index 00000000..3b7a2d27 --- /dev/null +++ b/tests/xbot/common/logging/SafeRobotAssertionTests.java @@ -0,0 +1,32 @@ +package xbot.common.logging; + +import static org.junit.Assert.*; +import org.junit.Test; + +import xbot.common.injection.BaseWPITest; + +public class SafeRobotAssertionTests extends BaseWPITest { + @Test + public void testNoExceptionOnRobot() { + SafeRobotAssertionManager assertMan = injector.getInstance(SafeRobotAssertionManager.class); + assertMan.setExceptionsEnabled(false); + + assertMan.throwException(new RuntimeException("Something really bad happened (...but robots never die)")); + } + + @Test + public void testExceptionThrownInTests() { + SafeRobotAssertionManager assertMan = injector.getInstance(SafeRobotAssertionManager.class); + + try { + assertMan.throwException(new RuntimeException("Something really bad happened (tests are free to die as necessary)")); + } + catch (Throwable e) { + // We want it to throw -- this is good + return; + } + + // If it didn't throw, something went wrong! + fail(); + } +} From 0008df99946642b098e804683308b6424bf069f5 Mon Sep 17 00:00:00 2001 From: WasabiFan Date: Sat, 21 Nov 2015 15:47:44 -0800 Subject: [PATCH 2/7] Add safe assertions (just assertTrue) --- .../logging/SafeRobotAssertionException.java | 7 +++++ .../logging/SafeRobotAssertionManager.java | 9 ++++++- .../logging/SafeRobotAssertionTests.java | 27 +++++++++++++++++++ 3 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 src/xbot/common/logging/SafeRobotAssertionException.java diff --git a/src/xbot/common/logging/SafeRobotAssertionException.java b/src/xbot/common/logging/SafeRobotAssertionException.java new file mode 100644 index 00000000..9288a6aa --- /dev/null +++ b/src/xbot/common/logging/SafeRobotAssertionException.java @@ -0,0 +1,7 @@ +package xbot.common.logging; + +public class SafeRobotAssertionException extends RuntimeException { + public SafeRobotAssertionException(String faliureCauseCause) { + super("Assertion error: " + faliureCauseCause); + } +} diff --git a/src/xbot/common/logging/SafeRobotAssertionManager.java b/src/xbot/common/logging/SafeRobotAssertionManager.java index c4138410..371859d7 100644 --- a/src/xbot/common/logging/SafeRobotAssertionManager.java +++ b/src/xbot/common/logging/SafeRobotAssertionManager.java @@ -14,7 +14,8 @@ public class SafeRobotAssertionManager { static Logger log = Logger.getLogger(SafeRobotAssertionManager.class); public void throwException(RuntimeException e) { - log.error(e.getMessage() + ": " + e.getCause()); + log.error("Safe exception encountered (exception throw " + (allowExceptions ? "enabled" : "disabled") + "): " + + e.getMessage()); log.error("Stack trace: \n " + Arrays.stream(e.getStackTrace()) .map(elem -> elem.toString()) @@ -25,6 +26,12 @@ public void throwException(RuntimeException e) { } } + public void assertTrue(boolean value, String assertionFaliureCause) { + if(!value) { + throwException(new SafeRobotAssertionException(assertionFaliureCause)); + } + } + public void setExceptionsEnabled(boolean allowException) { this.allowExceptions = allowException; } diff --git a/tests/xbot/common/logging/SafeRobotAssertionTests.java b/tests/xbot/common/logging/SafeRobotAssertionTests.java index 3b7a2d27..5435c7bb 100644 --- a/tests/xbot/common/logging/SafeRobotAssertionTests.java +++ b/tests/xbot/common/logging/SafeRobotAssertionTests.java @@ -29,4 +29,31 @@ public void testExceptionThrownInTests() { // If it didn't throw, something went wrong! fail(); } + + @Test + public void testAssertionContinuesOnRobot() { + SafeRobotAssertionManager assertMan = injector.getInstance(SafeRobotAssertionManager.class); + assertMan.setExceptionsEnabled(false); + + assertMan.assertTrue(true, "The world is ending"); + assertMan.assertTrue(false, "false != true"); + } + + @Test + public void testAssertionInTests() { + SafeRobotAssertionManager assertMan = injector.getInstance(SafeRobotAssertionManager.class); + + assertMan.assertTrue(true, "The world is ending"); + + try { + assertMan.assertTrue(false, "false != true"); + } + catch (Throwable e) { + // We want it to throw -- this is good + return; + } + + // If it didn't throw, something went wrong! + fail(); + } } From fdc22606385c3b407641fceef48815d95daf3858 Mon Sep 17 00:00:00 2001 From: WasabiFan Date: Sat, 21 Nov 2015 15:53:17 -0800 Subject: [PATCH 3/7] Use JUnit constructs to expect an exception --- .../logging/SafeRobotAssertionTests.java | 36 +++++++------------ 1 file changed, 12 insertions(+), 24 deletions(-) diff --git a/tests/xbot/common/logging/SafeRobotAssertionTests.java b/tests/xbot/common/logging/SafeRobotAssertionTests.java index 5435c7bb..a2de4fdf 100644 --- a/tests/xbot/common/logging/SafeRobotAssertionTests.java +++ b/tests/xbot/common/logging/SafeRobotAssertionTests.java @@ -14,20 +14,12 @@ public void testNoExceptionOnRobot() { assertMan.throwException(new RuntimeException("Something really bad happened (...but robots never die)")); } - @Test + @Test(expected=RuntimeException.class + ) public void testExceptionThrownInTests() { SafeRobotAssertionManager assertMan = injector.getInstance(SafeRobotAssertionManager.class); - try { - assertMan.throwException(new RuntimeException("Something really bad happened (tests are free to die as necessary)")); - } - catch (Throwable e) { - // We want it to throw -- this is good - return; - } - - // If it didn't throw, something went wrong! - fail(); + assertMan.throwException(new RuntimeException("Something really bad happened (tests are free to die as necessary)")); } @Test @@ -39,21 +31,17 @@ public void testAssertionContinuesOnRobot() { assertMan.assertTrue(false, "false != true"); } - @Test - public void testAssertionInTests() { + @Test(expected=SafeRobotAssertionException.class) + public void testAssertionFailedInTests() { SafeRobotAssertionManager assertMan = injector.getInstance(SafeRobotAssertionManager.class); - assertMan.assertTrue(true, "The world is ending"); - - try { - assertMan.assertTrue(false, "false != true"); - } - catch (Throwable e) { - // We want it to throw -- this is good - return; - } + assertMan.assertTrue(false, "false != true"); + } + + @Test() + public void testAssertionPassedInTests() { + SafeRobotAssertionManager assertMan = injector.getInstance(SafeRobotAssertionManager.class); - // If it didn't throw, something went wrong! - fail(); + assertMan.assertTrue(true, "The world is ending"); } } From eb038ea4ff59ee5a3cc42b91f2faa9ea925b6577 Mon Sep 17 00:00:00 2001 From: WasabiFan Date: Sat, 21 Nov 2015 15:57:21 -0800 Subject: [PATCH 4/7] Fix line wrapping --- src/xbot/common/logging/SafeRobotAssertionManager.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/xbot/common/logging/SafeRobotAssertionManager.java b/src/xbot/common/logging/SafeRobotAssertionManager.java index 371859d7..cbab9a62 100644 --- a/src/xbot/common/logging/SafeRobotAssertionManager.java +++ b/src/xbot/common/logging/SafeRobotAssertionManager.java @@ -16,8 +16,8 @@ public class SafeRobotAssertionManager { public void throwException(RuntimeException e) { log.error("Safe exception encountered (exception throw " + (allowExceptions ? "enabled" : "disabled") + "): " + e.getMessage()); - log.error("Stack trace: \n " + - Arrays.stream(e.getStackTrace()) + log.error("Stack trace: \n " + + Arrays.stream(e.getStackTrace()) .map(elem -> elem.toString()) .collect(Collectors.joining("\n "))); From c38f592d88219c746f1b0f2ca2dde006d8334579 Mon Sep 17 00:00:00 2001 From: WasabiFan Date: Fri, 27 Nov 2015 14:44:25 -0800 Subject: [PATCH 5/7] Remove bad newline --- tests/xbot/common/logging/SafeRobotAssertionTests.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/xbot/common/logging/SafeRobotAssertionTests.java b/tests/xbot/common/logging/SafeRobotAssertionTests.java index a2de4fdf..123e1942 100644 --- a/tests/xbot/common/logging/SafeRobotAssertionTests.java +++ b/tests/xbot/common/logging/SafeRobotAssertionTests.java @@ -14,8 +14,7 @@ public void testNoExceptionOnRobot() { assertMan.throwException(new RuntimeException("Something really bad happened (...but robots never die)")); } - @Test(expected=RuntimeException.class - ) + @Test(expected=RuntimeException.class) public void testExceptionThrownInTests() { SafeRobotAssertionManager assertMan = injector.getInstance(SafeRobotAssertionManager.class); From 6dcc4371180d539f03140a0c98c1c65a5920f32e Mon Sep 17 00:00:00 2001 From: WasabiFan Date: Sat, 19 Dec 2015 12:21:03 -0800 Subject: [PATCH 6/7] Change structure of assertion manager to rely on guice instead of flags --- src/xbot/common/command/BaseSubsystem.java | 1 - src/xbot/common/injection/RobotModule.java | 3 ++ .../logging/LoudRobotAssertionManager.java | 15 ++++++++ .../logging/RobotAssertionException.java | 7 ++++ .../common/logging/RobotAssertionManager.java | 35 +++++++++++++++++ .../logging/SafeRobotAssertionException.java | 7 ---- .../logging/SafeRobotAssertionManager.java | 38 ------------------- .../logging/SilentRobotAssertionManager.java | 15 ++++++++ tests/xbot/common/injection/BaseWPITest.java | 5 +-- .../xbot/common/injection/UnitTestModule.java | 4 ++ .../logging/SafeRobotAssertionTests.java | 14 +++---- 11 files changed, 86 insertions(+), 58 deletions(-) create mode 100644 src/xbot/common/logging/LoudRobotAssertionManager.java create mode 100644 src/xbot/common/logging/RobotAssertionException.java create mode 100644 src/xbot/common/logging/RobotAssertionManager.java delete mode 100644 src/xbot/common/logging/SafeRobotAssertionException.java delete mode 100644 src/xbot/common/logging/SafeRobotAssertionManager.java create mode 100644 src/xbot/common/logging/SilentRobotAssertionManager.java diff --git a/src/xbot/common/command/BaseSubsystem.java b/src/xbot/common/command/BaseSubsystem.java index 8754baa6..cb460790 100644 --- a/src/xbot/common/command/BaseSubsystem.java +++ b/src/xbot/common/command/BaseSubsystem.java @@ -11,7 +11,6 @@ public void setDefaultCommand(Command command) { @Override protected void initDefaultCommand() { - // TODO Auto-generated method stub } diff --git a/src/xbot/common/injection/RobotModule.java b/src/xbot/common/injection/RobotModule.java index 918db9e3..7796bc49 100644 --- a/src/xbot/common/injection/RobotModule.java +++ b/src/xbot/common/injection/RobotModule.java @@ -4,6 +4,8 @@ import xbot.common.command.SmartDashboardCommandPutter; import xbot.common.injection.wpi_factories.RealWPIFactory; import xbot.common.injection.wpi_factories.WPIFactory; +import xbot.common.logging.RobotAssertionManager; +import xbot.common.logging.SilentRobotAssertionManager; import xbot.common.properties.DatabaseStorageBase; import xbot.common.properties.ITableProxy; import xbot.common.properties.RobotDatabaseStorage; @@ -19,6 +21,7 @@ protected void configure() { this.bind(ITableProxy.class).to(SmartDashboardTableWrapper.class); this.bind(DatabaseStorageBase.class).to(RobotDatabaseStorage.class); this.bind(SmartDashboardCommandPutter.class).to(RealSmartDashboardCommandPutter.class); + this.bind(RobotAssertionManager.class).to(SilentRobotAssertionManager.class); } } diff --git a/src/xbot/common/logging/LoudRobotAssertionManager.java b/src/xbot/common/logging/LoudRobotAssertionManager.java new file mode 100644 index 00000000..02b375cb --- /dev/null +++ b/src/xbot/common/logging/LoudRobotAssertionManager.java @@ -0,0 +1,15 @@ +package xbot.common.logging; + +public class LoudRobotAssertionManager extends RobotAssertionManager { + + @Override + protected void handlePlatformException(RuntimeException e) { + throw e; + } + + @Override + public boolean isExceptionsEnabled() { + return true; + } + +} diff --git a/src/xbot/common/logging/RobotAssertionException.java b/src/xbot/common/logging/RobotAssertionException.java new file mode 100644 index 00000000..6875e67f --- /dev/null +++ b/src/xbot/common/logging/RobotAssertionException.java @@ -0,0 +1,7 @@ +package xbot.common.logging; + +public class RobotAssertionException extends RuntimeException { + public RobotAssertionException(String failureCauseCause) { + super("Assertion error: " + failureCauseCause); + } +} diff --git a/src/xbot/common/logging/RobotAssertionManager.java b/src/xbot/common/logging/RobotAssertionManager.java new file mode 100644 index 00000000..d73ff252 --- /dev/null +++ b/src/xbot/common/logging/RobotAssertionManager.java @@ -0,0 +1,35 @@ +package xbot.common.logging; + +import java.util.Arrays; +import java.util.stream.Collectors; + +import org.apache.log4j.Logger; + +public abstract class RobotAssertionManager { + static Logger log = Logger.getLogger(RobotAssertionManager.class); + + public final void throwException(RuntimeException e) { + log.error("Safe exception encountered (exception throw " + (this.isExceptionsEnabled() ? "enabled" : "disabled") + "): " + + e.getMessage()); + log.error("Stack trace: \n " + + Arrays.stream(e.getStackTrace()) + .map(elem -> elem.toString()) + .collect(Collectors.joining("\n "))); + + handlePlatformException(e); + } + + protected abstract void handlePlatformException(RuntimeException e); + + public abstract boolean isExceptionsEnabled(); + + public final void throwException(String message, Throwable cause) { + throwException(new RuntimeException(message, cause)); + } + + public final void assertTrue(boolean value, String assertionFaliureCause) { + if(!value) { + throwException(new RobotAssertionException(assertionFaliureCause)); + } + } +} diff --git a/src/xbot/common/logging/SafeRobotAssertionException.java b/src/xbot/common/logging/SafeRobotAssertionException.java deleted file mode 100644 index 9288a6aa..00000000 --- a/src/xbot/common/logging/SafeRobotAssertionException.java +++ /dev/null @@ -1,7 +0,0 @@ -package xbot.common.logging; - -public class SafeRobotAssertionException extends RuntimeException { - public SafeRobotAssertionException(String faliureCauseCause) { - super("Assertion error: " + faliureCauseCause); - } -} diff --git a/src/xbot/common/logging/SafeRobotAssertionManager.java b/src/xbot/common/logging/SafeRobotAssertionManager.java deleted file mode 100644 index cbab9a62..00000000 --- a/src/xbot/common/logging/SafeRobotAssertionManager.java +++ /dev/null @@ -1,38 +0,0 @@ -package xbot.common.logging; - -import java.util.Arrays; -import java.util.stream.Collectors; -import java.util.stream.Stream; - -import org.apache.log4j.Logger; - -import com.google.inject.Singleton; - -@Singleton -public class SafeRobotAssertionManager { - private boolean allowExceptions = false; - static Logger log = Logger.getLogger(SafeRobotAssertionManager.class); - - public void throwException(RuntimeException e) { - log.error("Safe exception encountered (exception throw " + (allowExceptions ? "enabled" : "disabled") + "): " - + e.getMessage()); - log.error("Stack trace: \n " - + Arrays.stream(e.getStackTrace()) - .map(elem -> elem.toString()) - .collect(Collectors.joining("\n "))); - - if(allowExceptions) { - throw e; - } - } - - public void assertTrue(boolean value, String assertionFaliureCause) { - if(!value) { - throwException(new SafeRobotAssertionException(assertionFaliureCause)); - } - } - - public void setExceptionsEnabled(boolean allowException) { - this.allowExceptions = allowException; - } -} diff --git a/src/xbot/common/logging/SilentRobotAssertionManager.java b/src/xbot/common/logging/SilentRobotAssertionManager.java new file mode 100644 index 00000000..b966cb4a --- /dev/null +++ b/src/xbot/common/logging/SilentRobotAssertionManager.java @@ -0,0 +1,15 @@ +package xbot.common.logging; + +public class SilentRobotAssertionManager extends RobotAssertionManager { + + @Override + protected void handlePlatformException(RuntimeException e) { + // Don't do anything: we don't need to throw + } + + @Override + public boolean isExceptionsEnabled() { + return false; + } + +} diff --git a/tests/xbot/common/injection/BaseWPITest.java b/tests/xbot/common/injection/BaseWPITest.java index 674645a9..2d79ae7d 100644 --- a/tests/xbot/common/injection/BaseWPITest.java +++ b/tests/xbot/common/injection/BaseWPITest.java @@ -8,7 +8,7 @@ import com.google.inject.Injector; import xbot.common.controls.MockRobotIO; -import xbot.common.logging.SafeRobotAssertionManager; +import xbot.common.logging.RobotAssertionManager; import xbot.common.properties.PropertyManager; import edu.wpi.first.wpilibj.HLUsageReporting; import edu.wpi.first.wpilibj.MockHLUsageReporting; @@ -39,9 +39,6 @@ public void setUp() { RobotState.SetImplementation(mockRobotState); propertyManager = injector.getInstance(PropertyManager.class); - - SafeRobotAssertionManager assertionMan = injector.getInstance(SafeRobotAssertionManager.class); - assertionMan.setExceptionsEnabled(true); DOMConfigurator.configure("lib/log4jConfig/log4j4unitTesting.xml"); } diff --git a/tests/xbot/common/injection/UnitTestModule.java b/tests/xbot/common/injection/UnitTestModule.java index fc23aed4..32301e8c 100644 --- a/tests/xbot/common/injection/UnitTestModule.java +++ b/tests/xbot/common/injection/UnitTestModule.java @@ -4,6 +4,8 @@ import xbot.common.command.SmartDashboardCommandPutter; import xbot.common.injection.wpi_factories.MockWPIFactory; import xbot.common.injection.wpi_factories.WPIFactory; +import xbot.common.logging.LoudRobotAssertionManager; +import xbot.common.logging.RobotAssertionManager; import xbot.common.properties.DatabaseStorageBase; import xbot.common.properties.ITableProxy; import xbot.common.properties.TableProxy; @@ -28,5 +30,7 @@ protected void configure() { this.bind(DatabaseStorageBase.class).to(OffRobotDatabaseStorage.class).in(Singleton.class); this.bind(SmartDashboardCommandPutter.class).to(MockSmartDashboardCommandPutter.class); + + this.bind(RobotAssertionManager.class).to(LoudRobotAssertionManager.class); } } \ No newline at end of file diff --git a/tests/xbot/common/logging/SafeRobotAssertionTests.java b/tests/xbot/common/logging/SafeRobotAssertionTests.java index 123e1942..51f54b95 100644 --- a/tests/xbot/common/logging/SafeRobotAssertionTests.java +++ b/tests/xbot/common/logging/SafeRobotAssertionTests.java @@ -8,38 +8,36 @@ public class SafeRobotAssertionTests extends BaseWPITest { @Test public void testNoExceptionOnRobot() { - SafeRobotAssertionManager assertMan = injector.getInstance(SafeRobotAssertionManager.class); - assertMan.setExceptionsEnabled(false); + RobotAssertionManager assertMan = new SilentRobotAssertionManager(); assertMan.throwException(new RuntimeException("Something really bad happened (...but robots never die)")); } @Test(expected=RuntimeException.class) public void testExceptionThrownInTests() { - SafeRobotAssertionManager assertMan = injector.getInstance(SafeRobotAssertionManager.class); + RobotAssertionManager assertMan = new LoudRobotAssertionManager(); assertMan.throwException(new RuntimeException("Something really bad happened (tests are free to die as necessary)")); } @Test public void testAssertionContinuesOnRobot() { - SafeRobotAssertionManager assertMan = injector.getInstance(SafeRobotAssertionManager.class); - assertMan.setExceptionsEnabled(false); + RobotAssertionManager assertMan = new SilentRobotAssertionManager(); assertMan.assertTrue(true, "The world is ending"); assertMan.assertTrue(false, "false != true"); } - @Test(expected=SafeRobotAssertionException.class) + @Test(expected=RobotAssertionException.class) public void testAssertionFailedInTests() { - SafeRobotAssertionManager assertMan = injector.getInstance(SafeRobotAssertionManager.class); + RobotAssertionManager assertMan = new LoudRobotAssertionManager(); assertMan.assertTrue(false, "false != true"); } @Test() public void testAssertionPassedInTests() { - SafeRobotAssertionManager assertMan = injector.getInstance(SafeRobotAssertionManager.class); + RobotAssertionManager assertMan = new LoudRobotAssertionManager(); assertMan.assertTrue(true, "The world is ending"); } From 106cdcfaa72cf1fd73ffc096789fa68d56744ba8 Mon Sep 17 00:00:00 2001 From: WasabiFan Date: Sat, 19 Dec 2015 12:31:04 -0800 Subject: [PATCH 7/7] Make checkstyle happy --- src/xbot/common/logging/RobotAssertionManager.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/xbot/common/logging/RobotAssertionManager.java b/src/xbot/common/logging/RobotAssertionManager.java index d73ff252..34a6bce8 100644 --- a/src/xbot/common/logging/RobotAssertionManager.java +++ b/src/xbot/common/logging/RobotAssertionManager.java @@ -19,13 +19,13 @@ public final void throwException(RuntimeException e) { handlePlatformException(e); } - protected abstract void handlePlatformException(RuntimeException e); - - public abstract boolean isExceptionsEnabled(); - public final void throwException(String message, Throwable cause) { throwException(new RuntimeException(message, cause)); } + + protected abstract void handlePlatformException(RuntimeException e); + + public abstract boolean isExceptionsEnabled(); public final void assertTrue(boolean value, String assertionFaliureCause) { if(!value) {