|
15 | 15 | */
|
16 | 16 | package org.springframework.batch.core.partition.support;
|
17 | 17 |
|
18 |
| -import static org.junit.Assert.assertEquals; |
19 |
| -import static org.junit.Assert.assertNotNull; |
20 |
| - |
21 |
| -import java.util.Arrays; |
22 |
| -import java.util.Collections; |
23 |
| - |
24 | 18 | import org.junit.Test;
|
25 | 19 | import org.springframework.batch.core.BatchStatus;
|
26 | 20 | import org.springframework.batch.core.ExitStatus;
|
27 | 21 | import org.springframework.batch.core.JobExecution;
|
28 | 22 | import org.springframework.batch.core.StepExecution;
|
29 | 23 |
|
| 24 | +import java.util.Arrays; |
| 25 | +import java.util.Collections; |
| 26 | + |
| 27 | +import static org.junit.Assert.assertEquals; |
| 28 | +import static org.junit.Assert.assertNotNull; |
| 29 | + |
30 | 30 | public class DefaultStepExecutionAggregatorTests {
|
31 | 31 |
|
32 | 32 | private StepExecutionAggregator aggregator = new DefaultStepExecutionAggregator();
|
@@ -87,10 +87,31 @@ public void testAggregateExitStatusSunnyDay() {
|
87 | 87 | }
|
88 | 88 |
|
89 | 89 | @Test
|
90 |
| - public void testAggregateCommitCountSunnyDay() { |
91 |
| - stepExecution1.setCommitCount(10); |
92 |
| - stepExecution2.setCommitCount(5); |
| 90 | + public void testAggregateCountsSunnyDay() { |
| 91 | + stepExecution1.setCommitCount(1); |
| 92 | + stepExecution1.setFilterCount(2); |
| 93 | + stepExecution1.setProcessSkipCount(3); |
| 94 | + stepExecution1.setReadCount(4); |
| 95 | + stepExecution1.setReadSkipCount(5); |
| 96 | + stepExecution1.setRollbackCount(6); |
| 97 | + stepExecution1.setWriteCount(7); |
| 98 | + stepExecution1.setWriteSkipCount(8); |
| 99 | + stepExecution2.setCommitCount(11); |
| 100 | + stepExecution2.setFilterCount(12); |
| 101 | + stepExecution2.setProcessSkipCount(13); |
| 102 | + stepExecution2.setReadCount(14); |
| 103 | + stepExecution2.setReadSkipCount(15); |
| 104 | + stepExecution2.setRollbackCount(16); |
| 105 | + stepExecution2.setWriteCount(17); |
| 106 | + stepExecution2.setWriteSkipCount(18); |
93 | 107 | aggregator.aggregate(result, Arrays.<StepExecution> asList(stepExecution1, stepExecution2));
|
94 |
| - assertEquals(15, result.getCommitCount()); |
| 108 | + assertEquals(12, result.getCommitCount()); |
| 109 | + assertEquals(14, result.getFilterCount()); |
| 110 | + assertEquals(16, result.getProcessSkipCount()); |
| 111 | + assertEquals(18, result.getReadCount()); |
| 112 | + assertEquals(20, result.getReadSkipCount()); |
| 113 | + assertEquals(22, result.getRollbackCount()); |
| 114 | + assertEquals(24, result.getWriteCount()); |
| 115 | + assertEquals(26, result.getWriteSkipCount()); |
95 | 116 | }
|
96 | 117 | }
|
0 commit comments