Ignore:
Timestamp:
08/16/12 14:45:03 (12 years ago)
Author:
sherbold
Message:
  • countless adaptations throughout nearly all components to remove errors introduced due to the refactoring of the event core
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  
    99 
    1010import static org.junit.Assert.*; 
     11import static org.mockito.Mockito.*; 
    1112 
    1213import de.ugoe.cs.quest.SequenceInstanceOf; 
    1314import de.ugoe.cs.quest.eventcore.Event; 
     15import de.ugoe.cs.quest.eventcore.IEventType; 
    1416 
    1517 
     
    2729                Collection<List<Event>> sequences = new LinkedList<List<Event>>(); 
    2830                List<Event> sequence1 = new ArrayList<Event>(); 
    29                 sequence1.add(new Event<String>("a")); 
     31                sequence1.add(new Event(mock(IEventType.class))); 
    3032                sequences.add(sequence1); 
    3133                 
     
    6769        public void TestIsEventSequence_1() throws Exception { 
    6870                List<Event> sequence = new ArrayList<Event>(); 
    69                 sequence.add(new Event<String>("a")); 
     71                sequence.add(new Event(mock(IEventType.class))); 
    7072                 
    7173                boolean result = SequenceInstanceOf.isEventSequence(sequence); 
  • trunk/quest-core-events-test/src/test/java/de/ugoe/cs/quest/eventcore/EventTest.java

    r547 r548  
    22package de.ugoe.cs.quest.eventcore; 
    33 
     4 
     5import java.util.LinkedList; 
     6import java.util.List; 
    47 
    58import org.junit.*; 
     
    225228        assertEquals("(typeString;targetString)", result); 
    226229    } 
     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    } 
    227286 
    228287    public static void main(String[] args) { 
Note: See TracChangeset for help on using the changeset viewer.