ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject ignite git commit: IGNITE-2150: Debug.
Date Mon, 14 Dec 2015 08:20:54 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-2150 36e9a8ee8 -> 7881f5916


IGNITE-2150: Debug.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/7881f591
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/7881f591
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/7881f591

Branch: refs/heads/ignite-2150
Commit: 7881f5916dfcedf1663c279321c30e431acc99b1
Parents: 36e9a8e
Author: vozerov-gridgain <vozerov@gridgain.com>
Authored: Mon Dec 14 11:21:53 2015 +0300
Committer: vozerov-gridgain <vozerov@gridgain.com>
Committed: Mon Dec 14 11:21:53 2015 +0300

----------------------------------------------------------------------
 .../internal/binary/BinaryWriterExImpl.java     |  2 +
 .../binary/BinaryMarshallerSelfTest.java        | 64 ++++++++++++--------
 2 files changed, 41 insertions(+), 25 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/7881f591/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriterExImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriterExImpl.java
b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriterExImpl.java
index 6e05b40..e19ce1a 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriterExImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriterExImpl.java
@@ -302,6 +302,8 @@ public class BinaryWriterExImpl implements BinaryWriter, BinaryRawWriterEx,
Obje
         // Actual write.
         int retPos = out.position();
 
+        System.out.println("POST WRITE HC: " + hashCode);
+
         out.unsafePosition(start);
 
         out.unsafeWriteByte(GridBinaryMarshaller.OBJ);

http://git-wip-us.apache.org/repos/asf/ignite/blob/7881f591/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryMarshallerSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryMarshallerSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryMarshallerSelfTest.java
index 4ecad09..8ebe6ac 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryMarshallerSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryMarshallerSelfTest.java
@@ -76,6 +76,7 @@ import org.apache.ignite.internal.util.lang.GridMapEntry;
 import org.apache.ignite.internal.util.typedef.F;
 import org.apache.ignite.internal.util.typedef.internal.S;
 import org.apache.ignite.internal.util.typedef.internal.U;
+import org.apache.ignite.lang.IgniteBiTuple;
 import org.apache.ignite.marshaller.MarshallerContextTestImpl;
 import org.apache.ignite.testframework.GridTestUtils;
 import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
@@ -188,7 +189,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest {
      * @throws Exception If failed.
      */
     public void testUuid() throws Exception {
-        UUID uuid = UUID.randomUUID();
+        UUID uuid = CONST_UUID;
 
         assertEquals(uuid, marshalUnmarshal(uuid));
     }
@@ -310,7 +311,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest {
      * @throws Exception If failed.
      */
     public void testUuidArray() throws Exception {
-        UUID[] arr = new UUID[] {UUID.randomUUID(), UUID.randomUUID(), UUID.randomUUID()};
+        UUID[] arr = new UUID[] {CONST_UUID, CONST_UUID, CONST_UUID};
 
         assertArrayEquals(arr, marshalUnmarshal(arr));
     }
@@ -1147,7 +1148,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest
{
             new BinaryTypeConfiguration(DetachedInnerTestObject.class.getName())
         ));
 
-        UUID id = UUID.randomUUID();
+        UUID id = CONST_UUID;
 
         DetachedTestObject obj = marshal(new DetachedTestObject(
             new DetachedInnerTestObject(null, id)), marsh).deserialize();
@@ -1474,6 +1475,8 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest
{
 
         assertEquals(obj, po.deserialize());
 
+        System.out.println("DATA ARRAY: " + Arrays.toString(((BinaryObjectImpl) po).array()));
+
         BinaryObject copy = copy(po, null);
 
         assertEquals(obj, copy.deserialize());
@@ -1616,7 +1619,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest
{
 
         BinaryObject po = marshal(obj, marsh);
 
-        UUID uuid = UUID.randomUUID();
+        UUID uuid = CONST_UUID;
 
         BinaryObject copy = copy(po, F.<String, Object>asMap("uuid", uuid));
 
@@ -2755,6 +2758,8 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest
{
         private final long time = System.currentTimeMillis();
     }
 
+    private static final UUID CONST_UUID = UUID.fromString("123e4567-e89b-12d3-a456-426655440000");
+    
     /**
      * @return Simple object.
      */
@@ -2770,7 +2775,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest
{
         inner.c = 1;
         inner.bool = true;
         inner.str = "str1";
-        inner.uuid = UUID.randomUUID();
+        inner.uuid = UUID.fromString("123e4567-e89b-12d3-a456-426655440000");
         inner.date = new Date();
         inner.ts = new Timestamp(System.currentTimeMillis());
         inner.bArr = new byte[] {1, 2, 3};
@@ -2782,9 +2787,9 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest
{
         inner.cArr = new char[] {1, 2, 3};
         inner.boolArr = new boolean[] {true, false, true};
         inner.strArr = new String[] {"str1", "str2", "str3"};
-        inner.uuidArr = new UUID[] {UUID.randomUUID(), UUID.randomUUID(), UUID.randomUUID()};
+        inner.uuidArr = new UUID[] {CONST_UUID, CONST_UUID, CONST_UUID};
         inner.dateArr = new Date[] {new Date(11111), new Date(22222), new Date(33333)};
-        inner.objArr = new Object[] {UUID.randomUUID(), UUID.randomUUID(), UUID.randomUUID()};
+        inner.objArr = new Object[] {CONST_UUID, CONST_UUID, CONST_UUID};
         inner.col = new ArrayList<>();
         inner.map = new HashMap<>();
         inner.enumVal = TestEnum.A;
@@ -2812,7 +2817,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest
{
         outer.c = 2;
         outer.bool = false;
         outer.str = "str2";
-        outer.uuid = UUID.randomUUID();
+        outer.uuid = CONST_UUID;
         outer.date = new Date();
         outer.ts = new Timestamp(System.currentTimeMillis());
         outer.bArr = new byte[] {10, 20, 30};
@@ -2824,9 +2829,9 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest
{
         outer.cArr = new char[] {10, 20, 30};
         outer.boolArr = new boolean[] {false, true, false};
         outer.strArr = new String[] {"str10", "str20", "str30"};
-        outer.uuidArr = new UUID[] {UUID.randomUUID(), UUID.randomUUID(), UUID.randomUUID()};
+        outer.uuidArr = new UUID[] {CONST_UUID, CONST_UUID, CONST_UUID};
         outer.dateArr = new Date[] {new Date(44444), new Date(55555), new Date(66666)};
-        outer.objArr = new Object[] {UUID.randomUUID(), UUID.randomUUID(), UUID.randomUUID()};
+        outer.objArr = new Object[] {CONST_UUID, CONST_UUID, CONST_UUID};
         outer.col = new ArrayList<>();
         outer.map = new HashMap<>();
         outer.enumVal = TestEnum.B;
@@ -2863,7 +2868,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest
{
         innerSimple.c = 1;
         innerSimple.bool = true;
         innerSimple.str = "str1";
-        innerSimple.uuid = UUID.randomUUID();
+        innerSimple.uuid = CONST_UUID;
         innerSimple.date = new Date();
         innerSimple.ts = new Timestamp(System.currentTimeMillis());
         innerSimple.bArr = new byte[] {1, 2, 3};
@@ -2875,9 +2880,9 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest
{
         innerSimple.cArr = new char[] {1, 2, 3};
         innerSimple.boolArr = new boolean[] {true, false, true};
         innerSimple.strArr = new String[] {"str1", "str2", "str3"};
-        innerSimple.uuidArr = new UUID[] {UUID.randomUUID(), UUID.randomUUID(), UUID.randomUUID()};
+        innerSimple.uuidArr = new UUID[] {CONST_UUID, CONST_UUID, CONST_UUID};
         innerSimple.dateArr = new Date[] {new Date(11111), new Date(22222), new Date(33333)};
-        innerSimple.objArr = new UUID[] {UUID.randomUUID(), UUID.randomUUID(), UUID.randomUUID()};
+        innerSimple.objArr = new UUID[] {CONST_UUID, CONST_UUID, CONST_UUID};
         innerSimple.col = new ArrayList<>();
         innerSimple.map = new HashMap<>();
         innerSimple.enumVal = TestEnum.A;
@@ -2902,7 +2907,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest
{
         innerBinary.c = 2;
         innerBinary.bool = true;
         innerBinary.str = "str2";
-        innerBinary.uuid = UUID.randomUUID();
+        innerBinary.uuid = CONST_UUID;
         innerBinary.date = new Date();
         innerBinary.ts = new Timestamp(System.currentTimeMillis());
         innerBinary.bArr = new byte[] {10, 20, 30};
@@ -2914,9 +2919,9 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest
{
         innerBinary.cArr = new char[] {10, 20, 30};
         innerBinary.boolArr = new boolean[] {true, false, true};
         innerBinary.strArr = new String[] {"str10", "str20", "str30"};
-        innerBinary.uuidArr = new UUID[] {UUID.randomUUID(), UUID.randomUUID(), UUID.randomUUID()};
+        innerBinary.uuidArr = new UUID[] {CONST_UUID, CONST_UUID, CONST_UUID};
         innerBinary.dateArr = new Date[] {new Date(44444), new Date(55555), new Date(66666)};
-        innerBinary.objArr = new Object[] {UUID.randomUUID(), UUID.randomUUID(), UUID.randomUUID()};
+        innerBinary.objArr = new Object[] {CONST_UUID, CONST_UUID, CONST_UUID};
         innerBinary.bRaw = 3;
         innerBinary.sRaw = 3;
         innerBinary.iRaw = 3;
@@ -2926,7 +2931,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest
{
         innerBinary.cRaw = 3;
         innerBinary.boolRaw = true;
         innerBinary.strRaw = "str3";
-        innerBinary.uuidRaw = UUID.randomUUID();
+        innerBinary.uuidRaw = CONST_UUID;
         innerBinary.dateRaw = new Date();
         innerBinary.tsRaw = new Timestamp(System.currentTimeMillis());
         innerBinary.bArrRaw = new byte[] {11, 21, 31};
@@ -2938,9 +2943,9 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest
{
         innerBinary.cArrRaw = new char[] {11, 21, 31};
         innerBinary.boolArrRaw = new boolean[] {true, false, true};
         innerBinary.strArrRaw = new String[] {"str11", "str21", "str31"};
-        innerBinary.uuidArrRaw = new UUID[] {UUID.randomUUID(), UUID.randomUUID(), UUID.randomUUID()};
+        innerBinary.uuidArrRaw = new UUID[] {CONST_UUID, CONST_UUID, CONST_UUID};
         innerBinary.dateArrRaw = new Date[] {new Date(77777), new Date(88888), new Date(99999)};
-        innerBinary.objArrRaw = new Object[] {UUID.randomUUID(), UUID.randomUUID(), UUID.randomUUID()};
+        innerBinary.objArrRaw = new Object[] {CONST_UUID, CONST_UUID, CONST_UUID};
         innerBinary.col = new ArrayList<>();
         innerBinary.colRaw = new ArrayList<>();
         innerBinary.map = new HashMap<>();
@@ -2977,7 +2982,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest
{
         outer.c = 4;
         outer.bool = true;
         outer.str = "str4";
-        outer.uuid = UUID.randomUUID();
+        outer.uuid = CONST_UUID;
         outer.date = new Date();
         outer.ts = new Timestamp(System.currentTimeMillis());
         outer.bArr = new byte[] {12, 22, 32};
@@ -2989,9 +2994,9 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest
{
         outer.cArr = new char[] {12, 22, 32};
         outer.boolArr = new boolean[] {true, false, true};
         outer.strArr = new String[] {"str12", "str22", "str32"};
-        outer.uuidArr = new UUID[] {UUID.randomUUID(), UUID.randomUUID(), UUID.randomUUID()};
+        outer.uuidArr = new UUID[] {CONST_UUID, CONST_UUID, CONST_UUID};
         outer.dateArr = new Date[] {new Date(10101), new Date(20202), new Date(30303)};
-        outer.objArr = new Object[] {UUID.randomUUID(), UUID.randomUUID(), UUID.randomUUID()};
+        outer.objArr = new Object[] {CONST_UUID, CONST_UUID, CONST_UUID};
         outer.simple = innerSimple;
         outer.binary = innerBinary;
         outer.bRaw = 5;
@@ -3003,7 +3008,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest
{
         outer.cRaw = 5;
         outer.boolRaw = true;
         outer.strRaw = "str5";
-        outer.uuidRaw = UUID.randomUUID();
+        outer.uuidRaw = CONST_UUID;
         outer.dateRaw = new Date();
         outer.tsRaw = new Timestamp(System.currentTimeMillis());
         outer.bArrRaw = new byte[] {13, 23, 33};
@@ -3015,9 +3020,9 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest
{
         outer.cArrRaw = new char[] {13, 23, 33};
         outer.boolArrRaw = new boolean[] {true, false, true};
         outer.strArrRaw = new String[] {"str13", "str23", "str33"};
-        outer.uuidArrRaw = new UUID[] {UUID.randomUUID(), UUID.randomUUID(), UUID.randomUUID()};
+        outer.uuidArrRaw = new UUID[] {CONST_UUID, CONST_UUID, CONST_UUID};
         outer.dateArr = new Date[] {new Date(40404), new Date(50505), new Date(60606)};
-        outer.objArrRaw = new Object[] {UUID.randomUUID(), UUID.randomUUID(), UUID.randomUUID()};
+        outer.objArrRaw = new Object[] {CONST_UUID, CONST_UUID, CONST_UUID};
         outer.col = new ArrayList<>();
         outer.colRaw = new ArrayList<>();
         outer.map = new HashMap<>();
@@ -3149,6 +3154,10 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest
{
         /** */
         private SimpleObject inner;
 
+        @Override public int hashCode() {
+            return 1;
+        }
+
         /** {@inheritDoc} */
         @SuppressWarnings("FloatingPointEquality")
         @Override public boolean equals(Object other) {
@@ -3486,6 +3495,11 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest
{
         }
 
         /** {@inheritDoc} */
+        @Override public int hashCode() {
+            return 1;
+        }
+
+        /** {@inheritDoc} */
         @SuppressWarnings("FloatingPointEquality")
         @Override public boolean equals(Object other) {
             if (this == other)


Mime
View raw message