Package hudson.model

Examples of hudson.model.FreeStyleBuild


            project.getBuildersList().add(new BatchFile("echo hello"));
        } else {
            project.getBuildersList().add(new Shell("echo hello"));
        }

        FreeStyleBuild build = project.scheduleBuild2(0).get();
        System.out.println(build.getDisplayName()+" completed");

        String s = FileUtils.readFileToString(build.getLogFile());
        assertTrue(s,s.contains("echo hello"));
    }
View Full Code Here


    /**
     * Verifies that the error message and stacktrace from a failed junit test actually render properly.
     */
    @Bug(4257)
    public void testFreestyleErrorMsgAndStacktraceRender() throws Exception {
        FreeStyleBuild b = configureTestBuild("render-test");
        TestResult tr = b.getAction(TestResultAction.class).getResult();
        assertEquals(3,tr.getFailedTests().size());
        CaseResult cr = tr.getFailedTests().get(1);
        assertEquals("org.twia.vendor.VendorManagerTest",cr.getClassName());
        assertEquals("testGetRevokedClaimsForAdjustingFirm",cr.getName());
  assertNotNull("Error details should not be null", cr.getErrorDetails());
View Full Code Here

    private static final String[] REDUCED_VISIBILITY_FIELDS = { "stdout", "stderr", "errorStackTrace", "errorDetails" };
    private static final String[] OTHER_FIELDS = { "duration", "className", "failedSince", "age", "skipped", "status" };

    @Email("http://jenkins.361315.n4.nabble.com/Change-remote-API-visibility-for-CaseResult-getStdout-getStderr-td395102.html")
    public void testRemoteApiDefaultVisibility() throws Exception {
        FreeStyleBuild b = configureTestBuild("test-remoteapi");

        XmlPage page = (XmlPage) new WebClient().goTo("job/test-remoteapi/1/testReport/org.twia.vendor/VendorManagerTest/testCreateAdjustingFirm/api/xml","application/xml");

        int found = 0;
View Full Code Here

        assertTrue("Should have found an element, but found " + found, found > 0);
    }
   
    @Email("http://jenkins.361315.n4.nabble.com/Change-remote-API-visibility-for-CaseResult-getStdout-getStderr-td395102.html")
    public void testRemoteApiNoDetails() throws Exception {
        FreeStyleBuild b = configureTestBuild("test-remoteapi");

        XmlPage page = (XmlPage) new WebClient().goTo("job/test-remoteapi/1/testReport/org.twia.vendor/VendorManagerTest/testCreateAdjustingFirm/api/xml?depth=-1","application/xml");

        int found = 0;
View Full Code Here

        assertTrue("Should have found an element, but found " + found, found > 0);
   }
   
    @Email("http://jenkins.361315.n4.nabble.com/Change-remote-API-visibility-for-CaseResult-getStdout-getStderr-td395102.html")
    public void testRemoteApiNameOnly() throws Exception {
        FreeStyleBuild b = configureTestBuild("test-remoteapi");

        XmlPage page = (XmlPage) new WebClient().goTo("job/test-remoteapi/1/testReport/org.twia.vendor/VendorManagerTest/testCreateAdjustingFirm/api/xml?depth=-10","application/xml");

        int found = 0;
View Full Code Here

    project.setScm(new ExtractResourceSCM(getClass().getResource(
        "/simple-projects.zip")));

    // test the regular slave - variable not expanded
    project.setAssignedLabel(slaveRegular.getSelfLabel());
    FreeStyleBuild build = project.scheduleBuild2(0).get();
    System.out.println(build.getDisplayName() + " completed");

    assertBuildStatusSuccess(build);

    String buildLogRegular = getBuildLog(build);
    System.out.println(buildLogRegular);
    assertTrue(buildLogRegular.contains(DUMMY_LOCATION_VARNAME));

    // test the slave with prepared environment
    project.setAssignedLabel(slaveEnv.getSelfLabel());
    build = project.scheduleBuild2(0).get();
    System.out.println(build.getDisplayName() + " completed");

    assertBuildStatusSuccess(build);

    // Check variable was expanded
    String buildLogEnv = getBuildLog(build);
View Full Code Here

        new Ant("-Dtest.property=cor${" + DUMMY_LOCATION_VARNAME
            + "}rect", "varAnt", "", buildFile, ""));

    // test the regular slave - variable not expanded
    project.setAssignedLabel(slaveRegular.getSelfLabel());
    FreeStyleBuild build = project.scheduleBuild2(0).get();
    System.out.println(build.getDisplayName() + " completed");

    assertBuildStatus(Result.FAILURE, build);

    String buildLogRegular = getBuildLog(build);
    assertTrue(buildLogRegular.contains(Ant_ExecutableNotFound("varAnt")));

    // test the slave with prepared environment
    project.setAssignedLabel(slaveEnv.getSelfLabel());
    build = project.scheduleBuild2(0).get();
    System.out.println(build.getDisplayName() + " completed");

    assertBuildStatusSuccess(build);

    // Check variable was expanded
    String buildLogEnv = getBuildLog(build);
View Full Code Here

              + DUMMY_LOCATION_VARNAME + "}", "", "",
              false));

    // test the regular slave - variable not expanded
    project.setAssignedLabel(slaveRegular.getSelfLabel());
    FreeStyleBuild build = project.scheduleBuild2(0).get();
    System.out.println(build.getDisplayName() + " completed");

    assertBuildStatus(Result.FAILURE, build);

    String buildLogRegular = getBuildLog(build);
    System.out.println(buildLogRegular);
    assertTrue(buildLogRegular.contains(DUMMY_LOCATION_VARNAME));

    // test the slave with prepared environment
    project.setAssignedLabel(slaveEnv.getSelfLabel());
    build = project.scheduleBuild2(0).get();
    System.out.println(build.getDisplayName() + " completed");

    assertBuildStatusSuccess(build);

    // Check variable was expanded
    String buildLogEnv = getBuildLog(build);
View Full Code Here

        project.getBuildersList().add(new TouchBuilder());
    }

    @LocalData
    public void testFailureLinks() throws Exception {
        FreeStyleBuild build = project.scheduleBuild2(0).get(10, TimeUnit.SECONDS);
        assertBuildStatus(Result.UNSTABLE, build);

        TestResult theOverallTestResult =   build.getAction(TestResultAction.class).getResult();
        CaseResult theFailedTestCase = theOverallTestResult.getFailedTests().get(0);
        String relativePath = theFailedTestCase.getRelativePathFrom(theOverallTestResult);
        System.out.println("relative path seems to be: " + relativePath);

        HudsonTestCase.WebClient wc = new HudsonTestCase.WebClient();
View Full Code Here

    }

    // Exercises the b-is-not-a-descendant-of-a path.
    @LocalData
    public void testNonDescendantRelativePath() throws Exception {
        FreeStyleBuild build = project.scheduleBuild2(0).get(10, TimeUnit.MINUTES); // leave time for interactive debugging
        assertBuildStatus(Result.UNSTABLE, build);
        TestResult theOverallTestResult =   build.getAction(TestResultAction.class).getResult();
        CaseResult theFailedTestCase = theOverallTestResult.getFailedTests().get(0);
        String relativePath = theFailedTestCase.getRelativePathFrom(theOverallTestResult);
        System.out.println("relative path seems to be: " + relativePath);
        assertNotNull("relative path exists", relativePath);
        assertFalse("relative path doesn't start with a slash", relativePath.startsWith("/"));
View Full Code Here

TOP

Related Classes of hudson.model.FreeStyleBuild

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.