use of org.commonjava.maven.atlas.ident.ref.SimpleProjectVersionRef in project galley by Commonjava.
the class VersionResolverImplTest method resolveSnapshot_Latest_TwoLocationList_TwoSingletonSnapshotList_LatestVersionStrategy.
@Test
public void resolveSnapshot_Latest_TwoLocationList_TwoSingletonSnapshotList_LatestVersionStrategy() throws Exception {
final String testResource = "2-snapshots-2-locations/maven-metadata-1.xml";
final String testResource2 = "2-snapshots-2-locations/maven-metadata-2.xml";
final ProjectVersionRef ref = new SimpleProjectVersionRef("org.group2", "artifact", "1.0-SNAPSHOT");
final String path = fixture.snapshotMetadataPath(ref);
fixture.getTransport().registerDownload(new ConcreteResource(LOCATION, path), new TestDownload(ROOT + testResource));
fixture.getTransport().registerDownload(new ConcreteResource(LOCATION2, path), new TestDownload(ROOT + testResource2));
final ProjectVersionRef result = fixture.getVersionResolver().resolveLatestVariableVersion(TWO_LOCATIONS, ref, LatestVersionSelectionStrategy.INSTANCE, new EventMetadata());
assertThat(result, notNullValue());
// newest snapshot is in the SECOND location.
assertThat(result.getVersionString(), equalTo("1.0-20140604.102909-1"));
}
Aggregations