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);
        }
예제 #3
0
 public override void Initialise(StormHandshake handshake)
 {
 }
예제 #4
0
 public abstract void Initialise(StormHandshake handshake);