You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2018/03/01 23:49:49 UTC
commons-testing git commit: Use default Eclipse sort order for
members and adjust package declaration.
Repository: commons-testing
Updated Branches:
refs/heads/master 1696bcfef -> 4da6b2902
Use default Eclipse sort order for members and adjust package
declaration.
Project: http://git-wip-us.apache.org/repos/asf/commons-testing/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-testing/commit/4da6b290
Tree: http://git-wip-us.apache.org/repos/asf/commons-testing/tree/4da6b290
Diff: http://git-wip-us.apache.org/repos/asf/commons-testing/diff/4da6b290
Branch: refs/heads/master
Commit: 4da6b2902984395dc2a1405c0dcce40d30ba77f7
Parents: 1696bcf
Author: Gary Gregory <ga...@gmail.com>
Authored: Thu Mar 1 16:49:46 2018 -0700
Committer: Gary Gregory <ga...@gmail.com>
Committed: Thu Mar 1 16:49:46 2018 -0700
----------------------------------------------------------------------
.../testing/junit4/SecurityManagerTestRule.java | 29 ++++++++++----------
1 file changed, 15 insertions(+), 14 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/commons-testing/blob/4da6b290/commons-testing-junit4/src/main/java/org/apache/commons/testing/junit4/SecurityManagerTestRule.java
----------------------------------------------------------------------
diff --git a/commons-testing-junit4/src/main/java/org/apache/commons/testing/junit4/SecurityManagerTestRule.java b/commons-testing-junit4/src/main/java/org/apache/commons/testing/junit4/SecurityManagerTestRule.java
index 9a600ef..effadd1 100644
--- a/commons-testing-junit4/src/main/java/org/apache/commons/testing/junit4/SecurityManagerTestRule.java
+++ b/commons-testing-junit4/src/main/java/org/apache/commons/testing/junit4/SecurityManagerTestRule.java
@@ -15,7 +15,7 @@
* limitations under the license.
*/
-package org.apache.logging.log4j.junit;
+package org.apache.commons.testing.junit4;
import org.junit.rules.TestRule;
import org.junit.runner.Description;
@@ -41,6 +41,10 @@ import org.junit.runners.model.Statement;
*/
public class SecurityManagerTestRule implements TestRule {
+ private final SecurityManager securityManager;
+
+ private SecurityManager securityManagerBefore;
+
/**
* Constructs a new instance with the given {@link SecurityManager}.
* <p>
@@ -61,22 +65,9 @@ public class SecurityManagerTestRule implements TestRule {
this.securityManager = securityManager;
}
- private SecurityManager securityManagerBefore;
- private final SecurityManager securityManager;
-
@Override
public Statement apply(final Statement base, final Description description) {
return new Statement() {
- @Override
- public void evaluate() throws Throwable {
- before();
- try {
- base.evaluate();
- } finally {
- after();
- }
- }
-
private void after() {
System.setSecurityManager(securityManagerBefore);
}
@@ -86,6 +77,16 @@ public class SecurityManagerTestRule implements TestRule {
System.setSecurityManager(securityManager);
}
+
+ @Override
+ public void evaluate() throws Throwable {
+ before();
+ try {
+ base.evaluate();
+ } finally {
+ after();
+ }
+ }
};
}