Package org.rioproject.resolver.aether

Examples of org.rioproject.resolver.aether.AetherResolver$ResolvingRequestTask


        Util.verifyAndInstall();
    }

    @Test
    public void resolveWithoutTestDependenciesIncluded() throws ResolverException {
        AetherResolver r = new AetherResolver();
        String[] cp = r.getClassPathFor("org.rioproject.resolver.test.project:project-service:2.0");
        Assert.assertTrue("We should have 2 items in the classpath, we got: " + cp.length, cp.length == 2);
    }
View Full Code Here


    public void testJskLibResolution() throws ResolverException {
        File testRepo;
        Throwable thrown = null;
        try {
            Utils.writeLocalM2RepoSettings();
            Resolver r = new AetherResolver();
            testRepo = Repository.getLocalRepository();
            if(testRepo.exists())
                FileUtils.remove(testRepo);
            String[] classPath = r.getClassPathFor("net.jini:jsk-lib:2.1");
            Assert.assertTrue("classPath for net.jini:jsk-lib:2.1 expected to be > 1, actual="+classPath.length,
                              classPath.length>0);
            File jskPlatformJar = new File(testRepo, "net/jini/jsk-lib/2.1/jsk-lib-2.1.jar");
            Assert.assertTrue(jskPlatformJar.exists());
            StringBuilder sb = new StringBuilder();
View Full Code Here

        try {
            Utils.writeLocalM2RepoSettings();
            testRepo = Repository.getLocalRepository();
            if(testRepo.exists())
                FileUtils.remove(testRepo);
            Resolver r = new AetherResolver();
            URL loc = r.getLocation("org.codehaus.groovy:groovy-all:1.6.2", null);
            Assert.assertNotNull(loc);
            File groovyJar = new File(testRepo, "org/codehaus/groovy/groovy-all/1.6.2/groovy-all-1.6.2.jar");
            Assert.assertTrue(groovyJar.exists());
        } finally {
            Assert.assertNull(thrown);
View Full Code Here

        File testRepo;
        Utils.writeLocalM2RepoSettings();
        testRepo = Repository.getLocalRepository();
        if(testRepo.exists())
            FileUtils.remove(testRepo);
        Resolver r = new AetherResolver();
        List<String> cp = getClassPathFor("com.sun.jini:outrigger:jar:dl:2.1", r);
        Assert.assertTrue(cp.size()==1);
    }
View Full Code Here

        System.out.println("INCLUDE:\n"+Utils.formatClassPath(classPath)+"\n");
    }

    private String[] getClassPath() throws ResolverException, IOException {
        File testRepo;
        Resolver r = new AetherResolver();
        testRepo = Repository.getLocalRepository();

        File srcParentPom = new File("src/test/resources/events-2.0.pom");
        Assert.assertTrue(srcParentPom.exists());

        File parentDir = new File(testRepo, "org/rioproject/examples/events/2.0");
        if(!parentDir.exists()) {
            if(parentDir.mkdirs())
                System.out.println("Created "+parentDir.getAbsolutePath());
        }
        File parentPom = new File(parentDir, "events-2.0.pom");
        if(!parentPom.exists()) {
            FileUtils.copy(srcParentPom, parentPom);
        }
        Assert.assertTrue("The events-2.0.pom should be in "+parentPom.getAbsolutePath(), parentPom.exists());

        File srcPom = new File("src/test/resources/events-api-2.0.pom");
        Assert.assertTrue(srcPom.exists());
        File srcJar = new File("src/test/resources/events-api-2.0.jar");
        Assert.assertTrue(srcJar.exists());

        File artifactDir = new File(testRepo, "org/rioproject/examples/events/events-api/2.0");
        if(!artifactDir.exists()) {
            if(artifactDir.mkdirs())
                System.out.println("Created "+artifactDir.getAbsolutePath());
        }
        File pomArtifact = new File(artifactDir, "events-api-2.0.pom");
        if(!pomArtifact.exists()) {
            FileUtils.copy(srcPom, pomArtifact);
        }
        Assert.assertTrue("The events-api-2.0.pom should be in "+pomArtifact.getAbsolutePath(), pomArtifact.exists());

        File jarArtifact = new File(artifactDir, "events-api-2.0.jar");
        if(!jarArtifact.exists()) {
            FileUtils.copy(srcJar, jarArtifact);
        }
        Assert.assertTrue("The events-api-2.0.jar should be in "+jarArtifact.getAbsolutePath(), jarArtifact.exists());

        return r.getClassPathFor("org.rioproject.examples.events:events-api:2.0");
    }
View Full Code Here

*/
public class ITResolverConcurrencyTest {

    @Test
    public void testConcurrentAccess() throws ExecutionException, InterruptedException {
        Resolver r = new AetherResolver();
        ExecutorService resolverExecutor = Executors.newCachedThreadPool();
        System.out.println("Create 100 threads");
        long t0 = System.currentTimeMillis();
        List<Future<String[]>> futures = new ArrayList<Future<String[]>>();
        for(int i=0; i<100; i++) {
View Full Code Here

        System.out.println("Complete, took "+(t1-t0)+" millis");
    }

    @Test
    public void testConcurrentAccess2() throws ExecutionException, InterruptedException {
        Resolver r = new AetherResolver();
        ExecutorService resolverExecutor = Executors.newCachedThreadPool();
        System.out.println("Create 100 threads");
        long t0 = System.currentTimeMillis();
        List<Future<String[]>> futures = new ArrayList<Future<String[]>>();
        RemoteRepository repository = new RemoteRepository();
View Full Code Here

TOP

Related Classes of org.rioproject.resolver.aether.AetherResolver$ResolvingRequestTask

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.