ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akuznet...@apache.org
Subject [15/50] [abbrv] incubator-ignite git commit: #Fixed GridCacheVersionEx bug.
Date Wed, 28 Jan 2015 03:26:43 GMT
#Fixed GridCacheVersionEx bug.


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

Branch: refs/heads/ignite-102
Commit: b4da38a336e8df1b3b8745549abba3053bb99ab1
Parents: 10b0a09
Author: vozerov-gridgain <vozerov@gridgain.com>
Authored: Tue Jan 27 14:03:21 2015 +0300
Committer: vozerov-gridgain <vozerov@gridgain.com>
Committed: Tue Jan 27 14:03:21 2015 +0300

----------------------------------------------------------------------
 .../processors/cache/GridCacheVersionEx.java    |  9 ++++++++
 .../cache/GridCacheVersionSelfTest.java         | 23 +++++++++++++++++++-
 2 files changed, 31 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b4da38a3/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheVersionEx.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheVersionEx.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheVersionEx.java
index 193538b..89d0462 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheVersionEx.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheVersionEx.java
@@ -26,6 +26,10 @@ public class GridCacheVersionEx extends GridCacheVersion {
     /** */
     private static final long serialVersionUID = 0L;
 
+    /** */
+    @SuppressWarnings({"NonConstantFieldWithUpperCaseName", "AbbreviationUsage", "UnusedDeclaration"})
+    private static Object GG_CLASS_ID;
+
     /** DR version. */
     private GridCacheVersion drVer;
 
@@ -78,6 +82,11 @@ public class GridCacheVersionEx extends GridCacheVersion {
     }
 
     /** {@inheritDoc} */
+    @Override public Object ggClassId() {
+        return GG_CLASS_ID;
+    }
+
+    /** {@inheritDoc} */
     @Override public void readExternal(ObjectInput in) throws IOException {
         super.readExternal(in);
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b4da38a3/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheVersionSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheVersionSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheVersionSelfTest.java
index cdf371b..86cff4e 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheVersionSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheVersionSelfTest.java
@@ -17,7 +17,7 @@
 
 package org.apache.ignite.internal.processors.cache;
 
-import org.apache.ignite.internal.processors.cache.*;
+import org.apache.ignite.marshaller.optimized.*;
 import org.apache.ignite.testframework.*;
 import org.apache.ignite.testframework.junits.common.*;
 
@@ -71,6 +71,27 @@ public class GridCacheVersionSelfTest extends GridCommonAbstractTest {
     }
 
     /**
+     * Test versions marshalling.
+     *
+     * @throws Exception If failed.
+     */
+    public void testMarshalling() throws Exception {
+        GridCacheVersion ver = version(1, 1);
+        GridCacheVersionEx verEx = new GridCacheVersionEx(2, 2, 0, 0, ver);
+
+        IgniteOptimizedMarshaller marsh = new IgniteOptimizedMarshaller(false);
+
+        byte[] verBytes = marsh.marshal(ver);
+        byte[] verExBytes = marsh.marshal(verEx);
+
+        GridCacheVersion verNew = marsh.unmarshal(verBytes, Thread.currentThread().getContextClassLoader());
+        GridCacheVersionEx verExNew = marsh.unmarshal(verExBytes, Thread.currentThread().getContextClassLoader());
+
+        assert ver.equals(verNew);
+        assert verEx.equals(verExNew);
+    }
+
+    /**
      * @param nodeOrder Node order.
      * @param drId Data center ID.
      * @return Cache version.


Mime
View raw message