Search in sources :

Example 1 with StageState

use of com.thoughtworks.go.domain.StageState in project gocd by gocd.

the class StageStateTypeHandlerCallbackTest method assertMaps.

private void assertMaps(final String str, StageState value) throws SQLException {
    final ResultGetter resultGetter;
    Mockery context = new Mockery() {

        {
            setImposteriser(ClassImposteriser.INSTANCE);
        }
    };
    resultGetter = context.mock(ResultGetter.class);
    context.checking(new Expectations() {

        {
            one(resultGetter).getString();
            will(returnValue(str));
        }
    });
    StageState result = (StageState) callback.getResult(resultGetter);
    assertThat(result, is(equal(value)));
    final ParameterSetter parameterSetter = context.mock(ParameterSetter.class);
    context.checking(new Expectations() {

        {
            one(parameterSetter).setString(str);
        }
    });
    callback.setParameter(parameterSetter, value);
}
Also used : Expectations(org.jmock.Expectations) StageState(com.thoughtworks.go.domain.StageState) ParameterSetter(com.ibatis.sqlmap.client.extensions.ParameterSetter) ResultGetter(com.ibatis.sqlmap.client.extensions.ResultGetter) Mockery(org.jmock.Mockery)

Example 2 with StageState

use of com.thoughtworks.go.domain.StageState in project gocd by gocd.

the class JobStatusListener method onMessage.

public void onMessage(final JobStatusMessage message) {
    if (message.getJobState().isCompleted()) {
        final Stage stage = stageService.findStageWithIdentifier(message.getStageIdentifier());
        stage.statusHandling(new StageStatusHandler() {

            public void onNormalCompletion(StageState stageState, StageResult stageResult) {
                stageStatusTopic.post(new StageStatusMessage(message.getStageIdentifier(), stageState, stageResult));
            }
        });
    }
}
Also used : StageState(com.thoughtworks.go.domain.StageState) StageStatusHandler(com.thoughtworks.go.server.domain.StageStatusHandler) StageResult(com.thoughtworks.go.domain.StageResult) Stage(com.thoughtworks.go.domain.Stage)

Aggregations

StageState (com.thoughtworks.go.domain.StageState)2 ParameterSetter (com.ibatis.sqlmap.client.extensions.ParameterSetter)1 ResultGetter (com.ibatis.sqlmap.client.extensions.ResultGetter)1 Stage (com.thoughtworks.go.domain.Stage)1 StageResult (com.thoughtworks.go.domain.StageResult)1 StageStatusHandler (com.thoughtworks.go.server.domain.StageStatusHandler)1 Expectations (org.jmock.Expectations)1 Mockery (org.jmock.Mockery)1