Skip to content

Commit

Permalink
hamcrest 1.x vs 2.x package naming conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
keturn committed May 9, 2020
1 parent 33c4fae commit efee219
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
8 changes: 8 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -149,11 +149,19 @@ dependencies {
configurations.named("testRuntimeClasspath") {
gradlegoo.prefers(getResolutionStrategy(), "logging", "jcl-api-capability", "jcl-over-slf4j", "jcl should prefer slf4j when available")
gradlegoo.prefers(getResolutionStrategy(), "logging", "slf4j-impl-capability", "spf4j-slf4j-test", "tests use slf4j-test")

// old hamcrest versions exist only to spite us
// http://hamcrest.org/JavaHamcrest/distributables#upgrading-from-hamcrest-1x
exclude group: "org.hamcrest", module: "hamcrest-core"
exclude group: "org.hamcrest", module: "hamcrest-library"
}

configurations.named("testCompileClasspath") {
gradlegoo.prefers(getResolutionStrategy(), "logging", "jcl-api-capability", "jcl-over-slf4j", "jcl should prefer slf4j when available")
gradlegoo.prefers(getResolutionStrategy(), "logging", "slf4j-impl-capability", "spf4j-slf4j-test", "tests use slf4j-test")

exclude group: "org.hamcrest", module: "hamcrest-core"
exclude group: "org.hamcrest", module: "hamcrest-library"
}

// Set the expected module Java level (can use a higher Java to run, but should not use features from a higher Java)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
import static com.google.common.util.concurrent.Futures.allAsList;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.allOf;
import static org.hamcrest.Matchers.containsStringIgnoringCase;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.describedAs;
import static org.hamcrest.Matchers.empty;
import static org.hamcrest.Matchers.equalTo;
Expand Down Expand Up @@ -95,7 +95,6 @@ void tearDown() throws InterruptedException {
assertThat(executor.shutdownNow(), empty());
executor.awaitTermination(100, TimeUnit.MILLISECONDS);
assertTrue(executor.isTerminated());
assertTrue(gameTask.isDone());
}

@Test
Expand Down Expand Up @@ -181,7 +180,7 @@ public void testExeNotFound() {
var cause = exc.getCause();
assertThat(cause, allOf(
instanceOf(IOException.class),
hasToString(containsStringIgnoringCase("no such file"))
hasToString(containsString("No such file"))
));
}

Expand Down

0 comments on commit efee219

Please sign in to comment.