public void ShouldHandleHandshakeInSpout() { var processSetup = Substitute.For<ISetupProcess>(); var subjectUnderTest = new StormHandshake(processSetup) { PidDir = ProcessDir }; var spout = Substitute.For<ISpout>(); subjectUnderTest.BeProcessesBy(spout); spout.Received().Initialise(subjectUnderTest); processSetup.Received().Setup(ProcessDir); }
public StormHandshake Handshake(string handshakeRaw) { var jsonObject = JsonObject.Parse(handshakeRaw); var result = new StormHandshake(_setupProcess) { Conf = jsonObject.Object(WellKnownStrings.Configuration), PidDir = jsonObject[WellKnownStrings.ProcessDirectory], }; var context = jsonObject.Object(WellKnownStrings.Context); if (context != null && context.Count > 0) { result.TaskComponent = context.Object(WellKnownStrings.TaskComponent); result.TaskId = context.Get <long>(WellKnownStrings.TaskId); } return(result); }
public override void Initialise(StormHandshake handshake) { }
public abstract void Initialise(StormHandshake handshake);