* @author Dennis Reedy
*/
public class ResolverRepositoryTest {
@Test
public void testGetSetRepositories() {
RemoteRepository r1 = create("R1");
RemoteRepository r2 = create("R2");
AetherResolver ar = new AetherResolver();
List<org.eclipse.aether.repository.RemoteRepository> transformed =
ar.transformRemoteRepository(new RemoteRepository[]{r1, r2});
for(org.eclipse.aether.repository.RemoteRepository r : transformed) {
RepositoryPolicy snapShotPolicy = r.getPolicy(true);
RepositoryPolicy releasePolicy = r.getPolicy(false);
assertTrue(snapShotPolicy.getChecksumPolicy().equals(RemoteRepository.CHECKSUM_POLICY_IGNORE));
assertTrue(snapShotPolicy.getUpdatePolicy().equals(RemoteRepository.UPDATE_POLICY_ALWAYS));
assertTrue(releasePolicy.getChecksumPolicy().equals(RemoteRepository.CHECKSUM_POLICY_IGNORE));
assertTrue(releasePolicy.getUpdatePolicy().equals(RemoteRepository.UPDATE_POLICY_ALWAYS));
}
for(org.eclipse.aether.repository.RemoteRepository r : transformed) {
RemoteRepository rr = ar.transformAetherRemoteRepository(r);
assertTrue(rr.getSnapshotChecksumPolicy().equals(RemoteRepository.CHECKSUM_POLICY_IGNORE));
assertTrue(rr.getSnapshotUpdatePolicy().equals(RemoteRepository.UPDATE_POLICY_ALWAYS));
assertTrue(rr.getReleaseChecksumPolicy().equals(RemoteRepository.CHECKSUM_POLICY_IGNORE));
assertTrue(rr.getReleaseUpdatePolicy().equals(RemoteRepository.UPDATE_POLICY_ALWAYS));
}
}