File tree Expand file tree Collapse file tree 2 files changed +25
-8
lines changed
src/main/java/com/nordstrom/automation/junit Expand file tree Collapse file tree 2 files changed +25
-8
lines changed Original file line number Diff line number Diff line change @@ -24,13 +24,28 @@ public class JUnitConfig extends SettingsCore<JUnitConfig.JUnitSettings> {
2424 * the {@code junit.properties} file and System property declarations.
2525 */
2626 public enum JUnitSettings implements SettingsCore .SettingsAPI {
27- /** name: <b>junit.rule.chain.list</b> <br> default: {@code rulesStartingWithInnerMost} */
28- RULE_CHAIN_LIST ("junit.rule.chain.list" , "rulesStartingWithInnerMost" ),
29- /** name: <b>junit.timeout.test</b> <br> default: {@code null} */
27+ /**
28+ * Global per-test timeout interval in milliseconds.
29+ * <p>
30+ * name: <b>junit.timeout.test</b><br>
31+ * default: {@code null}
32+ */
3033 TEST_TIMEOUT ("junit.timeout.test" , null ),
31- /** name: <b>junit.timeout.rule</b> <br> default: {@code null} */
34+
35+ /**
36+ * Global per-class timeout interval in milliseconds.
37+ * <p>
38+ * name: <b>junit.timeout.rule</b><br>
39+ * default: {@code null}
40+ */
3241 TIMEOUT_RULE ("junit.timeout.rule" , null ),
33- /** name: <b>junit.max.retry</b> <br> default: <b>0</b> */
42+
43+ /**
44+ * Maximum retry attempts for failed test methods.
45+ * <p>
46+ * name: <b>junit.max.retry</b><br>
47+ * default: <b>0</b>
48+ */
3449 MAX_RETRY ("junit.max.retry" , "0" );
3550
3651 private String propertyName ;
Original file line number Diff line number Diff line change 77import org .junit .rules .TestRule ;
88
99import com .google .common .base .Optional ;
10- import com .nordstrom .automation .junit .JUnitConfig .JUnitSettings ;
1110import com .nordstrom .common .base .UncheckedThrow ;
1211
1312/**
1413 * This is a static utility class that uses reflection to access the list of {@link TestRule} objects inside a
1514 * {@link RuleChain}.
15+ *
16+ * @deprecated Use the <a href='https://junit.org/junit4/javadoc/4.13.1/org/junit/Rule.html#order()'>order</a>
17+ * parameter of the {@literal @}Rule annotation instead of {@link RuleChain}.
1618 */
19+ @ Deprecated
1720public class RuleChainWalker {
1821
1922 private RuleChainWalker () {
@@ -48,8 +51,7 @@ public static <T extends TestRule> Optional<T> getAttachedRule(RuleChain ruleCha
4851 private static List <TestRule > getRuleList (RuleChain ruleChain ) {
4952 Field ruleChainList ;
5053 try {
51- String fieldName = JUnitConfig .getConfig ().getString (JUnitSettings .RULE_CHAIN_LIST .key ());
52- ruleChainList = RuleChain .class .getDeclaredField (fieldName );
54+ ruleChainList = RuleChain .class .getDeclaredField ("rulesStartingWithInnerMost" );
5355 ruleChainList .setAccessible (true );
5456 return (List <TestRule >) ruleChainList .get (ruleChain );
5557 } catch (NoSuchFieldException | SecurityException | IllegalArgumentException | IllegalAccessException e ) {
You can’t perform that action at this time.
0 commit comments