Changeset 1146 for trunk/autoquest-core-tasktrees-test/src/test/java/de/ugoe/cs/autoquest/tasktrees/taskequality/TaskAndSelectionComparisonRuleTest.java
- Timestamp:
- 04/04/13 16:06:07 (11 years ago)
- 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 13 13 // limitations under the License. 14 14 15 package de.ugoe.cs.autoquest.tasktrees. nodeequality;15 package de.ugoe.cs.autoquest.tasktrees.taskequality; 16 16 17 17 import static org.junit.Assert.*; … … 19 19 import org.junit.Test; 20 20 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; 21 import de.ugoe.cs.autoquest.eventcore.IEventTarget; 22 import de.ugoe.cs.autoquest.eventcore.IEventType; 23 import de.ugoe.cs.autoquest.eventcore.StringEventType; 24 import de.ugoe.cs.autoquest.tasktrees.taskequality.TaskAndSelectionComparisonRule; 25 import de.ugoe.cs.autoquest.tasktrees.taskequality.TaskEquality; 26 import de.ugoe.cs.autoquest.tasktrees.taskequality.TaskEqualityRuleManager; 24 27 import de.ugoe.cs.autoquest.tasktrees.treeifc.ISelection; 25 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask TreeBuilder;26 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask TreeNode;27 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask TreeNodeFactory;28 import de.ugoe.cs.autoquest.tasktrees.treeimpl.Task TreeBuilder;29 import de.ugoe.cs.autoquest.tasktrees.treeimpl.Task TreeNode;30 import de.ugoe.cs.autoquest.t asktrees.treeimpl.TaskTreeNodeFactory;28 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskBuilder; 29 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask; 30 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskFactory; 31 import de.ugoe.cs.autoquest.tasktrees.treeimpl.TaskBuilder; 32 import de.ugoe.cs.autoquest.tasktrees.treeimpl.TaskFactory; 33 import de.ugoe.cs.autoquest.test.DummyGUIElement; 31 34 32 35 /** 33 36 * @author Patrick Harms 34 37 */ 35 public class NodeAndSelectionComparisonRuleTest {38 public class TaskAndSelectionComparisonRuleTest { 36 39 37 40 /** … … 40 43 @Test 41 44 public void test() { 42 NodeEqualityRuleManager manager = new NodeEqualityRuleManager();45 TaskEqualityRuleManager manager = new TaskEqualityRuleManager(); 43 46 manager.init(); 44 47 45 ITask TreeNodeFactory treeNodeFactory = new TaskTreeNodeFactory();46 ITask TreeBuilder treeBuilder = new TaskTreeBuilder();48 ITaskFactory taskFactory = new TaskFactory(); 49 ITaskBuilder treeBuilder = new TaskBuilder(); 47 50 48 NodeAndSelectionComparisonRule rule = new NodeAndSelectionComparisonRule(manager);51 TaskAndSelectionComparisonRule rule = new TaskAndSelectionComparisonRule(manager); 49 52 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); 51 56 52 57 assertNull(rule.compare(task1, task1)); 53 58 54 ISelection selection1 = t reeNodeFactory.createNewSelection();59 ISelection selection1 = taskFactory.createNewSelection(); 55 60 assertNull(rule.compare(selection1, selection1)); 56 61 assertNull(rule.compare(task1, selection1)); … … 59 64 treeBuilder.addChild(selection1, task1); 60 65 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)); 63 68 64 selection1 = t reeNodeFactory.createNewSelection();65 ISelection selection2 = t reeNodeFactory.createNewSelection();69 selection1 = taskFactory.createNewSelection(); 70 ISelection selection2 = taskFactory.createNewSelection(); 66 71 treeBuilder.addChild(selection2, task1); 67 72 treeBuilder.addChild(selection1, selection2); 68 73 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)); 71 76 } 72 77
Note: See TracChangeset
for help on using the changeset viewer.