# ignite-648: remove from spring
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/53b04a30 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/53b04a30 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/53b04a30 Branch: refs/heads/ignite-648 Commit: 53b04a30d9bcaefa7fbc5ebf11a77f793138f7e4 Parents: 54365d9 Author: Artem Shutak <ashu...@gridgain.com> Authored: Tue Apr 21 11:47:38 2015 +0300 Committer: Artem Shutak <ashu...@gridgain.com> Committed: Tue Apr 21 11:47:38 2015 +0300 ---------------------------------------------------------------------- .../CachePartitionedMultyJvmSelfTest.java | 40 --------- .../ignite/internal/multijvm/CheckInCache.java | 41 ---------- .../ignite/internal/multijvm/MultiJvmTest.java | 85 -------------------- .../ignite/internal/multijvm/PutInCache.java | 36 --------- .../ignite/internal/multijvm/example-cache.xml | 75 ----------------- 5 files changed, 277 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/53b04a30/modules/spring/src/test/java/org/apache/ignite/internal/multijvm/CachePartitionedMultyJvmSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/spring/src/test/java/org/apache/ignite/internal/multijvm/CachePartitionedMultyJvmSelfTest.java b/modules/spring/src/test/java/org/apache/ignite/internal/multijvm/CachePartitionedMultyJvmSelfTest.java deleted file mode 100644 index bb25f98..0000000 --- a/modules/spring/src/test/java/org/apache/ignite/internal/multijvm/CachePartitionedMultyJvmSelfTest.java +++ /dev/null @@ -1,40 +0,0 @@ -/* @java.file.header */ - -/* _________ _____ __________________ _____ - * __ ____/___________(_)______ /__ ____/______ ____(_)_______ - * _ / __ __ ___/__ / _ __ / _ / __ _ __ `/__ / __ __ \ - * / /_/ / _ / _ / / /_/ / / /_/ / / /_/ / _ / _ / / / - * \____/ /_/ /_/ \_,__/ \____/ \__,_/ /_/ /_/ /_/ - */ - -package org.apache.ignite.internal.multijvm; - -/** - * Test cases for multi-jvm tests. - */ -public class CachePartitionedMultyJvmSelfTest extends MultiJvmTest{ - private static final String IGNITE_NODE_1 = "IGNITE_NODE_1"; - private static final String IGNITE_NODE_2 = "IGNITE_NODE_2"; - private static final String IGNITE_NODE_3 = "IGNITE_NODE_3"; - private static final String CFG = "modules/spring/src/test/java/org/apache/ignite/internal/multijvm/" + - "example-cache.xml"; - - @Override protected void beforeTestsStarted() throws Exception { - runIgniteProcess(IGNITE_NODE_1, CFG); - runIgniteProcess(IGNITE_NODE_2, CFG); - runIgniteProcess(IGNITE_NODE_3, CFG); - } - - /** - * @throws Exception If test fails. - */ - public void testMultiJvmPut() throws Exception { - executeTask(IGNITE_NODE_1, PutInCache.class, 1); - - executeTask(IGNITE_NODE_1, CheckInCache.class, 1); - - executeTask(IGNITE_NODE_2, CheckInCache.class, 1); - - executeTask(IGNITE_NODE_3, CheckInCache.class, 1); - } -} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/53b04a30/modules/spring/src/test/java/org/apache/ignite/internal/multijvm/CheckInCache.java ---------------------------------------------------------------------- diff --git a/modules/spring/src/test/java/org/apache/ignite/internal/multijvm/CheckInCache.java b/modules/spring/src/test/java/org/apache/ignite/internal/multijvm/CheckInCache.java deleted file mode 100644 index 031cfd0..0000000 --- a/modules/spring/src/test/java/org/apache/ignite/internal/multijvm/CheckInCache.java +++ /dev/null @@ -1,41 +0,0 @@ -/* @java.file.header */ - -/* _________ _____ __________________ _____ - * __ ____/___________(_)______ /__ ____/______ ____(_)_______ - * _ / __ __ ___/__ / _ __ / _ / __ _ __ `/__ / __ __ \ - * / /_/ / _ / _ / / /_/ / / /_/ / / /_/ / _ / _ / / / - * \____/ /_/ /_/ \_,__/ \____/ \__,_/ /_/ /_/ /_/ - */ - -package org.apache.ignite.internal.multijvm; - -import org.apache.ignite.*; -import org.apache.ignite.internal.util.typedef.*; - -import static junit.framework.TestCase.*; - -/** - * TODO: Add class description. - * - * @author @java.author - * @version @java.version - */ -public class CheckInCache implements IgniteNodeRunner.Task { - /** {@inheritDoc} */ - @Override public boolean execute(Ignite ignite, String... args) { - int cnt = Integer.valueOf(args[0]); - - IgniteCache<Integer, String> cache = ignite.cache(null); - - for (int i = 1; i <= cnt; i++) { - String v = cache.get(i); - - assertNotNull(v); - assertEquals("val" + i, v); - - X.println(">>>>> Got=" + "val" + i); - } - - return true; - } -} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/53b04a30/modules/spring/src/test/java/org/apache/ignite/internal/multijvm/MultiJvmTest.java ---------------------------------------------------------------------- diff --git a/modules/spring/src/test/java/org/apache/ignite/internal/multijvm/MultiJvmTest.java b/modules/spring/src/test/java/org/apache/ignite/internal/multijvm/MultiJvmTest.java deleted file mode 100644 index 69803e2..0000000 --- a/modules/spring/src/test/java/org/apache/ignite/internal/multijvm/MultiJvmTest.java +++ /dev/null @@ -1,85 +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.internal.multijvm; - -import org.apache.ignite.internal.util.*; -import org.apache.ignite.lang.*; -import org.apache.ignite.testframework.junits.common.*; - -import java.io.*; -import java.util.*; - -/** - * Multi JVM tests. - */ -public class MultiJvmTest extends GridCommonAbstractTest { - /** Proces name to process map. */ - private final Map<String, GridJavaProcess> nodes = new HashMap<>(); - - @Override protected void afterTestsStopped() throws Exception { - for (GridJavaProcess process : nodes.values()) - process.kill(); - - nodes.clear(); - - super.afterTestsStopped(); - } - - protected GridJavaProcess runIgniteProcess(final String nodeName, String cfg) throws Exception { - GridJavaProcess ps = GridJavaProcess.exec( - IgniteNodeRunner.class, - cfg, // Params. - log, - // Optional closure to be called each time wrapped process prints line to system.out or system.err. - new IgniteInClosure<String>() { - @Override public void apply(String s) { - log.info("[" + nodeName + "] " + s); - } - }, - null, - Collections.<String>emptyList(), // JVM Args. - System.getProperty("surefire.test.class.path") - ); - - nodes.put(nodeName, ps); - - return ps; - } - - protected void executeTask(String nodeName, Class<? extends IgniteNodeRunner.Task> taskCls, - Object... args) throws Exception { - GridJavaProcess proc = nodes.get(nodeName); - - OutputStream os = proc.getProcess().getOutputStream(); - - String argsAsStr = ""; - - for (Object arg : args) - argsAsStr += arg.toString(); - - OutputStreamWriter writer = new OutputStreamWriter(os); - - writer.write(IgniteNodeRunner.EXECUTE_TASK + taskCls.getName() + IgniteNodeRunner.TASK_ARGS + argsAsStr + '\n'); - - writer.flush(); - - // Wait for finish. - Thread.sleep(3_000); - } - -} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/53b04a30/modules/spring/src/test/java/org/apache/ignite/internal/multijvm/PutInCache.java ---------------------------------------------------------------------- diff --git a/modules/spring/src/test/java/org/apache/ignite/internal/multijvm/PutInCache.java b/modules/spring/src/test/java/org/apache/ignite/internal/multijvm/PutInCache.java deleted file mode 100644 index 9cc9c0d..0000000 --- a/modules/spring/src/test/java/org/apache/ignite/internal/multijvm/PutInCache.java +++ /dev/null @@ -1,36 +0,0 @@ -/* @java.file.header */ - -/* _________ _____ __________________ _____ - * __ ____/___________(_)______ /__ ____/______ ____(_)_______ - * _ / __ __ ___/__ / _ __ / _ / __ _ __ `/__ / __ __ \ - * / /_/ / _ / _ / / /_/ / / /_/ / / /_/ / _ / _ / / / - * \____/ /_/ /_/ \_,__/ \____/ \__,_/ /_/ /_/ /_/ - */ - -package org.apache.ignite.internal.multijvm; - -import org.apache.ignite.*; -import org.apache.ignite.internal.util.typedef.*; - -/** - * TODO: Add class description. - * - * @author @java.author - * @version @java.version - */ -public class PutInCache implements IgniteNodeRunner.Task { - /** {@inheritDoc} */ - @Override public boolean execute(Ignite ignite, String... args) { - int cnt = Integer.valueOf(args[0]); - - IgniteCache<Integer, String> cache = ignite.cache(null); - - for (int i = 1; i <= cnt; i++) { - cache.put(i, "val" + i); - - X.println(">>>>> Put=" + "val" + i); - } - - return true; - } -} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/53b04a30/modules/spring/src/test/java/org/apache/ignite/internal/multijvm/example-cache.xml ---------------------------------------------------------------------- diff --git a/modules/spring/src/test/java/org/apache/ignite/internal/multijvm/example-cache.xml b/modules/spring/src/test/java/org/apache/ignite/internal/multijvm/example-cache.xml deleted file mode 100644 index cbc4b40..0000000 --- a/modules/spring/src/test/java/org/apache/ignite/internal/multijvm/example-cache.xml +++ /dev/null @@ -1,75 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<!-- - 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. ---> - -<!-- - Ignite Spring configuration file to startup Ignite cache. - - This file demonstrates how to configure cache using Spring. Provided cache - will be created on node startup. - - Use this configuration file when running HTTP REST examples (see 'examples/rest' folder). - - When starting a standalone node, you need to execute the following command: - {IGNITE_HOME}/bin/ignite.{bat|sh} examples/config/example-cache.xml - - When starting Ignite from Java IDE, pass path to this file to Ignition: - Ignition.start("examples/config/example-cache.xml"); ---> -<beans xmlns="http://www.springframework.org/schema/beans" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation=" - http://www.springframework.org/schema/beans - http://www.springframework.org/schema/beans/spring-beans.xsd"> - <bean id="ignite.cfg" class="org.apache.ignite.configuration.IgniteConfiguration"> - <property name="localHost" value="127.0.0.1"/> - - <property name="cacheConfiguration"> - <list> - <!-- Partitioned cache example configuration (Atomic mode). --> - <bean class="org.apache.ignite.configuration.CacheConfiguration"> - <property name="atomicityMode" value="ATOMIC"/> - <property name="backups" value="1"/> - </bean> - </list> - </property> - - <!-- Explicitly configure TCP discovery SPI to provide list of initial nodes. --> - <property name="discoverySpi"> - <bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi"> - <property name="ipFinder"> - <!-- - Ignite provides several options for automatic discovery that can be used - instead os static IP based discovery. For information on all options refer - to our documentation: http://apacheignite.readme.io/docs/cluster-config - --> - <!-- Uncomment static IP finder to enable static-based discovery of initial nodes. --> - <!--<bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder">--> - <bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.multicast.TcpDiscoveryMulticastIpFinder"> - <property name="addresses"> - <list> - <!-- In distributed environment, replace with actual host IP address. --> - <value>127.0.0.1:47500..47509</value> - </list> - </property> - </bean> - </property> - </bean> - </property> - </bean> -</beans>