gh-25650 Replace remaining usage of LinkedList with ArrayList in tests
This commit is contained in:
committed by
Juergen Hoeller
parent
79cf6b4353
commit
1f3e52d932
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
* Copyright 2002-2020 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -18,8 +18,8 @@ package org.springframework.transaction.interceptor;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.rmi.RemoteException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
@@ -51,7 +51,7 @@ public class RuleBasedTransactionAttributeTests {
|
||||
*/
|
||||
@Test
|
||||
public void testRuleForRollbackOnChecked() {
|
||||
List<RollbackRuleAttribute> list = new LinkedList<>();
|
||||
List<RollbackRuleAttribute> list = new ArrayList<>();
|
||||
list.add(new RollbackRuleAttribute(IOException.class.getName()));
|
||||
RuleBasedTransactionAttribute rta = new RuleBasedTransactionAttribute(TransactionDefinition.PROPAGATION_REQUIRED, list);
|
||||
|
||||
@@ -64,7 +64,7 @@ public class RuleBasedTransactionAttributeTests {
|
||||
|
||||
@Test
|
||||
public void testRuleForCommitOnUnchecked() {
|
||||
List<RollbackRuleAttribute> list = new LinkedList<>();
|
||||
List<RollbackRuleAttribute> list = new ArrayList<>();
|
||||
list.add(new NoRollbackRuleAttribute(MyRuntimeException.class.getName()));
|
||||
list.add(new RollbackRuleAttribute(IOException.class.getName()));
|
||||
RuleBasedTransactionAttribute rta = new RuleBasedTransactionAttribute(TransactionDefinition.PROPAGATION_REQUIRED, list);
|
||||
@@ -79,7 +79,7 @@ public class RuleBasedTransactionAttributeTests {
|
||||
|
||||
@Test
|
||||
public void testRuleForSelectiveRollbackOnCheckedWithString() {
|
||||
List<RollbackRuleAttribute> l = new LinkedList<>();
|
||||
List<RollbackRuleAttribute> l = new ArrayList<>();
|
||||
l.add(new RollbackRuleAttribute(java.rmi.RemoteException.class.getName()));
|
||||
RuleBasedTransactionAttribute rta = new RuleBasedTransactionAttribute(TransactionDefinition.PROPAGATION_REQUIRED, l);
|
||||
doTestRuleForSelectiveRollbackOnChecked(rta);
|
||||
@@ -106,7 +106,7 @@ public class RuleBasedTransactionAttributeTests {
|
||||
*/
|
||||
@Test
|
||||
public void testRuleForCommitOnSubclassOfChecked() {
|
||||
List<RollbackRuleAttribute> list = new LinkedList<>();
|
||||
List<RollbackRuleAttribute> list = new ArrayList<>();
|
||||
// Note that it's important to ensure that we have this as
|
||||
// a FQN: otherwise it will match everything!
|
||||
list.add(new RollbackRuleAttribute("java.lang.Exception"));
|
||||
@@ -121,7 +121,7 @@ public class RuleBasedTransactionAttributeTests {
|
||||
|
||||
@Test
|
||||
public void testRollbackNever() {
|
||||
List<RollbackRuleAttribute> list = new LinkedList<>();
|
||||
List<RollbackRuleAttribute> list = new ArrayList<>();
|
||||
list.add(new NoRollbackRuleAttribute("Throwable"));
|
||||
RuleBasedTransactionAttribute rta = new RuleBasedTransactionAttribute(TransactionDefinition.PROPAGATION_REQUIRED, list);
|
||||
|
||||
@@ -134,7 +134,7 @@ public class RuleBasedTransactionAttributeTests {
|
||||
|
||||
@Test
|
||||
public void testToStringMatchesEditor() {
|
||||
List<RollbackRuleAttribute> list = new LinkedList<>();
|
||||
List<RollbackRuleAttribute> list = new ArrayList<>();
|
||||
list.add(new NoRollbackRuleAttribute("Throwable"));
|
||||
RuleBasedTransactionAttribute rta = new RuleBasedTransactionAttribute(TransactionDefinition.PROPAGATION_REQUIRED, list);
|
||||
|
||||
@@ -154,7 +154,7 @@ public class RuleBasedTransactionAttributeTests {
|
||||
*/
|
||||
@Test
|
||||
public void testConflictingRulesToDetermineExactContract() {
|
||||
List<RollbackRuleAttribute> list = new LinkedList<>();
|
||||
List<RollbackRuleAttribute> list = new ArrayList<>();
|
||||
list.add(new NoRollbackRuleAttribute(MyBusinessWarningException.class));
|
||||
list.add(new RollbackRuleAttribute(MyBusinessException.class));
|
||||
RuleBasedTransactionAttribute rta = new RuleBasedTransactionAttribute(TransactionDefinition.PROPAGATION_REQUIRED, list);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
* Copyright 2002-2020 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -16,8 +16,8 @@
|
||||
|
||||
package org.springframework.transaction.jta;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -45,7 +45,7 @@ public class MockUOWManager implements UOWManager {
|
||||
|
||||
private final Map<Object, Object> resources = new HashMap<>();
|
||||
|
||||
private final List<Synchronization> synchronizations = new LinkedList<>();
|
||||
private final List<Synchronization> synchronizations = new ArrayList<>();
|
||||
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user