Package org.rioproject.resolver

Examples of org.rioproject.resolver.RemoteRepository


* @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));
        }

    }
View Full Code Here


        }

    }

    RemoteRepository create(String id) {
        RemoteRepository r = new RemoteRepository();
        r.setId(id);
        r.setUrl(System.getProperty(Constants.CODESERVER));
        r.setSnapshotChecksumPolicy(RemoteRepository.CHECKSUM_POLICY_IGNORE);
        r.setReleaseChecksumPolicy(RemoteRepository.CHECKSUM_POLICY_IGNORE);
        r.setReleaseUpdatePolicy(RemoteRepository.UPDATE_POLICY_ALWAYS);
        r.setSnapshotUpdatePolicy(RemoteRepository.UPDATE_POLICY_ALWAYS);
        return r;
    }
View Full Code Here

        List<String> classPath = new ArrayList<String>();
        for (ArtifactResult artifactResult : result.getArtifactResults()) {
            classPath.add(artifactResult.getArtifact().getFile().getAbsolutePath());
            ArtifactRepository r = artifactResult.getRepository();
            if(r instanceof org.eclipse.aether.repository.RemoteRepository) {
                RemoteRepository rr = transformAetherRemoteRepository((org.eclipse.aether.repository.RemoteRepository)r);
                if(!cachedRemoteRepositories.contains(rr))
                    cachedRemoteRepositories.add(rr);
            }

        }
View Full Code Here

            newLine = "\n";
        logger.debug(String.format("Artifact resolution for %s:%s", result.getArtifact(), newLine+resolvedList.toString()));
    }

    protected RemoteRepository transformAetherRemoteRepository(org.eclipse.aether.repository.RemoteRepository r) {
        RemoteRepository rr = new RemoteRepository();
        rr.setId(r.getId());
        rr.setUrl(r.getUrl());
        rr.setReleaseChecksumPolicy(r.getPolicy(false).getChecksumPolicy());
        rr.setReleaseUpdatePolicy(r.getPolicy(false).getUpdatePolicy());
        rr.setSnapshotChecksumPolicy(r.getPolicy(true).getChecksumPolicy());
        rr.setSnapshotUpdatePolicy(r.getPolicy(true).getUpdatePolicy());
        rr.setReleases(r.getPolicy(true).isEnabled());
        rr.setSnapshots(r.getPolicy(false).isEnabled());
        return rr;
    }
View Full Code Here

        RemoteRepository[] repositories = deploymentVerifier.mergeRepositories(r1, r2);
        Assert.assertTrue(repositories.length==3);
    }

    private RemoteRepository createRR(String url, String id, String name) {
        RemoteRepository rr = new RemoteRepository();
        rr.setId(id);
        rr.setName(name);
        rr.setUrl(url);
        return rr;
    }
View Full Code Here

                    url = subParts[0];
                    id = subParts[1];
                } else {
                    url = subParts[0];
                }
                RemoteRepository r = new RemoteRepository();
                r.setUrl(url);
                r.setId(id);
                repositories.add(r);
            }
        }
        artifact = pathToUse.replaceAll("/", ":");
    }
View Full Code Here

                    }
                    if(deployOptions.repositories!=null) {
                        String[] parts = deployOptions.repositories.split(";");
                        List<RemoteRepository> remoteRepositories = new ArrayList<RemoteRepository>();
                        for(String part : parts) {
                            RemoteRepository r = new RemoteRepository();
                            r.setUrl(part);
                            remoteRepositories.add(r);
                        }
                        for(ServiceElement service : deploy.getServices()) {
                            service.setRemoteRepositories(remoteRepositories);
                        }
View Full Code Here

TOP

Related Classes of org.rioproject.resolver.RemoteRepository

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.