-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/issue 641 filtering env props #2
base: feature/issue-641-tooling-tests
Are you sure you want to change the base?
Feature/issue 641 filtering env props #2
Conversation
Signed-off-by: Krzysztof Sierszeń <krzysztof.sierszen@digitalnewagency.com>
Signed-off-by: Krzysztof Sierszeń <krzysztof.sierszen@digitalnewagency.com>
Signed-off-by: Krzysztof Sierszeń <krzysztof.sierszen@digitalnewagency.com>
Signed-off-by: Krzysztof Sierszeń <krzysztof.sierszen@digitalnewagency.com>
5547f57
to
7429227
Compare
@@ -62,7 +68,3 @@ def configureDependencies = { deps -> | |||
} | |||
} | |||
this.with project(':archunit-junit').configureJUnitArchive(configureDependencies) | |||
|
|||
singlePackageExport { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure what to do about this one (should I just move everything from internal/filtering
to internal
? If the other PRs are merged there will be a lot more filtering stuff)
String escaped = SPECIAL_REGEX_CHARS.matcher(pattern).replaceAll(ESCAPED_INPUT); | ||
escaped = MULTIPLE_ESCAPED_ASTERISK.matcher(escaped).replaceAll(SINGLE_ESCAPED_ASTERISK_STRING); | ||
escaped = SINGLE_ESCAPED_ASTERISK.matcher(escaped).replaceAll(MATCH_ALL_CHARACTERS); | ||
return Pattern.compile("(?:^|\\.)" + escaped + "$", Pattern.CASE_INSENSITIVE | Pattern.UNICODE_CASE); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wasn't sure about case sensitivity, please make a decision
(in case any explanation is needed for the (?:^|\\.)
bit, ^
is supposed to match FQ names, while \\.
is supposed to match simple names - i.e. match must start at a dot, presumably where the package name ends)
private static class SelectorMatcher { | ||
|
||
private static final String SINGLE_ESCAPED_ASTERISK_STRING = "\\\\*"; | ||
private static final Pattern MULTIPLE_ESCAPED_ASTERISK = Pattern.compile("(\\\\\\*)+"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried using Pattern.LITERAL
to make those patterns a bit more readable, but I couldn't make it right
|
||
import static com.tngtech.archunit.lang.syntax.ArchRuleDefinition.classes; | ||
|
||
public class AnotherClass { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These must exist in order for FieldSource.from
and FieldSelector.selectField
not to throw an exception
.filters() | ||
.build(); | ||
private org.junit.platform.engine.TestEngine[] manuallyLoadCorrectTestEngines(TestFile testFile) { | ||
List<String> engineIds = engineResolver.resolveJUnitEngines(testFile); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same configuration problem as with the other cases - Vintage and ArchUnit cannot be used simultaneously
void shouldOnlyExecuteSelectedTests(TestEngine engine, Class<?> fixture) throws Exception { | ||
assumeTrue(engine instanceof JUnitJupiterEngine); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only one supported for now, of course
Signed-off-by: Krzysztof Sierszeń <krzysztof.sierszen@digitalnewagency.com>
Signed-off-by: Krzysztof Sierszeń <krzysztof.sierszen@digitalnewagency.com>
c3c4f39
to
d064bc2
Compare
Signed-off-by: Krzysztof Sierszeń <krzysztof.sierszen@digitalnewagency.com>
Signed-off-by: Krzysztof Sierszeń <krzysztof.sierszen@digitalnewagency.com>
Signed-off-by: Krzysztof Sierszeń <krzysztof.sierszen@digitalnewagency.com>
No description provided.