{"action":"created","comment":{"url":"https://api.github.com/repos/hazelcast/hazelcast/pulls/comments/42459603","id":42459603,"diff_hunk":"@@ -0,0 +1,218 @@\n+package com.hazelcast.internal.serialization.impl;\n+\n+import com.hazelcast.nio.BufferObjectDataInput;\n+import com.hazelcast.nio.serialization.Data;\n+import com.hazelcast.nio.serialization.MorphingBasePortable;\n+import com.hazelcast.nio.serialization.MorphingPortable;\n+import com.hazelcast.nio.serialization.Portable;\n+import com.hazelcast.nio.serialization.PortableFactory;\n+import com.hazelcast.nio.serialization.PortableReader;\n+import com.hazelcast.nio.serialization.TestSerializationConstants;\n+import com.hazelcast.test.HazelcastParallelClassRunner;\n+import com.hazelcast.test.annotation.ParallelTest;\n+import com.hazelcast.test.annotation.QuickTest;\n+import org.junit.After;\n+import org.junit.Before;\n+import org.junit.Test;\n+import org.junit.experimental.categories.Category;\n+import org.junit.runner.RunWith;\n+\n+import static org.junit.Assert.assertEquals;\n+import static org.junit.Assert.assertFalse;\n+import static org.junit.Assert.assertNotNull;\n+import static org.junit.Assert.assertNull;\n+\n+/**\n+ * MorphingPortableReader Tester.\n+ *\n+ */\n+@RunWith(HazelcastParallelClassRunner.class)\n+@Category({QuickTest.class, ParallelTest.class})\n+public class MorphingPortableReaderTest {\n+\n+    private SerializationServiceV1 service1;\n+    private SerializationServiceV1 service2;\n+\n+    private PortableReader reader;\n+\n+    @Before\n+    public void before() throws Exception {\n+        service1 = (SerializationServiceV1) new DefaultSerializationServiceBuilder()\n+                .addPortableFactory(TestSerializationConstants.PORTABLE_FACTORY_ID, new PortableFactory() {\n+                    public Portable create(int classId) {\n+                        return new MorphingBasePortable();\n+                    }\n+\n+                }).build();\n+\n+        service2 = (SerializationServiceV1) new DefaultSerializationServiceBuilder()\n+                .addPortableFactory(TestSerializationConstants.PORTABLE_FACTORY_ID, new PortableFactory() {\n+                    public Portable create(int classId) {\n+                        return new MorphingPortable();\n+                    }\n+                }).build();\n+\n+        Data data = service1.toData(new MorphingBasePortable((byte) 1, true, (char) 2, (short) 3, 4, 5, 1f, 2d));\n+\n+        BufferObjectDataInput in = service2.createObjectDataInput(data);\n+        PortableSerializer portableSerializer = service2.getPortableSerializer();\n+        reader = portableSerializer.createMorphingReader(in);\n+    }\n+\n+    @After\n+    public void after() throws Exception {\n+        service1.destroy();\n+        service2.destroy();\n+    }\n+\n+    @Test\n+    public void testReadInt() throws Exception {\n+        int aByte = reader.readInt(\"byte\");\n+        int aShort = reader.readInt(\"short\");\n+        int aChar = reader.readInt(\"char\");\n+        int aInt = reader.readInt(\"int\");\n+\n+        assertEquals(1, aByte);\n+        assertEquals(3, aShort);\n+        assertEquals(2, aChar);\n+        assertEquals(4, aInt);\n+        assertEquals(0, reader.readInt(\"NO SUCH FIELD\"));\n+\n+    }\n+\n+    @Test\n+    public void testReadLong() throws Exception {\n+        long aByte = reader.readLong(\"byte\");\n+        long aShort = reader.readLong(\"short\");\n+        long aChar = reader.readLong(\"char\");\n+        long aInt = reader.readLong(\"int\");\n+\n+        assertEquals(1, aByte);\n+        assertEquals(3, aShort);\n+        assertEquals(2, aChar);\n+        assertEquals(4, aInt);\n+        assertEquals(0, reader.readLong(\"NO SUCH FIELD\"));\n+\n+    }\n+\n+    @Test\n+    public void testReadUTF() throws Exception {\n+        assertNull(reader.readUTF(\"NO SUCH FIELD\"));\n+    }\n+\n+    @Test\n+    public void testReadBoolean() throws Exception {","path":"hazelcast/src/test/java/com/hazelcast/internal/serialization/impl/MorphingPortableReaderTest.java","position":104,"original_position":104,"commit_id":"9676d446a6108ac3c9fe520dc798388f40c2424e","original_commit_id":"9676d446a6108ac3c9fe520dc798388f40c2424e","user":{"login":"pveentjer","id":105243,"avatar_url":"https://avatars.githubusercontent.com/u/105243?v=3","gravatar_id":"","url":"https://api.github.com/users/pveentjer","html_url":"https://github.com/pveentjer","followers_url":"https://api.github.com/users/pveentjer/followers","following_url":"https://api.github.com/users/pveentjer/following{/other_user}","gists_url":"https://api.github.com/users/pveentjer/gists{/gist_id}","starred_url":"https://api.github.com/users/pveentjer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pveentjer/subscriptions","organizations_url":"https://api.github.com/users/pveentjer/orgs","repos_url":"https://api.github.com/users/pveentjer/repos","events_url":"https://api.github.com/users/pveentjer/events{/privacy}","received_events_url":"https://api.github.com/users/pveentjer/received_events","type":"User","site_admin":false},"body":"Should the readBoolean not be tested on a boolean field? Because afaik it is only tested what happens when the field is not found, but we have no idea what happens when the boolean field is found.","created_at":"2015-10-20T06:21:41Z","updated_at":"2015-10-20T06:21:41Z","html_url":"https://github.com/hazelcast/hazelcast/pull/6503#discussion_r42459603","pull_request_url":"https://api.github.com/repos/hazelcast/hazelcast/pulls/6503","_links":{"self":{"href":"https://api.github.com/repos/hazelcast/hazelcast/pulls/comments/42459603"},"html":{"href":"https://github.com/hazelcast/hazelcast/pull/6503#discussion_r42459603"},"pull_request":{"href":"https://api.github.com/repos/hazelcast/hazelcast/pulls/6503"}}},"pull_request":{"url":"https://api.github.com/repos/hazelcast/hazelcast/pulls/6503","id":48121899,"html_url":"https://github.com/hazelcast/hazelcast/pull/6503","diff_url":"https://github.com/hazelcast/hazelcast/pull/6503.diff","patch_url":"https://github.com/hazelcast/hazelcast/pull/6503.patch","issue_url":"https://api.github.com/repos/hazelcast/hazelcast/issues/6503","number":6503,"state":"open","locked":false,"title":"MorphingPortableReader tests","user":{"login":"asimarslan","id":2497208,"avatar_url":"https://avatars.githubusercontent.com/u/2497208?v=3","gravatar_id":"","url":"https://api.github.com/users/asimarslan","html_url":"https://github.com/asimarslan","followers_url":"https://api.github.com/users/asimarslan/followers","following_url":"https://api.github.com/users/asimarslan/following{/other_user}","gists_url":"https://api.github.com/users/asimarslan/gists{/gist_id}","starred_url":"https://api.github.com/users/asimarslan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asimarslan/subscriptions","organizations_url":"https://api.github.com/users/asimarslan/orgs","repos_url":"https://api.github.com/users/asimarslan/repos","events_url":"https://api.github.com/users/asimarslan/events{/privacy}","received_events_url":"https://api.github.com/users/asimarslan/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-10-19T20:29:00Z","updated_at":"2015-10-20T06:21:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1e78ee08ba59a003553e9e66e89d8b934bb00cb0","assignee":null,"milestone":{"url":"https://api.github.com/repos/hazelcast/hazelcast/milestones/61","html_url":"https://github.com/hazelcast/hazelcast/milestones/3.6","labels_url":"https://api.github.com/repos/hazelcast/hazelcast/milestones/61/labels","id":982584,"number":61,"title":"3.6","description":"","creator":{"login":"enesakar","id":234086,"avatar_url":"https://avatars.githubusercontent.com/u/234086?v=3","gravatar_id":"","url":"https://api.github.com/users/enesakar","html_url":"https://github.com/enesakar","followers_url":"https://api.github.com/users/enesakar/followers","following_url":"https://api.github.com/users/enesakar/following{/other_user}","gists_url":"https://api.github.com/users/enesakar/gists{/gist_id}","starred_url":"https://api.github.com/users/enesakar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/enesakar/subscriptions","organizations_url":"https://api.github.com/users/enesakar/orgs","repos_url":"https://api.github.com/users/enesakar/repos","events_url":"https://api.github.com/users/enesakar/events{/privacy}","received_events_url":"https://api.github.com/users/enesakar/received_events","type":"User","site_admin":false},"open_issues":153,"closed_issues":608,"state":"open","created_at":"2015-02-17T09:27:09Z","updated_at":"2015-10-20T06:09:47Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/hazelcast/hazelcast/pulls/6503/commits","review_comments_url":"https://api.github.com/repos/hazelcast/hazelcast/pulls/6503/comments","review_comment_url":"https://api.github.com/repos/hazelcast/hazelcast/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hazelcast/hazelcast/issues/6503/comments","statuses_url":"https://api.github.com/repos/hazelcast/hazelcast/statuses/9676d446a6108ac3c9fe520dc798388f40c2424e","head":{"label":"asimarslan:feature/master/serialization-compatibility5","ref":"feature/master/serialization-compatibility5","sha":"9676d446a6108ac3c9fe520dc798388f40c2424e","user":{"login":"asimarslan","id":2497208,"avatar_url":"https://avatars.githubusercontent.com/u/2497208?v=3","gravatar_id":"","url":"https://api.github.com/users/asimarslan","html_url":"https://github.com/asimarslan","followers_url":"https://api.github.com/users/asimarslan/followers","following_url":"https://api.github.com/users/asimarslan/following{/other_user}","gists_url":"https://api.github.com/users/asimarslan/gists{/gist_id}","starred_url":"https://api.github.com/users/asimarslan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asimarslan/subscriptions","organizations_url":"https://api.github.com/users/asimarslan/orgs","repos_url":"https://api.github.com/users/asimarslan/repos","events_url":"https://api.github.com/users/asimarslan/events{/privacy}","received_events_url":"https://api.github.com/users/asimarslan/received_events","type":"User","site_admin":false},"repo":{"id":10238745,"name":"hazelcast","full_name":"asimarslan/hazelcast","owner":{"login":"asimarslan","id":2497208,"avatar_url":"https://avatars.githubusercontent.com/u/2497208?v=3","gravatar_id":"","url":"https://api.github.com/users/asimarslan","html_url":"https://github.com/asimarslan","followers_url":"https://api.github.com/users/asimarslan/followers","following_url":"https://api.github.com/users/asimarslan/following{/other_user}","gists_url":"https://api.github.com/users/asimarslan/gists{/gist_id}","starred_url":"https://api.github.com/users/asimarslan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asimarslan/subscriptions","organizations_url":"https://api.github.com/users/asimarslan/orgs","repos_url":"https://api.github.com/users/asimarslan/repos","events_url":"https://api.github.com/users/asimarslan/events{/privacy}","received_events_url":"https://api.github.com/users/asimarslan/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/asimarslan/hazelcast","description":"Open Source In-Memory Data Grid","fork":true,"url":"https://api.github.com/repos/asimarslan/hazelcast","forks_url":"https://api.github.com/repos/asimarslan/hazelcast/forks","keys_url":"https://api.github.com/repos/asimarslan/hazelcast/keys{/key_id}","collaborators_url":"https://api.github.com/repos/asimarslan/hazelcast/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/asimarslan/hazelcast/teams","hooks_url":"https://api.github.com/repos/asimarslan/hazelcast/hooks","issue_events_url":"https://api.github.com/repos/asimarslan/hazelcast/issues/events{/number}","events_url":"https://api.github.com/repos/asimarslan/hazelcast/events","assignees_url":"https://api.github.com/repos/asimarslan/hazelcast/assignees{/user}","branches_url":"https://api.github.com/repos/asimarslan/hazelcast/branches{/branch}","tags_url":"https://api.github.com/repos/asimarslan/hazelcast/tags","blobs_url":"https://api.github.com/repos/asimarslan/hazelcast/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/asimarslan/hazelcast/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/asimarslan/hazelcast/git/refs{/sha}","trees_url":"https://api.github.com/repos/asimarslan/hazelcast/git/trees{/sha}","statuses_url":"https://api.github.com/repos/asimarslan/hazelcast/statuses/{sha}","languages_url":"https://api.github.com/repos/asimarslan/hazelcast/languages","stargazers_url":"https://api.github.com/repos/asimarslan/hazelcast/stargazers","contributors_url":"https://api.github.com/repos/asimarslan/hazelcast/contributors","subscribers_url":"https://api.github.com/repos/asimarslan/hazelcast/subscribers","subscription_url":"https://api.github.com/repos/asimarslan/hazelcast/subscription","commits_url":"https://api.github.com/repos/asimarslan/hazelcast/commits{/sha}","git_commits_url":"https://api.github.com/repos/asimarslan/hazelcast/git/commits{/sha}","comments_url":"https://api.github.com/repos/asimarslan/hazelcast/comments{/number}","issue_comment_url":"https://api.github.com/repos/asimarslan/hazelcast/issues/comments{/number}","contents_url":"https://api.github.com/repos/asimarslan/hazelcast/contents/{+path}","compare_url":"https://api.github.com/repos/asimarslan/hazelcast/compare/{base}...{head}","merges_url":"https://api.github.com/repos/asimarslan/hazelcast/merges","archive_url":"https://api.github.com/repos/asimarslan/hazelcast/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/asimarslan/hazelcast/downloads","issues_url":"https://api.github.com/repos/asimarslan/hazelcast/issues{/number}","pulls_url":"https://api.github.com/repos/asimarslan/hazelcast/pulls{/number}","milestones_url":"https://api.github.com/repos/asimarslan/hazelcast/milestones{/number}","notifications_url":"https://api.github.com/repos/asimarslan/hazelcast/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/asimarslan/hazelcast/labels{/name}","releases_url":"https://api.github.com/repos/asimarslan/hazelcast/releases{/id}","created_at":"2013-05-23T07:56:42Z","updated_at":"2015-04-01T14:20:18Z","pushed_at":"2015-10-19T20:28:48Z","git_url":"git://github.com/asimarslan/hazelcast.git","ssh_url":"git@github.com:asimarslan/hazelcast.git","clone_url":"https://github.com/asimarslan/hazelcast.git","svn_url":"https://github.com/asimarslan/hazelcast","homepage":"www.hazelcast.com","size":78985,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"hazelcast:master","ref":"master","sha":"b8163fc89a4e697d58216dccd9b1511a375b3ab4","user":{"login":"hazelcast","id":1453152,"avatar_url":"https://avatars.githubusercontent.com/u/1453152?v=3","gravatar_id":"","url":"https://api.github.com/users/hazelcast","html_url":"https://github.com/hazelcast","followers_url":"https://api.github.com/users/hazelcast/followers","following_url":"https://api.github.com/users/hazelcast/following{/other_user}","gists_url":"https://api.github.com/users/hazelcast/gists{/gist_id}","starred_url":"https://api.github.com/users/hazelcast/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hazelcast/subscriptions","organizations_url":"https://api.github.com/users/hazelcast/orgs","repos_url":"https://api.github.com/users/hazelcast/repos","events_url":"https://api.github.com/users/hazelcast/events{/privacy}","received_events_url":"https://api.github.com/users/hazelcast/received_events","type":"Organization","site_admin":false},"repo":{"id":3786237,"name":"hazelcast","full_name":"hazelcast/hazelcast","owner":{"login":"hazelcast","id":1453152,"avatar_url":"https://avatars.githubusercontent.com/u/1453152?v=3","gravatar_id":"","url":"https://api.github.com/users/hazelcast","html_url":"https://github.com/hazelcast","followers_url":"https://api.github.com/users/hazelcast/followers","following_url":"https://api.github.com/users/hazelcast/following{/other_user}","gists_url":"https://api.github.com/users/hazelcast/gists{/gist_id}","starred_url":"https://api.github.com/users/hazelcast/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hazelcast/subscriptions","organizations_url":"https://api.github.com/users/hazelcast/orgs","repos_url":"https://api.github.com/users/hazelcast/repos","events_url":"https://api.github.com/users/hazelcast/events{/privacy}","received_events_url":"https://api.github.com/users/hazelcast/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hazelcast/hazelcast","description":"Open Source In-Memory Data Grid","fork":false,"url":"https://api.github.com/repos/hazelcast/hazelcast","forks_url":"https://api.github.com/repos/hazelcast/hazelcast/forks","keys_url":"https://api.github.com/repos/hazelcast/hazelcast/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hazelcast/hazelcast/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hazelcast/hazelcast/teams","hooks_url":"https://api.github.com/repos/hazelcast/hazelcast/hooks","issue_events_url":"https://api.github.com/repos/hazelcast/hazelcast/issues/events{/number}","events_url":"https://api.github.com/repos/hazelcast/hazelcast/events","assignees_url":"https://api.github.com/repos/hazelcast/hazelcast/assignees{/user}","branches_url":"https://api.github.com/repos/hazelcast/hazelcast/branches{/branch}","tags_url":"https://api.github.com/repos/hazelcast/hazelcast/tags","blobs_url":"https://api.github.com/repos/hazelcast/hazelcast/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hazelcast/hazelcast/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hazelcast/hazelcast/git/refs{/sha}","trees_url":"https://api.github.com/repos/hazelcast/hazelcast/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hazelcast/hazelcast/statuses/{sha}","languages_url":"https://api.github.com/repos/hazelcast/hazelcast/languages","stargazers_url":"https://api.github.com/repos/hazelcast/hazelcast/stargazers","contributors_url":"https://api.github.com/repos/hazelcast/hazelcast/contributors","subscribers_url":"https://api.github.com/repos/hazelcast/hazelcast/subscribers","subscription_url":"https://api.github.com/repos/hazelcast/hazelcast/subscription","commits_url":"https://api.github.com/repos/hazelcast/hazelcast/commits{/sha}","git_commits_url":"https://api.github.com/repos/hazelcast/hazelcast/git/commits{/sha}","comments_url":"https://api.github.com/repos/hazelcast/hazelcast/comments{/number}","issue_comment_url":"https://api.github.com/repos/hazelcast/hazelcast/issues/comments{/number}","contents_url":"https://api.github.com/repos/hazelcast/hazelcast/contents/{+path}","compare_url":"https://api.github.com/repos/hazelcast/hazelcast/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hazelcast/hazelcast/merges","archive_url":"https://api.github.com/repos/hazelcast/hazelcast/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hazelcast/hazelcast/downloads","issues_url":"https://api.github.com/repos/hazelcast/hazelcast/issues{/number}","pulls_url":"https://api.github.com/repos/hazelcast/hazelcast/pulls{/number}","milestones_url":"https://api.github.com/repos/hazelcast/hazelcast/milestones{/number}","notifications_url":"https://api.github.com/repos/hazelcast/hazelcast/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hazelcast/hazelcast/labels{/name}","releases_url":"https://api.github.com/repos/hazelcast/hazelcast/releases{/id}","created_at":"2012-03-21T12:25:18Z","updated_at":"2015-10-20T00:03:54Z","pushed_at":"2015-10-20T03:35:06Z","git_url":"git://github.com/hazelcast/hazelcast.git","ssh_url":"git@github.com:hazelcast/hazelcast.git","clone_url":"https://github.com/hazelcast/hazelcast.git","svn_url":"https://github.com/hazelcast/hazelcast","homepage":"www.hazelcast.com","size":160050,"stargazers_count":1275,"watchers_count":1275,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":620,"mirror_url":null,"open_issues_count":534,"forks":620,"open_issues":534,"watchers":1275,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hazelcast/hazelcast/pulls/6503"},"html":{"href":"https://github.com/hazelcast/hazelcast/pull/6503"},"issue":{"href":"https://api.github.com/repos/hazelcast/hazelcast/issues/6503"},"comments":{"href":"https://api.github.com/repos/hazelcast/hazelcast/issues/6503/comments"},"review_comments":{"href":"https://api.github.com/repos/hazelcast/hazelcast/pulls/6503/comments"},"review_comment":{"href":"https://api.github.com/repos/hazelcast/hazelcast/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hazelcast/hazelcast/pulls/6503/commits"},"statuses":{"href":"https://api.github.com/repos/hazelcast/hazelcast/statuses/9676d446a6108ac3c9fe520dc798388f40c2424e"}}}}