Mercurial > hg > Database > Alice
view src/alice/topology/manager/keeparive/ListManagerTest.java @ 329:35b4e24e3e02
setNowTask method need synchronized. may be...
author | sugi |
---|---|
date | Mon, 24 Mar 2014 23:52:20 +0900 |
parents | 370a2f63944f |
children | d35ff0f588e8 |
line wrap: on
line source
package alice.topology.manager.keeparive; import java.util.LinkedList; public class ListManagerTest { public static void main(String args[]){ TaskExecuter.getInstance().getNowTask(); ListManager manager = new ListManager(); LinkedList<String> nameList = new LinkedList<String>(); nameList.add("nodeA"); nameList.add("nodeB"); nameList.add("nodeC"); nameList.add("nodeD"); TaskInfo taskA = new TaskInfo(TaskType.PING); taskA.setInfo("node0", "_TEST", 3 * 1000); TaskExecuter.getInstance().setNowTask(taskA); int i = 5; for (String name : nameList){ TaskInfo task = new TaskInfo(TaskType.PING); task.setInfo(name, "_TEST", i * 1000); System.out.println(task.getSleepTime()); manager.addTask(task); manager.showList(); i +=1; } TaskExecuter.getInstance().skip(); i = 11; for (String name : nameList){ TaskInfo task = new TaskInfo(TaskType.PING); task.setInfo(name, "_TEST", i * 1000); System.out.println(task.getSleepTime()); manager.addTask(task); manager.showList(); i +=1; } manager = new ListManager(); System.out.println(TaskExecuter.getInstance().getRemainingTime()); TaskExecuter.getInstance().setNowTask(taskA); TaskExecuter.getInstance().skip(); System.out.println(TaskExecuter.getInstance().getRemainingTime()); } }