aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIvan Dubrov <idubrov@guidewire.com>2016-04-06 12:03:35 -0700
committerIvan Dubrov <idubrov@guidewire.com>2016-04-06 12:03:35 -0700
commite278cb949c512228d3177759be9ee39c3235e324 (patch)
tree7f9eb57df55bd39e2d99c0994d535655783c0e00
parent5d3ec9ec2a35d330c7d96a403e266b7793cc8d8d (diff)
downloaddcevm-e278cb949c512228d3177759be9ee39c3235e324.tar.gz
dcevm-e278cb949c512228d3177759be9ee39c3235e324.zip
Adding test for getComponentType
-rw-r--r--dcevm/src/test/java7/com/github/dcevm/test/body/ArrayTest.java14
1 files changed, 14 insertions, 0 deletions
diff --git a/dcevm/src/test/java7/com/github/dcevm/test/body/ArrayTest.java b/dcevm/src/test/java7/com/github/dcevm/test/body/ArrayTest.java
index 1c2ecb2b..b4ea5ddf 100644
--- a/dcevm/src/test/java7/com/github/dcevm/test/body/ArrayTest.java
+++ b/dcevm/src/test/java7/com/github/dcevm/test/body/ArrayTest.java
@@ -28,6 +28,7 @@ import org.junit.Before;
import org.junit.Test;
import java.lang.reflect.Array;
+import java.util.Arrays;
import static com.github.dcevm.test.util.HotSwapTestHelper.__toVersion__;
import static org.junit.Assert.assertEquals;
@@ -93,4 +94,17 @@ public class ArrayTest {
assertTrue(arr3 instanceof Object[][]);
assertEquals(arr3.getClass(), Array.newInstance(B[].class, 0).getClass());
}
+
+ @Test
+ public void testArrayGetComponentType() {
+
+ A[] array = new A[10];
+
+ assertEquals(A.class, array.getClass().getComponentType());
+ __toVersion__(1);
+
+ assertEquals(A.class, array.getClass().getComponentType());
+ array = Arrays.copyOf(array, array.length);
+ assertEquals(A.class, array.getClass().getComponentType());
+ }
}