2006/unicorn/org/w3c/unicorn/tests TaskTest.java,1.2,1.3

Update of /sources/public/2006/unicorn/org/w3c/unicorn/tests
In directory hutz:/tmp/cvs-serv21947/org/w3c/unicorn/tests

Modified Files:
	TaskTest.java 
Log Message:
Some test for the expansion algorithm and XMLBeans reading of the tasklist

Index: TaskTest.java
===================================================================
RCS file: /sources/public/2006/unicorn/org/w3c/unicorn/tests/TaskTest.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- TaskTest.java	30 Jul 2008 14:19:06 -0000	1.2
+++ TaskTest.java	30 Jul 2008 14:45:51 -0000	1.3
@@ -6,8 +6,6 @@
 
 import java.io.File;
 import java.io.IOException;
-import java.util.ArrayList;
-import java.util.HashMap;
 import java.util.LinkedHashMap;
 import java.util.Map;
 
@@ -15,7 +13,8 @@
 import org.w3.unicorn.tasklist.TaskType;
 import org.w3.unicorn.tasklist.TasklistDocument;
 import org.w3c.unicorn.tasklist.Task;
-import org.w3c.unicorn.tasklisttree.TLTExec;
+import org.w3c.unicorn.tasklist.TaskListUnmarshallerBeans;
+
 /**
  * @author shenril
  *
@@ -27,15 +26,18 @@
 	 */
 	public static void main(String[] args) {
 		try {
-			TasklistDocument tasklist=TasklistDocument.Factory.parse(new File("resources/tasklist/new-tasklist.xml"));
-			Task aTask=new Task(tasklist.getTasklist().getTaskArray(0));
+			TasklistDocument tasklist=TasklistDocument.Factory.parse(new File("./resources/tasklist/new-tasklist.xml"));
+			TaskListUnmarshallerBeans unmarshaller=new TaskListUnmarshallerBeans();
+			Task aTask=new Task();
+			aTask.setTree(unmarshaller.ExpandTree(tasklist.getTasklist().getTaskArray(0)));
 			Map<String, Task> mapOfTask = new LinkedHashMap<String, Task>();
 			for(TaskType myTask : tasklist.getTasklist().getTaskArray()){
-				Task bTask=new Task(myTask);
+				Task bTask=new Task();
+				aTask.setTree(unmarshaller.ExpandTree(myTask));
 				mapOfTask.put(bTask.getID(), bTask);
 			}
-			aTask.setRoot(aTask.expandNode(mapOfTask, aTask.getRoot()));
-			aTask.displayTree(aTask.getRoot()); 
+			aTask.setTree(aTask.expandNode(mapOfTask, aTask.getTree()));
+			aTask.displayTree(aTask.getTree()); 
 		} catch (XmlException e) {
 			e.printStackTrace();
 		} catch (IOException e) {

Received on Wednesday, 30 July 2008 14:57:41 UTC