ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [22/65] [abbrv] incubator-ignite git commit: # ignite-63
Date Thu, 22 Jan 2015 21:27:09 GMT
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cfcf46df/modules/core/src/test/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsModesSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsModesSelfTest.java b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsModesSelfTest.java
deleted file mode 100644
index b589d2a..0000000
--- a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsModesSelfTest.java
+++ /dev/null
@@ -1,604 +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.gridgain.grid.kernal.processors.ggfs;
-
-import org.apache.ignite.*;
-import org.apache.ignite.cache.*;
-import org.apache.ignite.configuration.*;
-import org.apache.ignite.fs.*;
-import org.apache.ignite.internal.*;
-import org.apache.ignite.lang.*;
-import org.apache.ignite.spi.discovery.tcp.*;
-import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*;
-import org.apache.ignite.internal.util.typedef.*;
-import org.apache.ignite.internal.util.typedef.internal.*;
-
-import java.util.*;
-
-import static org.apache.ignite.fs.IgniteFsMode.*;
-import static org.apache.ignite.cache.GridCacheAtomicityMode.*;
-import static org.apache.ignite.cache.GridCacheMode.*;
-
-/**
- * GGFS modes self test.
- */
-public class GridGgfsModesSelfTest extends GridGgfsCommonAbstractTest {
-    /** Grid instance hosting primary GGFS. */
-    private GridEx grid;
-
-    /** Primary GGFS. */
-    private GridGgfsImpl ggfs;
-
-    /** Secondary GGFS. */
-    private GridGgfsImpl ggfsSecondary;
-
-    /** Default GGFS mode. */
-    private IgniteFsMode mode;
-
-    /** Modes map. */
-    private Map<String, IgniteFsMode> pathModes;
-
-    /** Whether to set "null" mode. */
-    private boolean setNullMode;
-
-    /** Whether to set secondary file system URI. */
-    private boolean setSecondaryFs;
-
-    /** {@inheritDoc} */
-    @Override protected void beforeTest() throws Exception {
-        mode = null;
-        pathModes = null;
-
-        setNullMode = false;
-        setSecondaryFs = false;
-    }
-
-    /** {@inheritDoc} */
-    @Override protected void afterTest() throws Exception {
-        G.stopAll(true);
-    }
-
-    /**
-     * Perform initial startup.
-     *
-     * @throws Exception If failed.
-     */
-    @SuppressWarnings("NullableProblems")
-    private void startUp() throws Exception {
-        startUpSecondary();
-
-        IgniteFsConfiguration ggfsCfg = new IgniteFsConfiguration();
-
-        ggfsCfg.setDataCacheName("partitioned");
-        ggfsCfg.setMetaCacheName("replicated");
-        ggfsCfg.setName("ggfs");
-        ggfsCfg.setBlockSize(512 * 1024);
-
-        if (setNullMode)
-            ggfsCfg.setDefaultMode(null);
-        else if (mode != null)
-            ggfsCfg.setDefaultMode(mode);
-
-        ggfsCfg.setPathModes(pathModes);
-
-        if (setSecondaryFs)
-            ggfsCfg.setSecondaryFileSystem(ggfsSecondary);
-
-        CacheConfiguration cacheCfg = defaultCacheConfiguration();
-
-        cacheCfg.setName("partitioned");
-        cacheCfg.setCacheMode(PARTITIONED);
-        cacheCfg.setDistributionMode(GridCacheDistributionMode.PARTITIONED_ONLY);
-        cacheCfg.setWriteSynchronizationMode(GridCacheWriteSynchronizationMode.FULL_SYNC);
-        cacheCfg.setAffinityMapper(new IgniteFsGroupDataBlocksKeyMapper(128));
-        cacheCfg.setBackups(0);
-        cacheCfg.setQueryIndexEnabled(false);
-        cacheCfg.setAtomicityMode(TRANSACTIONAL);
-
-        CacheConfiguration metaCacheCfg = defaultCacheConfiguration();
-
-        metaCacheCfg.setName("replicated");
-        metaCacheCfg.setCacheMode(REPLICATED);
-        metaCacheCfg.setWriteSynchronizationMode(GridCacheWriteSynchronizationMode.FULL_SYNC);
-        metaCacheCfg.setQueryIndexEnabled(false);
-        metaCacheCfg.setAtomicityMode(TRANSACTIONAL);
-
-        IgniteConfiguration cfg = new IgniteConfiguration();
-
-        cfg.setGridName("ggfs-grid");
-
-        TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
-
-        discoSpi.setIpFinder(new TcpDiscoveryVmIpFinder(true));
-
-        cfg.setDiscoverySpi(discoSpi);
-        cfg.setCacheConfiguration(metaCacheCfg, cacheCfg);
-        cfg.setGgfsConfiguration(ggfsCfg);
-
-        cfg.setLocalHost("127.0.0.1");
-        cfg.setRestEnabled(false);
-
-        grid = (GridEx)G.start(cfg);
-
-        ggfs = (GridGgfsImpl)grid.fileSystem("ggfs");
-    }
-
-    /**
-     * Startup secondary file system.
-     *
-     * @throws Exception If failed.
-     */
-    private void startUpSecondary() throws Exception {
-        IgniteFsConfiguration ggfsCfg = new IgniteFsConfiguration();
-
-        ggfsCfg.setDataCacheName("partitioned");
-        ggfsCfg.setMetaCacheName("replicated");
-        ggfsCfg.setName("ggfs-secondary");
-        ggfsCfg.setBlockSize(512 * 1024);
-        ggfsCfg.setDefaultMode(PRIMARY);
-        ggfsCfg.setIpcEndpointConfiguration(new HashMap<String, String>() {{
-            put("type", "tcp");
-            put("port", "11500");
-        }});
-
-        CacheConfiguration cacheCfg = defaultCacheConfiguration();
-
-        cacheCfg.setName("partitioned");
-        cacheCfg.setCacheMode(PARTITIONED);
-        cacheCfg.setDistributionMode(GridCacheDistributionMode.PARTITIONED_ONLY);
-        cacheCfg.setWriteSynchronizationMode(GridCacheWriteSynchronizationMode.FULL_SYNC);
-        cacheCfg.setAffinityMapper(new IgniteFsGroupDataBlocksKeyMapper(128));
-        cacheCfg.setBackups(0);
-        cacheCfg.setQueryIndexEnabled(false);
-        cacheCfg.setAtomicityMode(TRANSACTIONAL);
-
-        CacheConfiguration metaCacheCfg = defaultCacheConfiguration();
-
-        metaCacheCfg.setName("replicated");
-        metaCacheCfg.setCacheMode(REPLICATED);
-        metaCacheCfg.setWriteSynchronizationMode(GridCacheWriteSynchronizationMode.FULL_SYNC);
-        metaCacheCfg.setQueryIndexEnabled(false);
-        metaCacheCfg.setAtomicityMode(TRANSACTIONAL);
-
-        IgniteConfiguration cfg = new IgniteConfiguration();
-
-        cfg.setGridName("ggfs-grid-secondary");
-
-        TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
-
-        discoSpi.setIpFinder(new TcpDiscoveryVmIpFinder(true));
-
-        cfg.setDiscoverySpi(discoSpi);
-        cfg.setCacheConfiguration(metaCacheCfg, cacheCfg);
-        cfg.setGgfsConfiguration(ggfsCfg);
-
-        cfg.setLocalHost("127.0.0.1");
-        cfg.setRestEnabled(false);
-
-        ggfsSecondary = (GridGgfsImpl)G.start(cfg).fileSystem("ggfs-secondary");
-    }
-
-    /**
-     * Set GGFS modes for particular paths.
-     *
-     * @param modes Modes.
-     */
-    @SafeVarargs
-    final void pathModes(IgniteBiTuple<String, IgniteFsMode>... modes) {
-        assert modes != null;
-
-        pathModes = new LinkedHashMap<>(modes.length, 1.0f);
-
-        for (IgniteBiTuple<String, IgniteFsMode> mode : modes)
-            pathModes.put(mode.getKey(), mode.getValue());
-    }
-
-    /**
-     * Test predefined path modes for PRIMARY mode.
-     *
-     * @throws Exception If failed.
-     */
-    public void testDefaultFoldersPrimary() throws Exception {
-        setSecondaryFs = true;
-
-        mode = DUAL_ASYNC;
-
-        startUp();
-
-        checkMode("/gridgain/primary", PRIMARY);
-        checkMode("/gridgain/primary/", PRIMARY);
-        checkMode("/gridgain/primary/subfolder", PRIMARY);
-        checkMode("/gridgain/primary/folder/file.txt", PRIMARY);
-        checkMode("/gridgain/primaryx", DUAL_ASYNC);
-        checkMode("/gridgain/primaryx/", DUAL_ASYNC);
-        checkMode("/gridgain/primaryx/subfolder", DUAL_ASYNC);
-        checkMode("/gridgain/primaryx/folder/file.txt", DUAL_ASYNC);
-    }
-
-    /**
-     * Test predefined path modes for all modes except of PRIMARY mode.
-     *
-     * @throws Exception If failed.
-     */
-    public void testDefaultFoldersNonPrimary() throws Exception {
-        setSecondaryFs = true;
-
-        mode = PRIMARY;
-
-        startUp();
-
-        checkMode("/gridgain/proxy", PROXY);
-        checkMode("/gridgain/proxy/", PROXY);
-        checkMode("/gridgain/proxy/subfolder", PROXY);
-        checkMode("/gridgain/proxy/folder/file.txt", PROXY);
-        checkMode("/gridgain/proxyx", PRIMARY);
-        checkMode("/gridgain/proxyx/", PRIMARY);
-        checkMode("/gridgain/proxyx/subfolder", PRIMARY);
-        checkMode("/gridgain/proxyx/folder/file.txt", PRIMARY);
-
-        checkMode("/userdir/gridgain/proxy", PRIMARY);
-        checkMode("/userdir/gridgain/proxy/", PRIMARY);
-        checkMode("/userdir/gridgain/proxy/subfolder", PRIMARY);
-        checkMode("/userdir/gridgain/proxy/folder/file.txt", PRIMARY);
-
-        checkMode("/gridgain/sync", DUAL_SYNC);
-        checkMode("/gridgain/sync/", DUAL_SYNC);
-        checkMode("/gridgain/sync/subfolder", DUAL_SYNC);
-        checkMode("/gridgain/sync/folder/file.txt", DUAL_SYNC);
-        checkMode("/gridgain/syncx", PRIMARY);
-        checkMode("/gridgain/syncx/", PRIMARY);
-        checkMode("/gridgain/syncx/subfolder", PRIMARY);
-        checkMode("/gridgain/syncx/folder/file.txt", PRIMARY);
-
-        checkMode("/userdir/gridgain/sync", PRIMARY);
-        checkMode("/userdir/gridgain/sync/", PRIMARY);
-        checkMode("/userdir/gridgain/sync/subfolder", PRIMARY);
-        checkMode("/userdir/gridgain/sync/folder/file.txt", PRIMARY);
-
-        checkMode("/gridgain/async", DUAL_ASYNC);
-        checkMode("/gridgain/async/", DUAL_ASYNC);
-        checkMode("/gridgain/async/subfolder", DUAL_ASYNC);
-        checkMode("/gridgain/async/folder/file.txt", DUAL_ASYNC);
-        checkMode("/gridgain/asyncx", PRIMARY);
-        checkMode("/gridgain/asyncx/", PRIMARY);
-        checkMode("/gridgain/asyncx/subfolder", PRIMARY);
-        checkMode("/gridgain/asyncx/folder/file.txt", PRIMARY);
-
-        checkMode("/userdir/gridgain/async", PRIMARY);
-        checkMode("/userdir/gridgain/async/", PRIMARY);
-        checkMode("/userdir/gridgain/async/subfolder", PRIMARY);
-        checkMode("/userdir/gridgain/async/folder/file.txt", PRIMARY);
-    }
-
-    /**
-     * Ensure that in case secondary file system URI is not provided, all predefined have no special mappings. This test
-     * doesn't make sense for PRIMARY mode since in case URI is not provided DUAL_* modes automatically transforms to
-     * PRIMARY and for PROXY mode we will have an exception during startup.
-     *
-     * @throws Exception If failed.
-     */
-    public void testDefaultsNoSecondaryUriNonPrimary() throws Exception {
-        startUp();
-
-        checkMode("/gridgain/proxy", PRIMARY);
-        checkMode("/gridgain/proxy/", PRIMARY);
-        checkMode("/gridgain/proxy/subfolder", PRIMARY);
-        checkMode("/gridgain/proxy/folder/file.txt", PRIMARY);
-
-        checkMode("/gridgain/sync", PRIMARY);
-        checkMode("/gridgain/sync/", PRIMARY);
-        checkMode("/gridgain/sync/subfolder", PRIMARY);
-        checkMode("/gridgain/sync/folder/file.txt", PRIMARY);
-
-        checkMode("/gridgain/async", PRIMARY);
-        checkMode("/gridgain/async/", PRIMARY);
-        checkMode("/gridgain/async/subfolder", PRIMARY);
-        checkMode("/gridgain/async/folder/file.txt", PRIMARY);
-    }
-
-    /**
-     * Ensure that it is impossible to override mappings for /gridgain/* folders.
-     *
-     * @throws Exception If failed.
-     */
-    public void testDefaultFoldersOverride() throws Exception {
-        setSecondaryFs = true;
-
-        mode = DUAL_ASYNC;
-
-        pathModes(F.t("/gridgain/primary", PROXY), F.t("/gridgain/proxy", DUAL_SYNC),
-            F.t("/gridgain/sync", DUAL_ASYNC), F.t("/gridgain/async", PRIMARY));
-
-        startUp();
-
-        checkMode("/gridgain/primary", PRIMARY);
-        checkMode("/gridgain/proxy", PROXY);
-        checkMode("/gridgain/sync", DUAL_SYNC);
-        checkMode("/gridgain/async", DUAL_ASYNC);
-    }
-
-    /**
-     * Ensure that DUAL_ASYNC mode is set by default.
-     *
-     * @throws Exception If failed.
-     */
-    public void testModeDefaultIsNotSet() throws Exception {
-        setSecondaryFs = true;
-
-        startUp();
-
-        checkMode("/dir", DUAL_ASYNC);
-    }
-
-    /**
-     * Ensure that when mode is set, it is correctly resolved.
-     *
-     * @throws Exception If failed.
-     */
-    public void testModeDefaultIsSet() throws Exception {
-        mode = DUAL_SYNC;
-
-        setSecondaryFs = true;
-
-        startUp();
-
-        checkMode("/dir", DUAL_SYNC);
-    }
-
-    /**
-     * Ensure that Grid doesn't start in case default mode is SECONDARY and secondary FS URI is not provided.
-     *
-     * @throws Exception If failed.
-     */
-    public void testModeSecondaryNoUri() throws Exception {
-        mode = PROXY;
-
-        String errMsg = null;
-
-        try {
-            startUp();
-        }
-        catch (IgniteCheckedException e) {
-            errMsg = e.getCause().getMessage();
-        }
-
-        assertTrue(errMsg.startsWith(
-            "Grid configuration parameter invalid: secondaryFileSystem cannot be null when mode is SECONDARY"));
-    }
-
-    /**
-     * Ensure that modes are resolved correctly when path modes are set.
-     *
-     * @throws Exception If failed.
-     */
-    public void testPathMode() throws Exception {
-        pathModes(F.t("/dir1", PROXY), F.t("/dir2", DUAL_SYNC),
-            F.t("/dir3", PRIMARY), F.t("/dir4", PRIMARY));
-
-        mode = DUAL_ASYNC;
-
-        setSecondaryFs = true;
-
-        startUp();
-
-        checkMode("/dir", DUAL_ASYNC);
-        checkMode("/dir1", PROXY);
-        checkMode("/dir2", DUAL_SYNC);
-
-        checkMode("/dir3", PRIMARY);
-        checkMode("/somedir/dir3", DUAL_ASYNC);
-
-        checkMode("/dir4", PRIMARY);
-        checkMode("/dir4/subdir", PRIMARY);
-        checkMode("/somedir/dir4", DUAL_ASYNC);
-        checkMode("/somedir/dir4/subdir", DUAL_ASYNC);
-    }
-
-    /**
-     * Ensure that path modes switch to PRIMARY in case secondary FS config is not provided.
-     *
-     * @throws Exception If failed.
-     */
-    public void testPathModeSwitchToPrimary() throws Exception {
-        mode = DUAL_SYNC;
-
-        pathModes(F.t("/dir1", PRIMARY), F.t("/dir2", DUAL_SYNC));
-
-        startUp();
-
-        checkMode("/dir", PRIMARY);
-        checkMode("/dir1", PRIMARY);
-        checkMode("/dir2", PRIMARY);
-    }
-
-    /**
-     * Ensure that Grid doesn't start in case path mode is SECONDARY and secondary FS config path is not provided.
-     *
-     * @throws Exception If failed.
-     */
-    public void testPathModeSecondaryNoCfg() throws Exception {
-        pathModes(F.t("dir", PROXY));
-
-        String errMsg = null;
-
-        try {
-            startUp();
-        }
-        catch (IgniteCheckedException e) {
-            errMsg = e.getCause().getMessage();
-        }
-
-        assertTrue(errMsg.startsWith(
-            "Grid configuration parameter invalid: secondaryFileSystem cannot be null when mode is SECONDARY"));
-    }
-
-    /**
-     * Ensure that data is not propagated to the secondary GGFS in PRIMARY mode.
-     *
-     * @throws Exception If failed.
-     */
-    public void testPropagationPrimary() throws Exception {
-        mode = PRIMARY;
-
-        checkPropagation();
-    }
-
-    /**
-     * Ensure that data is propagated to the secondary GGFS in DUAL_SYNC mode.
-     *
-     * @throws Exception If failed.
-     */
-    public void testPropagationDualSync() throws Exception {
-        mode = DUAL_SYNC;
-
-        checkPropagation();
-    }
-
-    /**
-     * Ensure that data is propagated to the secondary GGFS in DUAL_SYNC mode.
-     *
-     * @throws Exception If failed.
-     */
-    public void _testPropagationDualAsync() throws Exception {
-        mode = DUAL_ASYNC;
-
-        checkPropagation();
-    }
-
-    /**
-     * Resolve GGFS mode for the given path and compare it with expected one.
-     *
-     * @param pathStr Path ot resolve.
-     * @param expMode Expected mode.
-     * @throws Exception If failed.
-     */
-    private void checkMode(String pathStr, IgniteFsMode expMode) throws Exception {
-        assert ggfs != null;
-
-        IgniteFsPath path = new IgniteFsPath(pathStr);
-
-        GridGgfsModeResolver rslvr = ggfs.modeResolver();
-
-        IgniteFsMode mode = rslvr.resolveMode(path);
-
-        assertEquals(expMode, mode);
-    }
-
-    /**
-     * Check propagation of various operations to secondary file system.
-     *
-     * @throws Exception If failed.
-     */
-    private void checkPropagation() throws Exception {
-        byte[] testData1 = new byte[] {0, 1, 2, 3, 4, 5, 6, 7};
-        byte[] testData2 = new byte[] {8, 9, 10, 11};
-        byte[] testData = Arrays.copyOf(testData1, testData1.length + testData2.length);
-
-        U.arrayCopy(testData2, 0, testData, testData1.length, testData2.length);
-
-        setSecondaryFs = true;
-
-        startUp();
-
-        boolean primaryNotUsed = mode == PROXY;
-        boolean secondaryUsed = mode != PRIMARY;
-
-        IgniteFsPath dir = new IgniteFsPath("/dir");
-        IgniteFsPath file = new IgniteFsPath("/dir/file");
-
-        // Create new directory.
-        ggfs.mkdirs(dir);
-
-        // Create new file.
-        IgniteFsOutputStream os = ggfs.create(file, 1024, true, null, 0, 2048, null);
-
-        os.write(testData1);
-
-        os.close();
-
-        // Re-open it and append.
-        os = ggfs.append(file, 1024, false, null);
-
-        os.write(testData2);
-
-        os.close();
-
-        // Check file content.
-        IgniteFsInputStream is = ggfs.open(file);
-
-        assertEquals(testData.length, is.length());
-
-        byte[] data = new byte[testData.length];
-
-        is.read(data, 0, testData.length);
-
-        is.close();
-
-        assert Arrays.equals(testData, data);
-
-        if (secondaryUsed) {
-            assert ggfsSecondary.exists(dir);
-            assert ggfsSecondary.exists(file);
-
-            // In ASYNC mode we wait at most 2 seconds for background writer to finish.
-            for (int i = 0; i < 20; i++) {
-                IgniteFsInputStream isSecondary = null;
-
-                try {
-                    isSecondary = ggfsSecondary.open(file);
-
-                    if (isSecondary.length() == testData.length)
-                        break;
-                    else
-                        U.sleep(100);
-                }
-                finally {
-                    U.closeQuiet(isSecondary);
-                }
-            }
-
-            IgniteFsInputStream isSecondary = ggfsSecondary.open(file);
-
-            assertEquals(testData.length, isSecondary.length());
-
-            isSecondary.read(data, 0, testData.length);
-
-            assert Arrays.equals(testData, data);
-        }
-        else {
-            assert !ggfsSecondary.exists(dir);
-            assert !ggfsSecondary.exists(file);
-        }
-
-        int cacheSize = grid.cachex("partitioned").size();
-
-        if (primaryNotUsed)
-            assert cacheSize == 0;
-        else
-            assert cacheSize != 0;
-
-        // Now delete all.
-        ggfs.delete(dir, true);
-
-        assert !ggfs.exists(dir);
-        assert !ggfs.exists(file);
-
-        assert !ggfsSecondary.exists(dir);
-        assert !ggfsSecondary.exists(file);
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cfcf46df/modules/core/src/test/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsPrimaryOffheapTieredSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsPrimaryOffheapTieredSelfTest.java b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsPrimaryOffheapTieredSelfTest.java
deleted file mode 100644
index 50b2d93..0000000
--- a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsPrimaryOffheapTieredSelfTest.java
+++ /dev/null
@@ -1,33 +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.gridgain.grid.kernal.processors.ggfs;
-
-import static org.apache.ignite.fs.IgniteFsMode.*;
-import static org.apache.ignite.cache.GridCacheMemoryMode.*;
-
-/**
- * Tests for PRIMARY mode and OFFHEAP_TIERED memory.
- */
-public class GridGgfsPrimaryOffheapTieredSelfTest extends GridGgfsAbstractSelfTest {
-    /**
-     * Constructor.
-     */
-    public GridGgfsPrimaryOffheapTieredSelfTest() {
-        super(PRIMARY, OFFHEAP_TIERED);
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cfcf46df/modules/core/src/test/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsPrimaryOffheapValuesSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsPrimaryOffheapValuesSelfTest.java b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsPrimaryOffheapValuesSelfTest.java
deleted file mode 100644
index 6039637..0000000
--- a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsPrimaryOffheapValuesSelfTest.java
+++ /dev/null
@@ -1,33 +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.gridgain.grid.kernal.processors.ggfs;
-
-import static org.apache.ignite.fs.IgniteFsMode.*;
-import static org.apache.ignite.cache.GridCacheMemoryMode.*;
-
-/**
- * Tests for PRIMARY mode and OFFHEAP_VALUES memory.
- */
-public class GridGgfsPrimaryOffheapValuesSelfTest extends GridGgfsAbstractSelfTest {
-    /**
-     * Constructor.
-     */
-    public GridGgfsPrimaryOffheapValuesSelfTest() {
-        super(PRIMARY, OFFHEAP_VALUES);
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cfcf46df/modules/core/src/test/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsPrimarySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsPrimarySelfTest.java b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsPrimarySelfTest.java
deleted file mode 100644
index e894134..0000000
--- a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsPrimarySelfTest.java
+++ /dev/null
@@ -1,32 +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.gridgain.grid.kernal.processors.ggfs;
-
-import static org.apache.ignite.fs.IgniteFsMode.*;
-
-/**
- * Tests for PRIMARY mode.
- */
-public class GridGgfsPrimarySelfTest extends GridGgfsAbstractSelfTest {
-    /**
-     * Constructor.
-     */
-    public GridGgfsPrimarySelfTest() {
-        super(PRIMARY);
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cfcf46df/modules/core/src/test/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsProcessorSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsProcessorSelfTest.java b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsProcessorSelfTest.java
deleted file mode 100644
index 483bec4..0000000
--- a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsProcessorSelfTest.java
+++ /dev/null
@@ -1,977 +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.gridgain.grid.kernal.processors.ggfs;
-
-import org.apache.commons.io.*;
-import org.apache.ignite.*;
-import org.apache.ignite.cache.*;
-import org.apache.ignite.configuration.*;
-import org.apache.ignite.fs.*;
-import org.apache.ignite.internal.*;
-import org.apache.ignite.lang.*;
-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.internal.util.typedef.*;
-import org.apache.ignite.internal.util.typedef.internal.*;
-import org.gridgain.testframework.*;
-import org.jetbrains.annotations.*;
-
-import java.security.*;
-import java.util.*;
-import java.util.concurrent.*;
-import java.util.concurrent.atomic.*;
-
-import static java.nio.charset.StandardCharsets.*;
-import static org.apache.ignite.cache.GridCacheAtomicityMode.*;
-import static org.apache.ignite.cache.GridCacheMode.*;
-
-/**
- * Tests for {@link GridGgfsProcessor}.
- */
-public class GridGgfsProcessorSelfTest extends GridGgfsCommonAbstractTest {
-    /** Test IP finder. */
-    private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true);
-
-    /** Meta-information cache name. */
-    private static final String META_CACHE_NAME = "replicated";
-
-    /** Data cache name. */
-    public static final String DATA_CACHE_NAME = "data";
-
-    /** Random numbers generator. */
-    protected final SecureRandom rnd = new SecureRandom();
-
-    /** File system. */
-    protected IgniteFs ggfs;
-
-    /** Meta cache. */
-    private GridCache<Object, Object> metaCache;
-
-    /** Meta cache name. */
-    private String metaCacheName;
-
-    /** {@inheritDoc} */
-    @Override protected void beforeTest() throws Exception {
-        GridEx grid = grid(0);
-
-        ggfs = grid.fileSystem(ggfsName());
-
-        IgniteFsConfiguration[] cfgs = grid.configuration().getGgfsConfiguration();
-
-        assert cfgs.length == 1;
-
-        metaCacheName = cfgs[0].getMetaCacheName();
-
-        metaCache = grid.cachex(metaCacheName);
-    }
-
-    /** {@inheritDoc} */
-    @Override protected void afterTest() throws Exception {
-        super.afterTest();
-
-        ggfs.format();
-    }
-
-    /** {@inheritDoc} */
-    @Override protected void beforeTestsStarted() throws Exception {
-        startGrids(nodesCount());
-    }
-
-    /** {@inheritDoc} */
-    @Override protected void afterTestsStopped() throws Exception {
-        stopAllGrids();
-    }
-
-    /** {@inheritDoc} */
-    @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
-        IgniteConfiguration cfg = super.getConfiguration(gridName);
-
-        cfg.setCacheConfiguration(cacheConfiguration(META_CACHE_NAME), cacheConfiguration(DATA_CACHE_NAME));
-
-        TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
-
-        discoSpi.setIpFinder(IP_FINDER);
-
-        cfg.setDiscoverySpi(discoSpi);
-
-        IgniteFsConfiguration ggfsCfg = new IgniteFsConfiguration();
-
-        ggfsCfg.setMetaCacheName(META_CACHE_NAME);
-        ggfsCfg.setDataCacheName(DATA_CACHE_NAME);
-        ggfsCfg.setName("ggfs");
-
-        cfg.setGgfsConfiguration(ggfsCfg);
-
-        return cfg;
-    }
-
-    /** {@inheritDoc} */
-    protected CacheConfiguration cacheConfiguration(String cacheName) {
-        CacheConfiguration cacheCfg = defaultCacheConfiguration();
-
-        cacheCfg.setName(cacheName);
-
-        if (META_CACHE_NAME.equals(cacheName))
-            cacheCfg.setCacheMode(REPLICATED);
-        else {
-            cacheCfg.setCacheMode(PARTITIONED);
-            cacheCfg.setDistributionMode(GridCacheDistributionMode.PARTITIONED_ONLY);
-
-            cacheCfg.setBackups(0);
-            cacheCfg.setAffinityMapper(new IgniteFsGroupDataBlocksKeyMapper(128));
-        }
-
-        cacheCfg.setWriteSynchronizationMode(GridCacheWriteSynchronizationMode.FULL_SYNC);
-        cacheCfg.setAtomicityMode(TRANSACTIONAL);
-        cacheCfg.setQueryIndexEnabled(false);
-
-        return cacheCfg;
-    }
-
-    /** @return Test nodes count. */
-    public int nodesCount() {
-        return 1;
-    }
-
-    /** @return FS name. */
-    public String ggfsName() {
-        return "ggfs";
-    }
-
-    /** @throws Exception If failed. */
-    public void testGgfsEnabled() throws Exception {
-        IgniteFs ggfs = grid(0).fileSystem(ggfsName());
-
-        assertNotNull(ggfs);
-    }
-
-    /**
-     * Test properties management in meta-cache.
-     *
-     * @throws Exception If failed.
-     */
-    public void testUpdateProperties() throws Exception {
-        IgniteFsPath p = path("/tmp/my");
-
-        ggfs.mkdirs(p);
-
-        Map<String, String> oldProps = ggfs.info(p).properties();
-
-        ggfs.update(p, F.asMap("a", "1"));
-        ggfs.update(p, F.asMap("b", "2"));
-
-        assertEquals("1", ggfs.info(p).property("a"));
-        assertEquals("2", ggfs.info(p).property("b"));
-
-        ggfs.update(p, F.asMap("b", "3"));
-
-        Map<String, String> expProps = new HashMap<>(oldProps);
-        expProps.put("a", "1");
-        expProps.put("b", "3");
-
-        assertEquals("3", ggfs.info(p).property("b"));
-        assertEquals(expProps, ggfs.info(p).properties());
-        assertEquals("5", ggfs.info(p).property("c", "5"));
-
-        assertUpdatePropertiesFails(null, null, NullPointerException.class, "Ouch! Argument cannot be null");
-        assertUpdatePropertiesFails(p, null, NullPointerException.class, "Ouch! Argument cannot be null");
-        assertUpdatePropertiesFails(null, F.asMap("x", "9"), NullPointerException.class,
-            "Ouch! Argument cannot be null");
-
-        assertUpdatePropertiesFails(p, Collections.<String, String>emptyMap(), IllegalArgumentException.class,
-            "Ouch! Argument is invalid");
-    }
-
-    /** @throws Exception If failed. */
-    public void testCreate() throws Exception {
-        IgniteFsPath path = path("/file");
-
-        try (IgniteFsOutputStream os = ggfs.create(path, false)) {
-            assert os != null;
-
-            IgniteFsFileImpl info = (IgniteFsFileImpl)ggfs.info(path);
-
-            for (int i = 0; i < nodesCount(); i++) {
-                GridGgfsFileInfo fileInfo = (GridGgfsFileInfo)grid(i).cachex(metaCacheName).peek(info.fileId());
-
-                assertNotNull(fileInfo);
-                assertNotNull(fileInfo.listing());
-            }
-        }
-        finally {
-            ggfs.delete(path("/"), true);
-        }
-    }
-
-    /**
-     * Test make directories.
-     *
-     * @throws Exception In case of any exception.
-     */
-    public void testMakeListDeleteDirs() throws Exception {
-        assertListDir("/");
-
-        ggfs.mkdirs(path("/ab/cd/ef"));
-
-        assertListDir("/", "ab");
-        assertListDir("/ab", "cd");
-        assertListDir("/ab/cd", "ef");
-
-        ggfs.mkdirs(path("/ab/ef"));
-        ggfs.mkdirs(path("/cd/ef"));
-        ggfs.mkdirs(path("/cd/gh"));
-        ggfs.mkdirs(path("/ef"));
-        ggfs.mkdirs(path("/ef/1"));
-        ggfs.mkdirs(path("/ef/2"));
-        ggfs.mkdirs(path("/ef/3"));
-
-        assertListDir("/", "ef", "ab", "cd");
-        assertListDir("/ab", "cd", "ef");
-        assertListDir("/ab/cd", "ef");
-        assertListDir("/ab/cd/ef");
-        assertListDir("/cd", "ef", "gh");
-        assertListDir("/cd/ef");
-        assertListDir("/ef", "1", "2", "3");
-
-        ggfs.delete(path("/ef/2"), false);
-
-        assertListDir("/", "ef", "ab", "cd");
-        assertListDir("/ef", "1", "3");
-
-        // Delete should return false for non-existing paths.
-        assertFalse(ggfs.delete(path("/ef/2"), false));
-
-        assertListDir("/", "ef", "ab", "cd");
-        assertListDir("/ef", "1", "3");
-
-        GridTestUtils.assertThrows(log, new Callable<Object>() {
-            @Override public Object call() throws Exception {
-                ggfs.delete(path("/ef"), false);
-
-                return null;
-            }
-        }, GridGgfsDirectoryNotEmptyException.class, null);
-
-        assertListDir("/", "ef", "ab", "cd");
-        assertListDir("/ef", "1", "3");
-
-        ggfs.delete(path("/ef"), true);
-
-        assertListDir("/", "ab", "cd");
-    }
-
-    /**
-     * Test make directories in multi-threaded environment.
-     *
-     * @throws Exception In case of any exception.
-     */
-    @SuppressWarnings("TooBroadScope")
-    public void testMakeListDeleteDirsMultithreaded() throws Exception {
-        assertListDir("/");
-
-        final int max = 2 * 1000;
-        final int threads = 50;
-        final AtomicInteger cnt = new AtomicInteger();
-
-        info("Create directories: " + max);
-
-        GridTestUtils.runMultiThreaded(new Callable<Object>() {
-            @Override public Object call() throws Exception {
-                for (int cur = cnt.incrementAndGet(); cur < max; cur = cnt.incrementAndGet())
-                    ggfs.mkdirs(path(cur));
-
-                return null;
-            }
-        }, threads, "grid-test-make-directories");
-
-        info("Validate directories were created.");
-
-        cnt.set(0); // Reset counter.
-
-        GridTestUtils.runMultiThreaded(new Callable<Object>() {
-            @Override public Object call() throws Exception {
-                for (int cur = cnt.incrementAndGet(); cur < max; cur = cnt.incrementAndGet()) {
-                    IgniteFsFile info = ggfs.info(path(cur));
-
-                    assertNotNull("Expects file exist: " + cur, info);
-                    assertTrue("Expects file is a directory: " + cur, info.isDirectory());
-                }
-
-                return null;
-            }
-        }, threads, "grid-test-check-directories-exist");
-
-        info("Validate directories removing.");
-
-        cnt.set(0); // Reset counter.
-
-        GridTestUtils.runMultiThreaded(new Callable<Object>() {
-            @Override public Object call() throws Exception {
-                for (int cur = cnt.incrementAndGet(); cur < max; cur = cnt.incrementAndGet())
-                    ggfs.delete(path(cur), true);
-
-                return null;
-            }
-        }, threads, "grid-test-delete-directories");
-    }
-
-    /** @throws Exception If failed. */
-    public void testBasicOps() throws Exception {
-        // Create directories.
-        ggfs.mkdirs(path("/A/B1/C1"));
-
-        for (Object key : metaCache.keySet())
-            info("Entry in cache [key=" + key + ", val=" + metaCache.get(key) + ']');
-
-        ggfs.mkdirs(path("/A/B1/C2"));
-        ggfs.mkdirs(path("/A/B1/C3"));
-        ggfs.mkdirs(path("/A/B2/C1"));
-        ggfs.mkdirs(path("/A/B2/C2"));
-
-        ggfs.mkdirs(path("/A1/B1/C1"));
-        ggfs.mkdirs(path("/A1/B1/C2"));
-        ggfs.mkdirs(path("/A1/B1/C3"));
-        ggfs.mkdirs(path("/A2/B2/C1"));
-        ggfs.mkdirs(path("/A2/B2/C2"));
-
-        for (Object key : metaCache.keySet())
-            info("Entry in cache [key=" + key + ", val=" + metaCache.get(key) + ']');
-
-        // Check existence.
-        assert ggfs.exists(path("/A/B1/C1"));
-
-        // List items.
-        Collection<IgniteFsPath> paths = ggfs.listPaths(path("/"));
-
-        assert paths.size() == 3 : "Unexpected paths: " + paths;
-
-        paths = ggfs.listPaths(path("/A"));
-
-        assert paths.size() == 2 : "Unexpected paths: " + paths;
-
-        paths = ggfs.listPaths(path("/A/B1"));
-
-        assert paths.size() == 3 : "Unexpected paths: " + paths;
-
-        // Delete.
-        GridTestUtils.assertThrowsInherited(log, new Callable<Object>() {
-            @Override public Object call() throws Exception {
-                ggfs.delete(path("/"), false);
-
-                return null;
-            }
-        }, IgniteFsException.class, null);
-
-        ggfs.delete(path("/A1/B1/C1"), false);
-        assertNull(ggfs.info(path("/A1/B1/C1")));
-
-        ggfs.delete(path("/A1/B1/C2"), false);
-        assertNull(ggfs.info(path("/A1/B1/C2")));
-
-        ggfs.delete(path("/A1/B1/C3"), false);
-        assertNull(ggfs.info(path("/A1/B1/C3")));
-
-        assertEquals(Collections.<IgniteFsPath>emptyList(), ggfs.listPaths(path("/A1/B1")));
-
-        ggfs.delete(path("/A2/B2"), true);
-        assertNull(ggfs.info(path("/A2/B2")));
-
-        assertEquals(Collections.<IgniteFsPath>emptyList(), ggfs.listPaths(path("/A2")));
-
-        assertEquals(Arrays.asList(path("/A"), path("/A1"), path("/A2")), sorted(ggfs.listPaths(path("/"))));
-
-        GridTestUtils.assertThrowsInherited(log, new Callable<Object>() {
-            @Override public Object call() throws Exception {
-                ggfs.delete(path("/"), false);
-
-                return null;
-            }
-        }, IgniteFsException.class, null);
-        assertEquals(Arrays.asList(path("/A"), path("/A1"), path("/A2")), sorted(ggfs.listPaths(path("/"))));
-
-        ggfs.delete(path("/"), true);
-        assertEquals(Collections.<IgniteFsPath>emptyList(), ggfs.listPaths(path("/")));
-
-        ggfs.delete(path("/"), false);
-        assertEquals(Collections.<IgniteFsPath>emptyList(), ggfs.listPaths(path("/")));
-
-        for (GridCacheEntry<Object, Object> e : metaCache)
-            info("Entry in cache [key=" + e.getKey() + ", val=" + e.getValue() + ']');
-    }
-
-    /**
-     * Ensure correct size calculation.
-     *
-     * @throws Exception If failed.
-     */
-    public void testSize() throws Exception {
-        IgniteFsPath dir1 = path("/dir1");
-        IgniteFsPath subDir1 = path("/dir1/subdir1");
-        IgniteFsPath dir2 = path("/dir2");
-
-        IgniteFsPath fileDir1 = path("/dir1/file");
-        IgniteFsPath fileSubdir1 = path("/dir1/subdir1/file");
-        IgniteFsPath fileDir2 = path("/dir2/file");
-
-        IgniteFsOutputStream os = ggfs.create(fileDir1, false);
-        os.write(new byte[1000]);
-        os.close();
-
-        os = ggfs.create(fileSubdir1, false);
-        os.write(new byte[2000]);
-        os.close();
-
-        os = ggfs.create(fileDir2, false);
-        os.write(new byte[4000]);
-        os.close();
-
-        assert ggfs.size(fileDir1) == 1000;
-        assert ggfs.size(fileSubdir1) == 2000;
-        assert ggfs.size(fileDir2) == 4000;
-
-        assert ggfs.size(dir1) == 3000;
-        assert ggfs.size(subDir1) == 2000;
-
-        assert ggfs.size(dir2) == 4000;
-    }
-
-    /**
-     * Convert collection into sorted list.
-     *
-     * @param col Unsorted collection.
-     * @return Sorted collection.
-     */
-    private <T extends Comparable<T>> List<T> sorted(Collection<T> col) {
-        List<T> list = new ArrayList<>(col);
-
-        Collections.sort(list);
-
-        return list;
-    }
-
-    /** @throws Exception If failed. */
-    public void testRename() throws Exception {
-        // Create directories.
-        ggfs.mkdirs(path("/A/B1/C1"));
-
-        for (Object key : metaCache.keySet())
-            info("Entry in cache [key=" + key + ", val=" + metaCache.get(key) + ']');
-
-        // Move under itself.
-        GridTestUtils.assertThrowsInherited(log, new Callable<Object>() {
-            @Override public Object call() throws Exception {
-                ggfs.rename(path("/A/B1/C1"), path("/A/B1/C1/C2"));
-
-                return null;
-            }
-        }, IgniteFsException.class, null);
-
-        // Move under itself.
-        GridTestUtils.assertThrowsInherited(log, new Callable<Object>() {
-            @Override public Object call() throws Exception {
-                ggfs.rename(path("/A/B1/C1"), path("/A/B1/C1/D/C2"));
-
-                return null;
-            }
-        }, IgniteFsException.class, null);
-
-        // Move under itself.
-        GridTestUtils.assertThrowsInherited(log, new Callable<Object>() {
-            @Override
-            public Object call() throws Exception {
-                ggfs.rename(path("/A/B1/C1"), path("/A/B1/C1/D/E/C2"));
-
-                return null;
-            }
-        }, IgniteFsException.class, null);
-
-        ///
-        // F6 > Enter > Tab x N times
-        // "I like to move it, move it..."
-        //
-
-        Collection<IgniteBiTuple<String, String>> chain = Arrays.asList(
-            F.t("/A/B1/C1", "/A/B1/C2"),
-            F.t("/A/B1", "/A/B2"),
-            F.t("/A", "/Q"),
-            //F.t("/Q/B2/C2", "/C3"),
-            F.t("/Q/B2/C2", "/Q/B2/C1"),
-            F.t("/Q/B2", "/Q/B1"),
-            F.t("/Q", "/A"),
-            //F.t("/C3", "/A/B1/C1")
-            F.t("/A/B1/C1", "/"),
-            F.t("/C1", "/A/B1")
-        );
-
-        final IgniteFsPath root = path("/");
-
-        for (IgniteBiTuple<String, String> e : chain) {
-            final IgniteFsPath p1 = path(e.get1());
-            final IgniteFsPath p2 = path(e.get2());
-
-            assertTrue("Entry: " + e, ggfs.exists(p1));
-            ggfs.rename(p1, p2);
-            assertFalse("Entry: " + e, ggfs.exists(p1));
-            assertTrue("Entry: " + e, ggfs.exists(p2));
-
-            // Test root rename.
-            GridTestUtils.assertThrowsInherited(log, new Callable<Object>() {
-                @Override public Object call() throws Exception {
-                    ggfs.rename(root, p1);
-
-                    return null;
-                }
-            }, IgniteFsException.class, null);
-
-            // Test root rename.
-            GridTestUtils.assertThrowsInherited(log, new Callable<Object>() {
-                @Override public Object call() throws Exception {
-                    ggfs.rename(p1, root);
-
-                    return null;
-                }
-            }, IgniteFsException.class, null);
-
-            // Test root rename.
-            if (!root.equals(p2)) {
-                GridTestUtils.assertThrowsInherited(log, new Callable<Object>() {
-                    @Override public Object call() throws Exception {
-                        ggfs.rename(root, p2);
-
-                        return null;
-                    }
-                }, IgniteFsException.class, null);
-            }
-
-            // Test same rename.
-            ggfs.rename(p1, p1);
-            ggfs.rename(p2, p2);
-        }
-
-        // List items.
-        assertEquals(Arrays.asList(path("/A")), sorted(ggfs.listPaths(root)));
-        assertEquals(Arrays.asList(path("/A/B1")), sorted(ggfs.listPaths(path("/A"))));
-        assertEquals(Arrays.asList(path("/A/B1/C1")), sorted(ggfs.listPaths(path("/A/B1"))));
-
-        String text = "Test long number: " + rnd.nextLong();
-
-        // Create file.
-        assertEquals(text, create("/A/a", false, text));
-
-        // Validate renamed during reading.
-
-        try (IgniteFsInputStream in0 = ggfs.open(path("/A/a"))) {
-            // Rename file.
-            ggfs.rename(path("/A/a"), path("/b"));
-
-            assertEquals(text, IOUtils.toString(in0, UTF_8));
-        }
-
-        // Validate after renamed.
-        assertOpenFails("/A/a", "File not found");
-        assertEquals(text, read("/b"));
-
-        // Cleanup.
-        ggfs.delete(root, true);
-
-        assertEquals(Collections.<IgniteFsPath>emptyList(), ggfs.listPaths(root));
-    }
-
-    /**
-     * @param path Path.
-     * @return GGFS path.
-     */
-    private IgniteFsPath path(String path) {
-        assert path != null;
-
-        return new IgniteFsPath(path);
-    }
-
-    /**
-     * @param i Path index.
-     * @return GGFS path.
-     */
-    private IgniteFsPath path(long i) {
-        //return path(String.format("/%d", i));
-        return path(String.format("/%d/q/%d/%d", i % 10, (i / 10) % 10, i));
-    }
-
-    /** @throws Exception If failed. */
-    public void testCreateOpenAppend() throws Exception {
-        // Error - path points to root directory.
-        assertCreateFails("/", false, "Failed to resolve parent directory");
-
-        // Create directories.
-        ggfs.mkdirs(path("/A/B1/C1"));
-
-        // Error - path points to directory.
-        for (String path : Arrays.asList("/A", "/A/B1", "/A/B1/C1")) {
-            assertCreateFails(path, false, "Failed to create file (file already exists)");
-            assertCreateFails(path, true, "Failed to create file (path points to a directory)");
-            assertAppendFails(path, false, "Failed to open file (not a file)");
-            assertAppendFails(path, true, "Failed to open file (not a file)");
-            assertOpenFails(path, "Failed to open file (not a file)");
-        }
-
-        String text1 = "Test long number #1: " + rnd.nextLong();
-        String text2 = "Test long number #2: " + rnd.nextLong();
-
-        // Error - parent does not exist.
-        for (String path : Arrays.asList("/A/a", "/A/B1/a", "/A/B1/C1/a")) {
-            // Error - file doesn't exist.
-            assertOpenFails(path, "File not found");
-            assertAppendFails(path, false, "File not found");
-
-            // Create new and write.
-            assertEquals(text1, create(path, false, text1));
-
-            // Error - file already exists.
-            assertCreateFails(path, false, "Failed to create file (file already exists)");
-
-            // Overwrite existent.
-            assertEquals(text2, create(path, true, text2));
-
-            // Append text.
-            assertEquals(text2 + text1, append(path, false, text1));
-
-            // Append text.
-            assertEquals(text2 + text1 + text2, append(path, true, text2));
-
-            // Delete this file.
-            ggfs.delete(path(path), true);
-
-            // Error - file doesn't exist.
-            assertOpenFails(path, "File not found");
-            assertAppendFails(path, false, "File not found");
-
-            // Create with append.
-            assertEquals(text1, append(path, true, text1));
-
-            // Append.
-            for (String full = text1, cur = ""; full.length() < 10000; cur = ", long=" + rnd.nextLong())
-                assertEquals(full += cur, append(path, rnd.nextBoolean(), cur));
-
-            ggfs.delete(path(path), false);
-        }
-    }
-
-    /** @throws Exception If failed. */
-    @SuppressWarnings("BusyWait")
-    public void testDeleteCacheConsistency() throws Exception {
-        IgniteFsPath path = new IgniteFsPath("/someFile");
-
-        try (IgniteFsOutputStream out = ggfs.create(path, true)) {
-            out.write(new byte[10 * 1024 * 1024]);
-        }
-
-        IgniteUuid fileId = U.field(ggfs.info(path), "fileId");
-
-        GridCache<IgniteUuid, GridGgfsFileInfo> metaCache = grid(0).cachex(META_CACHE_NAME);
-        GridCache<GridGgfsBlockKey, byte[]> dataCache = grid(0).cachex(DATA_CACHE_NAME);
-
-        GridGgfsFileInfo info = metaCache.get(fileId);
-
-        assertNotNull(info);
-        assertTrue(info.isFile());
-        assertNotNull(metaCache.get(info.id()));
-
-        GridGgfsDataManager dataMgr = ((GridGgfsEx)ggfs).context().data();
-
-        for (int i = 0; i < info.blocksCount(); i++)
-            assertNotNull(dataCache.get(dataMgr.blockKey(i, info)));
-
-        ggfs.delete(path, true);
-
-        for (int i = 0; i < 25; i++) {
-            if (metaCache.get(info.id()) == null)
-                break;
-
-            U.sleep(100);
-        }
-
-        assertNull(metaCache.get(info.id()));
-
-        for (int i = 0; i < 10; i++) {
-            boolean doBreak = true;
-
-            for (int j = 0; j < info.blocksCount(); j++) {
-                if (dataCache.get(dataMgr.blockKey(i, info)) != null) {
-                    doBreak = false;
-
-                    break;
-                }
-            }
-
-            if (doBreak)
-                break;
-            else
-                Thread.sleep(100);
-        }
-
-        for (int i = 0; i < info.blocksCount(); i++)
-            assertNull(dataCache.get(new GridGgfsBlockKey(info.id(), null, false, i)));
-    }
-
-    /** @throws Exception If failed. */
-    public void testCreateAppendLongData1() throws Exception {
-        checkCreateAppendLongData(123, 1024, 100);
-    }
-
-    /** @throws Exception If failed. */
-    public void testCreateAppendLongData2() throws Exception {
-        checkCreateAppendLongData(123 + 1024, 1024, 100);
-    }
-
-    /** @throws Exception If failed. */
-    public void testCreateAppendLongData3() throws Exception {
-        checkCreateAppendLongData(123, 1024, 1000);
-    }
-
-    /** @throws Exception If failed. */
-    public void testCreateAppendLongData4() throws Exception {
-        checkCreateAppendLongData(123 + 1024, 1024, 1000);
-    }
-
-    /**
-     * Test format operation on non-empty file system.
-     *
-     * @throws Exception If failed.
-     */
-    public void testFormatNonEmpty() throws Exception {
-        String dirPath = "/A/B/C";
-
-        ggfs.mkdirs(path(dirPath));
-
-        String filePath = "/someFile";
-
-        create(filePath, false, "Some text.");
-
-        ggfs.format();
-
-        assert !ggfs.exists(path(dirPath));
-        assert !ggfs.exists(path(filePath));
-
-        assert grid(0).cachex(ggfs.configuration().getMetaCacheName()).size() == 2; // ROOT + TRASH.
-    }
-
-    /**
-     * Test format operation on empty file system.
-     *
-     * @throws Exception If failed.
-     */
-    public void testFormatEmpty() throws Exception {
-        ggfs.format();
-    }
-
-    /**
-     * @param chunkSize Chunk size.
-     * @param bufSize Buffer size.
-     * @param cnt Count.
-     * @throws Exception If failed.
-     */
-    private void checkCreateAppendLongData(int chunkSize, int bufSize, int cnt) throws Exception {
-        IgniteFsPath path = new IgniteFsPath("/someFile");
-
-        byte[] buf = new byte[chunkSize];
-
-        for (int i = 0; i < buf.length; i++)
-            buf[i] = (byte)(i * i);
-
-        IgniteFsOutputStream os = ggfs.create(path, bufSize, true, null, 0, 1024, null);
-
-        try {
-            for (int i = 0; i < cnt; i++)
-                os.write(buf);
-
-            os.flush();
-        }
-        finally {
-            os.close();
-        }
-
-        os = ggfs.append(path, chunkSize, false, null);
-
-        try {
-            for (int i = 0; i < cnt; i++)
-                os.write(buf);
-
-            os.flush();
-        }
-        finally {
-            os.close();
-        }
-
-        byte[] readBuf = new byte[chunkSize];
-
-        try (IgniteFsInputStream in = ggfs.open(path)) {
-            long pos = 0;
-
-            for (int k = 0; k < 2 * cnt; k++) {
-                in.readFully(pos, readBuf);
-
-                for (int i = 0; i < readBuf.length; i++)
-                    assertEquals(buf[i], readBuf[i]);
-
-                pos += readBuf.length;
-            }
-        }
-    }
-
-    /**
-     * Create file and write specified text to.
-     *
-     * @param path File path to create.
-     * @param overwrite Overwrite file if it already exists.
-     * @param text Text to write into file.
-     * @return Content of this file.
-     * @throws IgniteCheckedException In case of error.
-     */
-    private String create(String path, boolean overwrite, String text) throws Exception {
-
-        try (IgniteFsOutputStream out = ggfs.create(path(path), overwrite)) {
-            IOUtils.write(text, out, UTF_8);
-        }
-
-        assertNotNull(ggfs.info(path(path)));
-
-        return read(path);
-    }
-
-    /**
-     * Appent text to the file.
-     *
-     * @param path File path to create.
-     * @param create Create file if it doesn't exist yet.
-     * @param text Text to append to file.
-     * @return Content of this file.
-     * @throws IgniteCheckedException In case of error.
-     */
-    private String append(String path, boolean create, String text) throws Exception {
-
-        try (IgniteFsOutputStream out = ggfs.append(path(path), create)) {
-            IOUtils.write(text, out, UTF_8);
-        }
-
-        assertNotNull(ggfs.info(path(path)));
-
-        return read(path);
-    }
-
-    /**
-     * Read content of the file.
-     *
-     * @param path File path to read.
-     * @return Content of this file.
-     * @throws IgniteCheckedException In case of error.
-     */
-    private String read(String path) throws Exception {
-
-        try (IgniteFsInputStream in = ggfs.open(path(path))) {
-            return IOUtils.toString(in, UTF_8);
-        }
-    }
-
-    /**
-     * Test expected failures for 'update properties' operation.
-     *
-     * @param path Path to the file.
-     * @param props File properties to set.
-     * @param msg Failure message if expected exception was not thrown.
-     */
-    private void assertUpdatePropertiesFails(@Nullable final IgniteFsPath path,
-        @Nullable final Map<String, String> props,
-        Class<? extends Throwable> cls, @Nullable String msg) {
-        GridTestUtils.assertThrows(log, new Callable() {
-            @Override public Object call() throws Exception {
-                return ggfs.update(path, props);
-            }
-        }, cls, msg);
-    }
-
-    /**
-     * Test expected failures for 'create' operation.
-     *
-     * @param path File path to create.
-     * @param overwrite Overwrite file if it already exists. Note: you cannot overwrite an existent directory.
-     * @param msg Failure message if expected exception was not thrown.
-     */
-    private void assertCreateFails(final String path, final boolean overwrite, @Nullable String msg) {
-        GridTestUtils.assertThrowsInherited(log, new Callable<Object>() {
-            @Override public Object call() throws Exception {
-                ggfs.create(path(path), overwrite);
-
-                return false;
-            }
-        }, IgniteFsException.class, msg);
-    }
-
-    /**
-     * Test expected failures for 'append' operation.
-     *
-     * @param path File path to append.
-     * @param create Create file if it doesn't exist yet.
-     * @param msg Failure message if expected exception was not thrown.
-     */
-    private void assertAppendFails(final String path, final boolean create, @Nullable String msg) {
-        GridTestUtils.assertThrowsInherited(log, new Callable<Object>() {
-            @Override public Object call() throws Exception {
-                ggfs.append(path(path), create);
-
-                return false;
-            }
-        }, IgniteFsException.class, msg);
-    }
-
-    /**
-     * Test expected failures for 'open' operation.
-     *
-     * @param path File path to read.
-     * @param msg Failure message if expected exception was not thrown.
-     */
-    private void assertOpenFails(final String path, @Nullable String msg) {
-        GridTestUtils.assertThrowsInherited(log, new Callable<Object>() {
-            @Override public Object call() throws Exception {
-                ggfs.open(path(path));
-
-                return false;
-            }
-        }, IgniteCheckedException.class, msg);
-    }
-
-    /**
-     * Validate directory listing.
-     *
-     * @param path Directory path to validate listing for.
-     * @param item List of directory items.
-     * @throws IgniteCheckedException If failed.
-     */
-    private void assertListDir(String path, String... item) throws IgniteCheckedException {
-        Collection<IgniteFsFile> files = ggfs.listFiles(new IgniteFsPath(path));
-
-        List<String> names = new ArrayList<>(item.length);
-
-        for (IgniteFsFile file : files)
-            names.add(file.path().name());
-
-        Arrays.sort(item);
-        Collections.sort(names);
-
-        assertEquals(Arrays.asList(item), names);
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cfcf46df/modules/core/src/test/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsProcessorValidationSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsProcessorValidationSelfTest.java b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsProcessorValidationSelfTest.java
deleted file mode 100644
index af2c409..0000000
--- a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsProcessorValidationSelfTest.java
+++ /dev/null
@@ -1,535 +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.gridgain.grid.kernal.processors.ggfs;
-
-import org.apache.ignite.*;
-import org.apache.ignite.cache.*;
-import org.apache.ignite.configuration.*;
-import org.apache.ignite.fs.*;
-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.gridgain.grid.kernal.processors.cache.*;
-import org.apache.ignite.internal.util.typedef.*;
-
-import java.lang.reflect.*;
-import java.util.*;
-
-import static org.apache.ignite.fs.IgniteFsMode.*;
-import static org.apache.ignite.cache.GridCacheAtomicityMode.*;
-import static org.apache.ignite.cache.GridCacheMode.*;
-
-/**
- * Tests for node validation logic in {@link GridGgfsProcessor}.
- * <p>
- * Tests starting with "testLocal" are checking
- * {@link GridGgfsProcessor#validateLocalGgfsConfigurations(org.apache.ignite.fs.IgniteFsConfiguration[])}.
- * <p>
- * Tests starting with "testRemote" are checking {@link GridGgfsProcessor#checkGgfsOnRemoteNode(org.apache.ignite.cluster.ClusterNode)}.
- */
-public class GridGgfsProcessorValidationSelfTest extends GridGgfsCommonAbstractTest {
-    /** IP finder. */
-    private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true);
-
-    /** Grid #1 config. */
-    private IgniteConfiguration g1Cfg;
-
-    /** Data cache 1 name. */
-    private static final String dataCache1Name = "dataCache1";
-
-    /** Data cache 2 name. */
-    private static final String dataCache2Name = "dataCache2";
-
-    /** Meta cache 1 name. */
-    private static final String metaCache1Name = "metaCache1";
-
-    /** Meta cache 2 name. */
-    private static final String metaCache2Name = "metaCache2";
-
-    /** First GGFS config in grid #1. */
-    private IgniteFsConfiguration g1GgfsCfg1 = new IgniteFsConfiguration();
-
-    /** Second GGFS config in grid#1. */
-    private IgniteFsConfiguration g1GgfsCfg2 = new IgniteFsConfiguration();
-
-    /** {@inheritDoc} */
-    @Override protected void beforeTest() throws Exception {
-        g1Cfg = getConfiguration("g1");
-    }
-
-    /** {@inheritDoc} */
-    @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
-        IgniteConfiguration cfg = super.getConfiguration(gridName);
-
-        TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
-
-        discoSpi.setIpFinder(IP_FINDER);
-
-        cfg.setDiscoverySpi(discoSpi);
-
-        g1GgfsCfg1.setName("g1GgfsCfg1");
-        g1GgfsCfg1.setDataCacheName(dataCache1Name);
-        g1GgfsCfg1.setMetaCacheName(metaCache1Name);
-
-        g1GgfsCfg2.setName("g1GgfsCfg2");
-        g1GgfsCfg2.setDataCacheName(dataCache2Name);
-        g1GgfsCfg2.setMetaCacheName(metaCache2Name);
-
-        cfg.setGgfsConfiguration(g1GgfsCfg1, g1GgfsCfg2);
-
-        cfg.setLocalHost("127.0.0.1");
-
-        return cfg;
-    }
-
-    /** {@inheritDoc} */
-    @Override protected void afterTest() throws Exception {
-        stopAllGrids();
-    }
-
-    /**
-     * Returns a new array that contains the concatenated contents of two arrays.
-     *
-     * @param first the first array of elements to concatenate.
-     * @param second the second array of elements to concatenate.
-     * @param cls
-     * @return Concatenated array.
-     */
-    private <T> T[] concat(T[] first, T[] second, Class<?> cls) {
-        Collection<T> res = new ArrayList<>();
-
-        res.addAll(Arrays.asList(first));
-        res.addAll(Arrays.asList(second));
-
-        return res.toArray((T[]) Array.newInstance(cls, res.size()));
-    }
-
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testLocalIfNoCacheIsConfigured() throws Exception {
-        checkGridStartFails(g1Cfg, "Data cache is not configured locally for GGFS", true);
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testLocalIfNoDataCacheIsConfigured() throws Exception {
-        CacheConfiguration cc = defaultCacheConfiguration();
-
-        cc.setQueryIndexEnabled(false);
-        cc.setName("someName");
-
-        g1Cfg.setCacheConfiguration(cc);
-
-        checkGridStartFails(g1Cfg, "Data cache is not configured locally for GGFS", true);
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testLocalIfNoMetadataCacheIsConfigured() throws Exception {
-        CacheConfiguration cc = defaultCacheConfiguration();
-
-        cc.setQueryIndexEnabled(false);
-        cc.setName(dataCache1Name);
-
-        g1Cfg.setCacheConfiguration(cc);
-
-        checkGridStartFails(g1Cfg, "Metadata cache is not configured locally for GGFS", true);
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testLocalIfAffinityMapperIsWrongClass() throws Exception {
-        g1Cfg.setCacheConfiguration(concat(dataCaches(1024), metaCaches(), CacheConfiguration.class));
-
-        for (CacheConfiguration cc : g1Cfg.getCacheConfiguration())
-            cc.setAffinityMapper(new GridCacheDefaultAffinityKeyMapper());
-
-        checkGridStartFails(g1Cfg, "Invalid GGFS data cache configuration (key affinity mapper class should be", true);
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testLocalIfGgfsConfigsHaveDifferentNames() throws Exception {
-        g1Cfg.setCacheConfiguration(concat(dataCaches(1024), metaCaches(), CacheConfiguration.class));
-
-        String ggfsCfgName = "ggfs-cfg";
-
-        g1GgfsCfg1.setName(ggfsCfgName);
-        g1GgfsCfg2.setName(ggfsCfgName);
-
-        checkGridStartFails(g1Cfg, "Duplicate GGFS name found (check configuration and assign unique name", true);
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testLocalIfQueryIndexingEnabledForDataCache() throws Exception {
-        CacheConfiguration[] dataCaches = dataCaches(1024);
-
-        dataCaches[0].setQueryIndexEnabled(true);
-
-        g1Cfg.setCacheConfiguration(concat(dataCaches, metaCaches(), CacheConfiguration.class));
-
-        checkGridStartFails(g1Cfg, "GGFS data cache cannot start with enabled query indexing", true);
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testLocalIfQueryIndexingEnabledForMetaCache() throws Exception {
-        CacheConfiguration[] metaCaches = metaCaches();
-
-        metaCaches[0].setQueryIndexEnabled(true);
-
-        g1Cfg.setCacheConfiguration(concat(dataCaches(1024), metaCaches, CacheConfiguration.class));
-
-        checkGridStartFails(g1Cfg, "GGFS metadata cache cannot start with enabled query indexing", true);
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    @SuppressWarnings("NullableProblems")
-    public void testLocalNullGgfsNameIsSupported() throws Exception {
-        g1Cfg.setCacheConfiguration(concat(dataCaches(1024), metaCaches(), CacheConfiguration.class));
-
-        g1GgfsCfg1.setName(null);
-
-        assertFalse(G.start(g1Cfg).cluster().nodes().isEmpty());
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testLocalIfOffheapIsDisabledAndMaxSpaceSizeIsGreater() throws Exception {
-        g1Cfg.setCacheConfiguration(concat(dataCaches(1024), metaCaches(), CacheConfiguration.class));
-
-        g1GgfsCfg2.setMaxSpaceSize(999999999999999999L);
-
-        checkGridStartFails(g1Cfg, "Maximum GGFS space size cannot be greater that size of available heap", true);
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testLocalIfOffheapIsEnabledAndMaxSpaceSizeIsGreater() throws Exception {
-        g1Cfg.setCacheConfiguration(concat(dataCaches(1024), metaCaches(), CacheConfiguration.class));
-
-        for (CacheConfiguration cc : g1Cfg.getCacheConfiguration())
-            cc.setOffHeapMaxMemory(1000000);
-
-        g1GgfsCfg2.setMaxSpaceSize(999999999999999999L);
-
-        checkGridStartFails(g1Cfg,
-            "Maximum GGFS space size cannot be greater than size of available heap memory and offheap storage", true);
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testLocalIfBackupsEnabled() throws Exception {
-        g1Cfg.setCacheConfiguration(concat(dataCaches(1024), metaCaches(), CacheConfiguration.class));
-
-        for (CacheConfiguration cc : g1Cfg.getCacheConfiguration()) {
-            cc.setCacheMode(PARTITIONED);
-            cc.setBackups(1);
-        }
-
-        checkGridStartFails(g1Cfg, "GGFS data cache cannot be used with backups", true);
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testLocalIfNonPrimaryModeAndHadoopFileSystemUriIsNull() throws Exception {
-        g1Cfg.setCacheConfiguration(concat(dataCaches(1024), metaCaches(), CacheConfiguration.class));
-
-        g1GgfsCfg2.setDefaultMode(PROXY);
-
-        checkGridStartFails(g1Cfg, "secondaryFileSystem cannot be null when mode is SECONDARY", true);
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testRemoteIfDataBlockSizeDiffers() throws Exception {
-        IgniteConfiguration g2Cfg = getConfiguration("g2");
-
-        g1Cfg.setCacheConfiguration(concat(dataCaches(1024), metaCaches(), CacheConfiguration.class));
-        g2Cfg.setCacheConfiguration(concat(dataCaches(1024), metaCaches(), CacheConfiguration.class));
-
-        IgniteFsConfiguration g2GgfsCfg1 = new IgniteFsConfiguration(g1GgfsCfg1);
-
-        g2GgfsCfg1.setBlockSize(g2GgfsCfg1.getBlockSize() + 100);
-
-        g2Cfg.setGgfsConfiguration(g2GgfsCfg1, g1GgfsCfg2);
-
-        G.start(g1Cfg);
-
-        checkGridStartFails(g2Cfg, "Data block size should be the same on all nodes in grid for GGFS", false);
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testRemoteIfAffinityMapperGroupSizeDiffers() throws Exception {
-        IgniteConfiguration g2Cfg = getConfiguration("g2");
-
-        g1Cfg.setCacheConfiguration(concat(dataCaches(1024), metaCaches(), CacheConfiguration.class));
-        g2Cfg.setCacheConfiguration(concat(dataCaches(4021), metaCaches(), CacheConfiguration.class));
-
-        G.start(g1Cfg);
-
-        checkGridStartFails(g2Cfg, "Affinity mapper group size should be the same on all nodes in grid for GGFS",
-            false);
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testRemoteIfMetaCacheNameDiffers() throws Exception {
-        IgniteConfiguration g2Cfg = getConfiguration("g2");
-
-        IgniteFsConfiguration g2GgfsCfg1 = new IgniteFsConfiguration(g1GgfsCfg1);
-        IgniteFsConfiguration g2GgfsCfg2 = new IgniteFsConfiguration(g1GgfsCfg2);
-
-        g2GgfsCfg1.setMetaCacheName("g2MetaCache1");
-        g2GgfsCfg2.setMetaCacheName("g2MetaCache2");
-
-        g1Cfg.setCacheConfiguration(concat(dataCaches(1024), metaCaches(), CacheConfiguration.class));
-        g2Cfg.setCacheConfiguration(concat(dataCaches(1024), metaCaches("g2MetaCache1", "g2MetaCache2"),
-             CacheConfiguration.class));
-
-        g2Cfg.setGgfsConfiguration(g2GgfsCfg1, g2GgfsCfg2);
-
-        G.start(g1Cfg);
-
-        checkGridStartFails(g2Cfg, "Meta cache name should be the same on all nodes in grid for GGFS", false);
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testRemoteIfMetaCacheNameEquals() throws Exception {
-        IgniteConfiguration g2Cfg = getConfiguration("g2");
-
-        IgniteFsConfiguration g2GgfsCfg1 = new IgniteFsConfiguration(g1GgfsCfg1);
-        IgniteFsConfiguration g2GgfsCfg2 = new IgniteFsConfiguration(g1GgfsCfg2);
-
-        g2GgfsCfg1.setName("g2GgfsCfg1");
-        g2GgfsCfg2.setName("g2GgfsCfg2");
-
-        g2GgfsCfg1.setDataCacheName("g2DataCache1");
-        g2GgfsCfg2.setDataCacheName("g2DataCache2");
-
-        g1Cfg.setCacheConfiguration(concat(dataCaches(1024), metaCaches(), CacheConfiguration.class));
-        g2Cfg.setCacheConfiguration(concat(dataCaches(1024, "g2DataCache1", "g2DataCache2"), metaCaches(),
-             CacheConfiguration.class));
-
-        g2Cfg.setGgfsConfiguration(g2GgfsCfg1, g2GgfsCfg2);
-
-        G.start(g1Cfg);
-
-        checkGridStartFails(g2Cfg, "Meta cache names should be different for different GGFS instances", false);
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testRemoteIfDataCacheNameDiffers() throws Exception {
-        IgniteConfiguration g2Cfg = getConfiguration("g2");
-
-        IgniteFsConfiguration g2GgfsCfg1 = new IgniteFsConfiguration(g1GgfsCfg1);
-        IgniteFsConfiguration g2GgfsCfg2 = new IgniteFsConfiguration(g1GgfsCfg2);
-
-        g2GgfsCfg1.setDataCacheName("g2DataCache1");
-        g2GgfsCfg2.setDataCacheName("g2DataCache2");
-
-        g1Cfg.setCacheConfiguration(concat(dataCaches(1024), metaCaches(), CacheConfiguration.class));
-        g2Cfg.setCacheConfiguration(concat(dataCaches(1024, "g2DataCache1", "g2DataCache2"), metaCaches(),
-             CacheConfiguration.class));
-
-        g2Cfg.setGgfsConfiguration(g2GgfsCfg1, g2GgfsCfg2);
-
-        G.start(g1Cfg);
-
-        checkGridStartFails(g2Cfg, "Data cache name should be the same on all nodes in grid for GGFS", false);
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testRemoteIfDataCacheNameEquals() throws Exception {
-        IgniteConfiguration g2Cfg = getConfiguration("g2");
-
-        IgniteFsConfiguration g2GgfsCfg1 = new IgniteFsConfiguration(g1GgfsCfg1);
-        IgniteFsConfiguration g2GgfsCfg2 = new IgniteFsConfiguration(g1GgfsCfg2);
-
-        g2GgfsCfg1.setName("g2GgfsCfg1");
-        g2GgfsCfg2.setName("g2GgfsCfg2");
-
-        g2GgfsCfg1.setMetaCacheName("g2MetaCache1");
-        g2GgfsCfg2.setMetaCacheName("g2MetaCache2");
-
-        g1Cfg.setCacheConfiguration(concat(dataCaches(1024), metaCaches(), CacheConfiguration.class));
-        g2Cfg.setCacheConfiguration(concat(dataCaches(1024), metaCaches("g2MetaCache1", "g2MetaCache2"),
-             CacheConfiguration.class));
-
-        g2Cfg.setGgfsConfiguration(g2GgfsCfg1, g2GgfsCfg2);
-
-        G.start(g1Cfg);
-
-        checkGridStartFails(g2Cfg, "Data cache names should be different for different GGFS instances", false);
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testRemoteIfDefaultModeDiffers() throws Exception {
-        IgniteConfiguration g2Cfg = getConfiguration("g2");
-
-        IgniteFsConfiguration g2GgfsCfg1 = new IgniteFsConfiguration(g1GgfsCfg1);
-        IgniteFsConfiguration g2GgfsCfg2 = new IgniteFsConfiguration(g1GgfsCfg2);
-
-        g1GgfsCfg1.setDefaultMode(DUAL_ASYNC);
-        g1GgfsCfg2.setDefaultMode(DUAL_ASYNC);
-
-        g2GgfsCfg1.setDefaultMode(DUAL_SYNC);
-        g2GgfsCfg2.setDefaultMode(DUAL_SYNC);
-
-        g1Cfg.setCacheConfiguration(concat(dataCaches(1024), metaCaches(), CacheConfiguration.class));
-        g2Cfg.setCacheConfiguration(concat(dataCaches(1024), metaCaches(), CacheConfiguration.class));
-
-        g2Cfg.setGgfsConfiguration(g2GgfsCfg1, g2GgfsCfg2);
-
-        G.start(g1Cfg);
-
-        checkGridStartFails(g2Cfg, "Default mode should be the same on all nodes in grid for GGFS", false);
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testRemoteIfPathModeDiffers() throws Exception {
-        IgniteConfiguration g2Cfg = getConfiguration("g2");
-
-        IgniteFsConfiguration g2GgfsCfg1 = new IgniteFsConfiguration(g1GgfsCfg1);
-        IgniteFsConfiguration g2GgfsCfg2 = new IgniteFsConfiguration(g1GgfsCfg2);
-
-        g2GgfsCfg1.setPathModes(Collections.singletonMap("/somePath", DUAL_SYNC));
-        g2GgfsCfg2.setPathModes(Collections.singletonMap("/somePath", DUAL_SYNC));
-
-        g1Cfg.setCacheConfiguration(concat(dataCaches(1024), metaCaches(), CacheConfiguration.class));
-        g2Cfg.setCacheConfiguration(concat(dataCaches(1024), metaCaches(), CacheConfiguration.class));
-
-        g2Cfg.setGgfsConfiguration(g2GgfsCfg1, g2GgfsCfg2);
-
-        G.start(g1Cfg);
-
-        checkGridStartFails(g2Cfg, "Path modes should be the same on all nodes in grid for GGFS", false);
-    }
-
-    /**
-     * Checks that the given grid configuration will lead to {@link IgniteCheckedException} upon grid startup.
-     *
-     * @param cfg Grid configuration to check.
-     * @param excMsgSnippet Root cause (assertion) exception message snippet.
-     * @param testLoc {@code True} if checking is done for "testLocal" tests.
-     */
-    private void checkGridStartFails(IgniteConfiguration cfg, CharSequence excMsgSnippet, boolean testLoc) {
-        assertNotNull(cfg);
-        assertNotNull(excMsgSnippet);
-
-        try {
-            G.start(cfg);
-
-            fail("No exception has been thrown.");
-        }
-        catch (IgniteCheckedException e) {
-            if (testLoc) {
-                if ("Failed to start processor: GridProcessorAdapter []".equals(e.getMessage()) &&
-                    e.getCause().getMessage().contains(excMsgSnippet))
-                    return; // Expected exception.
-            }
-            else if (e.getMessage().contains(excMsgSnippet))
-                return; // Expected exception.
-
-            error("Caught unexpected exception.", e);
-
-            fail();
-        }
-    }
-
-    /**
-     * @param grpSize Group size to use in {@link org.apache.ignite.fs.IgniteFsGroupDataBlocksKeyMapper}.
-     * @param cacheNames 2 Optional caches names.
-     * @return 2 preconfigured data caches.
-     */
-    private CacheConfiguration[] dataCaches(int grpSize, String... cacheNames) {
-        assertTrue(F.isEmpty(cacheNames) || cacheNames.length == 2);
-
-        if (F.isEmpty(cacheNames))
-            cacheNames = new String[] {dataCache1Name, dataCache2Name};
-
-        CacheConfiguration[] res = new CacheConfiguration[cacheNames.length];
-
-        for (int i = 0; i < cacheNames.length; i++) {
-            CacheConfiguration dataCache = defaultCacheConfiguration();
-
-            dataCache.setName(cacheNames[i]);
-            dataCache.setAffinityMapper(new IgniteFsGroupDataBlocksKeyMapper(grpSize));
-            dataCache.setAtomicityMode(TRANSACTIONAL);
-            dataCache.setQueryIndexEnabled(false);
-
-            res[i] = dataCache;
-        }
-
-        return res;
-    }
-
-    /**
-     * @param cacheNames 2 Optional caches names.
-     * @return 2 preconfigured meta caches.
-     */
-    private CacheConfiguration[] metaCaches(String... cacheNames) {
-        assertTrue(F.isEmpty(cacheNames) || cacheNames.length == 2);
-
-        if (F.isEmpty(cacheNames))
-            cacheNames = new String[] {metaCache1Name, metaCache2Name};
-
-        CacheConfiguration[] res = new CacheConfiguration[cacheNames.length];
-
-        for (int i = 0; i < cacheNames.length; i++) {
-            CacheConfiguration metaCache = defaultCacheConfiguration();
-
-            metaCache.setName(cacheNames[i]);
-            metaCache.setAtomicityMode(TRANSACTIONAL);
-            metaCache.setQueryIndexEnabled(false);
-
-            res[i] = metaCache;
-        }
-
-        return res;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cfcf46df/modules/core/src/test/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsServerManagerIpcEndpointRegistrationAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsServerManagerIpcEndpointRegistrationAbstractSelfTest.java b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsServerManagerIpcEndpointRegistrationAbstractSelfTest.java
deleted file mode 100644
index 9f93d3d..0000000
--- a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsServerManagerIpcEndpointRegistrationAbstractSelfTest.java
+++ /dev/null
@@ -1,185 +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.gridgain.grid.kernal.processors.ggfs;
-
-import org.apache.ignite.*;
-import org.apache.ignite.cache.*;
-import org.apache.ignite.configuration.*;
-import org.apache.ignite.fs.*;
-import org.apache.ignite.internal.*;
-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.internal.processors.port.*;
-import org.apache.ignite.internal.util.ipc.loopback.*;
-import org.apache.ignite.internal.util.ipc.shmem.*;
-import org.apache.ignite.internal.util.typedef.*;
-import org.apache.ignite.internal.util.typedef.internal.*;
-import org.jetbrains.annotations.*;
-
-import java.util.*;
-import java.util.concurrent.atomic.*;
-
-import static org.apache.ignite.fs.IgniteFsConfiguration.*;
-import static org.apache.ignite.cache.GridCacheAtomicityMode.*;
-
-/**
- * Base test class for {@link GridGgfsServer} checking IPC endpoint registrations.
- */
-public abstract class GridGgfsServerManagerIpcEndpointRegistrationAbstractSelfTest extends GridGgfsCommonAbstractTest {
-    /** IP finder. */
-    private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true);
-
-    private static final AtomicInteger mgmtPort = new AtomicInteger(DFLT_MGMT_PORT);
-
-    /** {@inheritDoc} */
-    @Override protected void afterTest() throws Exception {
-        stopAllGrids();
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testLoopbackEndpointsRegistration() throws Exception {
-        IgniteConfiguration cfg = gridConfiguration();
-
-        cfg.setGgfsConfiguration(
-            igniteFsConfiguration("tcp", DFLT_IPC_PORT, null)
-        );
-
-        G.start(cfg);
-
-        T2<Integer, Integer> res = checkRegisteredIpcEndpoints();
-
-        // One regular enpoint + one management endpoint.
-        assertEquals(2, res.get1().intValue());
-        assertEquals(0, res.get2().intValue());
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testLoopbackEndpointsCustomHostRegistration() throws Exception {
-        IgniteConfiguration cfg = gridConfiguration();
-
-        cfg.setGgfsConfiguration(
-            igniteFsConfiguration("tcp", DFLT_IPC_PORT, "127.0.0.1"),
-            igniteFsConfiguration("tcp", DFLT_IPC_PORT + 1, U.getLocalHost().getHostName()));
-
-        G.start(cfg);
-
-        T2<Integer, Integer> res = checkRegisteredIpcEndpoints();
-
-        // Two regular endpoints + two management endpoints.
-        assertEquals(4, res.get1().intValue());
-        assertEquals(0, res.get2().intValue());
-    }
-
-    /**
-     * Counts all registered IPC endpoints.
-     *
-     * @return Tuple2 where (tcp endpoints count, shmem endpoints count).
-     */
-    protected T2<Integer, Integer> checkRegisteredIpcEndpoints() throws Exception {
-        GridKernalContext ctx = ((GridKernal)grid()).context();
-
-        int tcp = 0;
-        int shmem = 0;
-
-        for (GridPortRecord record : ctx.ports().records()) {
-            if (record.clazz() == GridIpcSharedMemoryServerEndpoint.class)
-                shmem++;
-            else if (record.clazz() == GridIpcServerTcpEndpoint.class)
-                tcp++;
-        }
-
-        return new T2<>(tcp, shmem);
-    }
-
-    /**
-     * Creates base grid configuration.
-     *
-     * @return Base grid configuration.
-     * @throws Exception In case of any error.
-     */
-    protected IgniteConfiguration gridConfiguration() throws Exception {
-        IgniteConfiguration cfg = getConfiguration(getTestGridName());
-
-        TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
-        discoSpi.setIpFinder(IP_FINDER);
-
-        cfg.setDiscoverySpi(discoSpi);
-
-        CacheConfiguration cc = defaultCacheConfiguration();
-
-        cc.setName("partitioned");
-        cc.setCacheMode(GridCacheMode.PARTITIONED);
-        cc.setAffinityMapper(new IgniteFsGroupDataBlocksKeyMapper(128));
-        cc.setBackups(0);
-        cc.setAtomicityMode(TRANSACTIONAL);
-        cc.setQueryIndexEnabled(false);
-
-        CacheConfiguration metaCfg = defaultCacheConfiguration();
-
-        metaCfg.setName("replicated");
-        metaCfg.setCacheMode(GridCacheMode.REPLICATED);
-        metaCfg.setAtomicityMode(TRANSACTIONAL);
-        metaCfg.setQueryIndexEnabled(false);
-
-        cfg.setCacheConfiguration(metaCfg, cc);
-
-        return cfg;
-    }
-
-    /**
-     * Creates test-purposed IgniteFsConfiguration.
-     *
-     * @param endPntType End point type.
-     * @param endPntPort End point port.
-     * @param endPntHost End point host.
-     * @return test-purposed IgniteFsConfiguration.
-     */
-    protected IgniteFsConfiguration igniteFsConfiguration(@Nullable String endPntType, @Nullable Integer endPntPort,
-        @Nullable String endPntHost) throws IgniteCheckedException {
-        HashMap<String, String> endPntCfg = null;
-
-        if (endPntType != null) {
-            endPntCfg = new HashMap<>();
-
-            endPntCfg.put("type", endPntType);
-
-            if (endPntPort != null)
-                endPntCfg.put("port", String.valueOf(endPntPort));
-
-            if (endPntHost != null)
-                endPntCfg.put("host", endPntHost);
-        }
-
-        IgniteFsConfiguration ggfsConfiguration = new IgniteFsConfiguration();
-
-        ggfsConfiguration.setDataCacheName("partitioned");
-        ggfsConfiguration.setMetaCacheName("replicated");
-        ggfsConfiguration.setName("ggfs" + UUID.randomUUID());
-        ggfsConfiguration.setManagementPort(mgmtPort.getAndIncrement());
-
-        if (endPntCfg != null)
-            ggfsConfiguration.setIpcEndpointConfiguration(endPntCfg);
-
-        return ggfsConfiguration;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cfcf46df/modules/core/src/test/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsServerManagerIpcEndpointRegistrationOnLinuxAndMacSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsServerManagerIpcEndpointRegistrationOnLinuxAndMacSelfTest.java b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsServerManagerIpcEndpointRegistrationOnLinuxAndMacSelfTest.java
deleted file mode 100644
index 7001068..0000000
--- a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsServerManagerIpcEndpointRegistrationOnLinuxAndMacSelfTest.java
+++ /dev/null
@@ -1,50 +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.gridgain.grid.kernal.processors.ggfs;
-
-import org.apache.ignite.configuration.*;
-import org.apache.ignite.internal.util.typedef.*;
-
-import static org.apache.ignite.fs.IgniteFsConfiguration.*;
-
-/**
- * Tests for {@link GridGgfsServer} that checks all IPC endpoint registration types
- * permitted for Linux and Mac OS.
- */
-public class GridGgfsServerManagerIpcEndpointRegistrationOnLinuxAndMacSelfTest
-    extends GridGgfsServerManagerIpcEndpointRegistrationAbstractSelfTest {
-    /**
-     * @throws Exception If failed.
-     */
-    public void testLoopbackAndShmemEndpointsRegistration() throws Exception {
-        IgniteConfiguration cfg = gridConfiguration();
-
-        cfg.setGgfsConfiguration(
-            igniteFsConfiguration(null, null, null), // Check null IPC endpoint config won't bring any hassles.
-            igniteFsConfiguration("tcp", DFLT_IPC_PORT + 1, null),
-            igniteFsConfiguration("shmem", DFLT_IPC_PORT + 2, null));
-
-        G.start(cfg);
-
-        T2<Integer, Integer> res = checkRegisteredIpcEndpoints();
-
-        // 1 regular + 3 management TCP endpoins.
-        assertEquals(4, res.get1().intValue());
-        assertEquals(2, res.get2().intValue());
-    }
-}


Mime
View raw message