Initialize DependencyResolutionContext with default dependency mgmt

In the absence of a @GrabMetadata annotation,
DependencyResolutionContext provided no dependency management. This
was leading to incorrect dependency versions being pulled in. This
commit intializes the context with default dependency management that
will be replaced should @GrabMetadata be encountered.

Fixes #1021
This commit is contained in:
Andy Wilkinson
2014-06-03 15:57:36 +01:00
parent 0def7644c2
commit 156dadaebe
4 changed files with 28 additions and 7 deletions

View File

@@ -25,8 +25,9 @@ import static org.junit.Assert.assertThat;
/**
* Integration tests to exercise and reproduce specific issues.
*
*
* @author Phillip Webb
* @author Andy Wilkinson
*/
public class ReproIntegrationTests {
@@ -58,6 +59,12 @@ public class ReproIntegrationTests {
containsString("{\"message\":\"Hello World\"}"));
}
@Test
public void dataJpaDependencies() throws Exception {
this.cli.run("data-jpa.groovy");
assertThat(this.cli.getOutput(), containsString("Hello World"));
}
@Test
public void jarFileExtensionNeeded() throws Exception {
this.thrown.expect(IllegalStateException.class);

View File

@@ -45,7 +45,7 @@ public class AetherGrapeEngineTests {
private final AetherGrapeEngine grapeEngine = AetherGrapeEngineFactory.create(
this.groovyClassLoader, Arrays.asList(new RepositoryConfiguration("central",
URI.create("http://repo1.maven.org/maven2"), false)),
new DependencyResolutionContext());
new DependencyResolutionContext());
@Test
public void dependencyResolution() {
@@ -54,7 +54,7 @@ public class AetherGrapeEngineTests {
this.grapeEngine.grab(args,
createDependency("org.springframework", "spring-jdbc", "3.2.4.RELEASE"));
assertEquals(6, this.groovyClassLoader.getURLs().length);
assertEquals(5, this.groovyClassLoader.getURLs().length);
}
@Test
@@ -76,7 +76,7 @@ public class AetherGrapeEngineTests {
createDependency("org.springframework", "spring-jdbc", "3.2.4.RELEASE"),
createDependency("org.springframework", "spring-beans", "3.2.4.RELEASE"));
assertEquals(4, this.groovyClassLoader.getURLs().length);
assertEquals(3, this.groovyClassLoader.getURLs().length);
}
@Test
@@ -101,7 +101,7 @@ public class AetherGrapeEngineTests {
createDependency("org.springframework", "spring-jdbc", "3.2.4.RELEASE"));
assertEquals(0, this.groovyClassLoader.getURLs().length);
assertEquals(6, customClassLoader.getURLs().length);
assertEquals(5, customClassLoader.getURLs().length);
}
@Test