Examples of MavenInstallation


Examples of hudson.tasks.Maven.MavenInstallation

        assertEquals("not only one module", 1, m.getModules().size());
    }   
   
    @Bug(8573)
    public void testBuildTimeStampProperty() throws Exception {
        MavenInstallation mavenInstallation = configureMaven3();
        MavenModuleSet m = createMavenProject();
        m.setMaven( mavenInstallation.getName() );
        m.getReporters().add(new TestReporter());
        m.setScm(new ExtractResourceSCM(getClass().getResource("JENKINS-8573.zip")));
        m.setGoals( "process-resources" );
        buildAndAssertSuccess(m);
        String content = m.getLastBuild().getWorkspace().child( "target/classes/test.txt" ).readToString();
View Full Code Here

Examples of hudson.tasks.Maven.MavenInstallation

        assertFalse( content.contains( "${maven.build.timestamp}") );
    }

    @Bug(1557)
    public void testDuplicateTestResults() throws Exception {
        MavenInstallation mavenInstallation = configureMaven3();
        MavenModuleSet m = createMavenProject();
        m.setMaven( mavenInstallation.getName() );
        m.getReporters().add(new TestReporter());
        m.setScm(new ExtractResourceSCM(getClass().getResource("JENKINS-1557.zip")));
        m.setGoals("verify");
        buildAndAssertSuccess(m);
View Full Code Here

Examples of hudson.tasks.Maven.MavenInstallation

        assertEquals(4, totalCount);
    }

    @Bug(9326)
    public void testTychoTestResults() throws Exception {
        MavenInstallation mavenInstallation = configureMaven3();
        MavenModuleSet m = createMavenProject();
        m.setRootPOM( "org.foobar.build/pom.xml" );
        m.setMaven( mavenInstallation.getName() );
        m.getReporters().add(new TestReporter());
        m.setScm(new ExtractResourceSCM(getClass().getResource("JENKINS-9326.zip"),"foobar"));
        m.setGoals("verify");
        buildAndAssertSuccess(m);
View Full Code Here

Examples of hudson.tasks.Maven.MavenInstallation

        assertEquals(1, totalCount);
    }

    @Bug(9326)
    public void testTychoEclipseTestResults() throws Exception {
        MavenInstallation mavenInstallation = configureMaven3();
        MavenModuleSet m = createMavenProject();
        m.setRootPOM( "org.foobar.build/pom.xml" );
        m.setMaven( mavenInstallation.getName() );
        m.getReporters().add(new TestReporter());
        m.setScm(new ExtractResourceSCM(getClass().getResource("foobar_eclipse_with_fix.zip"),"foobar_eclipse"));
        m.setGoals("verify");
        buildAndAssertSuccess(m);
View Full Code Here

Examples of hudson.tasks.Maven.MavenInstallation

    }   
   
    public void testTarGzMaven3() throws Exception {
       
        MavenModuleSet m3 = createMavenProject();
        MavenInstallation mvn = configureMaven3();
        m3.setMaven( mvn.getName() );
        File repo = createTmpDir();
        FileUtils.cleanDirectory( repo );
        // a fake build
        m3.setScm(new SingleFileSCM("pom.xml",getClass().getResource("targz-artifact.pom")));
        m3.getPublishersList().add(new RedeployPublisher("",repo.toURI().toString(),false, false));
View Full Code Here

Examples of hudson.tasks.Maven.MavenInstallation

        assertTrue("tar.gz doesn't exist",!files[0].contains( "SNAPSHOT" ));
    }   
   
    public void testTarGzUniqueVersionTrueMaven3() throws Exception {
        MavenModuleSet m3 = createMavenProject();
        MavenInstallation mvn = configureMaven3();
        m3.setMaven( mvn.getName() );       
        File repo = createTmpDir();
        FileUtils.cleanDirectory( repo );
        // a fake build
        m3.setScm(new SingleFileSCM("pom.xml",getClass().getResource("targz-artifact.pom")));
        m3.getPublishersList().add(new RedeployPublisher("",repo.toURI().toString(),true, false));
View Full Code Here

Examples of hudson.tasks.Maven.MavenInstallation

        assertEquals("-e", m.jvmOptions);
  assertTrue(m.usesPrivateRepository());
    }

    public void testWithNodeProperty() throws Exception {
        MavenInstallation maven = configureDefaultMaven();
        String mavenHome = maven.getHome();
        String mavenHomeVar = "${VAR_MAVEN}" + mavenHome.substring(3);
        String mavenVar = mavenHome.substring(0, 3);
        MavenInstallation varMaven = new MavenInstallation("varMaven", mavenHomeVar, NO_PROPERTIES);
        hudson.getDescriptorByType(Maven.DescriptorImpl.class).setInstallations(maven, varMaven);

        JDK jdk = hudson.getJDK("default");
        String javaHome = jdk.getHome();
        String javaHomeVar = "${VAR_JAVA}" + javaHome.substring(3);
        String javaVar = javaHome.substring(0, 3);
        JDK varJDK = new JDK("varJDK", javaHomeVar);
        hudson.getJDKs().add(varJDK);
        Jenkins.getInstance().getNodeProperties().replaceBy(
                Collections.singleton(new EnvironmentVariablesNodeProperty(
                        new Entry("VAR_MAVEN", mavenVar), new Entry("VAR_JAVA",
                                javaVar))));

        FreeStyleProject project = createFreeStyleProject();
        project.getBuildersList().add(new Maven("--help", varMaven.getName()));
        project.setJDK(varJDK);

        Build<?, ?> build = project.scheduleBuild2(0).get();

        Assert.assertEquals(Result.SUCCESS, build.getResult());
View Full Code Here

Examples of hudson.tasks.Maven.MavenInstallation

        Assert.assertEquals(Result.SUCCESS, build.getResult());

    }

    public void testWithParameter() throws Exception {
        MavenInstallation maven = configureDefaultMaven();
        String mavenHome = maven.getHome();
        String mavenHomeVar = "${VAR_MAVEN}" + mavenHome.substring(3);
        String mavenVar = mavenHome.substring(0, 3);
        MavenInstallation varMaven = new MavenInstallation("varMaven",mavenHomeVar,NO_PROPERTIES);
        hudson.getDescriptorByType(Maven.DescriptorImpl.class).setInstallations(maven, varMaven);

        JDK jdk = hudson.getJDK("default");
        String javaHome = jdk.getHome();
        String javaHomeVar = "${VAR_JAVA}" + javaHome.substring(3);
        String javaVar = javaHome.substring(0, 3);
        JDK varJDK = new JDK("varJDK", javaHomeVar);
        hudson.getJDKs().add(varJDK);

        FreeStyleProject project = createFreeStyleProject();
        project.addProperty(new ParametersDefinitionProperty(
                new StringParameterDefinition("VAR_MAVEN", "XXX"),
                new StringParameterDefinition("VAR_JAVA", "XXX")));
        project.getBuildersList().add(new Maven("--help", varMaven.getName()));
        project.setJDK(varJDK);

        FreeStyleBuild build = project.scheduleBuild2(0, new LegacyCodeCause(),
                new ParametersAction(
                        new StringParameterValue("VAR_MAVEN", mavenVar),
View Full Code Here

Examples of hudson.tasks.Maven.MavenInstallation

    }

    private void verify() throws Exception {
        MavenInstallation[] l = get(DescriptorImpl.class).getInstallations();
        assertEquals(1,l.length);
        assertEqualBeans(l[0],new MavenInstallation("myMaven","/tmp/foo",NO_PROPERTIES),"name,home");

        // by default we should get the auto installer
        DescribableList<ToolProperty<?>,ToolPropertyDescriptor> props = l[0].getProperties();
        assertEquals(1,props.size());
        InstallSourceProperty isp = props.get(InstallSourceProperty.class);
View Full Code Here

Examples of hudson.tasks.Maven.MavenInstallation

        Assert.assertNotNull(Jenkins.getInstance().toComputer());
    }
   
    private MavenModuleSet createSimpleMavenProject() throws Exception {
        MavenModuleSet project = createMavenProject();
        MavenInstallation mi = configureMaven3();
        project.setScm(new ExtractResourceSCM(getClass().getResource(
                "/simple-projects.zip")));
        project.setMaven(mi.getName());
        project.setGoals("validate");
        return project;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.