use of com.paulhammant.buildradiator.model.Radiator in project BuildRadiator by BuildRadiator.
the class RadiatorWebDriverTest method pageCanHaveStepsReplaceOnBrowserSide.
@Test
public void pageCanHaveStepsReplaceOnBrowserSide() 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", "/A/Ant/B/Bat/C/Clever_Cat");
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\nAnt\n2 secs\n(running) Bat\n0 secs\nClever Cat\n0 secs");
FWD.trs().get(2).getText().shouldBe("1\n4 secs\nAnt\n4 secs\n(failed) Bat\n0 secs\n(skipped) Clever Cat\n0 secs\n(skipped)");
}
use of com.paulhammant.buildradiator.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.model.Radiator in project BuildRadiator by BuildRadiator.
the class RadiatorStore method createRadiator.
Radiator createRadiator(RandomGenerator codeGenerator, String... steps) {
String radiatorCode = codeGenerator.generateRadiatorCode();
String secret = codeGenerator.generateSecret();
Radiator radiator = new Radiator(radiatorCode, secret, steps);
this.actualRadiators.put(radiatorCode, radiator);
return radiator;
}
use of com.paulhammant.buildradiator.model.Radiator in project BuildRadiator by BuildRadiator.
the class RadiatorStore method processRadiatorsToSave.
private void processRadiatorsToSave() {
synchronized (radiatorLastSavedTimes) {
Set<String> ks = actualRadiators.keySet();
for (String radCode : ks) {
Radiator rad = actualRadiators.get(radCode);
Long lastSaved = radiatorLastSavedTimes.get(radCode);
if (lastSaved == null || rad.lastUpdated > lastSaved) {
saveInDataService(radCode, rad);
radiatorLastSavedTimes.put(radCode, rad.lastUpdated);
}
}
}
}
use of com.paulhammant.buildradiator.model.Radiator in project BuildRadiator by BuildRadiator.
the class RadiatorIntegrationTest method radiatorCannotBeUpdatedWithWithBuildStartIfTheSecretIsWrong.
@Test
public void radiatorCannotBeUpdatedWithWithBuildStartIfTheSecretIsWrong() {
Radiator rad = rad("aaa", "sseeccrreett", stepNames("A"));
app = new TestVersionOfBuildRadiatorApp(rad);
startApp();
postStepStartedAndConfirmTestResponse("aaa", "wrong-secret", "1", "A", 200, "secret doesnt match");
assertThat(rad.builds.size(), equalTo(0));
}
Aggregations