Search in sources :

Example 21 with Radiator

use of com.paulhammant.buildradiator.radiator.model.Radiator in project BuildRadiator by BuildRadiator.

the class RadiatorIntegrationTest method radiatorCanBeUpdatedWithWithBuildStart.

@Test
public void radiatorCanBeUpdatedWithWithBuildStart() {
    Radiator rad = rad("aaa", "sseeccrreett", stepNames("A"));
    app = new TestVersionOfBuildRadiatorApp(rad);
    startApp();
    postStepStartedAndConfirmTestResponse("aaa", "sseeccrreett", "1", "A", 200, "OK");
    assertThat(rad.builds.get(0).steps.get(0).status, equalTo("running"));
}
Also used : Radiator(com.paulhammant.buildradiator.radiator.model.Radiator) CreatedRadiator(com.paulhammant.buildradiator.radiator.model.CreatedRadiator) HasNewRadiator.captureCreatedRadiator(com.paulhammant.buildradiator.radiator.hamcrest.HasNewRadiator.captureCreatedRadiator) Test(org.junit.Test)

Example 22 with Radiator

use of com.paulhammant.buildradiator.radiator.model.Radiator in project BuildRadiator by BuildRadiator.

the class RadiatorUnitTest method radiatorCanIgnoreABogusStepName.

@Test
public void radiatorCanIgnoreABogusStepName() throws InterruptedException, JsonProcessingException {
    Radiator rad = new RadiatorStore().createRadiator(new TestRandomGenerator("X", "sseeccrreett"), "A");
    try {
        rad.startStep("1", "NoMatch");
        fail();
    } catch (UnknownStep e) {
    }
    assertRadiatorsEqualIgnoringLastUpdatedField(rad, rad("X", "sseeccrreett", stepNames("A"), build("1", "", 0, step("A", 0, ""))));
}
Also used : UnknownStep(com.paulhammant.buildradiator.radiator.model.UnknownStep) Radiator(com.paulhammant.buildradiator.radiator.model.Radiator) Test(org.junit.Test)

Example 23 with Radiator

use of com.paulhammant.buildradiator.radiator.model.Radiator in project BuildRadiator by BuildRadiator.

the class RadiatorUnitTest method buildCanHaveThreeStepsAndFailOnSecond.

@Test
public void buildCanHaveThreeStepsAndFailOnSecond() throws InterruptedException, JsonProcessingException {
    Radiator r = new RadiatorStore().createRadiator(new TestRandomGenerator("abc123", "123"), "compile", "unit tests", "func tests");
    r.startStep("123", "compile");
    // test on timing too
    Thread.sleep(50);
    r.stepPassed("123", "compile");
    r.startStep("123", "unit tests");
    r.stepFailed("123", "unit tests");
    assertRadiatorsEqualIgnoringLastUpdatedField(r, rad("abc123", "123", stepNames("compile", "unit tests", "func tests"), build("123", "failed", 0, step("compile", 50, "passed"), step("unit tests", 0, "failed"), step("func tests", 0, "skipped"))));
}
Also used : Radiator(com.paulhammant.buildradiator.radiator.model.Radiator) Test(org.junit.Test)

Example 24 with Radiator

use of com.paulhammant.buildradiator.radiator.model.Radiator in project BuildRadiator by BuildRadiator.

the class RadiatorStoreUnitTest method unknownRadiatorShouldBeSoughtFromDataServiceJustOnce.

@Test
public void unknownRadiatorShouldBeSoughtFromDataServiceJustOnce() throws InterruptedException {
    radStore = getTestAwareRadiatorStore();
    Radiator r = radStore.createRadiator(new TestRandomGenerator("QWERTY", "sseeccrreett"), "A");
    assertQwertyRadiatorHasBeenCalledOnce();
}
Also used : Radiator(com.paulhammant.buildradiator.radiator.model.Radiator) Test(org.junit.Test)

Example 25 with Radiator

use of com.paulhammant.buildradiator.radiator.model.Radiator in project BuildRadiator by BuildRadiator.

the class RadiatorStoreUnitTest method radiatorCanBeRetrieved.

@Test
public void radiatorCanBeRetrieved() {
    RadiatorStore rs = new RadiatorStore();
    Radiator rad = null;
    try {
        rad = rs.get("AAA", "127.0.0.1");
        fail();
    } catch (RadiatorDoesntExist e) {
    // expected
    }
    rs.createRadiator(new TestRandomGenerator("AAA", "sseeccrreett"), "A");
    rad = rs.get("AAA", "127.0.0.1");
    assertThat(rad.code, equalTo("AAA"));
}
Also used : RadiatorDoesntExist(com.paulhammant.buildradiator.radiator.model.RadiatorDoesntExist) Radiator(com.paulhammant.buildradiator.radiator.model.Radiator) Test(org.junit.Test)

Aggregations

Radiator (com.paulhammant.buildradiator.radiator.model.Radiator)30 Test (org.junit.Test)21 HasNewRadiator.captureCreatedRadiator (com.paulhammant.buildradiator.radiator.hamcrest.HasNewRadiator.captureCreatedRadiator)14 CreatedRadiator (com.paulhammant.buildradiator.radiator.model.CreatedRadiator)14 Step (com.paulhammant.buildradiator.radiator.model.Step)3 ByteString (com.google.protobuf.ByteString)2 Build (com.paulhammant.buildradiator.radiator.model.Build)2 RadiatorDoesntExist (com.paulhammant.buildradiator.radiator.model.RadiatorDoesntExist)2 UnknownStep (com.paulhammant.buildradiator.radiator.model.UnknownStep)1 FluentWebElement (org.seleniumhq.selenium.fluent.FluentWebElement)1