Gradle tests: fix assertion of unresolved entry url

This commit is contained in:
Vladislav.Soroka
2017-11-22 18:11:53 +03:00
parent e58fbe99fa
commit b62c5e6d88
@@ -454,7 +454,7 @@ public class GradleDependenciesImportingTest extends GradleImportingTestCase {
assertEquals(DependencyScope.COMPILE, unresolvableEntry.getScope());
String[] unresolvableEntryUrls = unresolvableEntry.getUrls(OrderRootType.CLASSES);
assertEquals(1, unresolvableEntryUrls.length);
assertTrue(unresolvableEntryUrls[0].contains("Could not find some:unresolvable-lib:0.1"));
assertUnresolvedEntryUrl(unresolvableEntryUrls[0], "some:unresolvable-lib:0.1");
assertModuleLibDep("project_test", depName, depJar.getUrl());
assertModuleLibDepScope("project_test", depName, DependencyScope.COMPILE);
@@ -484,6 +484,10 @@ public class GradleDependenciesImportingTest extends GradleImportingTestCase {
}
}
private static void assertUnresolvedEntryUrl(String entryUrl, String artifactNotation) {
assertTrue(entryUrl.contains("Could not find " + artifactNotation) || entryUrl.contains("Could not resolve " + artifactNotation));
}
@Test
public void testSourceSetOutputDirsAsRuntimeDependencies() throws Exception {
importProject(
@@ -1243,7 +1247,7 @@ public class GradleDependenciesImportingTest extends GradleImportingTestCase {
assertModuleLibDepScope("project2_test", "Gradle: org.hamcrest:hamcrest-core:1.3", DependencyScope.COMPILE);
}
@TargetVersions("2.0+")
@TargetVersions("2.5+")
@Test
public void testJavadocAndSourcesForDependencyWithMultipleArtifacts() throws Exception {
createProjectSubFile("repo/depGroup/depArtifact/1.0-SNAPSHOT/ivy-1.0-SNAPSHOT.xml",