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"));
}
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, ""))));
}
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"))));
}
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();
}
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"));
}
Aggregations