|
59 | 59 | */ |
60 | 60 | public class TestGenerator { |
61 | 61 | private static final Logger logger = LoggerFactory.getLogger(TestGenerator.class); |
62 | | - private static final boolean SHOULD_PREPROCESS_RULES; |
63 | 62 |
|
64 | | - static { |
65 | | - // Allow overriding via system property, default to true |
66 | | - SHOULD_PREPROCESS_RULES = Boolean.parseBoolean(System.getProperty("jpwise.preprocessRules", "true")); |
67 | | - } |
68 | | - |
69 | | - private final TestInput input; // The effective TestInput after potential preprocessing |
| 63 | + private final TestInput input; // The effective TestInput after preprocessing |
70 | 64 | private final List<TestParameter> parameters; // Derived from the effective input |
71 | 65 | private CombinationTable result; // Holds the generated combinations |
72 | 66 | private final RulePreprocessor rulePreprocessor; |
73 | 67 |
|
74 | 68 | /** |
75 | 69 | * Initializes a new TestGenerator with the provided test input. |
76 | | - * If rule preprocessing is enabled (default), a new preprocessed TestInput will |
77 | | - * be used internally. |
| 70 | + * A new preprocessed TestInput will be used internally. |
78 | 71 | * |
79 | 72 | * @param initialInput The initial TestInput. |
80 | 73 | */ |
81 | 74 | public TestGenerator(TestInput initialInput) { |
82 | 75 | Objects.requireNonNull(initialInput, "Initial TestInput cannot be null"); |
83 | 76 |
|
84 | | - if (SHOULD_PREPROCESS_RULES) { |
85 | | - logger.info("Rule preprocessing is enabled. Preprocessing initial input."); |
86 | | - this.rulePreprocessor = new RulePreprocessor(); |
87 | | - this.input = this.rulePreprocessor.preprocess(initialInput); |
88 | | - } else { |
89 | | - logger.info("Rule preprocessing is disabled. Using initial input as is."); |
90 | | - // We could do 'this.input = new TestInput(initialInput);' for a defensive copy, |
91 | | - // but if initialInput is not modified elsewhere, direct assignment is fine. |
92 | | - this.rulePreprocessor = null; |
93 | | - this.input = initialInput; |
94 | | - } |
| 77 | + logger.info("Rule preprocessing is enabled by default. Preprocessing initial input."); |
| 78 | + this.rulePreprocessor = new RulePreprocessor(); |
| 79 | + this.input = this.rulePreprocessor.preprocess(initialInput); |
95 | 80 |
|
96 | 81 | this.parameters = this.input.getTestParameters(); |
97 | 82 | if (this.parameters.isEmpty()) { |
|
0 commit comments