Permalink
Browse files

applied code formatter for FitNesse

  • Loading branch information...
1 parent d020d75 commit 364842c1046ce8cd4f7de16ba15c99863873bcdf @mgaertne mgaertne committed Mar 31, 2013
@@ -4,39 +4,40 @@
public class SystemExitSecurityManager extends SecurityManager {
- private SecurityManager delegate;
-
- public SystemExitSecurityManager(SecurityManager delegate) {
- this.delegate = delegate;
- }
-
- @Override
- public void checkExit(int status) {
- throw new SystemExitException("prevented system exit with exit code " + status);
- }
-
- @Override
- public void checkPermission(Permission perm, Object context) {
- if (delegate != null) {
- delegate.checkPermission(perm, context);
- }
- }
-
- @Override
- public void checkPermission(Permission perm) {
- if (delegate != null) {
- delegate.checkPermission(perm);
- }
- }
-
- public static class SystemExitException extends SecurityException {
-
- public SystemExitException(String message) {
- super(message);
- }
-
- private static final long serialVersionUID = 2584644457111168436L;
-
- }
+ private SecurityManager delegate;
+
+ public SystemExitSecurityManager(SecurityManager delegate) {
+ this.delegate = delegate;
+ }
+
+ @Override
+ public void checkExit(int status) {
+ throw new SystemExitException("prevented system exit with exit code "
+ + status);
+ }
+
+ @Override
+ public void checkPermission(Permission perm, Object context) {
+ if (delegate != null) {
+ delegate.checkPermission(perm, context);
+ }
+ }
+
+ @Override
+ public void checkPermission(Permission perm) {
+ if (delegate != null) {
+ delegate.checkPermission(perm);
+ }
+ }
+
+ public static class SystemExitException extends SecurityException {
+
+ public SystemExitException(String message) {
+ super(message);
+ }
+
+ private static final long serialVersionUID = 2584644457111168436L;
+
+ }
}
@@ -11,38 +11,38 @@
public class SystemExitSecurityManagerTest {
- SecurityManager oldSecurityManager;
-
- SecurityManager securityManager;
-
- @Before
- public void setup() {
- oldSecurityManager = System.getSecurityManager();
- securityManager = new SystemExitSecurityManager(oldSecurityManager);
- System.setSecurityManager(securityManager);
- }
-
- @After
- public void teardown() {
- System.setSecurityManager(oldSecurityManager);
- }
-
- @Test
- public void shouldThrowExceptionWhenSystemExitIsCalled() {
- try {
- System.exit(0);
- fail("should have thrown exception");
- } catch (SystemExitException e) {
- }
- }
-
- @Test
- public void shouldIncludeExitCode() {
- try {
- System.exit(42);
- fail("should have thrown exception");
- } catch (SystemExitException e) {
- assertMatches("system exit with exit code 42", e.getMessage());
- }
- }
+ SecurityManager oldSecurityManager;
+
+ SecurityManager securityManager;
+
+ @Before
+ public void setup() {
+ oldSecurityManager = System.getSecurityManager();
+ securityManager = new SystemExitSecurityManager(oldSecurityManager);
+ System.setSecurityManager(securityManager);
+ }
+
+ @After
+ public void teardown() {
+ System.setSecurityManager(oldSecurityManager);
+ }
+
+ @Test
+ public void shouldThrowExceptionWhenSystemExitIsCalled() {
+ try {
+ System.exit(0);
+ fail("should have thrown exception");
+ } catch (SystemExitException e) {
+ }
+ }
+
+ @Test
+ public void shouldIncludeExitCode() {
+ try {
+ System.exit(42);
+ fail("should have thrown exception");
+ } catch (SystemExitException e) {
+ assertMatches("system exit with exit code 42", e.getMessage());
+ }
+ }
}

0 comments on commit 364842c

Please sign in to comment.