Ignore:
Timestamp:
04/04/13 16:06:07 (11 years ago)
Author:
pharms
Message:
  • complete refactoring of task tree model with a separation of task models and task instances
  • appropriate adaptation of task tree generation process
  • appropriate adaptation of commands and task tree visualization
Location:
trunk/autoquest-core-tasktrees-test/src/test/java/de/ugoe/cs/autoquest/tasktrees/taskequality
Files:
2 copied

Legend:

Unmodified
Added
Removed
  • trunk/autoquest-core-tasktrees-test/src/test/java/de/ugoe/cs/autoquest/tasktrees/taskequality/TaskAndSelectionComparisonRuleTest.java

    r927 r1146  
    1313//   limitations under the License. 
    1414 
    15 package de.ugoe.cs.autoquest.tasktrees.nodeequality; 
     15package de.ugoe.cs.autoquest.tasktrees.taskequality; 
    1616 
    1717import static org.junit.Assert.*; 
     
    1919import org.junit.Test; 
    2020 
    21 import de.ugoe.cs.autoquest.tasktrees.nodeequality.NodeAndSelectionComparisonRule; 
    22 import de.ugoe.cs.autoquest.tasktrees.nodeequality.NodeEquality; 
    23 import de.ugoe.cs.autoquest.tasktrees.nodeequality.NodeEqualityRuleManager; 
     21import de.ugoe.cs.autoquest.eventcore.IEventTarget; 
     22import de.ugoe.cs.autoquest.eventcore.IEventType; 
     23import de.ugoe.cs.autoquest.eventcore.StringEventType; 
     24import de.ugoe.cs.autoquest.tasktrees.taskequality.TaskAndSelectionComparisonRule; 
     25import de.ugoe.cs.autoquest.tasktrees.taskequality.TaskEquality; 
     26import de.ugoe.cs.autoquest.tasktrees.taskequality.TaskEqualityRuleManager; 
    2427import de.ugoe.cs.autoquest.tasktrees.treeifc.ISelection; 
    25 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskTreeBuilder; 
    26 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskTreeNode; 
    27 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskTreeNodeFactory; 
    28 import de.ugoe.cs.autoquest.tasktrees.treeimpl.TaskTreeBuilder; 
    29 import de.ugoe.cs.autoquest.tasktrees.treeimpl.TaskTreeNode; 
    30 import de.ugoe.cs.autoquest.tasktrees.treeimpl.TaskTreeNodeFactory; 
     28import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskBuilder; 
     29import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask; 
     30import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskFactory; 
     31import de.ugoe.cs.autoquest.tasktrees.treeimpl.TaskBuilder; 
     32import de.ugoe.cs.autoquest.tasktrees.treeimpl.TaskFactory; 
     33import de.ugoe.cs.autoquest.test.DummyGUIElement; 
    3134 
    3235/** 
    3336 * @author Patrick Harms 
    3437 */ 
    35 public class NodeAndSelectionComparisonRuleTest { 
     38public class TaskAndSelectionComparisonRuleTest { 
    3639 
    3740    /** 
     
    4043    @Test 
    4144    public void test() { 
    42         NodeEqualityRuleManager manager = new NodeEqualityRuleManager(); 
     45        TaskEqualityRuleManager manager = new TaskEqualityRuleManager(); 
    4346        manager.init(); 
    4447         
    45         ITaskTreeNodeFactory treeNodeFactory = new TaskTreeNodeFactory(); 
    46         ITaskTreeBuilder treeBuilder = new TaskTreeBuilder(); 
     48        ITaskFactory taskFactory = new TaskFactory(); 
     49        ITaskBuilder treeBuilder = new TaskBuilder(); 
    4750         
    48         NodeAndSelectionComparisonRule rule = new NodeAndSelectionComparisonRule(manager); 
     51        TaskAndSelectionComparisonRule rule = new TaskAndSelectionComparisonRule(manager); 
    4952         
    50         ITaskTreeNode task1 = new TaskTreeNode("task1"); 
     53        IEventType eventType1 = new StringEventType("eventType1"); 
     54        IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 
     55        ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1); 
    5156         
    5257        assertNull(rule.compare(task1, task1)); 
    5358         
    54         ISelection selection1 = treeNodeFactory.createNewSelection(); 
     59        ISelection selection1 = taskFactory.createNewSelection(); 
    5560        assertNull(rule.compare(selection1, selection1)); 
    5661        assertNull(rule.compare(task1, selection1)); 
     
    5964        treeBuilder.addChild(selection1, task1); 
    6065         
    61         assertEquals(NodeEquality.LEXICALLY_EQUAL, rule.compare(selection1, task1)); 
    62         assertEquals(NodeEquality.LEXICALLY_EQUAL, rule.compare(task1, selection1)); 
     66        assertEquals(TaskEquality.LEXICALLY_EQUAL, rule.compare(selection1, task1)); 
     67        assertEquals(TaskEquality.LEXICALLY_EQUAL, rule.compare(task1, selection1)); 
    6368         
    64         selection1 = treeNodeFactory.createNewSelection(); 
    65         ISelection selection2 = treeNodeFactory.createNewSelection(); 
     69        selection1 = taskFactory.createNewSelection(); 
     70        ISelection selection2 = taskFactory.createNewSelection(); 
    6671        treeBuilder.addChild(selection2, task1); 
    6772        treeBuilder.addChild(selection1, selection2); 
    6873         
    69         assertEquals(NodeEquality.LEXICALLY_EQUAL, rule.compare(selection1, task1)); 
    70         assertEquals(NodeEquality.LEXICALLY_EQUAL, rule.compare(task1, selection1)); 
     74        assertEquals(TaskEquality.LEXICALLY_EQUAL, rule.compare(selection1, task1)); 
     75        assertEquals(TaskEquality.LEXICALLY_EQUAL, rule.compare(task1, selection1)); 
    7176    } 
    7277 
Note: See TracChangeset for help on using the changeset viewer.