- From: Jonathan Barouh via cvs-syncmail <cvsmail@w3.org>
- Date: Wed, 30 Jul 2008 14:19:08 +0000
- To: www-validator-cvs@w3.org
Update of /sources/public/2006/unicorn/org/w3c/unicorn/tests In directory hutz:/tmp/cvs-serv5995/org/w3c/unicorn/tests Modified Files: TaskTest.java Log Message: Test for the new Task.expand method. Index: TaskTest.java =================================================================== RCS file: /sources/public/2006/unicorn/org/w3c/unicorn/tests/TaskTest.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- TaskTest.java 22 Jul 2008 12:22:06 -0000 1.1 +++ TaskTest.java 30 Jul 2008 14:19:06 -0000 1.2 @@ -7,8 +7,12 @@ import java.io.File; import java.io.IOException; import java.util.ArrayList; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.Map; import org.apache.xmlbeans.XmlException; +import org.w3.unicorn.tasklist.TaskType; import org.w3.unicorn.tasklist.TasklistDocument; import org.w3c.unicorn.tasklist.Task; import org.w3c.unicorn.tasklisttree.TLTExec; @@ -25,16 +29,16 @@ try { TasklistDocument tasklist=TasklistDocument.Factory.parse(new File("resources/tasklist/new-tasklist.xml")); Task aTask=new Task(tasklist.getTasklist().getTaskArray(0)); - ArrayList<TLTExec> liste=new ArrayList<TLTExec>(); - aTask.getExecs(liste, aTask.getTree()); - for(TLTExec exec: liste){ - System.out.println(exec); + Map<String, Task> mapOfTask = new LinkedHashMap<String, Task>(); + for(TaskType myTask : tasklist.getTasklist().getTaskArray()){ + Task bTask=new Task(myTask); + mapOfTask.put(bTask.getID(), bTask); } + aTask.setRoot(aTask.expandNode(mapOfTask, aTask.getRoot())); + aTask.displayTree(aTask.getRoot()); } catch (XmlException e) { - // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { - // TODO Auto-generated catch block e.printStackTrace(); } }
Received on Wednesday, 30 July 2008 14:19:45 UTC