use of com.paulhammant.buildradiator.radiator.model.Radiator in project BuildRadiator by BuildRadiator.
the class RadiatorIntegrationTest method radiatorCanBeUpdatedWithWithBuildStepCompletion.
@Test
public void radiatorCanBeUpdatedWithWithBuildStepCompletion() {
Radiator rad = rad("aaa", "sseeccrreett", stepNames("A", "B"), build("1", "running", 0, step("A", 0, "running"), step("B")));
app = new TestVersionOfBuildRadiatorApp(rad);
startApp();
given().params("build", "1", "step", "A", "secret", "sseeccrreett").when().post(CONTRIVED_PATH_FOR_TESTING + "/aaa/stepPassed").then().statusCode(200).body(equalTo("OK"));
ArrayList<Step> steps = rad.builds.get(0).steps;
assertThat(steps.get(0).name, equalTo("A"));
assertThat(steps.get(0).status, equalTo("passed"));
}
use of com.paulhammant.buildradiator.radiator.model.Radiator in project BuildRadiator by BuildRadiator.
the class RadiatorIntegrationTest method radiatorCanBeUpdatedWithWithBuildStepFailure.
@Test
public void radiatorCanBeUpdatedWithWithBuildStepFailure() {
Radiator rad = rad("aaa", "sseeccrreett", stepNames("A", "B"), build("1", "running", 0, step("A", 0, "running"), step("B")));
app = new TestVersionOfBuildRadiatorApp(rad);
startApp();
given().params("build", "1", "step", "A", "secret", "sseeccrreett").when().post(CONTRIVED_PATH_FOR_TESTING + "/aaa/stepFailed").then().statusCode(200).body(equalTo("OK"));
Build build = rad.builds.get(0);
assertThat(build.status, equalTo("failed"));
assertThat(build.steps.get(0).status, equalTo("failed"));
assertThat(build.steps.get(1).status, equalTo("skipped"));
}
use of com.paulhammant.buildradiator.radiator.model.Radiator in project BuildRadiator by BuildRadiator.
the class RadiatorIntegrationTest method radiatorCanBeUpdatedWithWithCancelledBuild.
@Test
public void radiatorCanBeUpdatedWithWithCancelledBuild() {
Radiator rad = rad("aaa", "sseeccrreett", stepNames("A", "B"), build("1", "running", 0, step("A", 0, "running"), step("B")));
app = new TestVersionOfBuildRadiatorApp(rad);
startApp();
given().params("build", "1", "step", "A", "secret", "sseeccrreett").when().post(CONTRIVED_PATH_FOR_TESTING + "/aaa/buildCancelled").then().statusCode(200).body(equalTo("OK"));
Build build = rad.builds.get(0);
assertThat(build.status, equalTo("cancelled"));
ArrayList<Step> steps = build.steps;
assertThat(steps.get(0).name, equalTo("A"));
assertThat(steps.get(0).status, equalTo("cancelled"));
assertThat(steps.get(1).name, equalTo("B"));
assertThat(steps.get(1).status, equalTo("cancelled"));
}
use of com.paulhammant.buildradiator.radiator.model.Radiator in project BuildRadiator by BuildRadiator.
the class RadiatorUnitTest method radiatorCanOnlyHoldTenBuildsAndInReverseOrder.
@Test
public void radiatorCanOnlyHoldTenBuildsAndInReverseOrder() throws InterruptedException, JsonProcessingException {
Radiator rad = new RadiatorStore().createRadiator(new TestRandomGenerator("X", "sseeccrreett"), "A");
for (int i = 1; i <= 11; i++) {
rad.startStep("" + i, "A");
}
assertThat(rad.builds.size(), is(10));
}
use of com.paulhammant.buildradiator.radiator.model.Radiator in project BuildRadiator by BuildRadiator.
the class RadiatorStoreUnitTest method saverThreadShouldDoItsBusinessForUnsavedRadiatorTwiceIfNeeded.
@Test
public void saverThreadShouldDoItsBusinessForUnsavedRadiatorTwiceIfNeeded() throws InterruptedException {
saverThreadShouldDoItsBusinessForUnsavedRadiatorJustOnce();
Radiator rad = radStore.get("QWERTY", "127.0.0.1");
rad.lastUpdated = System.currentTimeMillis();
Thread.sleep(10);
assertThat(called, equalTo(2));
}
Aggregations