ignite-648: init IgniteProcessProxy
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/95e31bcf Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/95e31bcf Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/95e31bcf Branch: refs/heads/ignite-648 Commit: 95e31bcfc70a294624c321c3a73d4199e952651b Parents: 6ea7f3d Author: Artem Shutak <[email protected]> Authored: Tue Apr 14 16:15:01 2015 +0300 Committer: Artem Shutak <[email protected]> Committed: Tue Apr 14 16:15:01 2015 +0300 ---------------------------------------------------------------------- .../cache/GridCacheAbstractFullApiSelfTest.java | 16 +- ...CachePartitionedMultiJvmFullApiSelfTest.java | 131 +++++++ .../cache/multijvm/IgniteNodeRunner.java | 122 +++++++ .../cache/multijvm/IgniteProcessProxy.java | 346 +++++++++++++++++++ .../CachePartitionedMultyJvmSelfTest.java | 11 +- .../ignite/internal/multijvm/MultiJvmTest.java | 12 +- 6 files changed, 619 insertions(+), 19 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/95e31bcf/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java index 30c2515..77405ee 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java @@ -27,6 +27,7 @@ import org.apache.ignite.configuration.*; import org.apache.ignite.events.*; import org.apache.ignite.internal.*; import org.apache.ignite.internal.processors.affinity.*; +import org.apache.ignite.internal.processors.cache.multijvm.*; import org.apache.ignite.internal.processors.cache.query.*; import org.apache.ignite.internal.processors.resource.*; import org.apache.ignite.internal.util.lang.*; @@ -157,7 +158,12 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract super.beforeTestsStarted(); for (Map.Entry<String, CacheConfiguration[]> entry : cacheCfgMap.entrySet()) { - Ignite ignite = IgnitionEx.grid(entry.getKey()); + Ignite ignite; + + if (isMultiJvm()) + ignite = IgniteProcessProxy.grid(entry.getKey()); + else + ignite = IgnitionEx.grid(entry.getKey()); for (CacheConfiguration cfg : entry.getValue()) ignite.createCache(cfg); @@ -186,8 +192,12 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract cacheCfgMap = null; } - for (int i = 0; i < gridCount(); i++) - info("Grid " + i + ": " + grid(i).localNode().id()); +// for (int i = 0; i < gridCount(); i++) +// info("Grid " + i + ": " + grid(i).localNode().id()); + } + + protected boolean isMultiJvm() { + return false; } /** {@inheritDoc} */ http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/95e31bcf/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCachePartitionedMultiJvmFullApiSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCachePartitionedMultiJvmFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCachePartitionedMultiJvmFullApiSelfTest.java new file mode 100644 index 0000000..753c13c --- /dev/null +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCachePartitionedMultiJvmFullApiSelfTest.java @@ -0,0 +1,131 @@ +/* + * 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.multijvm; + +import org.apache.ignite.*; +import org.apache.ignite.configuration.*; +import org.apache.ignite.internal.*; +import org.apache.ignite.internal.processors.cache.distributed.near.*; +import org.apache.ignite.internal.processors.resource.*; +import org.apache.ignite.spi.discovery.tcp.ipfinder.*; +import org.apache.ignite.spi.discovery.tcp.ipfinder.multicast.*; + +import java.util.*; + +/** + * TODO: Add class description. + */ +public class GridCachePartitionedMultiJvmFullApiSelfTest extends GridCachePartitionedMultiNodeFullApiSelfTest { + /** VM ip finder for TCP discovery. */ + public static final TcpDiscoveryIpFinder ipFinder = new TcpDiscoveryMulticastIpFinder(){{ + setAddresses(Collections.singleton("127.0.0.1:47500..47509")); + }}; + + /** Proces name to process map. */ + private final Map<String, IgniteProcessProxy> ignites = new HashMap<>(); + + @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception { +// IgniteConfiguration cfg = super.getConfiguration(gridName); +// +// ((TcpDiscoverySpi)cfg.getDiscoverySpi()).setIpFinder(ipFinder); + + return IgniteNodeRunner.configuration(null); // TODO: change. + } + + @Override protected CacheConfiguration cacheConfiguration(String gridName) throws Exception { + return super.cacheConfiguration(gridName); // TODO: CODE: implement. + } + + @Override protected int gridCount() { + return 1; + } + + protected boolean isMultiJvm() { + return true; + } + + @Override protected void afterTestsStopped() throws Exception { + for (IgniteProcessProxy ignite : ignites.values()) + ignite.getProcess().kill(); + + ignites.clear(); + + super.afterTestsStopped(); + } + + /** {@inheritDoc} */ + protected Ignite startGrid(String gridName, GridSpringResourceContext ctx) throws Exception { + startingGrid.set(gridName); + + try { + IgniteConfiguration cfg = optimize(getConfiguration(gridName)); + + IgniteProcessProxy proxy = new IgniteProcessProxy(cfg, log); + + ignites.put(gridName, proxy); + + return proxy; + } + finally { + startingGrid.set(null); + } + } + + @Override protected IgniteEx grid(int idx) { + String name = getTestGridName(idx); + + return ignites.get(name); + } + + /** + * @throws Exception If failed. + */ + public void testPutAllRemoveAll() throws Exception { +// for (int i = 0; i < gridCount(); i++) { +// IgniteEx grid0 = grid0(i); +// +// info(">>>>> Grid" + i + ": " + grid0.localNode().id()); +// } + + Map<Integer, Integer> putMap = new LinkedHashMap<>(); + + int size = 100; + + for (int i = 0; i < size; i++) + putMap.put(i, i * i); + + IgniteEx grid0 = grid(0); + + IgniteCache<Object, Object> c0 = grid0.cache(null); + + IgniteEx grid1 = grid(1); + + IgniteCache<Object, Object> c1 = grid1.cache(null); + + c0.putAll(putMap); + + atomicClockModeDelay(c0); + + c1.removeAll(putMap.keySet()); + + for (int i = 0; i < size; i++) { + assertNull(c0.get(i)); + assertNull(c1.get(i)); + } + } +} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/95e31bcf/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/IgniteNodeRunner.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/IgniteNodeRunner.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/IgniteNodeRunner.java new file mode 100644 index 0000000..b5cafe5 --- /dev/null +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/IgniteNodeRunner.java @@ -0,0 +1,122 @@ +/* + * 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.multijvm; + +import org.apache.ignite.*; +import org.apache.ignite.cache.*; +import org.apache.ignite.configuration.*; +import org.apache.ignite.internal.util.*; +import org.apache.ignite.internal.util.typedef.*; +import org.apache.ignite.internal.util.typedef.internal.*; +import org.apache.ignite.spi.discovery.tcp.*; +import org.apache.ignite.spi.discovery.tcp.ipfinder.*; +import org.apache.ignite.spi.discovery.tcp.ipfinder.multicast.*; + +import java.util.*; + +import static org.apache.ignite.cache.CacheAtomicWriteOrderMode.*; +import static org.apache.ignite.cache.CacheAtomicityMode.*; +import static org.apache.ignite.cache.CacheWriteSynchronizationMode.*; + +/** + * Run ignite node. + */ +public class IgniteNodeRunner { + /** VM ip finder for TCP discovery. */ + private static final TcpDiscoveryIpFinder ipFinder = new TcpDiscoveryMulticastIpFinder(){{ + setAddresses(Collections.singleton("127.0.0.1:47500..47509")); + }}; + + public static final char DELIM = ' '; + + public static void main(String[] args) throws Exception { + try { + X.println(GridJavaProcess.PID_MSG_PREFIX + U.jvmPid()); + + X.println("Starting Ignite Node... Args" + Arrays.toString(args)); + + IgniteConfiguration cfg = configuration(args); + +// cfg.setCacheConfiguration(cacheConfiguration()); + + Ignite ignite = Ignition.start(cfg); + } + catch (Throwable e) { + e.printStackTrace(); + + System.exit(1); + } + } + + public static String asParams(UUID id, IgniteConfiguration cfg) { + return id.toString() + DELIM + cfg.getGridName(); + } + + public static IgniteConfiguration configuration(String[] args) { + IgniteConfiguration cfg = new IgniteConfiguration(); + + // TODO uncomment +// cfg.setNodeId(UUID.fromString(args[0])); + //------- + TcpDiscoverySpi disco = new TcpDiscoverySpi(); + +// disco.setMaxMissedHeartbeats(Integer.MAX_VALUE); + + disco.setIpFinder(ipFinder); + +// if (isDebug()) +// disco.setAckTimeout(Integer.MAX_VALUE); + + cfg.setDiscoverySpi(disco); + +// cfg.setMarshaller(new OptimizedMarshaller(false)); + +// if (offHeapValues()) +// cfg.setSwapSpaceSpi(new GridTestSwapSpaceSpi()); + +// cfg.getTransactionConfiguration().setTxSerializableEnabled(true); + + return cfg; + } + + // TODO implement. + private static CacheConfiguration cacheConfiguration() { + CacheConfiguration cfg = new CacheConfiguration(); + + cfg.setStartSize(1024); + cfg.setAtomicWriteOrderMode(PRIMARY); + cfg.setAtomicityMode(TRANSACTIONAL); + cfg.setNearConfiguration(new NearCacheConfiguration()); + cfg.setWriteSynchronizationMode(FULL_SYNC); + cfg.setEvictionPolicy(null); + +// if (offHeapValues()) { +// ccfg.setMemoryMode(CacheMemoryMode.OFFHEAP_VALUES); +// ccfg.setOffHeapMaxMemory(0); +// } + + cfg.setEvictSynchronized(false); + +// cfg.setAtomicityMode(atomicityMode()); + cfg.setSwapEnabled(true); + + cfg.setRebalanceMode(CacheRebalanceMode.SYNC); + + return cfg; + } +} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/95e31bcf/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/IgniteProcessProxy.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/IgniteProcessProxy.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/IgniteProcessProxy.java new file mode 100644 index 0000000..810fd0e --- /dev/null +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/IgniteProcessProxy.java @@ -0,0 +1,346 @@ +/* + * 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.multijvm; + +import org.apache.ignite.*; +import org.apache.ignite.cache.affinity.*; +import org.apache.ignite.cluster.*; +import org.apache.ignite.configuration.*; +import org.apache.ignite.internal.*; +import org.apache.ignite.internal.cluster.*; +import org.apache.ignite.internal.processors.cache.*; +import org.apache.ignite.internal.processors.hadoop.*; +import org.apache.ignite.internal.util.*; +import org.apache.ignite.internal.util.typedef.*; +import org.apache.ignite.lang.*; +import org.apache.ignite.plugin.*; +import org.jetbrains.annotations.*; + +import java.util.*; +import java.util.concurrent.*; + +/** + * TODO: Add class description. + * + * @author @java.author + * @version @java.version + */ +public class IgniteProcessProxy implements IgniteEx { + private static final Map<String, IgniteProcessProxy> gridProxies = new HashMap<>(); + + private final GridJavaProcess proc; + private final IgniteConfiguration cfg; + private final IgniteLogger log; + private final UUID id = UUID.randomUUID();// TODO send. + + public IgniteProcessProxy(final IgniteConfiguration cfg, final IgniteLogger log) throws Exception { + this.cfg = cfg; + this.log = log; + + String cfgAsString = IgniteNodeRunner.asParams(id, cfg); + + proc = GridJavaProcess.exec( + IgniteNodeRunner.class, + cfgAsString, // 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("[" + cfg.getGridName() + "] " + s); + } + }, + null, + Collections.<String>emptyList(), // JVM Args. + System.getProperty("surefire.test.class.path") + ); + + Thread.sleep(3_000); + + gridProxies.put(cfg.getGridName(), this); + } + + @Override public String name() { + return cfg.getGridName(); + } + + @Override public IgniteLogger log() { + return log; + } + + @Override public IgniteConfiguration configuration() { + return cfg; + } + + @Override public <K extends GridCacheUtilityKey, V> GridCacheProjectionEx<K, V> utilityCache() { + return null; // TODO: CODE: implement. + } + + @Nullable @Override public <K, V> GridCache<K, V> cachex(@Nullable String name) { + return null; // TODO: CODE: implement. + } + + @Nullable @Override public <K, V> GridCache<K, V> cachex() { + return null; // TODO: CODE: implement. + } + + @Override public Collection<GridCache<?, ?>> cachesx(@Nullable IgnitePredicate<? super GridCache<?, ?>>... p) { + return null; // TODO: CODE: implement. + } + + @Override public boolean eventUserRecordable(int type) { + return false; // TODO: CODE: implement. + } + + @Override public boolean allEventsUserRecordable(int[] types) { + return false; // TODO: CODE: implement. + } + + @Override public boolean isJmxRemoteEnabled() { + return false; // TODO: CODE: implement. + } + + @Override public boolean isRestartEnabled() { + return false; // TODO: CODE: implement. + } + + @Nullable @Override public IgniteFileSystem igfsx(@Nullable String name) { + return null; // TODO: CODE: implement. + } + + @Override public Hadoop hadoop() { + return null; // TODO: CODE: implement. + } + + @Override public IgniteClusterEx cluster() { +// Ignition.setClientMode(true); + + // TODO cfg. + try(Ignite ignite = Ignition.start(IgniteNodeRunner.configuration(null))) { + // TODO +// ClusterGroup grp = ignite.cluster().forNodeId(id); + ClusterGroup grp = ignite.cluster().forRemotes(); + + return ignite.compute(grp).apply(new C1<Set<?>, IgniteClusterEx>() { + @Override public IgniteClusterEx apply(Set<?> objects) { + log.info(">>>>> Cluster 1"); + Ignite ignite1 = Ignition.ignite(); + log.info(">>>>> Cluster 2"); + IgniteCluster cluster = ignite1.cluster(); + log.info(">>>>> Cluster 3"); + IgniteClusterEx cluster1 = (IgniteClusterEx)cluster; + log.info(">>>>> Cluster 4"); + return cluster1; + } + }, Collections.emptySet()); + } + } + + @Nullable @Override public String latestVersion() { + return null; // TODO: CODE: implement. + } + + @Override public ClusterNode localNode() { + return null; // TODO: CODE: implement. + } + + @Override public GridKernalContext context() { + return null; // TODO: CODE: implement. + } + + @Override public IgniteCompute compute() { + return null; // TODO: CODE: implement. + } + + @Override public IgniteCompute compute(ClusterGroup grp) { + return null; // TODO: CODE: implement. + } + + @Override public IgniteMessaging message() { + return null; // TODO: CODE: implement. + } + + @Override public IgniteMessaging message(ClusterGroup grp) { + return null; // TODO: CODE: implement. + } + + @Override public IgniteEvents events() { + return null; // TODO: CODE: implement. + } + + @Override public IgniteEvents events(ClusterGroup grp) { + return null; // TODO: CODE: implement. + } + + @Override public IgniteServices services() { + return null; // TODO: CODE: implement. + } + + @Override public IgniteServices services(ClusterGroup grp) { + return null; // TODO: CODE: implement. + } + + @Override public ExecutorService executorService() { + return null; // TODO: CODE: implement. + } + + @Override public ExecutorService executorService(ClusterGroup grp) { + return null; // TODO: CODE: implement. + } + + @Override public IgniteProductVersion version() { + return null; // TODO: CODE: implement. + } + + @Override public IgniteScheduler scheduler() { + return null; // TODO: CODE: implement. + } + + @Override public <K, V> IgniteCache<K, V> createCache(CacheConfiguration<K, V> cacheCfg) { + return null; // TODO: CODE: implement. + } + + @Override public <K, V> IgniteCache<K, V> createCache(String cacheName) { + return null; // TODO: CODE: implement. + } + + @Override public <K, V> IgniteCache<K, V> getOrCreateCache(CacheConfiguration<K, V> cacheCfg) { + return null; // TODO: CODE: implement. + } + + @Override public <K, V> IgniteCache<K, V> getOrCreateCache(String cacheName) { + return null; // TODO: CODE: implement. + } + + @Override public <K, V> void addCacheConfiguration(CacheConfiguration<K, V> cacheCfg) { + // TODO: CODE: implement. + } + + @Override public <K, V> IgniteCache<K, V> createCache(CacheConfiguration<K, V> cacheCfg, + NearCacheConfiguration<K, V> nearCfg) { + return null; // TODO: CODE: implement. + } + + @Override public <K, V> IgniteCache<K, V> getOrCreateCache(CacheConfiguration<K, V> cacheCfg, + NearCacheConfiguration<K, V> nearCfg) { + return null; // TODO: CODE: implement. + } + + @Override + public <K, V> IgniteCache<K, V> createNearCache(@Nullable String cacheName, NearCacheConfiguration<K, V> nearCfg) { + return null; // TODO: CODE: implement. + } + + @Override public <K, V> IgniteCache<K, V> getOrCreateNearCache(@Nullable String cacheName, + NearCacheConfiguration<K, V> nearCfg) { + return null; // TODO: CODE: implement. + } + + @Override public void destroyCache(String cacheName) { + // TODO: CODE: implement. + } + + @Override public <K, V> IgniteCache<K, V> cache(@Nullable String name) { + Ignition.setClientMode(true); + + try(Ignite ignite = Ignition.start(cfg)) { + return ignite.compute(ignite.cluster().forNodeId(id)).apply(new C1<Set<?>, IgniteCache<K,V>>() { + @Override public IgniteCache<K, V> apply(Set<?> objects) { + return Ignition.ignite().cache(null); + } + }, Collections.emptySet()); + } + } + + @Override public IgniteTransactions transactions() { + return null; // TODO: CODE: implement. + } + + @Override public <K, V> IgniteDataStreamer<K, V> dataStreamer(@Nullable String cacheName) { + return null; // TODO: CODE: implement. + } + + @Override public IgniteFileSystem fileSystem(String name) { + return null; // TODO: CODE: implement. + } + + @Override public Collection<IgniteFileSystem> fileSystems() { + return null; // TODO: CODE: implement. + } + + @Override + public IgniteAtomicSequence atomicSequence(String name, long initVal, boolean create) throws IgniteException { + return null; // TODO: CODE: implement. + } + + @Override public IgniteAtomicLong atomicLong(String name, long initVal, boolean create) throws IgniteException { + return null; // TODO: CODE: implement. + } + + @Override public <T> IgniteAtomicReference<T> atomicReference(String name, @Nullable T initVal, + boolean create) throws IgniteException { + return null; // TODO: CODE: implement. + } + + @Override + public <T, S> IgniteAtomicStamped<T, S> atomicStamped(String name, @Nullable T initVal, @Nullable S initStamp, + boolean create) throws IgniteException { + return null; // TODO: CODE: implement. + } + + @Override public IgniteCountDownLatch countDownLatch(String name, int cnt, boolean autoDel, + boolean create) throws IgniteException { + return null; // TODO: CODE: implement. + } + + @Override public <T> IgniteQueue<T> queue(String name, int cap, + @Nullable CollectionConfiguration cfg) throws IgniteException { + return null; // TODO: CODE: implement. + } + + @Override public <T> IgniteSet<T> set(String name, @Nullable CollectionConfiguration cfg) throws IgniteException { + return null; // TODO: CODE: implement. + } + + @Override public <T extends IgnitePlugin> T plugin(String name) throws PluginNotFoundException { + return null; // TODO: CODE: implement. + } + + @Override public void close() throws IgniteException { + // TODO: CODE: implement. + } + + @Override public <K> Affinity<K> affinity(String cacheName) { + return null; // TODO: CODE: implement. + } + + public GridJavaProcess getProcess() { + return proc; + } + + public static Ignite grid(@Nullable String name) { +// IgniteNamedInstance grid = name != null ? grids.get(name) : dfltGrid; + + Ignite res = gridProxies.get(name); + + if (res == null) + throw new IgniteIllegalStateException("Grid instance was not properly started " + + "or was already stopped: " + name); + + return res; + } +} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/95e31bcf/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 index 95a22cf..bb25f98 100644 --- 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 @@ -16,7 +16,8 @@ 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"; + 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); @@ -28,12 +29,12 @@ public class CachePartitionedMultyJvmSelfTest extends MultiJvmTest{ * @throws Exception If test fails. */ public void testMultiJvmPut() throws Exception { - executeTaskAndWaitForFinish(IGNITE_NODE_1, PutInCache.class, 1); + executeTask(IGNITE_NODE_1, PutInCache.class, 1); - executeTaskAndWaitForFinish(IGNITE_NODE_1, CheckInCache.class, 1); + executeTask(IGNITE_NODE_1, CheckInCache.class, 1); - executeTaskAndWaitForFinish(IGNITE_NODE_2, CheckInCache.class, 1); + executeTask(IGNITE_NODE_2, CheckInCache.class, 1); - executeTaskAndWaitForFinish(IGNITE_NODE_3, CheckInCache.class, 1); + executeTask(IGNITE_NODE_3, CheckInCache.class, 1); } } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/95e31bcf/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 index f64f731..69803e2 100644 --- 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 @@ -40,16 +40,6 @@ public class MultiJvmTest extends GridCommonAbstractTest { super.afterTestsStopped(); } - - /** - * @throws Exception If failed. - */ - public void testRunProcess() throws Exception { - runIgniteProcess("JvmNode1", "modules/spring/src/test/java/org/apache/ignite/internal/multijvm/example-cache.xml"); - - Thread.sleep(10_000); - } - protected GridJavaProcess runIgniteProcess(final String nodeName, String cfg) throws Exception { GridJavaProcess ps = GridJavaProcess.exec( IgniteNodeRunner.class, @@ -71,7 +61,7 @@ public class MultiJvmTest extends GridCommonAbstractTest { return ps; } - protected void executeTaskAndWaitForFinish(String nodeName, Class<? extends IgniteNodeRunner.Task> taskCls, + protected void executeTask(String nodeName, Class<? extends IgniteNodeRunner.Task> taskCls, Object... args) throws Exception { GridJavaProcess proc = nodes.get(nodeName);
