-
Notifications
You must be signed in to change notification settings - Fork 473
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test service that will be used to configure default values for te…
…st runs Sometimes the defaults that make sense for end-users do not fit well with our tests. Phantoms for instance should be off by default and only configured.
- Loading branch information
Showing
2 changed files
with
36 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
recaf-core/src/testFixtures/java/software/coley/recaf/test/TestConfigSetup.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package software.coley.recaf.test; | ||
|
||
import jakarta.enterprise.context.ApplicationScoped; | ||
import jakarta.inject.Inject; | ||
import software.coley.recaf.services.compile.JavacCompilerConfig; | ||
|
||
/** | ||
* Configures default values for the test environment. Some of our values that are best enabled by default | ||
* for users aren't the best for testing the 'base case' of things during test development. | ||
* | ||
* @author Matt Coley | ||
*/ | ||
@ApplicationScoped | ||
public class TestConfigSetup { | ||
private final JavacCompilerConfig javac; | ||
|
||
@Inject | ||
public TestConfigSetup(JavacCompilerConfig javac) { | ||
this.javac = javac; | ||
} | ||
|
||
public void configure() { | ||
// Do not generate phantoms by default when using the compiler service | ||
javac.getGeneratePhantoms().setValue(false); | ||
} | ||
} |