|
49 | 49 | import org.springframework.jdbc.support.JdbcTransactionManager;
|
50 | 50 | import org.springframework.jdbc.datasource.embedded.EmbeddedDatabase;
|
51 | 51 | import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder;
|
52 |
| -import org.springframework.transaction.interceptor.RollbackRuleAttribute; |
53 |
| -import org.springframework.transaction.interceptor.RuleBasedTransactionAttribute; |
54 |
| -import org.springframework.transaction.interceptor.TransactionAttribute; |
55 |
| -import org.springframework.transaction.interceptor.TransactionAttributeEditor; |
56 | 52 | import org.springframework.util.StringUtils;
|
57 | 53 |
|
58 | 54 | import static org.hamcrest.CoreMatchers.instanceOf;
|
@@ -161,35 +157,6 @@ void testAfterChunkListenerException() throws Exception {
|
161 | 157 | assertThat(e.getCause(), instanceOf(IllegalArgumentException.class));
|
162 | 158 | }
|
163 | 159 |
|
164 |
| - @Test |
165 |
| - void testOverrideWithoutChangingRollbackRules() { |
166 |
| - TransactionAttributeEditor editor = new TransactionAttributeEditor(); |
167 |
| - editor.setAsText("-RuntimeException"); |
168 |
| - TransactionAttribute attr = (TransactionAttribute) editor.getValue(); |
169 |
| - assertTrue(attr.rollbackOn(new RuntimeException(""))); |
170 |
| - assertFalse(attr.rollbackOn(new Exception(""))); |
171 |
| - } |
172 |
| - |
173 |
| - @Test |
174 |
| - void testChangeRollbackRules() { |
175 |
| - TransactionAttributeEditor editor = new TransactionAttributeEditor(); |
176 |
| - editor.setAsText("+RuntimeException"); |
177 |
| - TransactionAttribute attr = (TransactionAttribute) editor.getValue(); |
178 |
| - assertFalse(attr.rollbackOn(new RuntimeException(""))); |
179 |
| - assertFalse(attr.rollbackOn(new Exception(""))); |
180 |
| - } |
181 |
| - |
182 |
| - @Test |
183 |
| - void testNonDefaultRollbackRules() { |
184 |
| - TransactionAttributeEditor editor = new TransactionAttributeEditor(); |
185 |
| - editor.setAsText("+RuntimeException,+SkippableException"); |
186 |
| - RuleBasedTransactionAttribute attr = (RuleBasedTransactionAttribute) editor.getValue(); |
187 |
| - attr.getRollbackRules().add(new RollbackRuleAttribute(Exception.class)); |
188 |
| - assertTrue(attr.rollbackOn(new Exception(""))); |
189 |
| - assertFalse(attr.rollbackOn(new RuntimeException(""))); |
190 |
| - assertFalse(attr.rollbackOn(new SkippableException(""))); |
191 |
| - } |
192 |
| - |
193 | 160 | /**
|
194 | 161 | * Scenario: Exception in reader that should not cause rollback
|
195 | 162 | */
|
|
0 commit comments