Changeset 557 for trunk/quest-core-tasktrees-test/src/test/java/de/ugoe/cs/quest/tasktrees/temporalrelation/TrackBarSelectionDetectionRuleTest.java
- Timestamp:
- 08/17/12 08:33:29 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/quest-core-tasktrees-test/src/test/java/de/ugoe/cs/quest/tasktrees/temporalrelation/TrackBarSelectionDetectionRuleTest.java
r468 r557 1 //-------------------------------------------------------------------------------------------------2 1 // Module : $RCSfile: DefaultIterationDetectionRuleTest.java,v $ 3 2 // Version : $Revision: 0.0 $ $Author: patrick $ $Date: 28.04.2012 $ … … 5 4 // Creation : 2012 by patrick 6 5 // Copyright : Patrick Harms, 2012 7 //------------------------------------------------------------------------------------------------- 6 8 7 package de.ugoe.cs.quest.tasktrees.temporalrelation; 9 8 10 9 import org.junit.Test; 11 10 12 import de.ugoe.cs.quest.eventcore.gui model.GUIElement;13 import de.ugoe.cs.quest.eventcore.guimodel. TrackBar;14 import de.ugoe.cs.quest.eventcore. userinteraction.ValueSelection;11 import de.ugoe.cs.quest.eventcore.gui.ValueSelection; 12 import de.ugoe.cs.quest.eventcore.guimodel.IGUIElement; 13 import de.ugoe.cs.quest.eventcore.guimodel.ITrackBar; 15 14 import de.ugoe.cs.quest.tasktrees.testutils.DummyGUIElement; 16 15 import de.ugoe.cs.quest.tasktrees.testutils.DummyInteraction; 17 16 import de.ugoe.cs.quest.tasktrees.testutils.TaskTreeChecker; 18 17 19 //-------------------------------------------------------------------------------------------------20 18 /** 21 19 * TODO comment … … 24 22 * @author 2012, last modified by $Author: patrick$ 25 23 */ 26 //------------------------------------------------------------------------------------------------- 27 public class TrackBarSelectionDetectionRuleTest extends AbstractTemporalRelationshipTC 28 { 24 public class TrackBarSelectionDetectionRuleTest extends AbstractTemporalRelationshipTC { 29 25 30 //-----------------------------------------------------------------------------------------------31 /**32 *33 */34 //-----------------------------------------------------------------------------------------------35 @Test36 public void testSimpleDetection() throws Exception37 {38 GUIElement element1 = new DummyTrackBar();39 simulateInteraction(element1, new ValueSelection<Integer>(1));40 new TaskTreeChecker().assertTaskTree41 ("Sequence sequence1 {" +42 " Iteration interation1 {" +43 " Selection selection1 {" +44 " Interaction ValueSelection {}" +45 " }" +46 " }" +47 "}", getTaskTree());48 49 simulateInteraction(element1, new ValueSelection<Integer>(2));50 new TaskTreeChecker().assertTaskTree51 ("Sequence sequence1 {" +52 " Iteration interation1 {" +53 " Selection selection1 {" +54 " Interaction ValueSelection {}" +55 " Interaction ValueSelection {}" +56 " }" +57 " }" +58 "}", getTaskTree());59 60 simulateInteraction(element1, new ValueSelection<Integer>(3));61 new TaskTreeChecker().assertTaskTree62 ("Sequence sequence1 {" +63 " Iteration interation1 {" +64 " Selection selection1 {" +65 " Interaction ValueSelection {}" +66 " Interaction ValueSelection {}" +67 " Interaction ValueSelection {}" +68 " }" +69 " }" +70 "}", getTaskTree());71 72 simulateInteraction(element1, new ValueSelection<Integer>(2));73 new TaskTreeChecker().assertTaskTree74 ("Sequence sequence1 {" +75 " Iteration interation1 {" +76 " Selection selection1 {" +77 " Interaction ValueSelection {}" +78 " Interaction ValueSelection {}" +79 " Interaction ValueSelection {}" +80 " }" +81 " }" +82 "}", getTaskTree());83 84 simulateInteraction(element1, new ValueSelection<Integer>(3));85 new TaskTreeChecker().assertTaskTree86 ("Sequence sequence1 {" +87 " Iteration interation1 {" +88 " Selection selection1 {" +89 " Interaction ValueSelection {}" +90 " Interaction ValueSelection {}" +91 " Interaction ValueSelection {}" +92 " }" +93 " }" +94 "}", getTaskTree());95 96 }97 98 //-----------------------------------------------------------------------------------------------99 /**100 *101 */102 //-----------------------------------------------------------------------------------------------103 @Test104 public void testComplexDetection() throws Exception105 {106 GUIElement element1 = new DummyTrackBar();107 simulateInteraction(element1, new ValueSelection<Integer>(1));108 simulateInteraction(element1, new ValueSelection<Integer>(2));109 simulateInteraction(element1, new ValueSelection<Integer>(3));110 simulateInteraction(element1, new ValueSelection<Integer>(1));111 simulateInteraction(element1, new DummyInteraction("bla", 1));112 simulateInteraction(element1, new DummyInteraction("bla", 2));113 simulateInteraction(element1, new ValueSelection<Integer>(2));114 simulateInteraction(element1, new ValueSelection<Integer>(1));115 simulateInteraction(element1, new DummyInteraction("bla", 3));116 simulateInteraction(element1, new ValueSelection<Integer>(3));117 simulateInteraction(element1, new ValueSelection<Integer>(2));118 simulateInteraction(element1, new ValueSelection<Integer>(3));119 simulateInteraction(element1, new DummyInteraction("bla", 1));120 simulateInteraction(element1, new DummyInteraction("bla", 2));121 simulateInteraction(element1, new ValueSelection<Integer>(1));122 simulateInteraction(element1, new ValueSelection<Integer>(1));123 124 new TaskTreeChecker().assertTaskTree125 ("Sequence sequence1 {" +126 " Iteration interation1 {" +127 " Selection selection1 {" +128 " Interaction ValueSelection {}" +129 " Interaction ValueSelection {}" +130 " Interaction ValueSelection {}" +131 " }" +132 " }" +133 " Interaction bla {}" +134 " Interaction bla {}" +135 " Iteration interation2 {" +136 " Selection selection2 {" +137 " Interaction ValueSelection {}" +138 " Interaction ValueSelection {}" +139 " }" +140 " }" +141 " Interaction bla {}" +142 " Iteration interation3 {" +143 " Selection selection3 {" +144 " Interaction ValueSelection {}" +145 " Interaction ValueSelection {}" +146 " }" +147 " }" +148 " Interaction bla {}" +149 " Interaction bla {}" +150 " Iteration interation4 {" +151 " Selection selection4 {" +152 " Interaction ValueSelection {}" +153 " }" +154 " }" +155 "}", getTaskTree());156 }157 158 //-----------------------------------------------------------------------------------------------159 /**160 * TODO comment161 *162 * @version $Revision: $ $Date: 28.04.2012$163 * @author 2012, last modified by $Author: patrick$164 */165 //-----------------------------------------------------------------------------------------------166 public class DummyTrackBar extends DummyGUIElement implements TrackBar167 {168 169 //---------------------------------------------------------------------------------------------170 26 /** 171 27 * 172 28 */ 173 //--------------------------------------------------------------------------------------------- 174 public DummyTrackBar() 175 { 176 super("DummyTrackBar"); 29 @Test 30 public void testSimpleDetection() throws Exception { 31 IGUIElement element1 = new DummyTrackBar(); 32 simulateEvent(new ValueSelection<Integer>(1), element1); 33 new TaskTreeChecker().assertTaskTree 34 ("Sequence sequence1 {" + 35 " Iteration interation1 {" + 36 " Selection selection1 {" + 37 " Event ValueSelection {}" + 38 " }" + 39 " }" + 40 "}", getTaskTree()); 41 42 simulateEvent(new ValueSelection<Integer>(2), element1); 43 new TaskTreeChecker().assertTaskTree 44 ("Sequence sequence1 {" + 45 " Iteration interation1 {" + 46 " Selection selection1 {" + 47 " Event ValueSelection {}" + 48 " Event ValueSelection {}" + 49 " }" + 50 " }" + 51 "}", getTaskTree()); 52 53 simulateEvent(new ValueSelection<Integer>(3), element1); 54 new TaskTreeChecker().assertTaskTree 55 ("Sequence sequence1 {" + 56 " Iteration interation1 {" + 57 " Selection selection1 {" + 58 " Event ValueSelection {}" + 59 " Event ValueSelection {}" + 60 " Event ValueSelection {}" + 61 " }" + 62 " }" + 63 "}", getTaskTree()); 64 65 simulateEvent(new ValueSelection<Integer>(2), element1); 66 new TaskTreeChecker().assertTaskTree 67 ("Sequence sequence1 {" + 68 " Iteration interation1 {" + 69 " Selection selection1 {" + 70 " Event ValueSelection {}" + 71 " Event ValueSelection {}" + 72 " Event ValueSelection {}" + 73 " }" + 74 " }" + 75 "}", getTaskTree()); 76 77 simulateEvent(new ValueSelection<Integer>(3), element1); 78 new TaskTreeChecker().assertTaskTree 79 ("Sequence sequence1 {" + 80 " Iteration interation1 {" + 81 " Selection selection1 {" + 82 " Event ValueSelection {}" + 83 " Event ValueSelection {}" + 84 " Event ValueSelection {}" + 85 " }" + 86 " }" + 87 "}", getTaskTree()); 88 177 89 } 178 } 90 91 /** 92 * 93 */ 94 @Test 95 public void testComplexDetection() throws Exception { 96 IGUIElement element1 = new DummyTrackBar(); 97 simulateEvent(new ValueSelection<Integer>(1), element1); 98 simulateEvent(new ValueSelection<Integer>(2), element1); 99 simulateEvent(new ValueSelection<Integer>(3), element1); 100 simulateEvent(new ValueSelection<Integer>(1), element1); 101 simulateEvent(new DummyInteraction("bla", 1), element1); 102 simulateEvent(new DummyInteraction("bla", 2), element1); 103 simulateEvent(new ValueSelection<Integer>(2), element1); 104 simulateEvent(new ValueSelection<Integer>(1), element1); 105 simulateEvent(new DummyInteraction("bla", 3), element1); 106 simulateEvent(new ValueSelection<Integer>(3), element1); 107 simulateEvent(new ValueSelection<Integer>(2), element1); 108 simulateEvent(new ValueSelection<Integer>(3), element1); 109 simulateEvent(new DummyInteraction("bla", 1), element1); 110 simulateEvent(new DummyInteraction("bla", 2), element1); 111 simulateEvent(new ValueSelection<Integer>(1), element1); 112 simulateEvent(new ValueSelection<Integer>(1), element1); 113 114 new TaskTreeChecker().assertTaskTree 115 ("Sequence sequence1 {" + 116 " Iteration interation1 {" + 117 " Selection selection1 {" + 118 " Event ValueSelection {}" + 119 " Event ValueSelection {}" + 120 " Event ValueSelection {}" + 121 " }" + 122 " }" + 123 " Event bla {}" + 124 " Event bla {}" + 125 " Iteration interation2 {" + 126 " Selection selection2 {" + 127 " Event ValueSelection {}" + 128 " Event ValueSelection {}" + 129 " }" + 130 " }" + 131 " Event bla {}" + 132 " Iteration interation3 {" + 133 " Selection selection3 {" + 134 " Event ValueSelection {}" + 135 " Event ValueSelection {}" + 136 " }" + 137 " }" + 138 " Event bla {}" + 139 " Event bla {}" + 140 " Iteration interation4 {" + 141 " Selection selection4 {" + 142 " Event ValueSelection {}" + 143 " }" + 144 " }" + 145 "}", getTaskTree()); 146 } 147 148 /** 149 * TODO comment 150 * 151 * @version $Revision: $ $Date: 28.04.2012$ 152 * @author 2012, last modified by $Author: patrick$ 153 */ 154 public class DummyTrackBar extends DummyGUIElement implements ITrackBar { 155 156 /** */ 157 private static final long serialVersionUID = 1L; 158 159 /** 160 * 161 */ 162 public DummyTrackBar() { 163 super("DummyTrackBar"); 164 } 165 } 179 166 180 167 }
Note: See TracChangeset
for help on using the changeset viewer.