#ignite-gg-10369: Move test from examples. (cherry picked from commit f23566e)
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/bcb9668f Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/bcb9668f Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/bcb9668f Branch: refs/heads/ignite-gg-10369-2 Commit: bcb9668f1355c90d351a24afe8cf377af4302405 Parents: 8faa72c Author: ivasilinets <[email protected]> Authored: Thu May 28 18:19:37 2015 +0300 Committer: ivasilinets <[email protected]> Committed: Fri May 29 15:01:52 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/bcb9668f/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()); + } +}
