Ignore:
Timestamp:
09/11/12 16:45:51 (12 years ago)
Author:
pharms
Message:
  • improved node equality comparison to match the principle of lexical, syntactical and semantical node equality. As a result, more condensed task trees are created.
Location:
trunk/quest-core-tasktrees-test/src/test/java/de/ugoe/cs/quest/tasktrees/nodeequality
Files:
4 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/quest-core-tasktrees-test/src/test/java/de/ugoe/cs/quest/tasktrees/nodeequality/NodeEqualityTest.java

    r655 r807  
    66 
    77/** 
    8  * TODO comment 
    9  *  
    10  * @version $Revision: $ $Date: 15.08.2012$ 
    11  * @author 2012, last modified by $Author: pharms$ 
     8 * @author Patrick Harms 
    129 */ 
    1310public class NodeEqualityTest { 
    1411 
    1512    /** 
    16      * TODO: comment 
    1713     * 
    1814     */ 
  • trunk/quest-core-tasktrees-test/src/test/java/de/ugoe/cs/quest/tasktrees/nodeequality/SequenceComparisonRuleTest.java

    r655 r807  
    55import org.junit.Test; 
    66 
     7import de.ugoe.cs.quest.tasktrees.treeifc.ISelection; 
    78import de.ugoe.cs.quest.tasktrees.treeifc.ISequence; 
    89import de.ugoe.cs.quest.tasktrees.treeifc.ITaskTreeBuilder; 
     
    1415 
    1516/** 
    16  * <p> 
    17  * TODO comment 
    18  * </p> 
    19  *  
    20  * @version $Revision: $ $Date: 16.08.2012$ 
    21  * @author 2012, last modified by $Author: pharms$ 
     17 * @author Patrick Harms 
    2218 */ 
    2319public class SequenceComparisonRuleTest { 
    2420 
    2521    /** 
    26      * <p> 
    27      * TODO: comment 
    28      * </p> 
    29      * 
     22     *  
    3023     */ 
    3124    @Test 
     
    4538         
    4639        ISequence sequence1 = treeNodeFactory.createNewSequence(); 
    47         assertEquals(NodeEquality.LEXICALLY_EQUAL, rule.compare(sequence1, sequence1)); 
     40        assertEquals(NodeEquality.IDENTICAL, rule.compare(sequence1, sequence1)); 
    4841 
    4942        ISequence sequence2 = treeNodeFactory.createNewSequence(); 
     
    5447        treeBuilder.addChild(sequence1, task1); 
    5548         
    56         assertNull(rule.compare(sequence1, sequence2)); 
    57         assertNull(rule.compare(sequence2, sequence1)); 
     49        assertEquals(NodeEquality.UNEQUAL, rule.compare(sequence1, sequence2)); 
     50        assertEquals(NodeEquality.UNEQUAL, rule.compare(sequence2, sequence1)); 
    5851         
    5952        treeBuilder.addChild(sequence2, task1); 
     
    6457        treeBuilder.addChild(sequence1, task2); 
    6558         
    66         assertNull(rule.compare(sequence1, sequence2)); 
    67         assertNull(rule.compare(sequence2, sequence1)); 
     59        assertEquals(NodeEquality.UNEQUAL, rule.compare(sequence1, sequence2)); 
     60        assertEquals(NodeEquality.UNEQUAL, rule.compare(sequence2, sequence1)); 
    6861         
    6962        treeBuilder.addChild(sequence2, task2); 
     
    7669        treeBuilder.addChild(sequence3, task1); 
    7770         
    78         assertNull(rule.compare(sequence1, sequence3)); 
    79         assertNull(rule.compare(sequence3, sequence1)); 
     71        assertEquals(NodeEquality.UNEQUAL, rule.compare(sequence1, sequence3)); 
     72        assertEquals(NodeEquality.UNEQUAL, rule.compare(sequence3, sequence1)); 
     73        assertEquals(NodeEquality.UNEQUAL, rule.compare(sequence2, sequence3)); 
     74        assertEquals(NodeEquality.UNEQUAL, rule.compare(sequence3, sequence2)); 
     75 
     76        ISelection selection = treeNodeFactory.createNewSelection(); 
     77        assertNull(rule.compare(sequence1, selection)); 
     78        assertNull(rule.compare(selection, sequence1)); 
     79        assertNull(rule.compare(sequence2, selection)); 
     80        assertNull(rule.compare(selection, sequence2)); 
     81        assertNull(rule.compare(sequence3, selection)); 
     82        assertNull(rule.compare(selection, sequence3)); 
    8083    } 
    8184 
Note: See TracChangeset for help on using the changeset viewer.