ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agoncha...@apache.org
Subject [1/5] incubator-ignite git commit: IGNITE-51 - Got rid of portables in code, tests need to be fixed.
Date Sun, 08 Feb 2015 07:35:03 GMT
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-51 2cfcca0d0 -> 71c7a694c


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dff026be/modules/core/src/main/java/org/apache/ignite/portables/PortableWriter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/portables/PortableWriter.java b/modules/core/src/main/java/org/apache/ignite/portables/PortableWriter.java
deleted file mode 100644
index 1b44aa3..0000000
--- a/modules/core/src/main/java/org/apache/ignite/portables/PortableWriter.java
+++ /dev/null
@@ -1,265 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.portables;
-
-import org.jetbrains.annotations.*;
-
-import java.math.*;
-import java.sql.*;
-import java.util.*;
-import java.util.Date;
-
-/**
- * Writer for portable object used in {@link PortableMarshalAware} implementations.
- * Useful for the cases when user wants a fine-grained control over serialization.
- * <p>
- * Note that Ignite never writes full strings for field or type names. Instead,
- * for performance reasons, Ignite writes integer hash codes for type and field names.
- * It has been tested that hash code conflicts for the type names or the field names
- * within the same type are virtually non-existent and, to gain performance, it is safe
- * to work with hash codes. For the cases when hash codes for different types or fields
- * actually do collide, Ignite provides {@link PortableIdMapper} which
- * allows to override the automatically generated hash code IDs for the type and field names.
- */
-public interface PortableWriter {
-    /**
-     * @param fieldName Field name.
-     * @param val Value to write.
-     * @throws PortableException In case of error.
-     */
-    public void writeByte(String fieldName, byte val) throws PortableException;
-
-    /**
-     * @param fieldName Field name.
-     * @param val Value to write.
-     * @throws PortableException In case of error.
-     */
-    public void writeShort(String fieldName, short val) throws PortableException;
-
-    /**
-     * @param fieldName Field name.
-     * @param val Value to write.
-     * @throws PortableException In case of error.
-     */
-    public void writeInt(String fieldName, int val) throws PortableException;
-
-    /**
-     * @param fieldName Field name.
-     * @param val Value to write.
-     * @throws PortableException In case of error.
-     */
-    public void writeLong(String fieldName, long val) throws PortableException;
-
-    /**
-     * @param fieldName Field name.
-     * @param val Value to write.
-     * @throws PortableException In case of error.
-     */
-    public void writeFloat(String fieldName, float val) throws PortableException;
-
-    /**
-     * @param fieldName Field name.
-     * @param val Value to write.
-     * @throws PortableException In case of error.
-     */
-    public void writeDouble(String fieldName, double val) throws PortableException;
-
-    /**
-     * @param fieldName Field name.
-     * @param val Value to write.
-     * @throws PortableException In case of error.
-     */
-    public void writeChar(String fieldName, char val) throws PortableException;
-
-    /**
-     * @param fieldName Field name.
-     * @param val Value to write.
-     * @throws PortableException In case of error.
-     */
-    public void writeBoolean(String fieldName, boolean val) throws PortableException;
-
-    /**
-     * @param fieldName Field name.
-     * @param val Value to write.
-     * @throws PortableException In case of error.
-     */
-    public void writeDecimal(String fieldName, @Nullable BigDecimal val) throws PortableException;
-
-    /**
-     * @param fieldName Field name.
-     * @param val Value to write.
-     * @throws PortableException In case of error.
-     */
-    public void writeString(String fieldName, @Nullable String val) throws PortableException;
-
-    /**
-     * @param fieldName Field name.
-     * @param val UUID to write.
-     * @throws PortableException In case of error.
-     */
-    public void writeUuid(String fieldName, @Nullable UUID val) throws PortableException;
-
-    /**
-     * @param fieldName Field name.
-     * @param val Date to write.
-     * @throws PortableException In case of error.
-     */
-    public void writeDate(String fieldName, @Nullable Date val) throws PortableException;
-
-    /**
-     * @param fieldName Field name.
-     * @param val Timestamp to write.
-     * @throws PortableException In case of error.
-     */
-    public void writeTimestamp(String fieldName, @Nullable Timestamp val) throws PortableException;
-
-    /**
-     * @param fieldName Field name.
-     * @param obj Value to write.
-     * @throws PortableException In case of error.
-     */
-    public void writeObject(String fieldName, @Nullable Object obj) throws PortableException;
-
-    /**
-     * @param fieldName Field name.
-     * @param val Value to write.
-     * @throws PortableException In case of error.
-     */
-    public void writeByteArray(String fieldName, @Nullable byte[] val) throws PortableException;
-
-    /**
-     * @param fieldName Field name.
-     * @param val Value to write.
-     * @throws PortableException In case of error.
-     */
-    public void writeShortArray(String fieldName, @Nullable short[] val) throws PortableException;
-
-    /**
-     * @param fieldName Field name.
-     * @param val Value to write.
-     * @throws PortableException In case of error.
-     */
-    public void writeIntArray(String fieldName, @Nullable int[] val) throws PortableException;
-
-    /**
-     * @param fieldName Field name.
-     * @param val Value to write.
-     * @throws PortableException In case of error.
-     */
-    public void writeLongArray(String fieldName, @Nullable long[] val) throws PortableException;
-
-    /**
-     * @param fieldName Field name.
-     * @param val Value to write.
-     * @throws PortableException In case of error.
-     */
-    public void writeFloatArray(String fieldName, @Nullable float[] val) throws PortableException;
-
-    /**
-     * @param fieldName Field name.
-     * @param val Value to write.
-     * @throws PortableException In case of error.
-     */
-    public void writeDoubleArray(String fieldName, @Nullable double[] val) throws PortableException;
-
-    /**
-     * @param fieldName Field name.
-     * @param val Value to write.
-     * @throws PortableException In case of error.
-     */
-    public void writeCharArray(String fieldName, @Nullable char[] val) throws PortableException;
-
-    /**
-     * @param fieldName Field name.
-     * @param val Value to write.
-     * @throws PortableException In case of error.
-     */
-    public void writeBooleanArray(String fieldName, @Nullable boolean[] val) throws PortableException;
-
-    /**
-     * @param fieldName Field name.
-     * @param val Value to write.
-     * @throws PortableException In case of error.
-     */
-    public void writeDecimalArray(String fieldName, @Nullable BigDecimal[] val) throws PortableException;
-
-    /**
-     * @param fieldName Field name.
-     * @param val Value to write.
-     * @throws PortableException In case of error.
-     */
-    public void writeStringArray(String fieldName, @Nullable String[] val) throws PortableException;
-
-    /**
-     * @param fieldName Field name.
-     * @param val Value to write.
-     * @throws PortableException In case of error.
-     */
-    public void writeUuidArray(String fieldName, @Nullable UUID[] val) throws PortableException;
-
-    /**
-     * @param fieldName Field name.
-     * @param val Value to write.
-     * @throws PortableException In case of error.
-     */
-    public void writeDateArray(String fieldName, @Nullable Date[] val) throws PortableException;
-
-    /**
-     * @param fieldName Field name.
-     * @param val Value to write.
-     * @throws PortableException In case of error.
-     */
-    public void writeObjectArray(String fieldName, @Nullable Object[] val) throws PortableException;
-
-    /**
-     * @param fieldName Field name.
-     * @param col Collection to write.
-     * @throws PortableException In case of error.
-     */
-    public <T> void writeCollection(String fieldName, @Nullable Collection<T>
col) throws PortableException;
-
-    /**
-     * @param fieldName Field name.
-     * @param map Map to write.
-     * @throws PortableException In case of error.
-     */
-    public <K, V> void writeMap(String fieldName, @Nullable Map<K, V> map) throws
PortableException;
-
-    /**
-     * @param fieldName Field name.
-     * @param val Value to write.
-     * @throws PortableException In case of error.
-     */
-    public <T extends Enum<?>> void writeEnum(String fieldName, T val) throws
PortableException;
-
-    /**
-     * @param fieldName Field name.
-     * @param val Value to write.
-     * @throws PortableException In case of error.
-     */
-    public <T extends Enum<?>> void writeEnumArray(String fieldName, T[] val)
throws PortableException;
-
-    /**
-     * Gets raw writer. Raw writer does not write field name hash codes, therefore,
-     * making the format even more compact. However, if the raw writer is used,
-     * dynamic structure changes to the portable objects are not supported.
-     *
-     * @return Raw writer.
-     */
-    public PortableRawWriter rawWriter();
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dff026be/modules/core/src/main/java/org/apache/ignite/portables/package.html
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/portables/package.html b/modules/core/src/main/java/org/apache/ignite/portables/package.html
deleted file mode 100644
index 4c645be..0000000
--- a/modules/core/src/main/java/org/apache/ignite/portables/package.html
+++ /dev/null
@@ -1,24 +0,0 @@
-<!--
-  Licensed to the Apache Software Foundation (ASF) under one or more
-  contributor license agreements.  See the NOTICE file distributed with
-  this work for additional information regarding copyright ownership.
-  The ASF licenses this file to You under the Apache License, Version 2.0
-  (the "License"); you may not use this file except in compliance with
-  the License.  You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License.
--->
-
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<body>
-    <!-- Package description. -->
-    Contains <b>Portable Objects</b> related functionality.
-</body>
-</html>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dff026be/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractSelfTest.java
index 2fe8b85..fe4fc15 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractSelfTest.java
@@ -255,7 +255,6 @@ public abstract class GridCacheAbstractSelfTest extends GridCommonAbstractTest
{
         cfg.setAtomicityMode(atomicityMode());
         cfg.setWriteSynchronizationMode(writeSynchronization());
         cfg.setDistributionMode(distributionMode());
-        cfg.setPortableEnabled(portableEnabled());
 
         if (cacheMode() == PARTITIONED)
             cfg.setBackups(1);
@@ -345,13 +344,6 @@ public abstract class GridCacheAbstractSelfTest extends GridCommonAbstractTest
{
     }
 
     /**
-     * @return Whether portable mode is enabled.
-     */
-    protected boolean portableEnabled() {
-        return false;
-    }
-
-    /**
      * @return {@code True} for partitioned caches.
      */
     protected final boolean partitionedMode() {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dff026be/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMemoryModeSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMemoryModeSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMemoryModeSelfTest.java
index c1a84c3..842468b 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMemoryModeSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMemoryModeSelfTest.java
@@ -87,7 +87,6 @@ public class GridCacheMemoryModeSelfTest extends GridCommonAbstractTest
{
         cacheCfg.setAtomicityMode(atomicity);
         cacheCfg.setOffHeapMaxMemory(offheapSize);
         cacheCfg.setQueryIndexEnabled(memoryMode != CacheMemoryMode.OFFHEAP_VALUES);
-        cacheCfg.setPortableEnabled(portableEnabled());
 
         cfg.setCacheConfiguration(cacheCfg);
         cfg.setMarshaller(new OptimizedMarshaller(false));
@@ -96,13 +95,6 @@ public class GridCacheMemoryModeSelfTest extends GridCommonAbstractTest
{
     }
 
     /**
-     * @return Portable enabled flag.
-     */
-    protected boolean portableEnabled() {
-        return false;
-    }
-
-    /**
      * @throws Exception If failed.
      */
     public void testOnheap() throws Exception {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dff026be/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapMultiThreadedUpdateAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapMultiThreadedUpdateAbstractSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapMultiThreadedUpdateAbstractSelfTest.java
index 064c033..e168f2b 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapMultiThreadedUpdateAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapMultiThreadedUpdateAbstractSelfTest.java
@@ -57,7 +57,6 @@ public abstract class GridCacheOffHeapMultiThreadedUpdateAbstractSelfTest
extend
         ccfg.setOffHeapMaxMemory(1024 * 1024);
         ccfg.setWriteSynchronizationMode(FULL_SYNC);
         ccfg.setAtomicWriteOrderMode(PRIMARY);
-        ccfg.setPortableEnabled(portableEnabled());
 
         return ccfg;
     }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dff026be/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapTieredAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapTieredAbstractSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapTieredAbstractSelfTest.java
index bf607b4..4d6162e 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapTieredAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapTieredAbstractSelfTest.java
@@ -21,7 +21,7 @@ import org.apache.ignite.*;
 import org.apache.ignite.cache.*;
 import org.apache.ignite.configuration.*;
 import org.apache.ignite.lang.*;
-import org.apache.ignite.portables.*;
+import org.gridgain.grid.portables.*;
 import org.apache.ignite.transactions.*;
 import org.jetbrains.annotations.*;
 import org.junit.*;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dff026be/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapTieredEvictionAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapTieredEvictionAbstractSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapTieredEvictionAbstractSelfTest.java
index b760af8..bc43dec 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapTieredEvictionAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapTieredEvictionAbstractSelfTest.java
@@ -22,7 +22,7 @@ import org.apache.ignite.cache.*;
 import org.apache.ignite.configuration.*;
 import org.apache.ignite.internal.util.typedef.*;
 import org.apache.ignite.internal.util.typedef.internal.*;
-import org.apache.ignite.portables.*;
+import org.gridgain.grid.portables.*;
 import org.apache.ignite.testframework.*;
 
 import javax.cache.processor.*;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dff026be/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractTest.java
index f704a75..0a4596e 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractTest.java
@@ -121,7 +121,6 @@ public abstract class IgniteCacheAbstractTest extends GridCommonAbstractTest
{
 
         cfg.setWriteSynchronizationMode(writeSynchronization());
         cfg.setDistributionMode(distributionMode());
-        cfg.setPortableEnabled(portableEnabled());
 
         cfg.setCacheLoaderFactory(loaderFactory());
 
@@ -199,13 +198,6 @@ public abstract class IgniteCacheAbstractTest extends GridCommonAbstractTest
{
     }
 
     /**
-     * @return Whether portable mode is enabled.
-     */
-    protected boolean portableEnabled() {
-        return false;
-    }
-
-    /**
      * @return {@code true} if swap should be enabled.
      */
     protected boolean swapEnabled() {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dff026be/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheAbstractDistributedByteArrayValuesSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheAbstractDistributedByteArrayValuesSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheAbstractDistributedByteArrayValuesSelfTest.java
index fceba6d..0bc842d 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheAbstractDistributedByteArrayValuesSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheAbstractDistributedByteArrayValuesSelfTest.java
@@ -69,13 +69,6 @@ public abstract class GridCacheAbstractDistributedByteArrayValuesSelfTest
extend
     protected abstract boolean peerClassLoading();
 
     /**
-     * @return Whether portable mode is enabled.
-     */
-    protected boolean portableEnabled() {
-        return false;
-    }
-
-    /**
      * @return How many grids to start.
      */
     protected int gridCount() {
@@ -89,7 +82,6 @@ public abstract class GridCacheAbstractDistributedByteArrayValuesSelfTest
extend
         CacheConfiguration cfg = cacheConfiguration0();
 
         cfg.setName(CACHE_REGULAR);
-        cfg.setPortableEnabled(portableEnabled());
 
         return cfg;
     }
@@ -106,7 +98,6 @@ public abstract class GridCacheAbstractDistributedByteArrayValuesSelfTest
extend
         CacheConfiguration cfg = offheapCacheConfiguration0();
 
         cfg.setName(CACHE_OFFHEAP);
-        cfg.setPortableEnabled(portableEnabled());
 
         return cfg;
     }
@@ -118,7 +109,6 @@ public abstract class GridCacheAbstractDistributedByteArrayValuesSelfTest
extend
         CacheConfiguration cfg = offheapTieredCacheConfiguration0();
 
         cfg.setName(CACHE_OFFHEAP_TIERED);
-        cfg.setPortableEnabled(portableEnabled());
 
         return cfg;
     }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dff026be/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheAbstractPartitionedByteArrayValuesSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheAbstractPartitionedByteArrayValuesSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheAbstractPartitionedByteArrayValuesSelfTest.java
index c5fadaf..485f95c 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheAbstractPartitionedByteArrayValuesSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheAbstractPartitionedByteArrayValuesSelfTest.java
@@ -54,7 +54,6 @@ public abstract class GridCacheAbstractPartitionedByteArrayValuesSelfTest
extend
         cfg.setSwapEnabled(true);
         cfg.setEvictSynchronized(false);
         cfg.setEvictNearSynchronized(false);
-        cfg.setPortableEnabled(portableEnabled());
 
         return cfg;
     }
@@ -71,7 +70,6 @@ public abstract class GridCacheAbstractPartitionedByteArrayValuesSelfTest
extend
         cfg.setMemoryMode(OFFHEAP_VALUES);
         cfg.setOffHeapMaxMemory(100 * 1024 * 1024);
         cfg.setQueryIndexEnabled(false);
-        cfg.setPortableEnabled(portableEnabled());
 
         return cfg;
     }
@@ -88,7 +86,6 @@ public abstract class GridCacheAbstractPartitionedByteArrayValuesSelfTest
extend
         cfg.setMemoryMode(OFFHEAP_TIERED);
         cfg.setOffHeapMaxMemory(100 * 1024 * 1024);
         cfg.setQueryIndexEnabled(false);
-        cfg.setPortableEnabled(portableEnabled());
 
         return cfg;
     }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dff026be/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/GridCacheSwapScanQueryAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/GridCacheSwapScanQueryAbstractSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/GridCacheSwapScanQueryAbstractSelfTest.java
index df305c1..62f0237 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/GridCacheSwapScanQueryAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/GridCacheSwapScanQueryAbstractSelfTest.java
@@ -22,7 +22,6 @@ import org.apache.ignite.cache.query.*;
 import org.apache.ignite.configuration.*;
 import org.apache.ignite.lang.*;
 import org.apache.ignite.marshaller.optimized.*;
-import org.apache.ignite.portables.*;
 import org.apache.ignite.spi.discovery.tcp.*;
 import org.apache.ignite.spi.discovery.tcp.ipfinder.*;
 import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*;
@@ -69,14 +68,6 @@ public abstract class GridCacheSwapScanQueryAbstractSelfTest extends GridCommonA
         cfg.setCacheConfiguration(cacheConfiguration(ATOMIC_CACHE_NAME, ATOMIC),
             cacheConfiguration(TRANSACTIONAL_CACHE_NAME, TRANSACTIONAL));
 
-        if (portableEnabled()) {
-            PortableConfiguration pCfg = new PortableConfiguration();
-
-            pCfg.setClassNames(Arrays.asList(Key.class.getName(), Person.class.getName()));
-
-            cfg.setPortableConfiguration(pCfg);
-        }
-
         return cfg;
     }
 
@@ -102,18 +93,11 @@ public abstract class GridCacheSwapScanQueryAbstractSelfTest extends
GridCommonA
 
         ccfg.setAtomicWriteOrderMode(PRIMARY);
 
-        ccfg.setPortableEnabled(portableEnabled());
-
         ccfg.setWriteSynchronizationMode(FULL_SYNC);
 
         return ccfg;
     }
 
-    /**
-     * @return Portable enabled flag.
-     */
-    protected abstract boolean portableEnabled();
-
     /** {@inheritDoc} */
     @Override protected void beforeTestsStarted() throws Exception {
         startGrids(4);
@@ -192,36 +176,7 @@ public abstract class GridCacheSwapScanQueryAbstractSelfTest extends
GridCommonA
      */
     @SuppressWarnings({"unchecked", "IfMayBeConditional"})
     private void checkProjectionFilter(GridCache cache, int expCnt) throws Exception {
-        CacheProjection prj;
-
-        if (portableEnabled()) {
-            prj = cache.projection(new IgnitePredicate<CacheEntry<PortableObject, PortableObject>>()
{
-                @Override public boolean apply(CacheEntry<PortableObject, PortableObject>
e) {
-                    Key key = e.getKey().deserialize();
-                    Person val = e.peek().deserialize();
-
-                    assertNotNull(e.version());
-
-                    assertEquals(key.id, (Integer)val.salary);
-
-                    return key.id % 100 != 0;
-                }
-            });
-        }
-        else {
-            prj = cache.projection(new IgnitePredicate<CacheEntry<Key, Person>>()
{
-                @Override public boolean apply(CacheEntry<Key, Person> e) {
-                    Key key = e.getKey();
-                    Person val = e.peek();
-
-                    assertNotNull(e.version());
-
-                    assertEquals(key.id, (Integer)val.salary);
-
-                    return key.id % 100 != 0;
-                }
-            });
-        }
+        CacheProjection prj = createProjectionForFilter(cache);
 
         CacheQuery<Map.Entry<Key, Person>> qry = prj.queries().createScanQuery(
             new IgniteBiPredicate<Key, Person>() {
@@ -240,6 +195,25 @@ public abstract class GridCacheSwapScanQueryAbstractSelfTest extends
GridCommonA
 
     /**
      * @param cache Cache.
+     * @return Projection.
+     */
+    protected CacheProjection createProjectionForFilter(GridCache cache) {
+        return cache.projection(new IgnitePredicate<CacheEntry<Key, Person>>()
{
+            @Override public boolean apply(CacheEntry<Key, Person> e) {
+                Key key = e.getKey();
+                Person val = e.peek();
+
+                assertNotNull(e.version());
+
+                assertEquals(key.id, (Integer)val.salary);
+
+                return key.id % 100 != 0;
+            }
+        });
+    }
+
+    /**
+     * @param cache Cache.
      * @param expCnt Expected entries in query result.
      * @throws Exception If failed.
      */

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dff026be/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/GridCacheSwapScanQuerySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/GridCacheSwapScanQuerySelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/GridCacheSwapScanQuerySelfTest.java
index c15cd5b..61f921c 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/GridCacheSwapScanQuerySelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/GridCacheSwapScanQuerySelfTest.java
@@ -21,8 +21,4 @@ package org.apache.ignite.internal.processors.cache.query;
  *
  */
 public class GridCacheSwapScanQuerySelfTest extends GridCacheSwapScanQueryAbstractSelfTest
{
-    /** {@inheritDoc} */
-    @Override protected boolean portableEnabled() {
-        return false;
-    }
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dff026be/modules/core/src/test/java/org/apache/ignite/testframework/junits/IgniteMock.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testframework/junits/IgniteMock.java
b/modules/core/src/test/java/org/apache/ignite/testframework/junits/IgniteMock.java
index 4c28bc5..19ea250 100644
--- a/modules/core/src/test/java/org/apache/ignite/testframework/junits/IgniteMock.java
+++ b/modules/core/src/test/java/org/apache/ignite/testframework/junits/IgniteMock.java
@@ -168,11 +168,6 @@ public class IgniteMock implements Ignite {
     }
 
     /** {@inheritDoc} */
-    @Override public IgnitePortables portables() {
-        return null;
-    }
-
-    /** {@inheritDoc} */
     @Override public <K, V> GridCache<K, V> cache(@Nullable String name) {
         return null;
     }


Mime
View raw message