@Test public void testGetTaskInfos() throws InterruptedException { taskManager.addProcessor("test", testTaskProcessor); when(testTaskProcessor.process(abstractTask)).thenReturn(true); taskManager.addTask("test", abstractTask); assertEquals("test:Thu Jan 01 08:00:00 CST 1970" + Constants.NACOS_LINE_SEPARATOR, taskManager.getTaskInfos()); TimeUnit.MILLISECONDS.sleep(150); assertEquals("test:finished" + Constants.NACOS_LINE_SEPARATOR, taskManager.getTaskInfos()); }
@Override public String getTaskInfos() { StringBuilder sb = new StringBuilder(); for (Object taskType : getAllProcessorKey()) { sb.append(taskType).append(":"); AbstractDelayTask task = this.tasks.get(taskType); if (task != null) { sb.append(new Date(task.getLastProcessTime()).toString()); } else { sb.append("finished"); } sb.append(Constants.NACOS_LINE_SEPARATOR); } return sb.toString(); }
TaskManager extends NacosDelayTaskExecuteEngine implements TaskManagerMBean { @Override public String getTaskInfos() { StringBuilder sb = new StringBuilder(); for (Object taskType : getAllProcessorKey()) { sb.append(taskType).append(":"); AbstractDelayTask task = this.tasks.get(taskType); if (task != null) { sb.append(new Date(task.getLastProcessTime()).toString()); } else { sb.append("finished"); } sb.append(Constants.NACOS_LINE_SEPARATOR); } return sb.toString(); } }
TaskManager extends NacosDelayTaskExecuteEngine implements TaskManagerMBean { @Override public String getTaskInfos() { StringBuilder sb = new StringBuilder(); for (Object taskType : getAllProcessorKey()) { sb.append(taskType).append(":"); AbstractDelayTask task = this.tasks.get(taskType); if (task != null) { sb.append(new Date(task.getLastProcessTime()).toString()); } else { sb.append("finished"); } sb.append(Constants.NACOS_LINE_SEPARATOR); } return sb.toString(); } TaskManager();  TaskManager(String name); }
TaskManager extends NacosDelayTaskExecuteEngine implements TaskManagerMBean { @Override public String getTaskInfos() { StringBuilder sb = new StringBuilder(); for (Object taskType : getAllProcessorKey()) { sb.append(taskType).append(":"); AbstractDelayTask task = this.tasks.get(taskType); if (task != null) { sb.append(new Date(task.getLastProcessTime()).toString()); } else { sb.append("finished"); } sb.append(Constants.NACOS_LINE_SEPARATOR); } return sb.toString(); } TaskManager();  TaskManager(String name); void close(); void await(); boolean await(long timeout, TimeUnit unit); @Override void addTask(Object key, AbstractDelayTask newTask); @Override AbstractDelayTask removeTask(Object key); @Override String getTaskInfos(); void init(); }
TaskManager extends NacosDelayTaskExecuteEngine implements TaskManagerMBean { @Override public String getTaskInfos() { StringBuilder sb = new StringBuilder(); for (Object taskType : getAllProcessorKey()) { sb.append(taskType).append(":"); AbstractDelayTask task = this.tasks.get(taskType); if (task != null) { sb.append(new Date(task.getLastProcessTime()).toString()); } else { sb.append("finished"); } sb.append(Constants.NACOS_LINE_SEPARATOR); } return sb.toString(); } TaskManager();  TaskManager(String name); void close(); void await(); boolean await(long timeout, TimeUnit unit); @Override void addTask(Object key, AbstractDelayTask newTask); @Override AbstractDelayTask removeTask(Object key); @Override String getTaskInfos(); void init();  }