Better Javadocs.
@@ -22,18 +22,42 @@ import org.junit.runner.Description;
import org.junit.runners.model.Statement;
/**
- * Sets a security manager for a test run. The current security manager is first
- * saved then restored after the test is run.
+ * Sets a security manager for a test run. The current security manager is first saved then restored after the test is
+ * run.
* <p>
- * Using a security manager can mess up other tests so this is best used from
- * integration tests (classes that end in "IT" instead of "Test" and
- * "TestCase".)
+ * Using a security manager can mess up other tests so this is best used from integration tests (classes that end in
+ * "IT" instead of "Test" and "TestCase".)
* </p>
*
+ * <p>
+ * When this test rule is evaluated, it will:
+ * </p>
+ * <ol>
+ * <li>Save the current SecurityManager.</li>
+ * <li>Set the SecurityManager to the instance supplied to this rule.</li>
+ * <li>Evaluate the test statement.</li>
+ * <li>Reset the current SecurityManager to the one from step (1).</li>
+ * </ol>
+ *
* @since 2.11.0
*/
public class SecurityManagerTestRule implements TestRule {
+ /**
+ * Constructs a new instance with the given {@link SecurityManager}.
+ * <p>
+ * When this test rule is evaluated, it will:
+ * </p>
+ * <ol>
+ * <li>Save the current SecurityManager.</li>
+ * <li>Set the SecurityManager to the instance supplied to this rule.</li>
+ * <li>Evaluate the test statement.</li>
+ * <li>Reset the current SecurityManager to the one from step (1).</li>
+ * </ol>
+ *
+ * @param securityManager
+ * the {@link SecurityManager} to use while running a test.
+ */
public SecurityManagerTestRule(final SecurityManager securityManager) {
super();
this.securityManager = securityManager;
