Search in sources :

Example 81 with JobIdentifier

use of com.thoughtworks.go.domain.JobIdentifier in project gocd by gocd.

the class TestInformationTest method equalsFalseWhenStatusSameNameDifferentAndJobIdentifiersHaveSameNames.

@Test
public void equalsFalseWhenStatusSameNameDifferentAndJobIdentifiersHaveSameNames() {
    TestInformation info1 = new TestInformation("test", TestStatus.Error);
    info1.addJob(new JobIdentifier(null, 1, null, null, null, "job1"));
    info1.addJob(new JobIdentifier(null, 2, null, null, null, "job"));
    TestInformation info2 = new TestInformation("anotherTest", TestStatus.Error);
    info2.addJob(new JobIdentifier(null, 3, null, null, null, "job1"));
    info2.addJob(new JobIdentifier(null, 4, null, null, null, "job"));
    assertThat(info1, not(info2));
    assertThat(info2, not(info1));
}
Also used : JobIdentifier(com.thoughtworks.go.domain.JobIdentifier) Test(org.junit.Test)

Example 82 with JobIdentifier

use of com.thoughtworks.go.domain.JobIdentifier in project gocd by gocd.

the class TestInformationTest method equalsFalseWhenStatusSameNameSameAndJobIdentifiersAreASubset.

@Test
public void equalsFalseWhenStatusSameNameSameAndJobIdentifiersAreASubset() {
    TestInformation info1 = new TestInformation("test", TestStatus.Error);
    info1.addJob(new JobIdentifier(null, 1, null, null, null, "job1"));
    info1.addJob(new JobIdentifier(null, 2, null, null, null, "job"));
    TestInformation info2 = new TestInformation("test", TestStatus.Error);
    info2.addJob(new JobIdentifier(null, 3, null, null, null, "job1"));
    info2.addJob(new JobIdentifier(null, 4, null, null, null, "job"));
    info2.addJob(new JobIdentifier(null, 4, null, null, null, "job33"));
    assertThat(info1, not(info2));
}
Also used : JobIdentifier(com.thoughtworks.go.domain.JobIdentifier) Test(org.junit.Test)

Example 83 with JobIdentifier

use of com.thoughtworks.go.domain.JobIdentifier in project gocd by gocd.

the class TestInformationTest method equalsFalseWhenStatusDifferentNameSameAndJobIdentifiersHaveSameNames.

@Test
public void equalsFalseWhenStatusDifferentNameSameAndJobIdentifiersHaveSameNames() {
    TestInformation info1 = new TestInformation("test", TestStatus.Error);
    info1.addJob(new JobIdentifier(null, 1, null, null, null, "job1"));
    info1.addJob(new JobIdentifier(null, 2, null, null, null, "job"));
    TestInformation info2 = new TestInformation("test", TestStatus.Failure);
    info2.addJob(new JobIdentifier(null, 3, null, null, null, "job1"));
    info2.addJob(new JobIdentifier(null, 4, null, null, null, "job"));
    assertThat(info1, not(info2));
}
Also used : JobIdentifier(com.thoughtworks.go.domain.JobIdentifier) Test(org.junit.Test)

Example 84 with JobIdentifier

use of com.thoughtworks.go.domain.JobIdentifier in project gocd by gocd.

the class TestSuiteTest method shouldReturnTestOrderedAlphabetically.

@Test
public void shouldReturnTestOrderedAlphabetically() throws Exception {
    testSuite.addTest("testB", TestStatus.Error, new JobIdentifier("", -1, "", "", "", "job-1"));
    testSuite.addTest("testA", TestStatus.Error, new JobIdentifier("", -1, "", "", "", "job-1"));
    testSuite.addTest("testC", TestStatus.Failure, new JobIdentifier("", -1, "", "", "", "job-1"));
    List<TestInformation> tests = testSuite.tests();
    assertThat(tests.get(0).getName(), is("testA"));
    assertThat(tests.get(1).getName(), is("testB"));
    assertThat(tests.get(2).getName(), is("testC"));
}
Also used : JobIdentifier(com.thoughtworks.go.domain.JobIdentifier) Test(org.junit.Test)

Example 85 with JobIdentifier

use of com.thoughtworks.go.domain.JobIdentifier in project gocd by gocd.

the class TestSuiteTest method shouldNotRemoveTestsThatHaveSameNameAndDiffernetContext.

@Test
public void shouldNotRemoveTestsThatHaveSameNameAndDiffernetContext() {
    testSuite.addTest("testB", TestStatus.Error, new JobIdentifier("", -1, "", "", "", "job-1"));
    testSuite.addTest("testA", TestStatus.Error, new JobIdentifier("", -1, "", "", "", "job-1"));
    TestSuite testSuite1 = new TestSuite("another-suite");
    testSuite1.addTest("testA", TestStatus.Error, new JobIdentifier("", 23, "", "", "", "job-2"));
    testSuite.removeDuplicateTestEntries(testSuite1);
    List<TestInformation> list = testSuite.tests();
    assertThat(list.size(), is(2));
}
Also used : JobIdentifier(com.thoughtworks.go.domain.JobIdentifier) Test(org.junit.Test)

Aggregations

JobIdentifier (com.thoughtworks.go.domain.JobIdentifier)113 Test (org.junit.Test)85 File (java.io.File)16 JobInstance (com.thoughtworks.go.domain.JobInstance)15 Pipeline (com.thoughtworks.go.domain.Pipeline)13 DateTime (org.joda.time.DateTime)12 Before (org.junit.Before)10 CoreMatchers.containsString (org.hamcrest.CoreMatchers.containsString)7 Stage (com.thoughtworks.go.domain.Stage)6 StageIdentifier (com.thoughtworks.go.domain.StageIdentifier)5 IllegalArtifactLocationException (com.thoughtworks.go.domain.exception.IllegalArtifactLocationException)5 AgentMetadata (com.thoughtworks.go.plugin.access.elastic.models.AgentMetadata)5 IOException (java.io.IOException)5 ModelAndView (org.springframework.web.servlet.ModelAndView)5 CaseInsensitiveString (com.thoughtworks.go.config.CaseInsensitiveString)3 Property (com.thoughtworks.go.domain.Property)3 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)3 RunIf (com.googlecode.junit.ext.RunIf)2 AgentIdentifier (com.thoughtworks.go.remote.AgentIdentifier)2 HeaderConstraint (com.thoughtworks.go.server.security.HeaderConstraint)2