Ejemplo n.º 1
0
        public static void Tasks(
            [Description("Имя задачи для получения расширенной информации")]
            string name,
            [DefaultValue("True")]
            [Description("Вызов справки")]
            bool help)
        {
            if (!string.IsNullOrEmpty(name))
            {
                Type type;

                if (TaskFactory.TaskHandlerTypes.TryGetValue(name, out type))
                {
                    Tasks.ITask task = ((Tasks.ITask)Activator.CreateInstance(type));
                    Console.WriteLine(task.GetDescription());
                    Console.WriteLine(task.GetHelp());
                }
                else
                {
                    Console.WriteLine("Задание '{0}' не найдено.", name);
                    name = null;
                }
            }

            if (string.IsNullOrEmpty(name))
            {
                Console.WriteLine("Список доступных задач:");
                foreach (var task in TaskFactory.TaskHandlerTypes)
                {
                    Console.WriteLine("    {0}: {1}.", task.Key, ((Tasks.ITask)Activator.CreateInstance(task.Value)).GetDescription().TrimEnd('.'));
                }
            }
        }
Ejemplo n.º 2
0
 public void FindWhenThereIsOneInstanceRunning()
 {
     System.Console.WriteLine("Start Test : FindWhenThereIsOneInstanceRunning");
     Tasks.ITask JupyterNotebookTask = JupyterNotebookTool.FindTask(JNBFirstFile);
     Assert.True(JupyterNotebookTask.IsAlive());
     Assert.False(JupyterNotebookTask.IsEmpty());
     System.Console.WriteLine("End Test : FindWhenThereIsOneInstanceRunning");
 }
Ejemplo n.º 3
0
 public void FindWhenThereIsNoInstanceRunning()
 {
     System.Console.WriteLine("Start Test : Find");
     Tasks.ITask JupyterNotebookTask = JupyterNotebookTool.FindTask("HelloWorld.ipynb");
     Assert.False(JupyterNotebookTask.IsAlive());
     Assert.True(JupyterNotebookTask.IsEmpty());
     System.Console.WriteLine("End Test : Find");
 }
Ejemplo n.º 4
0
 public void FindWhenThereIsOneInstanceRunning()
 {
     System.Console.WriteLine("Start Test : FindWhenThereIsOneInstanceRunning");
     Tasks.ITask TensorBoardTask = TensorBoardTool.FindTask(TBFirstResourceFile);
     Assert.True(TensorBoardTask.IsAlive());
     Assert.False(TensorBoardTask.IsEmpty());
     System.Console.WriteLine("End Test : FindWhenThereIsOneInstanceRunning");
 }
Ejemplo n.º 5
0
 public void FindInstanceWhenThereIsNoInstanceRunning()
 {
     System.Console.WriteLine("Start Test : Find");
     Tasks.ITask TensorBoardTask = TensorBoardTool.FindTask("HelloWorld.pmml");
     Assert.False(TensorBoardTask.IsAlive());
     Assert.True(TensorBoardTask.IsEmpty());
     System.Console.WriteLine("End Test : Find");
 }
Ejemplo n.º 6
0
 public void FindInstanceWhenThereIsNoInstanceRunning()
 {
     System.Console.WriteLine("Start Test : Find");
     Tasks.ITask NetronTemplateTask = NetronTool.FindTask("HelloWorld.h5");
     Assert.False(NetronTemplateTask.IsAlive());
     Assert.True(NetronTemplateTask.IsEmpty());
     System.Console.WriteLine("End Test : Find");
 }
Ejemplo n.º 7
0
 public void StopSingleInstance()
 {
     System.Console.WriteLine("Start Test : StopSingleInstance");
     Tasks.ITask JupyterNotebookTask = JupyterNotebookTool.FindTask(JNBFirstFile);
     Assert.True(JupyterNotebookTask.IsAlive());
     Assert.False(JupyterNotebookTask.IsEmpty());
     JupyterNotebookTool.StopTask(JNBFirstFile);
     System.Threading.Thread.Sleep(2000);
     JupyterNotebookTask = JupyterNotebookTool.FindTask(JNBFirstFile);
     Assert.False(JupyterNotebookTask.IsAlive());
     Assert.True(JupyterNotebookTask.IsEmpty());
     System.Console.WriteLine("End Test : StopSingleInstance");
 }
Ejemplo n.º 8
0
 public void StopSingleInstance()
 {
     System.Console.WriteLine("Start Test : StopSingleInstance");
     Tasks.ITask TensorBoardTask = TensorBoardTool.FindTask(TBFirstResourceFile);
     Assert.True(TensorBoardTask.IsAlive());
     Assert.False(TensorBoardTask.IsEmpty());
     TensorBoardTool.StopTask(TBFirstResourceFile);
     System.Threading.Thread.Sleep(500);
     TensorBoardTask = TensorBoardTool.FindTask(TBFirstResourceFile);
     Assert.False(TensorBoardTask.IsAlive());
     Assert.True(TensorBoardTask.IsEmpty());
     System.Console.WriteLine("End Test : StopSingleInstance");
 }