ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [2/2] incubator-ignite git commit: #ignite-gg-10369: Move test from examples.
Date Thu, 28 May 2015 15:21:54 GMT
#ignite-gg-10369: Move test from examples.


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

Branch: refs/heads/ignite-gg-10369
Commit: f23566ef00849adf99d526fbe775761818966a90
Parents: b62bc14
Author: ivasilinets <ivasilinets@gridgain.com>
Authored: Thu May 28 18:19:37 2015 +0300
Committer: ivasilinets <ivasilinets@gridgain.com>
Committed: Thu May 28 18:19:37 2015 +0300

----------------------------------------------------------------------
 .../org/apache/ignite/jvmtest/StartNode.java    | 59 ++++++++++++++++++++
 1 file changed, 59 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f23566ef/modules/core/src/test/java/org/apache/ignite/jvmtest/StartNode.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/jvmtest/StartNode.java b/modules/core/src/test/java/org/apache/ignite/jvmtest/StartNode.java
new file mode 100644
index 0000000..ab35934
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/jvmtest/StartNode.java
@@ -0,0 +1,59 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.jvmtest;
+
+import org.apache.ignite.*;
+import org.apache.ignite.configuration.*;
+import org.apache.ignite.spi.discovery.tcp.*;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*;
+
+import java.util.*;
+
+/**
+ * Test class to start node in GridJavaProcess.
+ */
+public class StartNode {
+    /**
+     * @return Configuration.
+     */
+    public static IgniteConfiguration createConfiguration() {
+        IgniteConfiguration cfg = new IgniteConfiguration();
+
+        cfg.setPeerClassLoadingEnabled(true);
+
+        cfg.setLocalHost("127.0.0.1");
+
+        TcpDiscoverySpi disco = new TcpDiscoverySpi();
+
+        disco.setIpFinderCleanFrequency(1000);
+
+        TcpDiscoveryVmIpFinder ipFinder = new TcpDiscoveryVmIpFinder();
+
+        ipFinder.setAddresses(Arrays.asList("127.0.0.1:47500..47509"));
+
+        disco.setIpFinder(ipFinder);
+
+        cfg.setDiscoverySpi(disco);
+
+        return cfg;
+    }
+
+    public static void main(String[] args) {
+        Ignition.start(createConfiguration());
+    }
+}


Mime
View raw message