-
Notifications
You must be signed in to change notification settings - Fork 299
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
JUnit 5 support now allows instance fields of all types of visibility…
… as well. Issue: #77 Signed-off-by: Peter Gafert <peter.gafert@tngtech.com>
- Loading branch information
1 parent
69fa562
commit 4e2e210
Showing
11 changed files
with
190 additions
and
91 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
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
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
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
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
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
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
20 changes: 20 additions & 0 deletions
20
...5/engine/src/test/java/com/tngtech/archunit/junit/testexamples/ClassWithPrivateTests.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,20 @@ | ||
package com.tngtech.archunit.junit.testexamples; | ||
|
||
import com.tngtech.archunit.core.domain.JavaClasses; | ||
import com.tngtech.archunit.junit.AnalyzeClasses; | ||
import com.tngtech.archunit.junit.ArchTest; | ||
import com.tngtech.archunit.lang.ArchRule; | ||
|
||
@AnalyzeClasses(packages = "some.dummy.package") | ||
public class ClassWithPrivateTests { | ||
@ArchTest | ||
private final ArchRule privateRuleField = RuleThatFails.on(UnwantedClass.CLASS_VIOLATING_RULES); | ||
|
||
@ArchTest | ||
private void privateRuleMethod(JavaClasses classes) { | ||
RuleThatFails.on(UnwantedClass.CLASS_VIOLATING_RULES).check(classes); | ||
} | ||
|
||
public static final String PRIVATE_RULE_FIELD_NAME = "privateRuleField"; | ||
public static final String PRIVATE_RULE_METHOD_NAME = "privateRuleMethod"; | ||
} |
20 changes: 20 additions & 0 deletions
20
...engine/src/test/java/com/tngtech/archunit/junit/testexamples/LibraryWithPrivateTests.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,20 @@ | ||
package com.tngtech.archunit.junit.testexamples; | ||
|
||
import com.tngtech.archunit.junit.AnalyzeClasses; | ||
import com.tngtech.archunit.junit.ArchRules; | ||
import com.tngtech.archunit.junit.ArchTest; | ||
|
||
@AnalyzeClasses(packages = "some.dummy.package") | ||
public class LibraryWithPrivateTests { | ||
@ArchTest | ||
private final ArchRules privateRulesField = ArchRules.in(SubRules.class); | ||
|
||
public static final String PRIVATE_RULES_FIELD_NAME = "privateRulesField"; | ||
|
||
public static class SubRules { | ||
@ArchTest | ||
private final ArchRules privateRulesField = ArchRules.in(ClassWithPrivateTests.class); | ||
|
||
public static final String PRIVATE_RULES_FIELD_NAME = "privateRulesField"; | ||
} | ||
} |
Oops, something went wrong.