|
|
|
@ -1,5 +1,5 @@
@@ -1,5 +1,5 @@
|
|
|
|
|
/* |
|
|
|
|
* Copyright 2002-2013 the original author or authors. |
|
|
|
|
* Copyright 2002-2014 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. |
|
|
|
@ -53,7 +53,8 @@ import static org.junit.Assert.*;
@@ -53,7 +53,8 @@ import static org.junit.Assert.*;
|
|
|
|
|
*/ |
|
|
|
|
public class DefaultConversionTests { |
|
|
|
|
|
|
|
|
|
private DefaultConversionService conversionService = new DefaultConversionService(); |
|
|
|
|
private final DefaultConversionService conversionService = new DefaultConversionService(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
public void testStringToCharacter() { |
|
|
|
@ -777,6 +778,16 @@ public class DefaultConversionTests {
@@ -777,6 +778,16 @@ public class DefaultConversionTests {
|
|
|
|
|
assertThat(converted, equalTo(new char[] { 'a', 'b', 'c' })); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
public void multidimensionalArrayToListConversionShouldConvertEntriesCorrectly() { |
|
|
|
|
String[][] grid = new String[][] { new String[] { "1", "2", "3", "4" }, new String[] { "5", "6", "7", "8" }, |
|
|
|
|
new String[] { "9", "10", "11", "12" } }; |
|
|
|
|
List<String[]> converted = conversionService.convert(grid, List.class); |
|
|
|
|
String[][] convertedBack = conversionService.convert(converted, String[][].class); |
|
|
|
|
assertArrayEquals(grid, convertedBack); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static class TestEntity { |
|
|
|
|
|
|
|
|
|
private Long id; |
|
|
|
@ -794,6 +805,7 @@ public class DefaultConversionTests {
@@ -794,6 +805,7 @@ public class DefaultConversionTests {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static class ListWrapper { |
|
|
|
|
|
|
|
|
|
private List<?> list; |
|
|
|
@ -807,8 +819,10 @@ public class DefaultConversionTests {
@@ -807,8 +819,10 @@ public class DefaultConversionTests {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public Object assignableTarget; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static class SSN { |
|
|
|
|
|
|
|
|
|
private String value; |
|
|
|
@ -837,6 +851,7 @@ public class DefaultConversionTests {
@@ -837,6 +851,7 @@ public class DefaultConversionTests {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static class ISBN { |
|
|
|
|
|
|
|
|
|
private String value; |
|
|
|
|