Package: InMemoryTestAccumulator

InMemoryTestAccumulator

nameinstructionbranchcomplexitylinemethod
InMemoryTestAccumulator()
M: 11 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 4 C: 0
0%
M: 1 C: 0
0%
getAllTests()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getNext()
M: 12 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
hasNext()
M: 10 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
registerTest(TraceTest)
M: 6 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
toString()
M: 26 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 5 C: 0
0%
M: 1 C: 0
0%

Coverage

1: package org.overture.codegen.runtime.traces;
2:
3: import java.util.LinkedList;
4: import java.util.List;
5:
6: public class InMemoryTestAccumulator implements TestAccumulator
7: {
8:         private static final long serialVersionUID = 1898551533520957210L;
9:
10:         private List<TraceTest> tests;
11:
12:         private int nextIdx;
13:
14:         public InMemoryTestAccumulator()
15:         {
16:                 this.tests = new LinkedList<TraceTest>();
17:                 this.nextIdx = 0;
18:         }
19:
20:         @Override
21:         public void registerTest(TraceTest test)
22:         {
23:                 this.tests.add(test);
24:         }
25:
26:         public boolean hasNext()
27:         {
28:•                return nextIdx < tests.size();
29:         }
30:
31:         public TraceTest getNext()
32:         {
33:                 return tests.get(nextIdx++);
34:         }
35:
36:         public List<TraceTest> getAllTests()
37:         {
38:                 return tests;
39:         }
40:
41:         @Override
42:         public String toString()
43:         {
44:                 StringBuilder sb = new StringBuilder();
45:
46:•                for (TraceTest t : tests)
47:                 {
48:                         sb.append(t.toString()).append('\n');
49:                 }
50:
51:                 return sb.toString();
52:         }
53: }