Ignore:
Timestamp:
02/27/14 17:09:29 (10 years ago)
Author:
pharms
Message:
  • test should not fail anymore after also committing some other changes in the task model
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  
    5656     
    5757    /** */ 
    58     private static final int MAX_TREE_DEPTH = 15; 
     58    private static final int MAX_TREE_DEPTH = 10; 
    5959 
    6060    /** */ 
     
    7575         
    7676        assertNotNull(task); 
    77         assertNotNull(task.getDescription()); 
    7877        assertNotNull(task.getId()); 
    7978        assertTrue(task.equals(task)); 
     
    122121         
    123122        assertNotNull(task); 
    124         assertNotNull(task.getDescription()); 
    125123        assertNotNull(task.getId()); 
    126124        assertNotNull(task.getChildren()); 
     
    187185         
    188186        assertNotNull(task); 
    189         assertNotNull(task.getDescription()); 
    190187        assertNotNull(task.getId()); 
    191188        assertNotNull(task.getChildren()); 
     
    252249         
    253250        assertNotNull(task); 
    254         assertNotNull(task.getDescription()); 
    255251        assertNotNull(task.getId()); 
    256252        assertNull(task.getMarkedTask()); 
     
    302298         
    303299        assertNotNull(task); 
    304         assertNotNull(task.getDescription()); 
    305300        assertNotNull(task.getId()); 
    306301        assertNull(task.getMarkedTask()); 
     
    381376     * 
    382377     */ 
    383     @Test(expected=IllegalArgumentException.class) 
     378    @Test() 
    384379    public void test_SequenceInstance_01() throws Exception { 
    385380        IEventType eventType = new DummyInteraction("interaction", 1); 
     
    534529     * 
    535530     */ 
    536     @Test(expected=IllegalArgumentException.class) 
     531    @Test() 
    537532    public void test_IterationInstance_01() throws Exception { 
    538533        IEventType eventType = new DummyInteraction("interaction", 1); 
     
    619614     * 
    620615     */ 
    621     @Test(expected=IllegalArgumentException.class) 
     616    @Test() 
    622617    public void test_OptionalInstance_01() throws Exception { 
    623618        IEventType eventType = new DummyInteraction("interaction", 1); 
     
    801796            } 
    802797             
     798            //new TaskTreeEncoder().encode(task, System.err); 
     799 
    803800            ISequenceInstance sequenceInstance = 
    804801                (ISequenceInstance) instantiateTask(task, noOfMaxChildren); 
     
    814811            List<IUserSession> sessions = new LinkedList<IUserSession>(); 
    815812            sessions.add(session); 
     813             
     814            //new TaskTreeEncoder().encode(session, System.err); 
    816815             
    817816            ITaskModel taskModel = taskFactory.createTaskModel(sessions); 
     
    853852            dumpMap(map1); 
    854853            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             
    855872            throw e; 
    856873        } 
     
    869886            System.err.println("map:"); 
    870887            for (Map.Entry<ITask, ITaskInfo> entry : map.entrySet()) { 
     888                int lineLength = 2; 
    871889                System.err.print("  "); 
    872890                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++) { 
    874901                    System.err.print(" "); 
    875902                } 
    876903                System.err.print(" : "); 
    877                 System.err.println(entry.getValue()); 
     904                System.err.println(entry.getKey().getDescription()); 
    878905            } 
    879906        } 
     
    10051032        for (int i = 0; i < noOfChildren; i++) { 
    10061033            ITask child = createTaskTree(maxNoOfChildren, maxDepth - 1, taskInfos); 
     1034             
     1035            //((Task) child).setDescription(sequence.toString()); 
    10071036            taskBuilder.addChild(sequence, child); 
    10081037        } 
     
    10421071        int noOfChildren = randomize(1, maxNoOfChildren); 
    10431072         
     1073        Map<ITask, ITaskInfo> childrenTaskInfos = new HashMap<ITask, ITaskInfo>(); 
    10441074        for (int i = 0; i < noOfChildren; i++) { 
    10451075            ITask child; 
    10461076            do { 
    1047                 child = createTaskTree(maxNoOfChildren, maxDepth - 1, taskInfos); 
     1077                childrenTaskInfos.clear(); 
     1078                child = createTaskTree(maxNoOfChildren, maxDepth - 1, childrenTaskInfos); 
    10481079            } 
    10491080            while (child instanceof ISelection); 
    10501081             
     1082            //((Task) child).setDescription(selection.toString()); 
    10511083            taskBuilder.addChild(selection, child); 
     1084            taskInfos.putAll(childrenTaskInfos); 
    10521085        } 
    10531086 
     
    10831116        IIteration iteration = taskFactory.createNewIteration(); 
    10841117 
     1118        Map<ITask, ITaskInfo> childrenTaskInfos = new HashMap<ITask, ITaskInfo>(); 
    10851119        ITask child; 
    10861120        do { 
    1087             child = createTaskTree(maxNoOfChildren, maxDepth - 1, taskInfos); 
     1121            childrenTaskInfos.clear(); 
     1122            child = createTaskTree(maxNoOfChildren, maxDepth - 1, childrenTaskInfos); 
    10881123        } 
    10891124        while ((child instanceof IOptional) || (child instanceof IIteration)); 
    10901125         
     1126        //((Task) child).setDescription(iteration.toString()); 
    10911127        taskBuilder.setMarkedTask(iteration, child); 
     1128        taskInfos.putAll(childrenTaskInfos); 
    10921129 
    10931130        taskInfos.put(iteration, new TaskInfo(iteration)); 
     
    11221159        IOptional optional = taskFactory.createNewOptional(); 
    11231160 
     1161        Map<ITask, ITaskInfo> childrenTaskInfos = new HashMap<ITask, ITaskInfo>(); 
    11241162        ITask child; 
    11251163        do { 
    1126             child = createTaskTree(maxNoOfChildren, maxDepth - 1, taskInfos); 
     1164            childrenTaskInfos.clear(); 
     1165            child = createTaskTree(maxNoOfChildren, maxDepth - 1, childrenTaskInfos); 
    11271166        } 
    11281167        while (child instanceof IOptional); 
    11291168         
     1169        //((Task) child).setDescription(optional.toString()); 
    11301170        taskBuilder.setMarkedTask(optional, child); 
     1171        taskInfos.putAll(childrenTaskInfos); 
    11311172 
    11321173        taskInfos.put(optional, new TaskInfo(optional)); 
Note: See TracChangeset for help on using the changeset viewer.