public IActionResult StartTask() { TinctTaskRepository q = new TinctTaskRepository(); var mloggname = "Masterlogger"; var mfilename = "Log4net.config"; TinctTaskService.StartMasterService(); Thread.Sleep(2000); TinctTaskService.StartTaskService(q, mloggname, mfilename); TinctTask t1 = new TinctTask(); t1.Name = "test"; t1.DllName = "Tinct.PlatformController"; t1.NamespaceName = "Tinct.PlatformController"; t1.ClassName = "TinctTestController"; t1.MethodName = "LoadData1"; t1.Datas = "test"; Thread.Sleep(1000); TinctTask t2 = new TinctTask(); t2.Name = "test"; t2.DllName = "Tinct.PlatformController"; t2.NamespaceName = "Tinct.PlatformController"; t2.ClassName = "TinctTest1Controller"; t2.MethodName = "LoadData1"; t2.Datas = "test"; q.QueueTinctTask(t1); q.QueueTinctTask(t2); return(View("Index")); }
public void StartTest() { TinctTaskRepository q = new TinctTaskRepository(); var mloggname = "Masterlogger"; var mfilename = "Log4net.config"; var slogname = "Slavelogger"; TinctTaskService.StartMasterService(); Thread.Sleep(2000); TinctTaskService.StartSlaveService(slogname, mfilename); Thread.Sleep(2000); TinctTaskService.StartTaskService(q, mloggname, mfilename); TinctTask t1 = new TinctTask(); t1.Name = "test"; t1.DllName = "Tinct.PlatformController"; t1.NamespaceName = "Tinct.PlatformController"; t1.ClassName = "TinctTestController"; t1.MethodName = "LoadData1"; t1.Datas = "test"; TinctTask t2 = new TinctTask(); t2.Name = "test"; t2.DllName = "Tinct.PlatformController"; t2.NamespaceName = "Tinct.PlatformController"; t2.ClassName = "TinctTest1Controller"; t2.MethodName = "LoadData1"; t2.Datas = "test"; q.QueueTinctTask(t1); q.QueueTinctTask(t2); Thread.Sleep(12000); Assert.IsTrue(t2.Status == TinctTaskStatus.Completed); }
static void Main(string[] args) { TinctTaskRepository q = new TinctTaskRepository(); var mloggname = "Masterlogger"; var mfilename = "Log4net.config"; TinctTaskService.StartMasterService(); //Thread.Sleep(2000); //TinctTaskService.StartSlaveService(slogname, mfilename); Thread.Sleep(2000); TinctTaskService.StartTaskService(q, mloggname, mfilename); TinctTask t1 = new TinctTask(); t1.Name = "test"; t1.DllName = "Tinct.PlatformController"; t1.NamespaceName = "Tinct.PlatformController"; t1.ClassName = "TinctTestController"; t1.MethodName = "LoadData1"; t1.Datas = "test"; TinctTask t2 = new TinctTask(); t2.Name = "test"; t2.DllName = "Tinct.PlatformController"; t2.NamespaceName = "Tinct.PlatformController"; t2.ClassName = "TinctTest1Controller"; t2.MethodName = "LoadData1"; t2.Datas = "test"; q.QueueTinctTask(t1); q.QueueTinctTask(t2); Console.Read(); }
public void RunFileTask() { TinctTaskRepository q = new TinctTaskRepository(); var mloggname = "Masterlogger"; var mfilename = "Log4net.config"; var slogname = "Slavelogger"; TinctTaskService.StartMasterService(); Thread.Sleep(2000); TinctTaskService.StartSlaveService(slogname, mfilename); Thread.Sleep(2000); TinctTaskService.StartTaskService(q, mloggname, mfilename); TinctTask t1 = new TinctTask(); t1.Name = "test"; t1.DllName = "Tinct.PlatformController"; t1.NamespaceName = "Tinct.PlatformController"; t1.ClassName = "TinctTestController"; t1.MethodName = "LoadData1"; t1.Datas = "test"; q.QueueTinctTask(t1); FileTask file = new FileTask(); file.FileName = "Tinct.PlatformController.dll"; file.SourcePath = "test.txt"; file.Content = new List <byte>(); Thread.Sleep(10000); TinctTaskService.DeployFile(file); //TinctMessage msg = new TinctMessage(); //msg.MessageHeader = new MessageHeader(); //msg.MessageHeader.CommandType = CommandType.Deploy; //msg.MessageBody = new MessageBody(); //msg.MessageBody.Datas = file.ToJsonSerializeString(); //TinctMasterNode.Current.SendMessage(TinctNodeCongratulations.MasterName, msg); Console.Read(); }