1 | package de.ugoe.cs.quest.plugin.jfc; |
---|
2 | |
---|
3 | import java.io.File; |
---|
4 | import java.util.Collection; |
---|
5 | import java.util.HashSet; |
---|
6 | import java.util.List; |
---|
7 | |
---|
8 | import junit.framework.TestCase; |
---|
9 | |
---|
10 | import org.junit.After; |
---|
11 | import org.junit.Before; |
---|
12 | import org.junit.Test; |
---|
13 | |
---|
14 | import de.ugoe.cs.quest.eventcore.Event; |
---|
15 | import de.ugoe.cs.quest.plugin.jfc.eventcore.JFCEventId; |
---|
16 | |
---|
17 | /** |
---|
18 | * The class <code>EFGReplayIDCalculatorTest</code> contains tests for the class |
---|
19 | * {@link <code>EFGReplayIDCalculator</code>} |
---|
20 | * |
---|
21 | * @pattern JUnit Test Case |
---|
22 | * |
---|
23 | * @generatedBy CodePro at 7/30/12 4:50 PM |
---|
24 | * |
---|
25 | * @author fabian.glaser |
---|
26 | * |
---|
27 | * @version $Revision$ |
---|
28 | */ |
---|
29 | public class JFCReplayIDCalculatorTest extends TestCase { |
---|
30 | |
---|
31 | /** |
---|
32 | * Construct new test instance |
---|
33 | * |
---|
34 | * @param name the test name |
---|
35 | */ |
---|
36 | public JFCReplayIDCalculatorTest(String name) { |
---|
37 | super(name); |
---|
38 | } |
---|
39 | |
---|
40 | /** |
---|
41 | * Run the String calculateReplayID(JFCEvent) method test. |
---|
42 | * |
---|
43 | * @throws Exception |
---|
44 | * |
---|
45 | * @generatedBy CodePro at 7/30/12 4:58 PM |
---|
46 | */ |
---|
47 | @Test |
---|
48 | public void testCalculateReplayID_1() |
---|
49 | throws Exception { |
---|
50 | Collection<JFCEventId> ignoredEvents = new HashSet<JFCEventId>(); |
---|
51 | ignoredEvents.add(JFCEventId.FOCUS_GAINED); |
---|
52 | JFCLogParser parser = new JFCLogParser(ignoredEvents); |
---|
53 | parser.parseFile(new File(ClassLoader.getSystemResource("freemind_trace.xml").getFile())); |
---|
54 | |
---|
55 | Collection<List<Event>> sequences = parser.getSequences(); |
---|
56 | Event event = sequences.iterator().next().get(0); |
---|
57 | |
---|
58 | String result = new JFCReplayIDCalculator().calculateReplayID(event); |
---|
59 | assertEquals("e3561778462", result); |
---|
60 | } |
---|
61 | |
---|
62 | /** |
---|
63 | * Perform pre-test initialization. |
---|
64 | * |
---|
65 | * @throws Exception |
---|
66 | * if the initialization fails for some reason |
---|
67 | * |
---|
68 | * @generatedBy CodePro at 7/30/12 4:58 PM |
---|
69 | */ |
---|
70 | @Before |
---|
71 | public void setUp() |
---|
72 | throws Exception { |
---|
73 | // add additional set up code here |
---|
74 | } |
---|
75 | |
---|
76 | /** |
---|
77 | * Perform post-test clean-up. |
---|
78 | * |
---|
79 | * @throws Exception |
---|
80 | * if the clean-up fails for some reason |
---|
81 | * |
---|
82 | * @generatedBy CodePro at 7/30/12 4:58 PM |
---|
83 | */ |
---|
84 | @After |
---|
85 | public void tearDown() |
---|
86 | throws Exception { |
---|
87 | // Add additional tear down code here |
---|
88 | } |
---|
89 | |
---|
90 | /** |
---|
91 | * Launch the test. |
---|
92 | * |
---|
93 | * @param args the command line arguments |
---|
94 | * |
---|
95 | * @generatedBy CodePro at 7/30/12 4:58 PM |
---|
96 | */ |
---|
97 | public static void main(String[] args) { |
---|
98 | new org.junit.runner.JUnitCore().run(JFCReplayIDCalculatorTest.class); |
---|
99 | } |
---|
100 | } |
---|
101 | |
---|
102 | /*$CPS$ This comment was generated by CodePro. Do not edit it. |
---|
103 | * patternId = com.instantiations.assist.eclipse.pattern.testCasePattern |
---|
104 | * strategyId = com.instantiations.assist.eclipse.pattern.testCasePattern.junitTestCase |
---|
105 | * additionalTestNames = |
---|
106 | * assertTrue = false |
---|
107 | * callTestMethod = true |
---|
108 | * createMain = false |
---|
109 | * createSetUp = false |
---|
110 | * createTearDown = false |
---|
111 | * createTestFixture = false |
---|
112 | * createTestStubs = false |
---|
113 | * methods = |
---|
114 | * package = de.ugoe.cs.eventbench.efg |
---|
115 | * package.sourceFolder = EventBenchConsoleTest/src |
---|
116 | * superclassType = junit.framework.TestCase |
---|
117 | * testCase = EFGEventIDCalculatorTest |
---|
118 | * testClassType = de.ugoe.cs.eventbench.efg.EFGEventIDCalculator |
---|
119 | */ |
---|