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 2019/03/01 13:42:53 UTC

[ignite] branch ignite-11461-java11 updated: IGNITE-11461: Automatic modules support for Apache Ignite: First persistent store test

This is an automated email from the ASF dual-hosted git repository.

dpavlov pushed a commit to branch ignite-11461-java11
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/ignite-11461-java11 by this push:
     new 0d3e177  IGNITE-11461: Automatic modules support for Apache Ignite: First persistent store test
0d3e177 is described below

commit 0d3e17723e036d9192c0dbc720ac1e5c2a61118a
Author: Dmitriy Pavlov <dp...@apache.org>
AuthorDate: Fri Mar 1 16:42:35 2019 +0300

    IGNITE-11461: Automatic modules support for Apache Ignite: First persistent store test
---
 .../modulestest/IgniteLaunchInModularEnvTest.java  | 76 ++++++++++++++++++++++
 .../ignite/modulestest/ModulesLaunchTest.java      | 40 ------------
 2 files changed, 76 insertions(+), 40 deletions(-)

diff --git a/modules/dev-utils/ignite-modules-test/src/test/java/org/apache/ignite/modulestest/IgniteLaunchInModularEnvTest.java b/modules/dev-utils/ignite-modules-test/src/test/java/org/apache/ignite/modulestest/IgniteLaunchInModularEnvTest.java
new file mode 100644
index 0000000..600dcf8
--- /dev/null
+++ b/modules/dev-utils/ignite-modules-test/src/test/java/org/apache/ignite/modulestest/IgniteLaunchInModularEnvTest.java
@@ -0,0 +1,76 @@
+/*
+ * 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.modulestest;
+
+import java.util.Collections;
+import org.apache.ignite.Ignite;
+import org.apache.ignite.Ignition;
+import org.apache.ignite.configuration.DataRegionConfiguration;
+import org.apache.ignite.configuration.DataStorageConfiguration;
+import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder;
+import org.junit.Test;
+
+/**
+ *
+ */
+public class IgniteLaunchInModularEnvTest {
+    /**
+     * Tests ignite startup without any features used.
+     */
+    @Test
+    public void testSimpleLaunch() {
+        IgniteConfiguration cfg = igniteConfiguration();
+
+        Ignite ignite = Ignition.start(cfg);
+
+        ignite.close();
+    }
+
+    @Test
+    public void testPdsEnabledSimpleLaunch() {
+        IgniteConfiguration cfg = igniteConfiguration();
+
+        DataRegionConfiguration regCfg = new DataRegionConfiguration();
+        regCfg.setMaxSize(256L*1024*1024);
+        regCfg.setPersistenceEnabled(true);
+
+        cfg.setDataStorageConfiguration(new DataStorageConfiguration().setDefaultDataRegionConfiguration(regCfg));
+
+        Ignite ignite = Ignition.start(cfg);
+
+        ignite.cluster().active(true);
+
+        String cacheName = "CACHE";
+        ignite.getOrCreateCache(cacheName).put("key", "value");
+        ignite.close();
+    }
+
+    /**
+     * @return default configuration for test without spring module.
+     */
+    private IgniteConfiguration igniteConfiguration() {
+        IgniteConfiguration cfg = new IgniteConfiguration();
+
+        TcpDiscoveryVmIpFinder finder = new TcpDiscoveryVmIpFinder();
+        finder.setAddresses(Collections.singletonList("127.0.0.1"));
+        cfg.setDiscoverySpi(new TcpDiscoverySpi().setIpFinder(finder));
+        return cfg;
+    }
+}
diff --git a/modules/dev-utils/ignite-modules-test/src/test/java/org/apache/ignite/modulestest/ModulesLaunchTest.java b/modules/dev-utils/ignite-modules-test/src/test/java/org/apache/ignite/modulestest/ModulesLaunchTest.java
deleted file mode 100644
index 32cce41..0000000
--- a/modules/dev-utils/ignite-modules-test/src/test/java/org/apache/ignite/modulestest/ModulesLaunchTest.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.modulestest;
-
-import org.apache.ignite.Ignite;
-import org.apache.ignite.Ignition;
-import org.apache.ignite.configuration.IgniteConfiguration;
-import org.junit.Test;
-
-/**
- *
- */
-public class ModulesLaunchTest {
-    /**
-     * Tests ignite startup without any features used.
-     */
-    @Test
-    public void testSimpleLaunch() {
-        IgniteConfiguration cfg = new IgniteConfiguration();
-
-        Ignite ignite = Ignition.start(cfg);
-
-        ignite.close();
-    }
-}