Package org.jboss.shrinkwrap.resolver.impl.maven.util

Examples of org.jboss.shrinkwrap.resolver.impl.maven.util.ValidationUtil


    public void controlWithNewAPI() {
        // This should resolve from Maven Central
        final File file = Maven.configureResolver().withClassPathResolution(false).loadPomFromFile("pom.xml").resolve("junit:junit")
            .withoutTransitivity().asSingle(File.class);
        // Ensure we get JUnit
        new ValidationUtil("junit").validate(file);
        final File localRepo = new File(FAKE_REPO);
        // Ensure we're pulling from the alternate repo we've designated above
        Assert.assertTrue(file.getAbsolutePath().contains(localRepo.getAbsolutePath()));
    }
View Full Code Here


        // Ensure we can use ClassPath resolution to get the results of the "current" build
        final PomEquippedResolveStage resolver = Maven.resolver().loadPomFromFile("pom.xml");
        File[] files = resolver.resolve("org.jboss.shrinkwrap.resolver:shrinkwrap-resolver-api-maven")
                .withTransitivity().as(File.class);
        new ValidationUtil("shrinkwrap-resolver-api", "shrinkwrap-resolver-api-maven")
                .validate(files);
    }
View Full Code Here

        // Ensure we can use ClassPath resolution to get the tests package of the "current" build
        final PomEquippedResolveStage resolver = Maven.resolver().loadPomFromFile("pom.xml");
        File file = resolver.resolve("org.jboss.shrinkwrap.resolver:shrinkwrap-resolver-api-maven:jar:tests:?")
                .withoutTransitivity().asSingle(File.class);

        new ValidationUtil("shrinkwrap-resolver-api-maven").validate(file);

        // check content of resolved jar, it should contain given class
        boolean containsTestClass = false;
        JarFile jarFile = new JarFile(file);
        Enumeration<JarEntry> entries = jarFile.entries();
View Full Code Here

        // Ensure we can use ClassPath resolution to get the tests package of the "current" build
        final PomEquippedResolveStage resolver = Maven.resolver().loadPomFromFile("pom.xml");
        File file = resolver.resolve("org.jboss.shrinkwrap.resolver:shrinkwrap-resolver-api-maven:test-jar:tests:?")
                .withoutTransitivity().asSingle(File.class);

        new ValidationUtil("shrinkwrap-resolver-api-maven").validate(file);

        // check content of resolved jar, it should contain given class
        boolean containsTestClass = false;
        JarFile jarFile = new JarFile(file);
        Enumeration<JarEntry> entries = jarFile.entries();
View Full Code Here

        final File[] jars = Maven.resolver().loadPomFromFile("target/poms/test-filter.xml")
            .importRuntimeDependencies().resolve().using(new RejectDependenciesStrategy("org.jboss.shrinkwrap.test:test-deps-c"))
            .as(File.class);

        // We should not bring in b and c, as b is transitive from c, and we excluded c above.
        new ValidationUtil("test-deps-a", "test-deps-d", "test-deps-e").validate(jars);

    }
View Full Code Here

                    // and their possible ancestors in dependency graph
                    new RejectDependenciesStrategy("org.jboss.shrinkwrap.test:test-deps-a",
                            "org.jboss.shrinkwrap.test:test-deps-c", "org.jboss.shrinkwrap.test:test-deps-d"))
            .asSingle(File.class);

        new ValidationUtil("test-deps-e").validate(jar);
    }
View Full Code Here

        final String artifactWhichShouldNotResolve = "junit:junit:3.8.2";

        // Precondition; we can resolve when connected
        final File file = Maven.configureResolver().fromFile(settingsFile).resolve(artifactWhichShouldNotResolve)
                .withTransitivity().asSingle(File.class);
        new ValidationUtil("junit-3.8.2.jar").validate(file);

        // Manually cleanup; we're gonna run a test again
        this.cleanup();

        // Now try in offline mode and ensure we cannot resolve
View Full Code Here

TOP

Related Classes of org.jboss.shrinkwrap.resolver.impl.maven.util.ValidationUtil

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.