use of com.paulhammant.buildradiator.model.Radiator in project BuildRadiator by BuildRadiator.
the class RadiatorIntegrationTest method radiatorCanBeUpdatedWithWithBuildStepCompletionAndStartOfNewStepInOneGo.
@Test
public void radiatorCanBeUpdatedWithWithBuildStepCompletionAndStartOfNewStepInOneGo() {
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", "pStep", "A", "step", "B", "secret", "sseeccrreett").when().post("/r/aaa/stepPassedAndStartStep").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"));
assertThat(steps.get(1).name, equalTo("B"));
assertThat(steps.get(1).status, equalTo("running"));
}
use of com.paulhammant.buildradiator.model.Radiator in project BuildRadiator by BuildRadiator.
the class RadiatorStore method get.
Radiator get(final String radCode, String ipAddress) {
Radiator radiator = this.actualRadiators.get(radCode);
if (radiator == null) {
radiator = getFromDataService(radCode);
if (radiator != null) {
actualRadiators.put(radCode, radiator);
radiatorLastSavedTimes.put(radCode, radiator.lastUpdated);
}
}
if (radiator != null) {
radiator.verifyIP(ipAddress);
} else {
throw new RadiatorDoesntExist();
}
return radiator;
}
use of com.paulhammant.buildradiator.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.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.model.Radiator in project BuildRadiator by BuildRadiator.
the class RadiatorWebDriverTest method pageContainsDataFromServer.
@Test
public void pageContainsDataFromServer() throws InterruptedException {
Radiator rad = rad("xxx", "sseeccrreett", stepNames("A", "B", "C"), build("2", "running", 2000, step("A", 2000, "running"), step("B"), step("C")), build("1", "running", 4000, step("A", 4000, "failed"), skip("B"), skip("C"))).withIpAccessRestrictedToThese("127.0.0.1", "111.222.33.44");
app = new TestVersionOfBuildRadiatorApp(rad);
startAppAndOpenWebDriverOnRadiatorPage("xxx");
FWD.td().getText().shouldBe("Main Project Trunk Build\nchange URL to customize the title ↑ or step codes ↓");
FWD.trs().get(1).getText().shouldBe("2\n2 secs\nA\n2 secs\n(running) B\n0 secs\nC\n0 secs");
FWD.trs().get(2).getText().shouldBe("1\n4 secs\nA\n4 secs\n(failed) B\n0 secs\n(skipped) C\n0 secs\n(skipped)");
}
Aggregations