Package org.jvnet.hudson.test

Examples of org.jvnet.hudson.test.SingleFileSCM


    public void testAnt() throws Exception {
        Ant.AntInstallation ant = configureDefaultAnt();
        String antPath = ant.getHome();
        Jenkins.getInstance().getDescriptorByType(Ant.DescriptorImpl.class).setInstallations(new AntInstallation("ant", "THIS IS WRONG"));

        project.setScm(new SingleFileSCM("build.xml", "<project name='foo'/>"));
        project.getBuildersList().add(new Ant("-version", "ant", null,null,null));
        configureDumpEnvBuilder();

        Build build = project.scheduleBuild2(0).get();
        assertBuildStatus(Result.FAILURE, build);
View Full Code Here


        configureDefaultMaven();
        MavenModuleSet m2 = createMavenProject();
        File repo = createTmpDir();

        // a fake build
        m2.setScm(new SingleFileSCM("pom.xml",getClass().getResource("big-artifact.pom")));
        m2.getPublishersList().add(new RedeployPublisher("",repo.toURI().toString(),true, false));

        MavenModuleSetBuild b = m2.scheduleBuild2(0).get();
        assertBuildStatus(Result.SUCCESS, b);
View Full Code Here

        configureDefaultMaven();
        MavenModuleSet m2 = createMavenProject();
        File repo = createTmpDir();

        // a fake build
        m2.setScm(new SingleFileSCM("pom.xml",getClass().getResource("targz-artifact.pom")));
        m2.getPublishersList().add(new RedeployPublisher("",repo.toURI().toString(),false, false));

        MavenModuleSetBuild b = m2.scheduleBuild2(0).get();
        assertBuildStatus(Result.SUCCESS, b);
View Full Code Here

        File repo = createTmpDir();
       
        FileUtils.cleanDirectory( repo );
       
        // a fake build
        m2.setScm(new SingleFileSCM("pom.xml",getClass().getResource("targz-artifact.pom")));
        m2.getPublishersList().add(new RedeployPublisher("",repo.toURI().toString(),true, false));

        MavenModuleSetBuild b = m2.scheduleBuild2(0).get();
        assertBuildStatus(Result.SUCCESS, b);
View Full Code Here

        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));

        MavenModuleSetBuild b = m3.scheduleBuild2(0).get();
        assertBuildStatus(Result.SUCCESS, b);
View Full Code Here

        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));

        MavenModuleSetBuild b = m3.scheduleBuild2(0).get();
        assertBuildStatus(Result.SUCCESS, b);
       
View Full Code Here

  }

  protected MavenModuleSet setupMavenProject(String pomName) throws Exception {
    MavenModuleSet project = j.createMavenProject("MavenProject");
    // Setup SCM
    project.setScm(new SingleFileSCM(pomName, getClass().getResource("/hudson/plugins/sonar/SonarTestCase/pom.xml")));
    // Setup Maven
    project.setRootPOM(pomName);
    project.setGoals("clean install");
    project.setIsArchivingDisabled(true);
    // Setup Sonar
View Full Code Here

  public void test() throws Exception {

    Project projectA = createFreeStyleProject("projectA");
    String properties = "KEY=value";
    projectA.setScm(new SingleFileSCM("properties.txt", properties));
    projectA.getPublishersList().add(
        new BuildTrigger(
        new BuildTriggerConfig("projectB", ResultCondition.SUCCESS,
            new FileBuildParameters("properties.txt"))));
View Full Code Here

    public void testUtf8File() throws Exception {

        FreeStyleProject projectA = createFreeStyleProject("projectA");
        String properties = "KEY=こんにちは\n"  // "hello" in Japanese.
                + "KEY=value"; // "KEY" in multibytes.
        projectA.setScm(new SingleFileSCM("properties.txt", properties.getBytes("UTF-8")));
        projectA.getPublishersList().add(
                new BuildTrigger(
                new BuildTriggerConfig("projectB", ResultCondition.SUCCESS,
                        new FileBuildParameters("properties.txt", "UTF-8", true))));
View Full Code Here

        // I test here that a non-UTF-8 encoding also works.

        FreeStyleProject projectA = createFreeStyleProject("projectA");
        String properties = "KEY=こんにちは\n"  // "hello" in Japanese.
                + "KEY=value"; // "KEY" in multibytes.
        projectA.setScm(new SingleFileSCM("properties.txt", properties.getBytes("Shift_JIS")));
        projectA.getPublishersList().add(
                new BuildTrigger(
                new BuildTriggerConfig("projectB", ResultCondition.SUCCESS,
                        new FileBuildParameters("properties.txt", "Shift_JIS", true))));
View Full Code Here

TOP

Related Classes of org.jvnet.hudson.test.SingleFileSCM

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.