source: trunk/quest-core-event-test/src/de/ugoe/cs/quest/SequenceInstanceOfTest.java @ 433

Last change on this file since 433 was 433, checked in by sherbold, 12 years ago
  • renamed packages to fit QUEST project structure
  • Property svn:mime-type set to text/plain
File size: 2.8 KB
Line 
1package de.ugoe.cs.quest;
2
3import java.util.ArrayList;
4import java.util.Collection;
5import java.util.LinkedList;
6import java.util.List;
7
8import org.junit.*;
9
10import static org.junit.Assert.*;
11
12import de.ugoe.cs.quest.SequenceInstanceOf;
13import de.ugoe.cs.quest.eventcore.Event;
14
15
16/**
17 * The class <code>SequenceInstanceOfTest</code> contains tests for the
18 * class <code>{@link SequenceInstanceOf}</code>.
19 *
20 * @author Steffen Herbold
21 * @version 1.0
22 */
23public class SequenceInstanceOfTest {
24       
25        @Test
26        public void TestIsCollectionOfSequences_1() throws Exception {
27                Collection<List<? extends Event<?>>> sequences = new LinkedList<List<? extends Event<?>>>();
28                List<Event<?>> sequence1 = new ArrayList<Event<?>>();
29                sequence1.add(new Event<String>("a"));
30                sequences.add(sequence1);
31               
32                boolean result = SequenceInstanceOf.isCollectionOfSequences(sequences);
33                assertTrue(result);
34        }
35       
36        @Test
37        public void TestIsCollectionOfSequences_2() throws Exception {
38                Collection<List<? extends Event<?>>> sequences = new LinkedList<List<? extends Event<?>>>();
39                List<Event<?>> sequence1 = new ArrayList<Event<?>>();
40                sequences.add(sequence1);
41               
42                boolean result = SequenceInstanceOf.isCollectionOfSequences(sequences);
43                assertFalse(result);
44        }
45       
46        @Test
47        public void TestIsCollectionOfSequences_3() throws Exception {
48                Collection<List<? extends Event<?>>> sequences = new LinkedList<List<? extends Event<?>>>();
49               
50                boolean result = SequenceInstanceOf.isCollectionOfSequences(sequences);
51                assertFalse(result);
52        }
53       
54        @Test
55        public void TestIsCollectionOfSequences_4() throws Exception {
56                boolean result = SequenceInstanceOf.isCollectionOfSequences(null);
57                assertFalse(result);
58        }
59       
60        @Test
61        public void TestIsCollectionOfSequences_5() throws Exception {
62                boolean result = SequenceInstanceOf.isCollectionOfSequences(new Object());
63                assertFalse(result);
64        }
65       
66        @Test
67        public void TestIsEventSequence_1() throws Exception {
68                List<Event<?>> sequence = new ArrayList<Event<?>>();
69                sequence.add(new Event<String>("a"));
70               
71                boolean result = SequenceInstanceOf.isEventSequence(sequence);
72                assertTrue(result);
73        }
74       
75        @Test
76        public void TestIsEventSequence_2() throws Exception {
77                List<Event<?>> sequence = new ArrayList<Event<?>>();
78               
79                boolean result = SequenceInstanceOf.isEventSequence(sequence);
80                assertFalse(result);
81        }
82       
83        @Test
84        public void TestIsEventSequence_3() throws Exception {
85                boolean result = SequenceInstanceOf.isEventSequence(null);
86                assertFalse(result);
87        }
88       
89        @Test
90        public void TestIsEventSequence_4() throws Exception {
91                boolean result = SequenceInstanceOf.isEventSequence(new Object());
92                assertFalse(result);
93        }
94       
95       
96       
97        public static void main(String[] args) {
98                new org.junit.runner.JUnitCore().run(SequenceInstanceOfTest.class);
99        }
100}
Note: See TracBrowser for help on using the repository browser.