Changeset 1411 for trunk/autoquest-core-tasktrees-test
- Timestamp:
- 02/27/14 17:09:29 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/autoquest-core-tasktrees-test/src/test/java/de/ugoe/cs/autoquest/tasktrees/treeimpl/TaskModelTest.java
r1402 r1411 56 56 57 57 /** */ 58 private static final int MAX_TREE_DEPTH = 1 5;58 private static final int MAX_TREE_DEPTH = 10; 59 59 60 60 /** */ … … 75 75 76 76 assertNotNull(task); 77 assertNotNull(task.getDescription());78 77 assertNotNull(task.getId()); 79 78 assertTrue(task.equals(task)); … … 122 121 123 122 assertNotNull(task); 124 assertNotNull(task.getDescription());125 123 assertNotNull(task.getId()); 126 124 assertNotNull(task.getChildren()); … … 187 185 188 186 assertNotNull(task); 189 assertNotNull(task.getDescription());190 187 assertNotNull(task.getId()); 191 188 assertNotNull(task.getChildren()); … … 252 249 253 250 assertNotNull(task); 254 assertNotNull(task.getDescription());255 251 assertNotNull(task.getId()); 256 252 assertNull(task.getMarkedTask()); … … 302 298 303 299 assertNotNull(task); 304 assertNotNull(task.getDescription());305 300 assertNotNull(task.getId()); 306 301 assertNull(task.getMarkedTask()); … … 381 376 * 382 377 */ 383 @Test( expected=IllegalArgumentException.class)378 @Test() 384 379 public void test_SequenceInstance_01() throws Exception { 385 380 IEventType eventType = new DummyInteraction("interaction", 1); … … 534 529 * 535 530 */ 536 @Test( expected=IllegalArgumentException.class)531 @Test() 537 532 public void test_IterationInstance_01() throws Exception { 538 533 IEventType eventType = new DummyInteraction("interaction", 1); … … 619 614 * 620 615 */ 621 @Test( expected=IllegalArgumentException.class)616 @Test() 622 617 public void test_OptionalInstance_01() throws Exception { 623 618 IEventType eventType = new DummyInteraction("interaction", 1); … … 801 796 } 802 797 798 //new TaskTreeEncoder().encode(task, System.err); 799 803 800 ISequenceInstance sequenceInstance = 804 801 (ISequenceInstance) instantiateTask(task, noOfMaxChildren); … … 814 811 List<IUserSession> sessions = new LinkedList<IUserSession>(); 815 812 sessions.add(session); 813 814 //new TaskTreeEncoder().encode(session, System.err); 816 815 817 816 ITaskModel taskModel = taskFactory.createTaskModel(sessions); … … 853 852 dumpMap(map1); 854 853 dumpMap(map2); 854 855 if (map1.size() > map2.size()) { 856 for (ITask task : map2.keySet()) { 857 map1.remove(task); 858 } 859 860 System.err.println("difference: "); 861 dumpMap(map1); 862 } 863 else if (map2.size() > map1.size()) { 864 for (ITask task : map1.keySet()) { 865 map2.remove(task); 866 } 867 868 System.err.println("difference: "); 869 dumpMap(map2); 870 } 871 855 872 throw e; 856 873 } … … 869 886 System.err.println("map:"); 870 887 for (Map.Entry<ITask, ITaskInfo> entry : map.entrySet()) { 888 int lineLength = 2; 871 889 System.err.print(" "); 872 890 System.err.print(entry.getKey()); 873 for (int i = entry.getKey().toString().length(); i < 60; i++) { 891 lineLength += entry.getKey().toString().length(); 892 for (int i = lineLength; i < 70; i++) { 893 System.err.print(" "); 894 } 895 lineLength = 60; 896 System.err.print(" : "); 897 lineLength += 3; 898 System.err.print(entry.getValue()); 899 lineLength += entry.getValue().toString().length(); 900 for (int i = lineLength; i < 140; i++) { 874 901 System.err.print(" "); 875 902 } 876 903 System.err.print(" : "); 877 System.err.println(entry.get Value());904 System.err.println(entry.getKey().getDescription()); 878 905 } 879 906 } … … 1005 1032 for (int i = 0; i < noOfChildren; i++) { 1006 1033 ITask child = createTaskTree(maxNoOfChildren, maxDepth - 1, taskInfos); 1034 1035 //((Task) child).setDescription(sequence.toString()); 1007 1036 taskBuilder.addChild(sequence, child); 1008 1037 } … … 1042 1071 int noOfChildren = randomize(1, maxNoOfChildren); 1043 1072 1073 Map<ITask, ITaskInfo> childrenTaskInfos = new HashMap<ITask, ITaskInfo>(); 1044 1074 for (int i = 0; i < noOfChildren; i++) { 1045 1075 ITask child; 1046 1076 do { 1047 child = createTaskTree(maxNoOfChildren, maxDepth - 1, taskInfos); 1077 childrenTaskInfos.clear(); 1078 child = createTaskTree(maxNoOfChildren, maxDepth - 1, childrenTaskInfos); 1048 1079 } 1049 1080 while (child instanceof ISelection); 1050 1081 1082 //((Task) child).setDescription(selection.toString()); 1051 1083 taskBuilder.addChild(selection, child); 1084 taskInfos.putAll(childrenTaskInfos); 1052 1085 } 1053 1086 … … 1083 1116 IIteration iteration = taskFactory.createNewIteration(); 1084 1117 1118 Map<ITask, ITaskInfo> childrenTaskInfos = new HashMap<ITask, ITaskInfo>(); 1085 1119 ITask child; 1086 1120 do { 1087 child = createTaskTree(maxNoOfChildren, maxDepth - 1, taskInfos); 1121 childrenTaskInfos.clear(); 1122 child = createTaskTree(maxNoOfChildren, maxDepth - 1, childrenTaskInfos); 1088 1123 } 1089 1124 while ((child instanceof IOptional) || (child instanceof IIteration)); 1090 1125 1126 //((Task) child).setDescription(iteration.toString()); 1091 1127 taskBuilder.setMarkedTask(iteration, child); 1128 taskInfos.putAll(childrenTaskInfos); 1092 1129 1093 1130 taskInfos.put(iteration, new TaskInfo(iteration)); … … 1122 1159 IOptional optional = taskFactory.createNewOptional(); 1123 1160 1161 Map<ITask, ITaskInfo> childrenTaskInfos = new HashMap<ITask, ITaskInfo>(); 1124 1162 ITask child; 1125 1163 do { 1126 child = createTaskTree(maxNoOfChildren, maxDepth - 1, taskInfos); 1164 childrenTaskInfos.clear(); 1165 child = createTaskTree(maxNoOfChildren, maxDepth - 1, childrenTaskInfos); 1127 1166 } 1128 1167 while (child instanceof IOptional); 1129 1168 1169 //((Task) child).setDescription(optional.toString()); 1130 1170 taskBuilder.setMarkedTask(optional, child); 1171 taskInfos.putAll(childrenTaskInfos); 1131 1172 1132 1173 taskInfos.put(optional, new TaskInfo(optional));
Note: See TracChangeset
for help on using the changeset viewer.