mirror of
https://github.com/spring-projects/spring-framework
synced 2026-06-08 17:33:33 +00:00
Replace space indentation with tabs
Issue: SPR-10127
This commit is contained in:
committed by
Chris Beams
parent
1762157ad1
commit
2cf45bad86
+59
-59
@@ -28,78 +28,78 @@ import static org.junit.Assert.*;
|
||||
*/
|
||||
public class ExceptionDepthComparatorTests {
|
||||
|
||||
@Test
|
||||
public void targetBeforeSameDepth() throws Exception {
|
||||
Class<? extends Throwable> foundClass = findClosestMatch(TargetException.class, SameDepthException.class);
|
||||
assertEquals(TargetException.class, foundClass);
|
||||
}
|
||||
@Test
|
||||
public void targetBeforeSameDepth() throws Exception {
|
||||
Class<? extends Throwable> foundClass = findClosestMatch(TargetException.class, SameDepthException.class);
|
||||
assertEquals(TargetException.class, foundClass);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void sameDepthBeforeTarget() throws Exception {
|
||||
Class<? extends Throwable> foundClass = findClosestMatch(SameDepthException.class, TargetException.class);
|
||||
assertEquals(TargetException.class, foundClass);
|
||||
}
|
||||
@Test
|
||||
public void sameDepthBeforeTarget() throws Exception {
|
||||
Class<? extends Throwable> foundClass = findClosestMatch(SameDepthException.class, TargetException.class);
|
||||
assertEquals(TargetException.class, foundClass);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void lowestDepthBeforeTarget() throws Exception {
|
||||
Class<? extends Throwable> foundClass = findClosestMatch(LowestDepthException.class, TargetException.class);
|
||||
assertEquals(TargetException.class, foundClass);
|
||||
}
|
||||
@Test
|
||||
public void lowestDepthBeforeTarget() throws Exception {
|
||||
Class<? extends Throwable> foundClass = findClosestMatch(LowestDepthException.class, TargetException.class);
|
||||
assertEquals(TargetException.class, foundClass);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void targetBeforeLowestDepth() throws Exception {
|
||||
Class<? extends Throwable> foundClass = findClosestMatch(TargetException.class, LowestDepthException.class);
|
||||
assertEquals(TargetException.class, foundClass);
|
||||
}
|
||||
@Test
|
||||
public void targetBeforeLowestDepth() throws Exception {
|
||||
Class<? extends Throwable> foundClass = findClosestMatch(TargetException.class, LowestDepthException.class);
|
||||
assertEquals(TargetException.class, foundClass);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void noDepthBeforeTarget() throws Exception {
|
||||
Class<? extends Throwable> foundClass = findClosestMatch(NoDepthException.class, TargetException.class);
|
||||
assertEquals(TargetException.class, foundClass);
|
||||
}
|
||||
@Test
|
||||
public void noDepthBeforeTarget() throws Exception {
|
||||
Class<? extends Throwable> foundClass = findClosestMatch(NoDepthException.class, TargetException.class);
|
||||
assertEquals(TargetException.class, foundClass);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void noDepthBeforeHighestDepth() throws Exception {
|
||||
Class<? extends Throwable> foundClass = findClosestMatch(NoDepthException.class, HighestDepthException.class);
|
||||
assertEquals(HighestDepthException.class, foundClass);
|
||||
}
|
||||
@Test
|
||||
public void noDepthBeforeHighestDepth() throws Exception {
|
||||
Class<? extends Throwable> foundClass = findClosestMatch(NoDepthException.class, HighestDepthException.class);
|
||||
assertEquals(HighestDepthException.class, foundClass);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void highestDepthBeforeNoDepth() throws Exception {
|
||||
Class<? extends Throwable> foundClass = findClosestMatch(HighestDepthException.class, NoDepthException.class);
|
||||
assertEquals(HighestDepthException.class, foundClass);
|
||||
}
|
||||
@Test
|
||||
public void highestDepthBeforeNoDepth() throws Exception {
|
||||
Class<? extends Throwable> foundClass = findClosestMatch(HighestDepthException.class, NoDepthException.class);
|
||||
assertEquals(HighestDepthException.class, foundClass);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void highestDepthBeforeLowestDepth() throws Exception {
|
||||
Class<? extends Throwable> foundClass = findClosestMatch(HighestDepthException.class, LowestDepthException.class);
|
||||
assertEquals(LowestDepthException.class, foundClass);
|
||||
}
|
||||
@Test
|
||||
public void highestDepthBeforeLowestDepth() throws Exception {
|
||||
Class<? extends Throwable> foundClass = findClosestMatch(HighestDepthException.class, LowestDepthException.class);
|
||||
assertEquals(LowestDepthException.class, foundClass);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void lowestDepthBeforeHighestDepth() throws Exception {
|
||||
Class<? extends Throwable> foundClass = findClosestMatch(LowestDepthException.class, HighestDepthException.class);
|
||||
assertEquals(LowestDepthException.class, foundClass);
|
||||
}
|
||||
@Test
|
||||
public void lowestDepthBeforeHighestDepth() throws Exception {
|
||||
Class<? extends Throwable> foundClass = findClosestMatch(LowestDepthException.class, HighestDepthException.class);
|
||||
assertEquals(LowestDepthException.class, foundClass);
|
||||
}
|
||||
|
||||
private Class<? extends Throwable> findClosestMatch(Class<? extends Throwable>... classes) {
|
||||
return ExceptionDepthComparator.findClosestMatch(Arrays.asList(classes), new TargetException());
|
||||
}
|
||||
private Class<? extends Throwable> findClosestMatch(
|
||||
Class<? extends Throwable>... classes) {
|
||||
return ExceptionDepthComparator.findClosestMatch(Arrays.asList(classes), new TargetException());
|
||||
}
|
||||
|
||||
public class HighestDepthException extends Throwable {
|
||||
}
|
||||
|
||||
public class HighestDepthException extends Throwable {
|
||||
}
|
||||
public class LowestDepthException extends HighestDepthException {
|
||||
}
|
||||
|
||||
public class LowestDepthException extends HighestDepthException {
|
||||
}
|
||||
public class TargetException extends LowestDepthException {
|
||||
}
|
||||
|
||||
public class TargetException extends LowestDepthException {
|
||||
}
|
||||
public class SameDepthException extends LowestDepthException {
|
||||
}
|
||||
|
||||
public class SameDepthException extends LowestDepthException {
|
||||
}
|
||||
|
||||
public class NoDepthException extends TargetException {
|
||||
}
|
||||
public class NoDepthException extends TargetException {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -130,26 +130,26 @@ public class GenericTypeResolverTests {
|
||||
assertEquals(Object.class, resolveReturnTypeForGenericMethod(extractMagicValue, new Object[] { map }));
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 3.2
|
||||
*/
|
||||
@Test
|
||||
public void testResolveType() {
|
||||
Method intMessageMethod = findMethod(MyTypeWithMethods.class, "readIntegerInputMessage", MyInterfaceType.class);
|
||||
MethodParameter intMessageMethodParam = new MethodParameter(intMessageMethod, 0);
|
||||
assertEquals(MyInterfaceType.class,
|
||||
resolveType(intMessageMethodParam.getGenericParameterType(), new HashMap<TypeVariable, Type>()));
|
||||
/**
|
||||
* @since 3.2
|
||||
*/
|
||||
@Test
|
||||
public void testResolveType() {
|
||||
Method intMessageMethod = findMethod(MyTypeWithMethods.class, "readIntegerInputMessage", MyInterfaceType.class);
|
||||
MethodParameter intMessageMethodParam = new MethodParameter(intMessageMethod, 0);
|
||||
assertEquals(MyInterfaceType.class,
|
||||
resolveType(intMessageMethodParam.getGenericParameterType(), new HashMap<TypeVariable, Type>()));
|
||||
|
||||
Method intArrMessageMethod = findMethod(MyTypeWithMethods.class, "readIntegerArrayInputMessage", MyInterfaceType[].class);
|
||||
MethodParameter intArrMessageMethodParam = new MethodParameter(intArrMessageMethod, 0);
|
||||
assertEquals(MyInterfaceType[].class,
|
||||
resolveType(intArrMessageMethodParam.getGenericParameterType(), new HashMap<TypeVariable, Type>()));
|
||||
Method intArrMessageMethod = findMethod(MyTypeWithMethods.class, "readIntegerArrayInputMessage", MyInterfaceType[].class);
|
||||
MethodParameter intArrMessageMethodParam = new MethodParameter(intArrMessageMethod, 0);
|
||||
assertEquals(MyInterfaceType[].class,
|
||||
resolveType(intArrMessageMethodParam.getGenericParameterType(), new HashMap<TypeVariable, Type>()));
|
||||
|
||||
Method genericArrMessageMethod = findMethod(MySimpleTypeWithMethods.class, "readGenericArrayInputMessage", Object[].class);
|
||||
MethodParameter genericArrMessageMethodParam = new MethodParameter(genericArrMessageMethod, 0);
|
||||
Map<TypeVariable, Type> varMap = getTypeVariableMap(MySimpleTypeWithMethods.class);
|
||||
assertEquals(Integer[].class, resolveType(genericArrMessageMethodParam.getGenericParameterType(), varMap));
|
||||
}
|
||||
Method genericArrMessageMethod = findMethod(MySimpleTypeWithMethods.class, "readGenericArrayInputMessage", Object[].class);
|
||||
MethodParameter genericArrMessageMethodParam = new MethodParameter(genericArrMessageMethod, 0);
|
||||
Map<TypeVariable, Type> varMap = getTypeVariableMap(MySimpleTypeWithMethods.class);
|
||||
assertEquals(Integer[].class, resolveType(genericArrMessageMethodParam.getGenericParameterType(), varMap));
|
||||
}
|
||||
|
||||
|
||||
public interface MyInterfaceType<T> {
|
||||
@@ -234,14 +234,14 @@ public class GenericTypeResolverTests {
|
||||
return null;
|
||||
}
|
||||
|
||||
public void readIntegerInputMessage(MyInterfaceType<Integer> message) {
|
||||
}
|
||||
public void readIntegerInputMessage(MyInterfaceType<Integer> message) {
|
||||
}
|
||||
|
||||
public void readIntegerArrayInputMessage(MyInterfaceType<Integer>[] message) {
|
||||
}
|
||||
public void readIntegerArrayInputMessage(MyInterfaceType<Integer>[] message) {
|
||||
}
|
||||
|
||||
public void readGenericArrayInputMessage(T[] message) {
|
||||
}
|
||||
public void readGenericArrayInputMessage(T[] message) {
|
||||
}
|
||||
}
|
||||
|
||||
public static class MySimpleTypeWithMethods extends MyTypeWithMethods<Integer> {
|
||||
|
||||
Reference in New Issue
Block a user