Esempio n. 1
0
        // [Timeout(60000)]
        public void SendActionToRemoteGrid()
        {
            // Arrange
            ActPlugIn actPlugin = new ActPlugIn()
            {
                ServiceId = "DummyService", ActionId = "A1"
            };

            //Act
            GingerNodeProxy.RemoteGridIP   = RemoteGridIP;   // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
            GingerNodeProxy.RemoteGridPort = RemoteGridPort; // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

            GingerNodeInfo gingerNodeInfo = new GingerNodeInfo()
            {
            };
            GingerNodeProxy gingerNodeProxy = new GingerNodeProxy(gingerNodeInfo, true);

            NewPayLoad actionPayLoad = ExecuteOnPlugin.CreateActionPayload(actPlugin);
            NewPayLoad actionResult  = gingerNodeProxy.RunAction(actionPayLoad);

            ExecuteOnPlugin.ParseActionResult(actionResult, actPlugin);

            //Assert
            Assert.AreEqual(RemoteGingerGrid.NodeList.Count, 2);
            Assert.AreEqual("A1 Result", actPlugin.ExInfo);
        }
        private void RunAction(ActPlugIn a1, GingerNodeProxy gNP1)
        {
            NewPayLoad a1Payload = ExecuteOnPlugin.CreateActionPayload(a1);
            NewPayLoad rc        = gNP1.RunAction(a1Payload);

            ExecuteOnPlugin.ParseActionResult(rc, a1);
        }
        public void SendActionToRemoteGridOnProcess()
        {
            // TODO: start the service batch + plugin to connect, for now we use manual bat file for testing

            // Arrange
            ActPlugIn actPlugin = new ActPlugIn()
            {
                ServiceId = "DummyService", ActionId = "Sum"
            };

            actPlugin.GetOrCreateInputParam("a").Value     = "4";
            actPlugin.GetOrCreateInputParam("a").ParamType = typeof(int);
            actPlugin.GetOrCreateInputParam("b").Value     = "3";
            actPlugin.GetOrCreateInputParam("b").ParamType = typeof(int);

            //Act
            GingerNodeProxy.RemoteGridIP   = RemoteGridIP; // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
            GingerNodeProxy.RemoteGridPort = 15555;        // RemoteGridPort; // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

            GingerNodeInfo gingerNodeInfo = new GingerNodeInfo()
            {
            };
            GingerNodeProxy gingerNodeProxy = new GingerNodeProxy(gingerNodeInfo, true);

            NewPayLoad actionPayLoad = ExecuteOnPlugin.CreateActionPayload(actPlugin);

            for (int i = 0; i < 1000; i++)
            {
                NewPayLoad actionResult = gingerNodeProxy.RunAction(actionPayLoad);
                ExecuteOnPlugin.ParseActionResult(actionResult, actPlugin);
            }

            //Assert
            Assert.AreEqual(RemoteGingerGrid.NodeList.Count, 2);
            // Assert.AreEqual("A1 Result", actPlugin.ExInfo);
        }