ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From se...@apache.org
Subject [2/3] incubator-ignite git commit: ignite-sql-tests - tests
Date Thu, 26 Feb 2015 00:10:03 GMT
ignite-sql-tests - tests


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

Branch: refs/heads/ignite-sql-tests
Commit: 17b75ae608bfba175321bb39901769c92b1b56ba
Parents: 29f294a
Author: S.Vladykin <svladykin@gridgain.com>
Authored: Thu Feb 26 02:48:13 2015 +0300
Committer: S.Vladykin <svladykin@gridgain.com>
Committed: Thu Feb 26 02:48:13 2015 +0300

----------------------------------------------------------------------
 ...dCacheAbstractReduceFieldsQuerySelfTest.java | 431 ------------------
 ...ridCacheReduceFieldsQueryAtomicSelfTest.java |  38 --
 ...GridCacheReduceFieldsQueryLocalSelfTest.java |  37 --
 ...cheReduceFieldsQueryPartitionedSelfTest.java |  60 ---
 ...acheReduceFieldsQueryReplicatedSelfTest.java |  37 --
 ...dCacheAbstractReduceFieldsQuerySelfTest.java | 434 +++++++++++++++++++
 ...ridCacheReduceFieldsQueryAtomicSelfTest.java |  38 ++
 ...GridCacheReduceFieldsQueryLocalSelfTest.java |  37 ++
 ...cheReduceFieldsQueryPartitionedSelfTest.java |  59 +++
 ...acheReduceFieldsQueryReplicatedSelfTest.java |  37 ++
 .../IgniteCacheQuerySelfTestSuite.java          |   2 +-
 11 files changed, 606 insertions(+), 604 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/17b75ae6/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/reducefields/GridCacheAbstractReduceFieldsQuerySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/reducefields/GridCacheAbstractReduceFieldsQuerySelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/reducefields/GridCacheAbstractReduceFieldsQuerySelfTest.java
deleted file mode 100644
index 63143f3..0000000
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/reducefields/GridCacheAbstractReduceFieldsQuerySelfTest.java
+++ /dev/null
@@ -1,431 +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.internal.processors.cache.query.reducefields;
-
-import org.apache.ignite.cache.*;
-import org.apache.ignite.cache.affinity.*;
-import org.apache.ignite.cache.query.annotations.*;
-import org.apache.ignite.configuration.*;
-import org.apache.ignite.internal.*;
-import org.apache.ignite.internal.processors.cache.*;
-import org.apache.ignite.internal.processors.cache.query.*;
-import org.apache.ignite.internal.util.typedef.*;
-import org.apache.ignite.lang.*;
-import org.apache.ignite.marshaller.optimized.*;
-import org.apache.ignite.spi.discovery.*;
-import org.apache.ignite.spi.discovery.tcp.*;
-import org.apache.ignite.spi.discovery.tcp.ipfinder.*;
-import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*;
-import org.apache.ignite.testframework.junits.common.*;
-import org.jetbrains.annotations.*;
-
-import java.io.*;
-import java.util.*;
-
-import static org.apache.ignite.cache.CacheAtomicityMode.*;
-import static org.apache.ignite.cache.CacheDistributionMode.*;
-import static org.apache.ignite.cache.CacheMode.*;
-import static org.apache.ignite.cache.CachePreloadMode.*;
-import static org.apache.ignite.cache.CacheWriteSynchronizationMode.*;
-
-/**
- * Tests for reduce fields queries.
- */
-public abstract class GridCacheAbstractReduceFieldsQuerySelfTest extends GridCommonAbstractTest {
-    /** IP finder. */
-    private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true);
-
-    /** Flag indicating if starting node should have cache. */
-    protected boolean hasCache;
-
-    /** {@inheritDoc} */
-    @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
-        IgniteConfiguration cfg = super.getConfiguration(gridName);
-
-        if (hasCache)
-            cfg.setCacheConfiguration(cache(null));
-        else
-            cfg.setCacheConfiguration();
-
-        cfg.setDiscoverySpi(discovery());
-        cfg.setMarshaller(new OptimizedMarshaller(false));
-
-        return cfg;
-    }
-
-    /**
-     * @return Distribution.
-     */
-    protected CacheDistributionMode distributionMode() {
-        return NEAR_PARTITIONED;
-    }
-
-    /**
-     * @param name Cache name.
-     * @return Cache.
-     */
-    private CacheConfiguration cache(@Nullable String name) {
-        CacheConfiguration cache = defaultCacheConfiguration();
-
-        cache.setName(name);
-        cache.setCacheMode(cacheMode());
-        cache.setAtomicityMode(atomicityMode());
-        cache.setDistributionMode(distributionMode());
-        cache.setWriteSynchronizationMode(FULL_SYNC);
-        cache.setPreloadMode(SYNC);
-        cache.setQueryIndexEnabled(true);
-        cache.setIndexedTypes();
-
-        if (cacheMode() == PARTITIONED)
-            cache.setBackups(1);
-
-        return cache;
-    }
-
-    /**
-     * @return Discovery SPI.
-     */
-    private static DiscoverySpi discovery() {
-        TcpDiscoverySpi spi = new TcpDiscoverySpi();
-
-        spi.setIpFinder(IP_FINDER);
-
-        return spi;
-    }
-
-    /** {@inheritDoc} */
-    @Override protected void beforeTestsStarted() throws Exception {
-        hasCache = true;
-
-        startGridsMultiThreaded(gridCount());
-
-        hasCache = false;
-
-        startGrid(gridCount());
-
-        GridCache<String, Organization> orgCache = ((IgniteKernal)grid(0)).cache(null);
-
-        assert orgCache != null;
-
-        assert orgCache.putx("o1", new Organization(1, "A"));
-        assert orgCache.putx("o2", new Organization(2, "B"));
-
-        GridCache<CacheAffinityKey<String>, Person> personCache = ((IgniteKernal)grid(0)).cache(null);
-
-        assert personCache != null;
-
-        assert personCache.putx(new CacheAffinityKey<>("p1", "o1"), new Person("John White", 25, 1));
-        assert personCache.putx(new CacheAffinityKey<>("p2", "o1"), new Person("Joe Black", 35, 1));
-        assert personCache.putx(new CacheAffinityKey<>("p3", "o2"), new Person("Mike Green", 40, 2));
-    }
-
-    /** {@inheritDoc} */
-    @Override protected void afterTestsStopped() throws Exception {
-        stopAllGrids();
-    }
-
-    /**
-     * @return cache mode.
-     */
-    protected abstract CacheMode cacheMode();
-
-    /**
-     * @return Number of grids to start.
-     */
-    protected abstract int gridCount();
-
-    /**
-     * @return Cache atomicity mode.
-     */
-    protected CacheAtomicityMode atomicityMode() {
-        return TRANSACTIONAL;
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testNoDataInCache() throws Exception {
-        CacheQuery<List<?>> qry = ((IgniteKernal)grid(0))
-            .cache(null).queries().createSqlFieldsQuery("select age from Person where orgId = 999");
-
-        Collection<IgniteBiTuple<Integer, Integer>> res = qry.execute(new AverageRemoteReducer()).get();
-
-        assertEquals("Result", 0, F.reduce(res, new AverageLocalReducer()).intValue());
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testAverageQuery() throws Exception {
-        CacheQuery<List<?>> qry = ((IgniteKernal)grid(0)).cache(null).queries().createSqlFieldsQuery("select age from Person");
-
-        Collection<IgniteBiTuple<Integer, Integer>> res = qry.execute(new AverageRemoteReducer()).get();
-
-        assertEquals("Average", 33, F.reduce(res, new AverageLocalReducer()).intValue());
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testAverageQueryWithArguments() throws Exception {
-        CacheQuery<List<?>> qry = ((IgniteKernal)grid(0)).cache(null).queries().createSqlFieldsQuery(
-            "select age from Person where orgId = ?");
-
-        Collection<IgniteBiTuple<Integer, Integer>> res = qry.execute(new AverageRemoteReducer(), 1).get();
-
-        assertEquals("Average", 30, F.reduce(res, new AverageLocalReducer()).intValue());
-    }
-
-//    /**
-//     * @throws Exception If failed.
-//     */
-//    public void testFilters() throws Exception {
-//        GridCacheReduceFieldsQuery<Object, Object, GridBiTuple<Integer, Integer>, Integer> qry = ((IgniteKernal)grid(0)).cache(null)
-//            .queries().createReduceFieldsQuery("select age from Person");
-//
-//        qry = qry.remoteKeyFilter(
-//            new GridPredicate<Object>() {
-//                @Override public boolean apply(Object e) {
-//                    return !"p2".equals(((CacheAffinityKey)e).key());
-//                }
-//            }
-//        ).remoteValueFilter(
-//            new P1<Object>() {
-//                @Override public boolean apply(Object e) {
-//                    return !"Mike Green".equals(((Person)e).name);
-//                }
-//            }
-//        );
-//
-//        qry = qry.remoteReducer(new AverageRemoteReducer()).localReducer(new AverageLocalReducer());
-//
-//        Integer avg = qry.reduce().get();
-//
-//        assertNotNull("Average", avg);
-//        assertEquals("Average", 25, avg.intValue());
-//    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testOnProjection() throws Exception {
-        P2<CacheAffinityKey<String>, Person> p = new P2<CacheAffinityKey<String>, Person>() {
-            @Override public boolean apply(CacheAffinityKey<String> key, Person val) {
-                return val.orgId == 1;
-            }
-        };
-
-        CacheProjection<CacheAffinityKey<String>, Person> cachePrj =
-            ((IgniteKernal)grid(0)).<CacheAffinityKey<String>, Person>cache(null).projection(p);
-
-        CacheQuery<List<?>> qry = cachePrj.queries().createSqlFieldsQuery("select age from Person");
-
-        Collection<IgniteBiTuple<Integer, Integer>> res = qry.execute(new AverageRemoteReducer()).get();
-
-        assertEquals("Average", 30, F.reduce(res, new AverageLocalReducer()).intValue());
-    }
-
-//    /**
-//     * @throws Exception If failed.
-//     */
-//    public void testOnProjectionWithFilter() throws Exception {
-//        P2<CacheAffinityKey<String>, Person> p = new P2<CacheAffinityKey<String>, Person>() {
-//            @Override public boolean apply(CacheAffinityKey<String> key, Person val) {
-//                return val.orgId == 1;
-//            }
-//        };
-//
-//        CacheProjection<CacheAffinityKey<String>, Person> cachePrj =
-//            grid(0).<CacheAffinityKey<String>, Person>cache(null).projection(p);
-//
-//        GridCacheReduceFieldsQuery<CacheAffinityKey<String>, Person, GridBiTuple<Integer, Integer>, Integer> qry =
-//            cachePrj.queries().createReduceFieldsQuery("select age from Person");
-//
-//        qry = qry.remoteValueFilter(
-//            new P1<Person>() {
-//                @Override public boolean apply(Person e) {
-//                    return !"Joe Black".equals(e.name);
-//                }
-//            });
-//
-//        qry = qry.remoteReducer(new AverageRemoteReducer()).localReducer(new AverageLocalReducer());
-//
-//        Integer avg = qry.reduce().get();
-//
-//        assertNotNull("Average", avg);
-//        assertEquals("Average", 25, avg.intValue());
-//    }
-
-    /**
-     * @return true if cache mode is replicated, false otherwise.
-     */
-    private boolean isReplicatedMode() {
-        return cacheMode() == REPLICATED;
-    }
-
-    /**
-     * Person.
-     */
-    @SuppressWarnings("UnusedDeclaration")
-    private static class Person implements Serializable {
-        /** Name. */
-        @QuerySqlField(index = false)
-        private final String name;
-
-        /** Age. */
-        @QuerySqlField(index = true)
-        private final int age;
-
-        /** Organization ID. */
-        @QuerySqlField(index = true)
-        private final int orgId;
-
-        /**
-         * @param name Name.
-         * @param age Age.
-         * @param orgId Organization ID.
-         */
-        private Person(String name, int age, int orgId) {
-            assert !F.isEmpty(name);
-            assert age > 0;
-            assert orgId > 0;
-
-            this.name = name;
-            this.age = age;
-            this.orgId = orgId;
-        }
-
-        /** {@inheritDoc} */
-        @Override public boolean equals(Object o) {
-            if (this == o)
-                return true;
-
-            if (o == null || getClass() != o.getClass())
-                return false;
-
-            Person person = (Person)o;
-
-            return age == person.age && orgId == person.orgId && name.equals(person.name);
-
-        }
-
-        /** {@inheritDoc} */
-        @Override public int hashCode() {
-            int res = name.hashCode();
-
-            res = 31 * res + age;
-            res = 31 * res + orgId;
-
-            return res;
-        }
-    }
-
-    /**
-     * Organization.
-     */
-    @SuppressWarnings("UnusedDeclaration")
-    private static class Organization implements Serializable {
-        /** ID. */
-        @QuerySqlField
-        private final int id;
-
-        /** Name. */
-        @QuerySqlField(index = false)
-        private final String name;
-
-        /**
-         * @param id ID.
-         * @param name Name.
-         */
-        private Organization(int id, String name) {
-            assert id > 0;
-            assert !F.isEmpty(name);
-
-            this.id = id;
-            this.name = name;
-        }
-
-        /** {@inheritDoc} */
-        @Override public boolean equals(Object o) {
-            if (this == o)
-                return true;
-
-            if (o == null || getClass() != o.getClass())
-                return false;
-
-            Organization that = (Organization)o;
-
-            return id == that.id && name.equals(that.name);
-
-        }
-
-        /** {@inheritDoc} */
-        @Override public int hashCode() {
-            int res = id;
-
-            res = 31 * res + name.hashCode();
-
-            return res;
-        }
-    }
-
-    /**
-     * Average remote reducer factory.
-     */
-    protected static class AverageRemoteReducer implements IgniteReducer<List<?>, IgniteBiTuple<Integer, Integer>> {
-        /** */
-        private int sum;
-
-        /** */
-        private int cnt;
-
-        @Override public boolean collect(List<?> e) {
-            sum += (Integer)e.get(0);
-
-            cnt++;
-
-            return true;
-        }
-
-        @Override public IgniteBiTuple<Integer, Integer> reduce() {
-            return F.t(sum, cnt);
-        }
-    }
-
-    /**
-     * Average local reducer factory.
-     */
-    protected static class AverageLocalReducer implements IgniteReducer<IgniteBiTuple<Integer, Integer>, Integer> {
-        /** */
-        private int sum;
-
-        /** */
-        private int cnt;
-
-        @Override public boolean collect(IgniteBiTuple<Integer, Integer> t) {
-            sum += t.get1();
-            cnt += t.get2();
-
-            return true;
-        }
-
-        @Override public Integer reduce() {
-            return cnt == 0 ? 0 : sum / cnt;
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/17b75ae6/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/reducefields/GridCacheReduceFieldsQueryAtomicSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/reducefields/GridCacheReduceFieldsQueryAtomicSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/reducefields/GridCacheReduceFieldsQueryAtomicSelfTest.java
deleted file mode 100644
index 3100f2c..0000000
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/reducefields/GridCacheReduceFieldsQueryAtomicSelfTest.java
+++ /dev/null
@@ -1,38 +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.internal.processors.cache.query.reducefields;
-
-import org.apache.ignite.cache.*;
-
-import static org.apache.ignite.cache.CacheAtomicityMode.*;
-import static org.apache.ignite.cache.CacheDistributionMode.*;
-
-/**
- * Reduce fields queries tests for partitioned cache.
- */
-public class GridCacheReduceFieldsQueryAtomicSelfTest extends GridCacheReduceFieldsQueryPartitionedSelfTest {
-    /** {@inheritDoc} */
-    @Override protected CacheAtomicityMode atomicityMode() {
-        return ATOMIC;
-    }
-
-    /** {@inheritDoc} */
-    @Override protected CacheDistributionMode distributionMode() {
-        return PARTITIONED_ONLY;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/17b75ae6/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/reducefields/GridCacheReduceFieldsQueryLocalSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/reducefields/GridCacheReduceFieldsQueryLocalSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/reducefields/GridCacheReduceFieldsQueryLocalSelfTest.java
deleted file mode 100644
index 24760be..0000000
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/reducefields/GridCacheReduceFieldsQueryLocalSelfTest.java
+++ /dev/null
@@ -1,37 +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.internal.processors.cache.query.reducefields;
-
-import org.apache.ignite.cache.*;
-
-import static org.apache.ignite.cache.CacheMode.*;
-
-/**
- * Reduce fields queries tests for local cache.
- */
-public class GridCacheReduceFieldsQueryLocalSelfTest extends GridCacheAbstractReduceFieldsQuerySelfTest {
-    /** {@inheritDoc} */
-    @Override protected CacheMode cacheMode() {
-        return LOCAL;
-    }
-
-    /** {@inheritDoc} */
-    @Override protected int gridCount() {
-        return 1;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/17b75ae6/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/reducefields/GridCacheReduceFieldsQueryPartitionedSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/reducefields/GridCacheReduceFieldsQueryPartitionedSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/reducefields/GridCacheReduceFieldsQueryPartitionedSelfTest.java
deleted file mode 100644
index c191be7..0000000
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/reducefields/GridCacheReduceFieldsQueryPartitionedSelfTest.java
+++ /dev/null
@@ -1,60 +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.internal.processors.cache.query.reducefields;
-
-import org.apache.ignite.cache.*;
-import org.apache.ignite.internal.processors.cache.query.*;
-import org.apache.ignite.internal.processors.cache.query.*;
-import org.apache.ignite.internal.*;
-import org.apache.ignite.lang.*;
-
-import java.util.*;
-
-import static org.apache.ignite.cache.CacheMode.*;
-
-/**
- * Reduce fields queries tests for partitioned cache.
- */
-public class GridCacheReduceFieldsQueryPartitionedSelfTest extends GridCacheAbstractReduceFieldsQuerySelfTest {
-    /** {@inheritDoc} */
-    @Override protected CacheMode cacheMode() {
-        return PARTITIONED;
-    }
-
-    /** {@inheritDoc} */
-    @Override protected int gridCount() {
-        return 3;
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testIncludeBackups() throws Exception {
-        CacheQuery<List<?>> qry = ((IgniteKernal)grid(0)).cache(null).queries().createSqlFieldsQuery("select age from Person");
-
-        qry.includeBackups(true);
-
-        int sum = 0;
-
-        for (IgniteBiTuple<Integer, Integer> tuple : qry.execute(new AverageRemoteReducer()).get())
-            sum += tuple.get1();
-
-        // One backup, so sum is two times greater
-        assertEquals("Sum", 200, sum);
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/17b75ae6/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/reducefields/GridCacheReduceFieldsQueryReplicatedSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/reducefields/GridCacheReduceFieldsQueryReplicatedSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/reducefields/GridCacheReduceFieldsQueryReplicatedSelfTest.java
deleted file mode 100644
index 64a9bef..0000000
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/reducefields/GridCacheReduceFieldsQueryReplicatedSelfTest.java
+++ /dev/null
@@ -1,37 +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.internal.processors.cache.query.reducefields;
-
-import org.apache.ignite.cache.*;
-
-import static org.apache.ignite.cache.CacheMode.*;
-
-/**
- * Reduce fields queries tests for replicated cache.
- */
-public class GridCacheReduceFieldsQueryReplicatedSelfTest extends GridCacheAbstractReduceFieldsQuerySelfTest {
-    /** {@inheritDoc} */
-    @Override protected CacheMode cacheMode() {
-        return REPLICATED;
-    }
-
-    /** {@inheritDoc} */
-    @Override protected int gridCount() {
-        return 3;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/17b75ae6/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/reducefields/GridCacheAbstractReduceFieldsQuerySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/reducefields/GridCacheAbstractReduceFieldsQuerySelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/reducefields/GridCacheAbstractReduceFieldsQuerySelfTest.java
new file mode 100644
index 0000000..6afdb34
--- /dev/null
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/reducefields/GridCacheAbstractReduceFieldsQuerySelfTest.java
@@ -0,0 +1,434 @@
+/*
+ * 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.internal.processors.cache.reducefields;
+
+import org.apache.ignite.cache.*;
+import org.apache.ignite.cache.affinity.*;
+import org.apache.ignite.cache.query.annotations.*;
+import org.apache.ignite.configuration.*;
+import org.apache.ignite.internal.*;
+import org.apache.ignite.internal.processors.cache.*;
+import org.apache.ignite.internal.processors.cache.query.*;
+import org.apache.ignite.internal.util.typedef.*;
+import org.apache.ignite.lang.*;
+import org.apache.ignite.marshaller.optimized.*;
+import org.apache.ignite.spi.discovery.*;
+import org.apache.ignite.spi.discovery.tcp.*;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.*;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*;
+import org.apache.ignite.testframework.junits.common.*;
+import org.jetbrains.annotations.*;
+
+import java.io.*;
+import java.util.*;
+
+import static org.apache.ignite.cache.CacheAtomicityMode.*;
+import static org.apache.ignite.cache.CacheDistributionMode.*;
+import static org.apache.ignite.cache.CacheMode.*;
+import static org.apache.ignite.cache.CachePreloadMode.*;
+import static org.apache.ignite.cache.CacheWriteSynchronizationMode.*;
+
+/**
+ * Tests for reduce fields queries.
+ */
+public abstract class GridCacheAbstractReduceFieldsQuerySelfTest extends GridCommonAbstractTest {
+    /** IP finder. */
+    private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true);
+
+    /** Flag indicating if starting node should have cache. */
+    protected boolean hasCache;
+
+    /** {@inheritDoc} */
+    @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
+        IgniteConfiguration cfg = super.getConfiguration(gridName);
+
+        if (hasCache)
+            cfg.setCacheConfiguration(cache(null));
+        else
+            cfg.setCacheConfiguration();
+
+        cfg.setDiscoverySpi(discovery());
+        cfg.setMarshaller(new OptimizedMarshaller(false));
+
+        return cfg;
+    }
+
+    /**
+     * @return Distribution.
+     */
+    protected CacheDistributionMode distributionMode() {
+        return NEAR_PARTITIONED;
+    }
+
+    /**
+     * @param name Cache name.
+     * @return Cache.
+     */
+    private CacheConfiguration cache(@Nullable String name) {
+        CacheConfiguration<?,?> cache = defaultCacheConfiguration();
+
+        cache.setName(name);
+        cache.setCacheMode(cacheMode());
+        cache.setAtomicityMode(atomicityMode());
+        cache.setDistributionMode(distributionMode());
+        cache.setWriteSynchronizationMode(FULL_SYNC);
+        cache.setPreloadMode(SYNC);
+        cache.setQueryIndexEnabled(true);
+        cache.setIndexedTypes(
+            String.class, Organization.class,
+            CacheAffinityKey.class, Person.class
+        );
+
+        if (cacheMode() == PARTITIONED)
+            cache.setBackups(1);
+
+        return cache;
+    }
+
+    /**
+     * @return Discovery SPI.
+     */
+    private static DiscoverySpi discovery() {
+        TcpDiscoverySpi spi = new TcpDiscoverySpi();
+
+        spi.setIpFinder(IP_FINDER);
+
+        return spi;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void beforeTestsStarted() throws Exception {
+        hasCache = true;
+
+        startGridsMultiThreaded(gridCount());
+
+        hasCache = false;
+
+        startGrid(gridCount());
+
+        GridCache<String, Organization> orgCache = ((IgniteKernal)grid(0)).cache(null);
+
+        assert orgCache != null;
+
+        assert orgCache.putx("o1", new Organization(1, "A"));
+        assert orgCache.putx("o2", new Organization(2, "B"));
+
+        GridCache<CacheAffinityKey<String>, Person> personCache = ((IgniteKernal)grid(0)).cache(null);
+
+        assert personCache != null;
+
+        assert personCache.putx(new CacheAffinityKey<>("p1", "o1"), new Person("John White", 25, 1));
+        assert personCache.putx(new CacheAffinityKey<>("p2", "o1"), new Person("Joe Black", 35, 1));
+        assert personCache.putx(new CacheAffinityKey<>("p3", "o2"), new Person("Mike Green", 40, 2));
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void afterTestsStopped() throws Exception {
+        stopAllGrids();
+    }
+
+    /**
+     * @return cache mode.
+     */
+    protected abstract CacheMode cacheMode();
+
+    /**
+     * @return Number of grids to start.
+     */
+    protected abstract int gridCount();
+
+    /**
+     * @return Cache atomicity mode.
+     */
+    protected CacheAtomicityMode atomicityMode() {
+        return TRANSACTIONAL;
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testNoDataInCache() throws Exception {
+        CacheQuery<List<?>> qry = ((IgniteKernal)grid(0))
+            .cache(null).queries().createSqlFieldsQuery("select age from Person where orgId = 999");
+
+        Collection<IgniteBiTuple<Integer, Integer>> res = qry.execute(new AverageRemoteReducer()).get();
+
+        assertEquals("Result", 0, F.reduce(res, new AverageLocalReducer()).intValue());
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testAverageQuery() throws Exception {
+        CacheQuery<List<?>> qry = ((IgniteKernal)grid(0)).cache(null).queries().createSqlFieldsQuery("select age from Person");
+
+        Collection<IgniteBiTuple<Integer, Integer>> res = qry.execute(new AverageRemoteReducer()).get();
+
+        assertEquals("Average", 33, F.reduce(res, new AverageLocalReducer()).intValue());
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testAverageQueryWithArguments() throws Exception {
+        CacheQuery<List<?>> qry = ((IgniteKernal)grid(0)).cache(null).queries().createSqlFieldsQuery(
+            "select age from Person where orgId = ?");
+
+        Collection<IgniteBiTuple<Integer, Integer>> res = qry.execute(new AverageRemoteReducer(), 1).get();
+
+        assertEquals("Average", 30, F.reduce(res, new AverageLocalReducer()).intValue());
+    }
+
+//    /**
+//     * @throws Exception If failed.
+//     */
+//    public void testFilters() throws Exception {
+//        GridCacheReduceFieldsQuery<Object, Object, GridBiTuple<Integer, Integer>, Integer> qry = ((IgniteKernal)grid(0)).cache(null)
+//            .queries().createReduceFieldsQuery("select age from Person");
+//
+//        qry = qry.remoteKeyFilter(
+//            new GridPredicate<Object>() {
+//                @Override public boolean apply(Object e) {
+//                    return !"p2".equals(((CacheAffinityKey)e).key());
+//                }
+//            }
+//        ).remoteValueFilter(
+//            new P1<Object>() {
+//                @Override public boolean apply(Object e) {
+//                    return !"Mike Green".equals(((Person)e).name);
+//                }
+//            }
+//        );
+//
+//        qry = qry.remoteReducer(new AverageRemoteReducer()).localReducer(new AverageLocalReducer());
+//
+//        Integer avg = qry.reduce().get();
+//
+//        assertNotNull("Average", avg);
+//        assertEquals("Average", 25, avg.intValue());
+//    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testOnProjection() throws Exception {
+        P2<CacheAffinityKey<String>, Person> p = new P2<CacheAffinityKey<String>, Person>() {
+            @Override public boolean apply(CacheAffinityKey<String> key, Person val) {
+                return val.orgId == 1;
+            }
+        };
+
+        CacheProjection<CacheAffinityKey<String>, Person> cachePrj =
+            ((IgniteKernal)grid(0)).<CacheAffinityKey<String>, Person>cache(null).projection(p);
+
+        CacheQuery<List<?>> qry = cachePrj.queries().createSqlFieldsQuery("select age from Person");
+
+        Collection<IgniteBiTuple<Integer, Integer>> res = qry.execute(new AverageRemoteReducer()).get();
+
+        assertEquals("Average", 30, F.reduce(res, new AverageLocalReducer()).intValue());
+    }
+
+//    /**
+//     * @throws Exception If failed.
+//     */
+//    public void testOnProjectionWithFilter() throws Exception {
+//        P2<CacheAffinityKey<String>, Person> p = new P2<CacheAffinityKey<String>, Person>() {
+//            @Override public boolean apply(CacheAffinityKey<String> key, Person val) {
+//                return val.orgId == 1;
+//            }
+//        };
+//
+//        CacheProjection<CacheAffinityKey<String>, Person> cachePrj =
+//            grid(0).<CacheAffinityKey<String>, Person>cache(null).projection(p);
+//
+//        GridCacheReduceFieldsQuery<CacheAffinityKey<String>, Person, GridBiTuple<Integer, Integer>, Integer> qry =
+//            cachePrj.queries().createReduceFieldsQuery("select age from Person");
+//
+//        qry = qry.remoteValueFilter(
+//            new P1<Person>() {
+//                @Override public boolean apply(Person e) {
+//                    return !"Joe Black".equals(e.name);
+//                }
+//            });
+//
+//        qry = qry.remoteReducer(new AverageRemoteReducer()).localReducer(new AverageLocalReducer());
+//
+//        Integer avg = qry.reduce().get();
+//
+//        assertNotNull("Average", avg);
+//        assertEquals("Average", 25, avg.intValue());
+//    }
+
+    /**
+     * @return true if cache mode is replicated, false otherwise.
+     */
+    private boolean isReplicatedMode() {
+        return cacheMode() == REPLICATED;
+    }
+
+    /**
+     * Person.
+     */
+    @SuppressWarnings("UnusedDeclaration")
+    private static class Person implements Serializable {
+        /** Name. */
+        @QuerySqlField(index = false)
+        private final String name;
+
+        /** Age. */
+        @QuerySqlField(index = true)
+        private final int age;
+
+        /** Organization ID. */
+        @QuerySqlField(index = true)
+        private final int orgId;
+
+        /**
+         * @param name Name.
+         * @param age Age.
+         * @param orgId Organization ID.
+         */
+        private Person(String name, int age, int orgId) {
+            assert !F.isEmpty(name);
+            assert age > 0;
+            assert orgId > 0;
+
+            this.name = name;
+            this.age = age;
+            this.orgId = orgId;
+        }
+
+        /** {@inheritDoc} */
+        @Override public boolean equals(Object o) {
+            if (this == o)
+                return true;
+
+            if (o == null || getClass() != o.getClass())
+                return false;
+
+            Person person = (Person)o;
+
+            return age == person.age && orgId == person.orgId && name.equals(person.name);
+
+        }
+
+        /** {@inheritDoc} */
+        @Override public int hashCode() {
+            int res = name.hashCode();
+
+            res = 31 * res + age;
+            res = 31 * res + orgId;
+
+            return res;
+        }
+    }
+
+    /**
+     * Organization.
+     */
+    @SuppressWarnings("UnusedDeclaration")
+    private static class Organization implements Serializable {
+        /** ID. */
+        @QuerySqlField
+        private final int id;
+
+        /** Name. */
+        @QuerySqlField(index = false)
+        private final String name;
+
+        /**
+         * @param id ID.
+         * @param name Name.
+         */
+        private Organization(int id, String name) {
+            assert id > 0;
+            assert !F.isEmpty(name);
+
+            this.id = id;
+            this.name = name;
+        }
+
+        /** {@inheritDoc} */
+        @Override public boolean equals(Object o) {
+            if (this == o)
+                return true;
+
+            if (o == null || getClass() != o.getClass())
+                return false;
+
+            Organization that = (Organization)o;
+
+            return id == that.id && name.equals(that.name);
+
+        }
+
+        /** {@inheritDoc} */
+        @Override public int hashCode() {
+            int res = id;
+
+            res = 31 * res + name.hashCode();
+
+            return res;
+        }
+    }
+
+    /**
+     * Average remote reducer factory.
+     */
+    protected static class AverageRemoteReducer implements IgniteReducer<List<?>, IgniteBiTuple<Integer, Integer>> {
+        /** */
+        private int sum;
+
+        /** */
+        private int cnt;
+
+        @Override public boolean collect(List<?> e) {
+            sum += (Integer)e.get(0);
+
+            cnt++;
+
+            return true;
+        }
+
+        @Override public IgniteBiTuple<Integer, Integer> reduce() {
+            return F.t(sum, cnt);
+        }
+    }
+
+    /**
+     * Average local reducer factory.
+     */
+    protected static class AverageLocalReducer implements IgniteReducer<IgniteBiTuple<Integer, Integer>, Integer> {
+        /** */
+        private int sum;
+
+        /** */
+        private int cnt;
+
+        @Override public boolean collect(IgniteBiTuple<Integer, Integer> t) {
+            sum += t.get1();
+            cnt += t.get2();
+
+            return true;
+        }
+
+        @Override public Integer reduce() {
+            return cnt == 0 ? 0 : sum / cnt;
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/17b75ae6/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/reducefields/GridCacheReduceFieldsQueryAtomicSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/reducefields/GridCacheReduceFieldsQueryAtomicSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/reducefields/GridCacheReduceFieldsQueryAtomicSelfTest.java
new file mode 100644
index 0000000..fd93a3e
--- /dev/null
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/reducefields/GridCacheReduceFieldsQueryAtomicSelfTest.java
@@ -0,0 +1,38 @@
+/*
+ * 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.internal.processors.cache.reducefields;
+
+import org.apache.ignite.cache.*;
+
+import static org.apache.ignite.cache.CacheAtomicityMode.*;
+import static org.apache.ignite.cache.CacheDistributionMode.*;
+
+/**
+ * Reduce fields queries tests for partitioned cache.
+ */
+public class GridCacheReduceFieldsQueryAtomicSelfTest extends GridCacheReduceFieldsQueryPartitionedSelfTest {
+    /** {@inheritDoc} */
+    @Override protected CacheAtomicityMode atomicityMode() {
+        return ATOMIC;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected CacheDistributionMode distributionMode() {
+        return PARTITIONED_ONLY;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/17b75ae6/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/reducefields/GridCacheReduceFieldsQueryLocalSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/reducefields/GridCacheReduceFieldsQueryLocalSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/reducefields/GridCacheReduceFieldsQueryLocalSelfTest.java
new file mode 100644
index 0000000..9253821
--- /dev/null
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/reducefields/GridCacheReduceFieldsQueryLocalSelfTest.java
@@ -0,0 +1,37 @@
+/*
+ * 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.internal.processors.cache.reducefields;
+
+import org.apache.ignite.cache.*;
+
+import static org.apache.ignite.cache.CacheMode.*;
+
+/**
+ * Reduce fields queries tests for local cache.
+ */
+public class GridCacheReduceFieldsQueryLocalSelfTest extends GridCacheAbstractReduceFieldsQuerySelfTest {
+    /** {@inheritDoc} */
+    @Override protected CacheMode cacheMode() {
+        return LOCAL;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected int gridCount() {
+        return 1;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/17b75ae6/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/reducefields/GridCacheReduceFieldsQueryPartitionedSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/reducefields/GridCacheReduceFieldsQueryPartitionedSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/reducefields/GridCacheReduceFieldsQueryPartitionedSelfTest.java
new file mode 100644
index 0000000..3837537
--- /dev/null
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/reducefields/GridCacheReduceFieldsQueryPartitionedSelfTest.java
@@ -0,0 +1,59 @@
+/*
+ * 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.internal.processors.cache.reducefields;
+
+import org.apache.ignite.cache.*;
+import org.apache.ignite.internal.processors.cache.query.*;
+import org.apache.ignite.internal.*;
+import org.apache.ignite.lang.*;
+
+import java.util.*;
+
+import static org.apache.ignite.cache.CacheMode.*;
+
+/**
+ * Reduce fields queries tests for partitioned cache.
+ */
+public class GridCacheReduceFieldsQueryPartitionedSelfTest extends GridCacheAbstractReduceFieldsQuerySelfTest {
+    /** {@inheritDoc} */
+    @Override protected CacheMode cacheMode() {
+        return PARTITIONED;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected int gridCount() {
+        return 3;
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testIncludeBackups() throws Exception {
+        CacheQuery<List<?>> qry = ((IgniteKernal)grid(0)).cache(null).queries().createSqlFieldsQuery("select age from Person");
+
+        qry.includeBackups(true);
+
+        int sum = 0;
+
+        for (IgniteBiTuple<Integer, Integer> tuple : qry.execute(new AverageRemoteReducer()).get())
+            sum += tuple.get1();
+
+        // One backup, so sum is two times greater
+        assertEquals("Sum", 200, sum);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/17b75ae6/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/reducefields/GridCacheReduceFieldsQueryReplicatedSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/reducefields/GridCacheReduceFieldsQueryReplicatedSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/reducefields/GridCacheReduceFieldsQueryReplicatedSelfTest.java
new file mode 100644
index 0000000..5abe859
--- /dev/null
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/reducefields/GridCacheReduceFieldsQueryReplicatedSelfTest.java
@@ -0,0 +1,37 @@
+/*
+ * 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.internal.processors.cache.reducefields;
+
+import org.apache.ignite.cache.*;
+
+import static org.apache.ignite.cache.CacheMode.*;
+
+/**
+ * Reduce fields queries tests for replicated cache.
+ */
+public class GridCacheReduceFieldsQueryReplicatedSelfTest extends GridCacheAbstractReduceFieldsQuerySelfTest {
+    /** {@inheritDoc} */
+    @Override protected CacheMode cacheMode() {
+        return REPLICATED;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected int gridCount() {
+        return 3;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/17b75ae6/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite.java b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite.java
index 8edce6c..dcf4914 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite.java
@@ -24,7 +24,7 @@ import org.apache.ignite.internal.processors.cache.distributed.replicated.*;
 import org.apache.ignite.internal.processors.cache.local.*;
 import org.apache.ignite.internal.processors.cache.query.*;
 import org.apache.ignite.internal.processors.cache.query.continuous.*;
-import org.apache.ignite.internal.processors.cache.query.reducefields.*;
+import org.apache.ignite.internal.processors.cache.reducefields.*;
 import org.apache.ignite.internal.processors.query.h2.sql.*;
 import org.apache.ignite.spi.communication.tcp.*;
 


Mime
View raw message