Changeset 548 for trunk/quest-core-events-test/src
- Timestamp:
- 08/16/12 14:45:03 (12 years ago)
- Location:
- trunk/quest-core-events-test/src/test/java/de/ugoe/cs/quest
- Files:
-
- 2 deleted
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/quest-core-events-test/src/test/java/de/ugoe/cs/quest/SequenceInstanceOfTest.java
r547 r548 9 9 10 10 import static org.junit.Assert.*; 11 import static org.mockito.Mockito.*; 11 12 12 13 import de.ugoe.cs.quest.SequenceInstanceOf; 13 14 import de.ugoe.cs.quest.eventcore.Event; 15 import de.ugoe.cs.quest.eventcore.IEventType; 14 16 15 17 … … 27 29 Collection<List<Event>> sequences = new LinkedList<List<Event>>(); 28 30 List<Event> sequence1 = new ArrayList<Event>(); 29 sequence1.add(new Event <String>("a"));31 sequence1.add(new Event(mock(IEventType.class))); 30 32 sequences.add(sequence1); 31 33 … … 67 69 public void TestIsEventSequence_1() throws Exception { 68 70 List<Event> sequence = new ArrayList<Event>(); 69 sequence.add(new Event <String>("a"));71 sequence.add(new Event(mock(IEventType.class))); 70 72 71 73 boolean result = SequenceInstanceOf.isEventSequence(sequence); -
trunk/quest-core-events-test/src/test/java/de/ugoe/cs/quest/eventcore/EventTest.java
r547 r548 2 2 package de.ugoe.cs.quest.eventcore; 3 3 4 5 import java.util.LinkedList; 6 import java.util.List; 4 7 5 8 import org.junit.*; … … 225 228 assertEquals("(typeString;targetString)", result); 226 229 } 230 231 @Test 232 public void testAddReplayable_1() throws Exception { 233 IReplayable replayable = mock(IReplayable.class); 234 235 Event fixture = new Event(mock(IEventType.class)); 236 fixture.addReplayable(replayable); 237 238 assertEquals(1, fixture.getReplayables().size()); 239 assertEquals(replayable, fixture.getReplayables().get(0)); 240 } 241 242 @Test 243 public void testAddReplayEvent_2() throws Exception { 244 IReplayable replayable1 = mock(IReplayable.class); 245 IReplayable replayable2 = mock(IReplayable.class); 246 247 Event fixture = new Event(mock(IEventType.class)); 248 fixture.addReplayable(replayable1); 249 fixture.addReplayable(replayable2); 250 251 assertEquals(2, fixture.getReplayables().size()); 252 assertEquals(replayable1, fixture.getReplayables().get(0)); 253 assertEquals(replayable2, fixture.getReplayables().get(1)); 254 } 255 256 @Test(expected = java.security.InvalidParameterException.class) 257 public void testAddReplayEvent_fixture_3() throws Exception { 258 Event fixture = new Event(mock(IEventType.class)); 259 fixture.addReplayable(null); 260 } 261 262 @Test 263 public void testAddReplaySequence_1() throws Exception { 264 IReplayable replayable1 = mock(IReplayable.class); 265 IReplayable replayable2 = mock(IReplayable.class); 266 267 List<IReplayable> replayableSequences = new LinkedList<IReplayable>(); 268 replayableSequences.add(replayable1); 269 replayableSequences.add(replayable2); 270 271 Event fixture = new Event(mock(IEventType.class)); 272 273 fixture.addReplayableSequence(replayableSequences); 274 275 assertEquals(2, fixture.getReplayables().size()); 276 assertEquals(replayable1, fixture.getReplayables().get(0)); 277 assertEquals(replayable2, fixture.getReplayables().get(1)); 278 } 279 280 @Test(expected = java.security.InvalidParameterException.class) 281 public void testAddReplaySequence_2() throws Exception { 282 Event fixture = new Event(mock(IEventType.class)); 283 284 fixture.addReplayableSequence(null); 285 } 227 286 228 287 public static void main(String[] args) {
Note: See TracChangeset
for help on using the changeset viewer.