IGNITE-2064 Fixed Usage of Optimize classloader test coverage
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/afbb0dc0 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/afbb0dc0 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/afbb0dc0 Branch: refs/heads/ignite-1.5 Commit: afbb0dc0c1323b1b24d1a6f4f46fc78d255c98a4 Parents: d078655 Author: Anton Vinogradov <a...@apache.org> Authored: Wed Dec 9 12:59:51 2015 +0300 Committer: Anton Vinogradov <a...@apache.org> Committed: Wed Dec 9 12:59:51 2015 +0300 ---------------------------------------------------------------------- .../internal/portable/BinaryMarshallerSelfTest.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/afbb0dc0/modules/core/src/test/java/org/apache/ignite/internal/portable/BinaryMarshallerSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/portable/BinaryMarshallerSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/portable/BinaryMarshallerSelfTest.java index a06e6c3..d667e07 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/portable/BinaryMarshallerSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/portable/BinaryMarshallerSelfTest.java @@ -80,6 +80,7 @@ import sun.misc.Unsafe; import static org.apache.ignite.internal.portable.streams.PortableMemoryAllocator.INSTANCE; import static org.junit.Assert.assertArrayEquals; +import static org.junit.Assert.assertNotEquals; /** * Portable marshaller tests. @@ -329,6 +330,17 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + public void testException() throws Exception { + Exception ex = new RuntimeException(); + + // Checks that Optimize marshaller will be used, because Throwable has writeObject method. + // Exception's stacktrace equals to zero-length array by default and generates at Throwable's writeObject method. + assertNotEquals(0, marshalUnmarshal(ex).getStackTrace().length); + } + + /** + * @throws Exception If failed. + */ public void testCollection() throws Exception { testCollection(new ArrayList<Integer>(3)); testCollection(new LinkedHashSet<Integer>()); @@ -2406,7 +2418,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest { protected boolean compactFooter() { return true; } - + /** * @param marsh Marshaller. * @return Portable context.