You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by dp...@apache.org on 2018/04/02 16:44:31 UTC

ignite git commit: IGNITE-6802 Test of NullPointerException when WAL store and WAL archive paths are same - Fixes #3021.

Repository: ignite
Updated Branches:
  refs/heads/master 6875ac3e0 -> 631ff3ad0


IGNITE-6802 Test of NullPointerException when WAL store and WAL archive paths are same - Fixes #3021.

Signed-off-by: dpavlov <dp...@gridgain.com>


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

Branch: refs/heads/master
Commit: 631ff3ad082330ec7b8165271be131399a2d8957
Parents: 6875ac3
Author: Dmitrii Ryabov <So...@gmail.com>
Authored: Mon Apr 2 19:43:53 2018 +0300
Committer: dpavlov <dp...@gridgain.com>
Committed: Mon Apr 2 19:43:53 2018 +0300

----------------------------------------------------------------------
 .../cache/persistence/db/wal/WalPathsTest.java  | 86 ++++++++++++++++++++
 .../IgnitePdsWithIndexingCoreTestSuite.java     |  2 +
 2 files changed, 88 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/631ff3ad/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/WalPathsTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/WalPathsTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/WalPathsTest.java
new file mode 100644
index 0000000..7141fed
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/WalPathsTest.java
@@ -0,0 +1,86 @@
+/*
+ * 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.persistence.db.wal;
+
+import java.io.File;
+import org.apache.ignite.configuration.DataRegionConfiguration;
+import org.apache.ignite.configuration.DataStorageConfiguration;
+import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.internal.util.typedef.internal.U;
+import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+
+/** Tests equal paths to WAL storage and WAL archive. */
+public class WalPathsTest extends GridCommonAbstractTest {
+    /** WalPath and WalArchivePath. */
+    private File walDir;
+
+    /** {@inheritDoc} */
+    @Override protected void afterTest() throws Exception {
+        super.afterTest();
+
+        stopAllGrids();
+
+        U.delete(walDir);
+    }
+
+    /**
+     * @param relativePath {@code True} - if wal archive path should be relative, {@code false} - for absolute path.
+     * @return Ignite configuration with the same path to wal store and wal archive.
+     * @throws Exception If failed.
+     */
+    private IgniteConfiguration getConfig(boolean relativePath) throws Exception {
+        IgniteConfiguration cfg = getConfiguration();
+
+        DataStorageConfiguration dsCfg = new DataStorageConfiguration();
+
+        dsCfg.setDefaultDataRegionConfiguration(new DataRegionConfiguration()
+            .setPersistenceEnabled(true)
+            .setMaxSize(200 * 1024 * 1024));
+
+        walDir = new File(U.defaultWorkDirectory(), getClass().getSimpleName());
+
+        dsCfg.setWalPath(walDir.getAbsolutePath());
+        dsCfg.setWalArchivePath(relativePath ? getClass().getSimpleName() : walDir.getAbsolutePath());
+
+        cfg.setDataStorageConfiguration(dsCfg);
+
+        return cfg;
+    }
+
+    /**
+     * Tests equal paths to the same directory.
+     *
+     * @throws Exception If failed.
+     */
+    public void testWalStoreAndArchivePathsEquality() throws Exception {
+        IgniteConfiguration cfg = getConfig(false);
+
+        startGrid(cfg);
+    }
+
+    /**
+     * Tests absolute and relative paths to the same directory.
+     *
+     * @throws Exception If failed.
+     */
+    public void testWalStoreAndArchiveAbsolutAndRelativePathsEquality() throws Exception {
+        final IgniteConfiguration cfg = getConfig(true);
+
+        startGrid(cfg);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/631ff3ad/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgnitePdsWithIndexingCoreTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgnitePdsWithIndexingCoreTestSuite.java b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgnitePdsWithIndexingCoreTestSuite.java
index d3256c2..447b622 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgnitePdsWithIndexingCoreTestSuite.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgnitePdsWithIndexingCoreTestSuite.java
@@ -33,6 +33,7 @@ import org.apache.ignite.internal.processors.cache.persistence.db.file.IgnitePds
 import org.apache.ignite.internal.processors.cache.persistence.db.wal.IgniteWalRecoveryPPCTest;
 import org.apache.ignite.internal.processors.cache.persistence.db.wal.IgniteWalRecoveryTest;
 import org.apache.ignite.internal.processors.cache.persistence.db.wal.IgniteWalRecoveryWithCompactionTest;
+import org.apache.ignite.internal.processors.cache.persistence.db.wal.WalPathsTest;
 import org.apache.ignite.internal.processors.cache.persistence.db.wal.WalRecoveryTxLogicalRecordsTest;
 
 /**
@@ -50,6 +51,7 @@ public class IgnitePdsWithIndexingCoreTestSuite extends TestSuite {
         suite.addTestSuite(IgnitePdsPageEvictionTest.class);
         suite.addTestSuite(IgnitePdsMultiNodePutGetRestartTest.class);
         suite.addTestSuite(IgnitePersistentStoreCacheGroupsTest.class);
+        suite.addTestSuite(WalPathsTest.class);
         suite.addTestSuite(WalRecoveryTxLogicalRecordsTest.class);
 
         suite.addTestSuite(IgniteWalRecoveryTest.class);