You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by sb...@apache.org on 2015/05/16 09:07:37 UTC
[2/8] incubator-ignite git commit: Revert "ignite-471: fixed NPE in
PortableMarshaller"
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8a6dd007/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedTxSalvageSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedTxSalvageSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedTxSalvageSelfTest.java
index 6192f39..5072642 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedTxSalvageSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedTxSalvageSelfTest.java
@@ -18,6 +18,7 @@
package org.apache.ignite.internal.processors.cache.distributed.near;
import org.apache.ignite.*;
+import org.apache.ignite.cache.*;
import org.apache.ignite.cache.affinity.rendezvous.*;
import org.apache.ignite.configuration.*;
import org.apache.ignite.internal.*;
@@ -34,8 +35,6 @@ import org.apache.ignite.transactions.*;
import java.util.*;
import static org.apache.ignite.IgniteSystemProperties.*;
-import static org.apache.ignite.cache.CacheMode.*;
-import static org.apache.ignite.cache.CacheRebalanceMode.*;
import static org.apache.ignite.transactions.TransactionConcurrency.*;
import static org.apache.ignite.transactions.TransactionIsolation.*;
@@ -77,10 +76,10 @@ public class GridCachePartitionedTxSalvageSelfTest extends GridCommonAbstractTes
CacheConfiguration cc = defaultCacheConfiguration();
- cc.setCacheMode(PARTITIONED);
+ cc.setCacheMode(CacheMode.PARTITIONED);
cc.setAffinity(new RendezvousAffinityFunction(false, 18));
cc.setBackups(1);
- cc.setRebalanceMode(SYNC);
+ cc.setRebalanceMode(CacheRebalanceMode.SYNC);
c.setCacheConfiguration(cc);
@@ -110,9 +109,8 @@ public class GridCachePartitionedTxSalvageSelfTest extends GridCommonAbstractTes
/** {@inheritDoc} */
@Override protected void afterTest() throws Exception {
+ // Shutwodn the gird.
stopAllGrids();
-
- System.gc();
}
/**
@@ -147,8 +145,8 @@ public class GridCachePartitionedTxSalvageSelfTest extends GridCommonAbstractTes
* Check whether caches has no transactions after salvage timeout.
*
* @param mode Transaction mode (PESSIMISTIC, OPTIMISTIC).
- * @param prepare Whether to prepare transaction state
- * (i.e. call {@link IgniteInternalTx#prepare()}).
+ * @param prepare Whether to preapre transaction state
+ * (i.e. call {@link org.apache.ignite.internal.processors.cache.transactions.IgniteInternalTx#prepare()}).
* @throws Exception If failed.
*/
private void checkSalvageAfterTimeout(TransactionConcurrency mode, boolean prepare) throws Exception {
@@ -166,8 +164,8 @@ public class GridCachePartitionedTxSalvageSelfTest extends GridCommonAbstractTes
* Check whether caches still has all transactions before salvage timeout.
*
* @param mode Transaction mode (PESSIMISTIC, OPTIMISTIC).
- * @param prepare Whether to prepare transaction state
- * (i.e. call {@link IgniteInternalTx#prepare()}).
+ * @param prepare Whether to preapre transaction state
+ * (i.e. call {@link org.apache.ignite.internal.processors.cache.transactions.IgniteInternalTx#prepare()}).
* @throws Exception If failed.
*/
private void checkSalvageBeforeTimeout(TransactionConcurrency mode, boolean prepare) throws Exception {
@@ -193,8 +191,8 @@ public class GridCachePartitionedTxSalvageSelfTest extends GridCommonAbstractTes
* Start new transaction on the grid(0) and put some keys to it.
*
* @param mode Transaction mode (PESSIMISTIC, OPTIMISTIC).
- * @param prepare Whether to prepare transaction state
- * (i.e. call {@link IgniteInternalTx#prepare()}).
+ * @param prepare Whether to preapre transaction state
+ * (i.e. call {@link org.apache.ignite.internal.processors.cache.transactions.IgniteInternalTx#prepare()}).
* @throws Exception If failed.
*/
private void startTxAndPutKeys(final TransactionConcurrency mode, final boolean prepare) throws Exception {
@@ -212,8 +210,9 @@ public class GridCachePartitionedTxSalvageSelfTest extends GridCommonAbstractTes
for (Integer key : keys)
c.put(key, "val" + key);
+ // Unproxy.
if (prepare)
- ((TransactionProxyImpl)tx).tx().prepare();
+ U.<IgniteInternalTx>field(tx, "tx").prepare();
}
catch (IgniteCheckedException e) {
info("Failed to put keys to cache: " + e.getMessage());
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8a6dd007/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/NoneRebalanceModeSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/NoneRebalanceModeSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/NoneRebalanceModeSelfTest.java
deleted file mode 100644
index d61ddcc..0000000
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/NoneRebalanceModeSelfTest.java
+++ /dev/null
@@ -1,67 +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.processors.cache.distributed.near;
-
-import org.apache.ignite.configuration.*;
-import org.apache.ignite.internal.*;
-import org.apache.ignite.internal.processors.cache.distributed.dht.*;
-import org.apache.ignite.testframework.junits.common.*;
-
-import static org.apache.ignite.cache.CacheRebalanceMode.*;
-import static org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtPartitionState.*;
-
-/**
- * Test none rebalance mode.
- */
-public class NoneRebalanceModeSelfTest extends GridCommonAbstractTest {
- /** {@inheritDoc} */
- @SuppressWarnings({"ConstantConditions"})
- @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
- IgniteConfiguration c = super.getConfiguration(gridName);
-
- CacheConfiguration cc = defaultCacheConfiguration();
-
- cc.setRebalanceMode(NONE);
-
- c.setCacheConfiguration(cc);
-
- return c;
- }
-
- /** {@inheritDoc} */
- @Override protected void beforeTestsStarted() throws Exception {
- startGrid(0);
- }
-
- /** {@inheritDoc} */
- @Override protected void afterTestsStopped() throws Exception {
- stopAllGrids();
- }
-
- /**
- * @throws Exception If failed.
- */
- public void testRemoveAll() throws Exception {
- GridNearTransactionalCache cache = (GridNearTransactionalCache)((IgniteKernal)grid(0)).internalCache(null);
-
- for (GridDhtLocalPartition part : cache.dht().topology().localPartitions())
- assertEquals(MOVING, part.state());
-
- grid(0).cache(null).removeAll();
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8a6dd007/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedFailoverSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedFailoverSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedFailoverSelfTest.java
index 3461dd4..326f57d 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedFailoverSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedFailoverSelfTest.java
@@ -18,7 +18,6 @@
package org.apache.ignite.internal.processors.cache.distributed.replicated;
import org.apache.ignite.cache.*;
-import org.apache.ignite.configuration.*;
import org.apache.ignite.internal.processors.cache.*;
import static org.apache.ignite.cache.CacheMode.*;
@@ -31,9 +30,4 @@ public class GridCacheReplicatedFailoverSelfTest extends GridCacheAbstractFailov
@Override protected CacheMode cacheMode() {
return REPLICATED;
}
-
- /** {@inheritDoc} */
- @Override protected NearCacheConfiguration nearConfiguration() {
- return null;
- }
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8a6dd007/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedLockSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedLockSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedLockSelfTest.java
index 510fa0c..97df1f0 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedLockSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedLockSelfTest.java
@@ -30,9 +30,4 @@ public class GridCacheReplicatedLockSelfTest extends GridCacheLockAbstractTest {
@Override protected CacheMode cacheMode() {
return REPLICATED;
}
-
- /** {@inheritDoc} */
- @Override public void testLockReentrancy() throws Throwable {
- fail("https://issues.apache.org/jira/browse/IGNITE-835");
- }
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8a6dd007/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedNodeRestartSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedNodeRestartSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedNodeRestartSelfTest.java
index 8ce96cd..0023160 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedNodeRestartSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedNodeRestartSelfTest.java
@@ -54,84 +54,4 @@ public class GridCacheReplicatedNodeRestartSelfTest extends GridCacheAbstractNod
return c;
}
-
- /** {@inheritDoc} */
- @Override public void testRestartWithPutTwoNodesNoBackups() throws Throwable {
- super.testRestartWithPutTwoNodesNoBackups();
- }
-
- /** {@inheritDoc} */
- @Override public void testRestartWithPutTwoNodesOneBackup() throws Throwable {
- // No-op.
- }
-
- /** {@inheritDoc} */
- @Override public void testRestartWithPutFourNodesOneBackups() throws Throwable {
- super.testRestartWithPutFourNodesOneBackups();
- }
-
- /** {@inheritDoc} */
- @Override public void testRestartWithPutFourNodesNoBackups() throws Throwable {
- // No-op.
- }
-
- /** {@inheritDoc} */
- @Override public void testRestartWithPutSixNodesTwoBackups() throws Throwable {
- super.testRestartWithPutSixNodesTwoBackups();
- }
-
- /** {@inheritDoc} */
- @Override public void testRestartWithPutEightNodesTwoBackups() throws Throwable {
- super.testRestartWithPutEightNodesTwoBackups();
- }
-
- /** {@inheritDoc} */
- @Override public void testRestartWithPutTenNodesTwoBackups() throws Throwable {
- super.testRestartWithPutTenNodesTwoBackups();
- }
-
- /** {@inheritDoc} */
- @Override public void testRestartWithTxTwoNodesNoBackups() throws Throwable {
- // No-op.
- }
-
- /** {@inheritDoc} */
- @Override public void testRestartWithTxTwoNodesOneBackup() throws Throwable {
- super.testRestartWithTxTwoNodesOneBackup();
- }
-
- /** {@inheritDoc} */
- @Override public void testRestartWithTxFourNodesOneBackups() throws Throwable {
- super.testRestartWithTxFourNodesOneBackups();
- }
-
- /** {@inheritDoc} */
- @Override public void testRestartWithTxFourNodesNoBackups() throws Throwable {
- // No-op.
- }
-
- /** {@inheritDoc} */
- @Override public void testRestartWithTxSixNodesTwoBackups() throws Throwable {
- super.testRestartWithTxSixNodesTwoBackups();
- }
-
- /** {@inheritDoc} */
- @Override public void testRestartWithTxEightNodesTwoBackups() throws Throwable {
- super.testRestartWithTxEightNodesTwoBackups();
- }
-
- /** {@inheritDoc} */
- @Override public void testRestartWithTxTenNodesTwoBackups() throws Throwable {
- super.testRestartWithTxTenNodesTwoBackups();
- }
-
- /** {@inheritDoc} */
- @Override public void testRestartWithTxPutAllTenNodesTwoBackups() throws Throwable {
- super.testRestartWithTxPutAllTenNodesTwoBackups();
- }
-
- /** {@inheritDoc} */
- @Override public void testRestartWithTxPutAllFourNodesTwoBackups() throws Throwable {
- super.testRestartWithTxPutAllFourNodesTwoBackups();
- }
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8a6dd007/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/GridCacheLocalIsolatedNodesSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/GridCacheLocalIsolatedNodesSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/GridCacheLocalIsolatedNodesSelfTest.java
index ee42ddb..dbfdc86 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/GridCacheLocalIsolatedNodesSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/GridCacheLocalIsolatedNodesSelfTest.java
@@ -40,7 +40,7 @@ public class GridCacheLocalIsolatedNodesSelfTest extends GridCommonAbstractTest
/** {@inheritDoc} */
@Override protected void beforeTest() throws Exception {
- startGrids(3);
+ startGrids(2);
}
/** {@inheritDoc} */
@@ -59,11 +59,7 @@ public class GridCacheLocalIsolatedNodesSelfTest extends GridCommonAbstractTest
Ignite g2 = grid(1);
UUID nid2 = g2.cluster().localNode().id();
- Ignite g3 = grid(2);
- UUID nid3 = g3.cluster().localNode().id();
-
assert !nid1.equals(nid2);
- assert !nid1.equals(nid3);
// Local cache on first node only.
CacheConfiguration<String, String> ccfg1 = new CacheConfiguration<>("A");
@@ -81,20 +77,8 @@ public class GridCacheLocalIsolatedNodesSelfTest extends GridCommonAbstractTest
IgniteCache<String, String> c2 = g2.createCache(ccfg2);
c2.put("g2", "c2");
- // Local cache on third node only.
- CacheConfiguration<String, String> ccfg3 = new CacheConfiguration<>("A");
- ccfg3.setCacheMode(LOCAL);
- ccfg3.setNodeFilter(new NodeIdFilter(nid3));
-
- IgniteCache<String, String> c3 = g3.createCache(ccfg3);
- c3.put("g3", "c3");
-
assertNull(c1.get("g2"));
- assertNull(c1.get("g3"));
assertNull(c2.get("g1"));
- assertNull(c2.get("g3"));
- assertNull(c3.get("g1"));
- assertNull(c3.get("g2"));
}
/** Filter by node ID. */
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8a6dd007/modules/core/src/test/java/org/apache/ignite/internal/util/nio/GridNioDelimitedBufferTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/util/nio/GridNioDelimitedBufferTest.java b/modules/core/src/test/java/org/apache/ignite/internal/util/nio/GridNioDelimitedBufferTest.java
deleted file mode 100644
index a0dd2e5..0000000
--- a/modules/core/src/test/java/org/apache/ignite/internal/util/nio/GridNioDelimitedBufferTest.java
+++ /dev/null
@@ -1,112 +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.util.nio;
-
-import junit.framework.TestCase;
-
-import java.nio.*;
-import java.util.*;
-
-/**
- * Tests for {@link GridNioDelimitedBuffer}.
- */
-public class GridNioDelimitedBufferTest extends TestCase {
- /** */
- private static final String ASCII = "ASCII";
-
- /**
- * Tests simple delimiter (excluded from alphabet)
- */
- public void testReadZString() throws Exception {
- Random rnd = new Random();
-
- int buffSize = 0;
-
- byte[] delim = new byte[] {0};
-
- List<String> strs = new ArrayList<>(50);
-
- for (int i = 0; i < 50; i++) {
- int len = rnd.nextInt(128) + 1;
-
- buffSize += len + delim.length;
-
- StringBuilder sb = new StringBuilder(len);
-
- for (int j = 0; j < len; j++)
- sb.append((char)(rnd.nextInt(26) + 'a'));
-
-
- strs.add(sb.toString());
- }
-
- ByteBuffer buff = ByteBuffer.allocate(buffSize);
-
- for (String str : strs) {
- buff.put(str.getBytes(ASCII));
- buff.put(delim);
- }
-
- buff.flip();
-
- byte[] msg;
-
- GridNioDelimitedBuffer delimBuff = new GridNioDelimitedBuffer(delim);
-
- List<String> res = new ArrayList<>(strs.size());
-
- while ((msg = delimBuff.read(buff)) != null)
- res.add(new String(msg, ASCII));
-
- assertEquals(strs, res);
- }
-
- /**
- * Tests compound delimiter (included to alphabet)
- */
- public void testDelim() throws Exception {
- byte[] delim = "aabb".getBytes(ASCII);
-
- List<String> strs = Arrays.asList("za", "zaa", "zaab", "zab", "zaabaababbbbabaab");
-
- int buffSize = 0;
-
- for (String str : strs)
- buffSize += str.length() + delim.length;
-
- ByteBuffer buff = ByteBuffer.allocate(buffSize);
-
- for (String str : strs) {
- buff.put(str.getBytes(ASCII));
- buff.put(delim);
- }
-
- buff.flip();
-
- byte[] msg;
-
- GridNioDelimitedBuffer delimBuff = new GridNioDelimitedBuffer(delim);
-
- List<String> res = new ArrayList<>(strs.size());
-
- while ((msg = delimBuff.read(buff)) != null)
- res.add(new String(msg, ASCII));
-
- assertEquals(strs, res);
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8a6dd007/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoveryRestartTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoveryRestartTest.java b/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoveryRestartTest.java
deleted file mode 100644
index e6bee4a..0000000
--- a/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoveryRestartTest.java
+++ /dev/null
@@ -1,199 +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.spi.discovery.tcp;
-
-import org.apache.ignite.*;
-import org.apache.ignite.configuration.*;
-import org.apache.ignite.events.*;
-import org.apache.ignite.internal.*;
-import org.apache.ignite.internal.util.typedef.*;
-import org.apache.ignite.lang.*;
-import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*;
-import org.apache.ignite.testframework.*;
-import org.apache.ignite.testframework.junits.common.*;
-import org.eclipse.jetty.util.*;
-
-import java.util.*;
-import java.util.concurrent.*;
-import java.util.concurrent.atomic.*;
-
-import static org.apache.ignite.events.EventType.*;
-
-/**
- *
- */
-public class TcpDiscoveryRestartTest extends GridCommonAbstractTest {
- /** */
- private TcpDiscoveryVmIpFinder ipFinder = new TcpDiscoveryVmIpFinder(true);
-
- /** */
- private static AtomicReference<String> err;
-
- /** {@inheritDoc} */
- @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
- IgniteConfiguration cfg = super.getConfiguration(gridName);
-
- TcpDiscoverySpi spi = new TcpDiscoverySpi();
-
- spi.setIpFinder(ipFinder);
-
- cfg.setDiscoverySpi(spi);
-
- int[] evts = {EVT_NODE_JOINED, EVT_NODE_FAILED, EVT_NODE_LEFT};
-
- cfg.setIncludeEventTypes(evts);
-
- Map<IgnitePredicate<? extends Event>, int[]> lsnrs = new HashMap<>();
-
- lsnrs.put(new TestEventListener(), evts);
-
- cfg.setLocalEventListeners(lsnrs);
-
- return cfg;
- }
-
- /** {@inheritDoc} */
- @Override protected void afterTest() throws Exception {
- stopAllGrids();
- }
-
- /**
- * @throws Exception If failed.
- */
- public void testRestart() throws Exception {
- err = new AtomicReference<>();
-
- final int NODE_CNT = 3;
-
- startGrids(NODE_CNT);
-
- final ConcurrentHashSet<UUID> nodeIds = new ConcurrentHashSet<>();
-
- final AtomicInteger id = new AtomicInteger(NODE_CNT);
-
- final IgniteInternalFuture<?> fut = GridTestUtils.runMultiThreadedAsync(new Callable<Void>() {
- @Override public Void call() throws Exception {
- int nodeIdx = id.getAndIncrement();
-
- for (int i = 0; i < 10 && err.get() == null; i++) {
- Ignite ignite = startGrid(nodeIdx);
-
- UUID nodeId = ignite.cluster().localNode().id();
-
- if (!nodeIds.add(nodeId))
- failed("Duplicated node ID: " + nodeId);
-
- stopGrid(nodeIdx);
- }
-
- return null;
- }
- }, 5, "restart-thread");
-
- IgniteInternalFuture<?> loadFut = GridTestUtils.runMultiThreadedAsync(new Callable<Long>() {
- @Override public Long call() throws Exception {
- long dummyRes = 0;
-
- List<String> list = new ArrayList<>();
-
- while (!fut.isDone()) {
- for (int i = 0; i < 100; i++) {
- String str = new String(new byte[i]);
-
- list.add(str);
-
- dummyRes += str.hashCode();
- }
-
- if (list.size() > 1000_000) {
- list = new ArrayList<>();
-
- System.gc();
- }
- }
-
- return dummyRes;
- }
- }, 2, "test-load");
-
- fut.get();
-
- loadFut.get();
-
- assertNull(err.get());
-
- for (int i = 0; i < NODE_CNT; i++) {
- Ignite ignite = ignite(i);
-
- TestEventListener lsnr = (TestEventListener)F.firstKey(ignite.configuration().getLocalEventListeners());
-
- assertNotNull(lsnr);
-
- for (UUID nodeId : nodeIds)
- lsnr.checkEvents(nodeId);
- }
- }
-
-
- /**
- * @param msg Message.
- */
- private void failed(String msg) {
- info(msg);
-
- err.compareAndSet(null, msg);
- }
-
- /**
- *
- */
- private class TestEventListener implements IgnitePredicate<Event> {
- /** */
- private final ConcurrentHashSet<UUID> joinIds = new ConcurrentHashSet<>();
-
- /** */
- private final ConcurrentHashSet<UUID> leftIds = new ConcurrentHashSet<>();
-
- /** {@inheritDoc} */
- @Override public boolean apply(Event evt) {
- DiscoveryEvent evt0 = (DiscoveryEvent)evt;
-
- if (evt.type() == EVT_NODE_FAILED || evt.type() == EVT_NODE_LEFT) {
- if (!leftIds.add(evt0.eventNode().id()))
- failed("Duplicated failed node ID: " + evt0.eventNode().id());
- }
- else {
- assertEquals(EVT_NODE_JOINED, evt.type());
-
- if (!joinIds.add(evt0.eventNode().id()))
- failed("Duplicated joined node ID: " + evt0.eventNode().id());
- }
-
- return true;
- }
-
- /**
- * @param nodeId Node ID.
- */
- void checkEvents(UUID nodeId) {
- assertTrue("No join event: " + nodeId, joinIds.contains(nodeId));
-
- assertTrue("No left event: " + nodeId, leftIds.contains(nodeId));
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8a6dd007/modules/core/src/test/java/org/apache/ignite/stream/socket/SocketStreamerSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/stream/socket/SocketStreamerSelfTest.java b/modules/core/src/test/java/org/apache/ignite/stream/socket/SocketStreamerSelfTest.java
deleted file mode 100644
index b4a6923..0000000
--- a/modules/core/src/test/java/org/apache/ignite/stream/socket/SocketStreamerSelfTest.java
+++ /dev/null
@@ -1,316 +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.stream.socket;
-
-import org.apache.ignite.*;
-import org.apache.ignite.cache.*;
-import org.apache.ignite.configuration.*;
-import org.apache.ignite.events.*;
-import org.apache.ignite.internal.util.typedef.internal.U;
-import org.apache.ignite.lang.*;
-import org.apache.ignite.marshaller.*;
-import org.apache.ignite.marshaller.jdk.*;
-import org.apache.ignite.spi.discovery.tcp.*;
-import org.apache.ignite.spi.discovery.tcp.ipfinder.*;
-import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*;
-import org.apache.ignite.stream.*;
-import org.apache.ignite.testframework.junits.common.*;
-
-import org.jetbrains.annotations.*;
-
-import java.io.*;
-import java.net.*;
-import java.util.*;
-import java.util.concurrent.*;
-
-import static org.apache.ignite.events.EventType.*;
-
-/**
- * Tests {@link SocketStreamer}.
- */
-public class SocketStreamerSelfTest extends GridCommonAbstractTest {
- /** IP finder. */
- private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true);
-
- /** Grid count. */
- private final static int GRID_CNT = 3;
-
- /** Count. */
- private static final int CNT = 500;
-
- /** Delimiter. */
- private static final byte[] DELIM = new byte[] {0, 1, 2, 3, 4, 5, 4, 3, 2, 1, 0};
-
- /** Port. */
- private static int port;
-
- /** Ignite. */
- private static Ignite ignite;
-
- /** {@inheritDoc} */
- @Override protected IgniteConfiguration getConfiguration() throws Exception {
- IgniteConfiguration cfg = super.getConfiguration();
-
- CacheConfiguration ccfg = cacheConfiguration(cfg, null);
-
- cfg.setCacheConfiguration(ccfg);
-
- TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
-
- discoSpi.setIpFinder(IP_FINDER);
-
- cfg.setDiscoverySpi(discoSpi);
-
- return cfg;
- }
-
-
- /** {@inheritDoc} */
- @Override protected void beforeTestsStarted() throws Exception {
- ignite = startGrids(GRID_CNT);
- ignite.<Integer, String>getOrCreateCache(defaultCacheConfiguration());
-
- try (ServerSocket sock = new ServerSocket(0)) {
- port = sock.getLocalPort();
- }
- }
-
- /** {@inheritDoc} */
- @Override protected void afterTestsStopped() throws Exception {
- stopAllGrids();
- }
-
- /** {@inheritDoc} */
- @Override protected void beforeTest() throws Exception {
- ignite.cache(null).clear();
- }
-
- /**
- * @throws Exception If failed.
- */
- public void testSizeBasedDefaultConverter() throws Exception {
- test(null, null, new Runnable() {
- @Override public void run() {
- try (Socket sock = new Socket(InetAddress.getLocalHost(), port);
- OutputStream os = new BufferedOutputStream(sock.getOutputStream())) {
- Marshaller marsh = new JdkMarshaller();
-
- for (int i = 0; i < CNT; i++) {
- byte[] msg = U.toArray(marsh.marshal(new Tuple(i)));
-
- os.write(msg.length >>> 24);
- os.write(msg.length >>> 16);
- os.write(msg.length >>> 8);
- os.write(msg.length);
-
- os.write(msg);
- }
- }
- catch (IOException | IgniteCheckedException e) {
- throw new IgniteException(e);
- }
- }
- });
- }
-
- /**
- * @throws Exception If failed.
- */
- public void testSizeBasedCustomConverter() throws Exception {
- SocketMessageConverter<Tuple> converter = new SocketMessageConverter<Tuple>() {
- @Override public Tuple convert(byte[] msg) {
- int i = (msg[0] & 0xFF) << 24;
- i |= (msg[1] & 0xFF) << 16;
- i |= (msg[2] & 0xFF) << 8;
- i |= msg[3] & 0xFF;
-
- return new Tuple(i);
- }
- };
-
- test(converter, null, new Runnable() {
- @Override public void run() {
- try(Socket sock = new Socket(InetAddress.getLocalHost(), port);
- OutputStream os = new BufferedOutputStream(sock.getOutputStream())) {
-
- for (int i = 0; i < CNT; i++) {
- os.write(0);
- os.write(0);
- os.write(0);
- os.write(4);
-
- os.write(i >>> 24);
- os.write(i >>> 16);
- os.write(i >>> 8);
- os.write(i);
- }
- }
- catch (IOException e) {
- throw new IgniteException(e);
- }
- }
- });
- }
-
- /**
- * @throws Exception If failed.
- */
- public void testDelimiterBasedDefaultConverter() throws Exception {
- test(null, DELIM, new Runnable() {
- @Override public void run() {
- try(Socket sock = new Socket(InetAddress.getLocalHost(), port);
- OutputStream os = new BufferedOutputStream(sock.getOutputStream())) {
- Marshaller marsh = new JdkMarshaller();
-
- for (int i = 0; i < CNT; i++) {
- byte[] msg = U.toArray(marsh.marshal(new Tuple(i)));
-
- os.write(msg);
- os.write(DELIM);
- }
- }
- catch (IOException | IgniteCheckedException e) {
- throw new IgniteException(e);
- }
- }
- });
-
- }
-
- /**
- * @throws Exception If failed.
- */
- public void testDelimiterBasedCustomConverter() throws Exception {
- SocketMessageConverter<Tuple> converter = new SocketMessageConverter<Tuple>() {
- @Override public Tuple convert(byte[] msg) {
- int i = (msg[0] & 0xFF) << 24;
- i |= (msg[1] & 0xFF) << 16;
- i |= (msg[2] & 0xFF) << 8;
- i |= msg[3] & 0xFF;
-
- return new Tuple(i);
- }
- };
-
- test(converter, DELIM, new Runnable() {
- @Override public void run() {
- try(Socket sock = new Socket(InetAddress.getLocalHost(), port);
- OutputStream os = new BufferedOutputStream(sock.getOutputStream())) {
-
- for (int i = 0; i < CNT; i++) {
- os.write(i >>> 24);
- os.write(i >>> 16);
- os.write(i >>> 8);
- os.write(i);
-
- os.write(DELIM);
- }
- }
- catch (IOException e) {
- throw new IgniteException(e);
- }
- }
- });
- }
-
- /**
- * @param converter Converter.
- * @param r Runnable..
- */
- private void test(@Nullable SocketMessageConverter<Tuple> converter, @Nullable byte[] delim, Runnable r) throws Exception
- {
- SocketStreamer<Tuple, Integer, String> sockStmr = null;
-
- try (IgniteDataStreamer<Integer, String> stmr = ignite.dataStreamer(null)) {
-
- stmr.allowOverwrite(true);
- stmr.autoFlushFrequency(10);
-
- sockStmr = new SocketStreamer<>();
-
- IgniteCache<Integer, String> cache = ignite.cache(null);
-
- sockStmr.setIgnite(ignite);
-
- sockStmr.setStreamer(stmr);
-
- sockStmr.setPort(port);
-
- sockStmr.setDelimiter(delim);
-
- sockStmr.setTupleExtractor(new StreamTupleExtractor<Tuple, Integer, String>() {
- @Override public Map.Entry<Integer, String> extract(Tuple msg) {
- return new IgniteBiTuple<>(msg.key, msg.val);
- }
- });
-
- if (converter != null)
- sockStmr.setConverter(converter);
-
- final CountDownLatch latch = new CountDownLatch(CNT);
-
- IgniteBiPredicate<UUID, CacheEvent> locLsnr = new IgniteBiPredicate<UUID, CacheEvent>() {
- @Override public boolean apply(UUID uuid, CacheEvent evt) {
- latch.countDown();
-
- return true;
- }
- };
-
- ignite.events(ignite.cluster().forCacheNodes(null)).remoteListen(locLsnr, null, EVT_CACHE_OBJECT_PUT);
-
- sockStmr.start();
-
- r.run();
-
- latch.await();
-
- assertEquals(CNT, cache.size(CachePeekMode.PRIMARY));
-
- for (int i = 0; i < CNT; i++)
- assertEquals(Integer.toString(i), cache.get(i));
- }
- finally {
- if (sockStmr != null)
- sockStmr.stop();
- }
-
- }
-
- /**
- * Tuple.
- */
- private static class Tuple implements Serializable {
- /** Serial version uid. */
- private static final long serialVersionUID = 0L;
-
- /** Key. */
- private final int key;
-
- /** Value. */
- private final String val;
-
- /**
- * @param key Key.
- */
- Tuple(int key) {
- this.key = key;
- this.val = Integer.toString(key);
- }
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8a6dd007/modules/core/src/test/java/org/apache/ignite/stream/socket/package-info.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/stream/socket/package-info.java b/modules/core/src/test/java/org/apache/ignite/stream/socket/package-info.java
deleted file mode 100644
index 2e28469..0000000
--- a/modules/core/src/test/java/org/apache/ignite/stream/socket/package-info.java
+++ /dev/null
@@ -1,21 +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.
- */
-
-/**
- * Contains tests for socket streamer.
- */
-package org.apache.ignite.stream.socket;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8a6dd007/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheFailoverTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheFailoverTestSuite.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheFailoverTestSuite.java
index dd3ce27..529bd23 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheFailoverTestSuite.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheFailoverTestSuite.java
@@ -54,6 +54,11 @@ public class IgniteCacheFailoverTestSuite extends TestSuite {
suite.addTestSuite(GridCacheAtomicPrimaryWriteOrderFailoverSelfTest.class);
suite.addTestSuite(GridCacheAtomicReplicatedFailoverSelfTest.class);
+ // TODO IGNITE-157.
+ // suite.addTestSuite(GridCachePartitionedFailoverSelfTest.class);
+ // suite.addTestSuite(GridCacheColocatedFailoverSelfTest.class);
+ // suite.addTestSuite(GridCacheReplicatedFailoverSelfTest.class);
+
suite.addTestSuite(IgniteCacheAtomicNodeJoinTest.class);
suite.addTestSuite(IgniteCacheTxNodeJoinTest.class);
suite.addTestSuite(IgniteCacheTxFairAffinityNodeJoinTest.class);
@@ -61,11 +66,6 @@ public class IgniteCacheFailoverTestSuite extends TestSuite {
suite.addTestSuite(IgniteCacheTxNearDisabledPutGetRestartTest.class);
suite.addTestSuite(IgniteCacheTxNearDisabledFairAffinityPutGetRestartTest.class);
- // TODO IGNITE-882.
- //suite.addTestSuite(GridCachePartitionedFailoverSelfTest.class);
- //suite.addTestSuite(GridCacheColocatedFailoverSelfTest.class);
- //suite.addTestSuite(GridCacheReplicatedFailoverSelfTest.class);
-
return suite;
}
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8a6dd007/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheRestartTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheRestartTestSuite.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheRestartTestSuite.java
index 24945dd..a449cfc 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheRestartTestSuite.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheRestartTestSuite.java
@@ -35,10 +35,10 @@ public class IgniteCacheRestartTestSuite extends TestSuite {
suite.addTestSuite(GridCachePartitionedTxSalvageSelfTest.class);
- // TODO IGNITE-882.
- //suite.addTestSuite(GridCachePartitionedNodeRestartTest.class);
- //suite.addTestSuite(GridCachePartitionedOptimisticTxNodeRestartTest.class);
- //suite.addTestSuite(GridCacheReplicatedNodeRestartSelfTest.class);
+ // TODO: IGNITE-157.
+ // suite.addTestSuite(GridCachePartitionedNodeRestartTest.class);
+ // suite.addTestSuite(GridCachePartitionedOptimisticTxNodeRestartTest.class);
+ // suite.addTestSuite(GridCacheReplicatedNodeRestartSelfTest.class);
suite.addTestSuite(IgniteCacheAtomicNodeRestartTest.class);
// suite.addTestSuite(IgniteCacheAtomicReplicatedNodeRestartSelfTest.class); // TODO IGNITE-747
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8a6dd007/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite2.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite2.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite2.java
index 5738778..dfd88a8 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite2.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite2.java
@@ -58,7 +58,6 @@ public class IgniteCacheTestSuite2 extends TestSuite {
suite.addTestSuite(GridCachePartitionedGetSelfTest.class);
suite.addTest(new TestSuite(GridCachePartitionedBasicApiTest.class));
suite.addTest(new TestSuite(GridCacheNearMultiGetSelfTest.class));
- suite.addTest(new TestSuite(NoneRebalanceModeSelfTest.class));
suite.addTest(new TestSuite(GridCacheNearJobExecutionSelfTest.class));
suite.addTest(new TestSuite(GridCacheNearOneNodeSelfTest.class));
suite.addTest(new TestSuite(GridCacheNearMultiNodeSelfTest.class));
@@ -77,7 +76,6 @@ public class IgniteCacheTestSuite2 extends TestSuite {
suite.addTest(new TestSuite(GridCachePartitionedNearDisabledBasicStoreMultiNodeSelfTest.class));
suite.addTest(new TestSuite(GridCachePartitionedEventSelfTest.class));
suite.addTest(new TestSuite(GridCachePartitionedLockSelfTest.class));
- suite.addTest(new TestSuite(GridCachePartitionedNearDisabledLockSelfTest.class));
suite.addTest(new TestSuite(GridCachePartitionedMultiNodeLockSelfTest.class));
suite.addTest(new TestSuite(GridCachePartitionedMultiNodeSelfTest.class));
suite.addTest(new TestSuite(GridCachePartitionedMultiThreadedPutGetSelfTest.class));
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8a6dd007/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite3.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite3.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite3.java
index c2b56ca..9394693 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite3.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite3.java
@@ -135,8 +135,6 @@ public class IgniteCacheTestSuite3 extends TestSuite {
// Cache interceptor tests.
suite.addTest(IgniteCacheInterceptorSelfTestSuite.suite());
- suite.addTestSuite(IgniteTxGetAfterStopTest.class);
-
return suite;
}
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8a6dd007/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java
index aaf7e5b..f7272d4 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java
@@ -126,10 +126,6 @@ public class IgniteCacheTestSuite4 extends TestSuite {
suite.addTestSuite(CacheNoValueClassOnServerNodeTest.class);
- suite.addTestSuite(CacheRemoveAllSelfTest.class);
-
- suite.addTestSuite(CacheOffheapMapEntrySelfTest.class);
-
return suite;
}
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8a6dd007/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteStreamTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteStreamTestSuite.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteStreamTestSuite.java
deleted file mode 100644
index 61be976..0000000
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteStreamTestSuite.java
+++ /dev/null
@@ -1,39 +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.testsuites;
-
-import org.apache.ignite.stream.socket.*;
-
-import junit.framework.*;
-
-/**
- * Stream test suite.
- */
-public class IgniteStreamTestSuite extends TestSuite {
- /**
- * @return Stream tests suite.
- * @throws Exception If failed.
- */
- public static TestSuite suite() throws Exception {
- TestSuite suite = new TestSuite("Ignite Stream Test Suite");
-
- suite.addTest(new TestSuite(SocketStreamerSelfTest.class));
-
- return suite;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8a6dd007/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteUtilSelfTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteUtilSelfTestSuite.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteUtilSelfTestSuite.java
index 32cd038..941b06e 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteUtilSelfTestSuite.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteUtilSelfTestSuite.java
@@ -67,7 +67,6 @@ public class IgniteUtilSelfTestSuite extends TestSuite {
suite.addTestSuite(GridNioSelfTest.class);
suite.addTestSuite(GridNioFilterChainSelfTest.class);
suite.addTestSuite(GridNioSslSelfTest.class);
- suite.addTestSuite(GridNioDelimitedBufferTest.class);
return suite;
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8a6dd007/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffheapIndexGetSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffheapIndexGetSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffheapIndexGetSelfTest.java
deleted file mode 100644
index 4e40040..0000000
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffheapIndexGetSelfTest.java
+++ /dev/null
@@ -1,111 +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.processors.cache;
-
-import org.apache.ignite.*;
-import org.apache.ignite.configuration.*;
-import org.apache.ignite.spi.discovery.tcp.*;
-import org.apache.ignite.spi.discovery.tcp.ipfinder.*;
-import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*;
-import org.apache.ignite.spi.swapspace.file.*;
-import org.apache.ignite.testframework.junits.common.*;
-
-import static org.apache.ignite.cache.CacheAtomicityMode.*;
-import static org.apache.ignite.cache.CacheMemoryMode.*;
-import static org.apache.ignite.cache.CacheMode.*;
-import static org.apache.ignite.cache.CacheWriteSynchronizationMode.*;
-import static org.apache.ignite.configuration.DeploymentMode.*;
-
-/**
- * Tests off heap storage when both offheaped and swapped entries exists.
- */
-public class GridCacheOffheapIndexGetSelfTest extends GridCommonAbstractTest {
- /** */
- private static final long OFFHEAP_MEM = 10L * 1024L;
-
- /** */
- private final TcpDiscoveryIpFinder ipFinder = new TcpDiscoveryVmIpFinder(true);
-
- /** {@inheritDoc} */
- @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
- IgniteConfiguration cfg = super.getConfiguration(gridName);
-
- TcpDiscoverySpi disco = new TcpDiscoverySpi();
-
- disco.setIpFinder(ipFinder);
-
- cfg.setDiscoverySpi(disco);
-
- cfg.setNetworkTimeout(2000);
-
- cfg.setSwapSpaceSpi(new FileSwapSpaceSpi());
-
- CacheConfiguration cacheCfg = defaultCacheConfiguration();
-
- cacheCfg.setWriteSynchronizationMode(FULL_SYNC);
- cacheCfg.setSwapEnabled(true);
- cacheCfg.setCacheMode(PARTITIONED);
- cacheCfg.setBackups(1);
- cacheCfg.setOffHeapMaxMemory(OFFHEAP_MEM);
- cacheCfg.setEvictSynchronized(true);
- cacheCfg.setEvictSynchronizedKeyBufferSize(1);
- cacheCfg.setAtomicityMode(TRANSACTIONAL);
- cacheCfg.setMemoryMode(OFFHEAP_TIERED);
- cacheCfg.setEvictionPolicy(null);
- cacheCfg.setOffHeapMaxMemory(OFFHEAP_MEM);
- cacheCfg.setIndexedTypes(Long.class, Long.class);
-
- cfg.setCacheConfiguration(cacheCfg);
-
- cfg.setDeploymentMode(SHARED);
-
- return cfg;
- }
-
- /** {@inheritDoc} */
- @Override protected void beforeTestsStarted() throws Exception {
- startGrids(2);
- }
-
- /** {@inheritDoc} */
- @Override protected void afterTestsStopped() throws Exception {
- stopAllGrids();
- }
-
- /** {@inheritDoc} */
- @Override protected void afterTest() throws Exception {
- grid(0).cache(null).clear();
- }
-
- /**
- * Tests behavior on offheaped entries.
- *
- * @throws Exception If failed.
- */
- public void testGet() throws Exception {
- fail("https://issues.apache.org/jira/browse/IGNITE-873");
-
- IgniteCache<Long, Long> cache = grid(0).cache(null);
-
- for (long i = 0; i < 100; i++)
- cache.put(i, i);
-
- for (long i = 0; i < 100; i++)
- assertEquals((Long)i, cache.get(i));
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8a6dd007/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheWithIndexingTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheWithIndexingTestSuite.java b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheWithIndexingTestSuite.java
index ae45120..a2ccc82 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheWithIndexingTestSuite.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheWithIndexingTestSuite.java
@@ -46,8 +46,6 @@ public class IgniteCacheWithIndexingTestSuite extends TestSuite {
suite.addTestSuite(CacheTtlOnheapAtomicLocalSelfTest.class);
suite.addTestSuite(CacheTtlOnheapAtomicPartitionedSelfTest.class);
- suite.addTestSuite(GridCacheOffheapIndexGetSelfTest.class);
-
suite.addTestSuite(CacheConfigurationP2PTest.class);
return suite;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8a6dd007/modules/jta/src/main/java/org/apache/ignite/internal/processors/cache/jta/CacheJtaManager.java
----------------------------------------------------------------------
diff --git a/modules/jta/src/main/java/org/apache/ignite/internal/processors/cache/jta/CacheJtaManager.java b/modules/jta/src/main/java/org/apache/ignite/internal/processors/cache/jta/CacheJtaManager.java
index 9af29d6..56bd676 100644
--- a/modules/jta/src/main/java/org/apache/ignite/internal/processors/cache/jta/CacheJtaManager.java
+++ b/modules/jta/src/main/java/org/apache/ignite/internal/processors/cache/jta/CacheJtaManager.java
@@ -85,7 +85,9 @@ public class CacheJtaManager extends CacheJtaManagerAdapter {
tCfg.getDefaultTxIsolation(),
tCfg.getDefaultTxTimeout(),
/*store enabled*/true,
- /*tx size*/0
+ /*tx size*/0,
+ /*group lock keys*/null,
+ /*partition lock*/false
);
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8a6dd007/modules/scalar/src/test/scala/org/apache/ignite/scalar/tests/ScalarCacheQueriesSpec.scala
----------------------------------------------------------------------
diff --git a/modules/scalar/src/test/scala/org/apache/ignite/scalar/tests/ScalarCacheQueriesSpec.scala b/modules/scalar/src/test/scala/org/apache/ignite/scalar/tests/ScalarCacheQueriesSpec.scala
index 2a11e5e..8d91fdc 100644
--- a/modules/scalar/src/test/scala/org/apache/ignite/scalar/tests/ScalarCacheQueriesSpec.scala
+++ b/modules/scalar/src/test/scala/org/apache/ignite/scalar/tests/ScalarCacheQueriesSpec.scala
@@ -31,7 +31,7 @@ import scala.collection.JavaConversions._
* Tests for Scalar cache queries API.
*/
@RunWith(classOf[JUnitRunner])
-class ScalarCacheQueriesSpec extends FunSpec with ShouldMatchers with BeforeAndAfterAll {
+class ScalarCacheQueriesSpec extends FlatSpec with ShouldMatchers with BeforeAndAfterAll {
/** Entries count. */
private val ENTRY_CNT = 10
@@ -67,142 +67,142 @@ class ScalarCacheQueriesSpec extends FunSpec with ShouldMatchers with BeforeAndA
stop()
}
- describe("Scalar cache queries API") {
- it("should correctly execute SCAN queries") {
- var res = c.scan(classOf[ObjectValue], (k: Int, v: ObjectValue) => k > 5 && v.intVal < 8).getAll
+ behavior of "Scalar cache queries API"
- assert(res.size == 2)
+ it should "correctly execute SCAN queries" in {
+ var res = c.scan(classOf[ObjectValue], (k: Int, v: ObjectValue) => k > 5 && v.intVal < 8).getAll
- res.foreach(t => assert(t.getKey > 5 && t.getKey < 8 && t.getKey == t.getValue.intVal))
+ assert(res.size == 2)
- res = c.scan((k: Int, v: ObjectValue) => k > 5 && v.intVal < 8).getAll
+ res.foreach(t => assert(t.getKey > 5 && t.getKey < 8 && t.getKey == t.getValue.intVal))
- assert(res.size == 2)
+ res = c.scan((k: Int, v: ObjectValue) => k > 5 && v.intVal < 8).getAll
- res.foreach(t => assert(t.getKey > 5 && t.getKey < 8 && t.getKey == t.getValue.intVal))
+ assert(res.size == 2)
- res = c.scan(classOf[ObjectValue], (k: Int, v: ObjectValue) => k > 5 && v.intVal < 8).getAll
+ res.foreach(t => assert(t.getKey > 5 && t.getKey < 8 && t.getKey == t.getValue.intVal))
- assert(res.size == 2)
+ res = c.scan(classOf[ObjectValue], (k: Int, v: ObjectValue) => k > 5 && v.intVal < 8).getAll
- res.foreach(t => assert(t.getKey > 5 && t.getKey < 8 && t.getKey == t.getValue.intVal))
+ assert(res.size == 2)
- res = c.scan((k: Int, v: ObjectValue) => k > 5 && v.intVal < 8).getAll
+ res.foreach(t => assert(t.getKey > 5 && t.getKey < 8 && t.getKey == t.getValue.intVal))
- assert(res.size == 2)
+ res = c.scan((k: Int, v: ObjectValue) => k > 5 && v.intVal < 8).getAll
- res.foreach(t => assert(t.getKey > 5 && t.getKey < 8 && t.getKey == t.getValue.intVal))
- }
+ assert(res.size == 2)
- it("should correctly execute SQL queries") {
- var res = c.sql(classOf[ObjectValue], "intVal > 5").getAll
+ res.foreach(t => assert(t.getKey > 5 && t.getKey < 8 && t.getKey == t.getValue.intVal))
+ }
- assert(res.size == ENTRY_CNT - 5)
+ it should "correctly execute SQL queries" in {
+ var res = c.sql(classOf[ObjectValue], "intVal > 5").getAll
- res.foreach(t => assert(t.getKey > 5 && t.getKey == t.getValue.intVal))
+ assert(res.size == ENTRY_CNT - 5)
- res = c.sql(classOf[ObjectValue], "intVal > ?", 5).getAll
+ res.foreach(t => assert(t.getKey > 5 && t.getKey == t.getValue.intVal))
- assert(res.size == ENTRY_CNT - 5)
+ res = c.sql(classOf[ObjectValue], "intVal > ?", 5).getAll
- res.foreach(t => assert(t.getKey > 5 && t.getKey == t.getValue.intVal))
+ assert(res.size == ENTRY_CNT - 5)
- res = c.sql("intVal > 5").getAll
+ res.foreach(t => assert(t.getKey > 5 && t.getKey == t.getValue.intVal))
- assert(res.size == ENTRY_CNT - 5)
+ res = c.sql("intVal > 5").getAll
- res.foreach(t => assert(t.getKey > 5 && t.getKey == t.getValue.intVal))
+ assert(res.size == ENTRY_CNT - 5)
- res = c.sql("intVal > ?", 5).getAll
+ res.foreach(t => assert(t.getKey > 5 && t.getKey == t.getValue.intVal))
- assert(res.size == ENTRY_CNT - 5)
+ res = c.sql("intVal > ?", 5).getAll
- res.foreach(t => assert(t.getKey > 5 && t.getKey == t.getValue.intVal))
+ assert(res.size == ENTRY_CNT - 5)
- res = c.sql(classOf[ObjectValue], "intVal > 5").getAll
+ res.foreach(t => assert(t.getKey > 5 && t.getKey == t.getValue.intVal))
- assert(res.size == ENTRY_CNT - 5)
+ res = c.sql(classOf[ObjectValue], "intVal > 5").getAll
- res.foreach(t => assert(t.getKey > 5 && t.getKey == t.getValue.intVal))
+ assert(res.size == ENTRY_CNT - 5)
- res = c.sql(classOf[ObjectValue], "intVal > ?", 5).getAll
+ res.foreach(t => assert(t.getKey > 5 && t.getKey == t.getValue.intVal))
- assert(res.size == ENTRY_CNT - 5)
+ res = c.sql(classOf[ObjectValue], "intVal > ?", 5).getAll
- res.foreach(t => assert(t.getKey > 5 && t.getKey == t.getValue.intVal))
+ assert(res.size == ENTRY_CNT - 5)
- res.foreach(t => assert(t.getKey > 5 && t.getKey == t.getValue.intVal))
+ res.foreach(t => assert(t.getKey > 5 && t.getKey == t.getValue.intVal))
- res = c.sql("intVal > 5").getAll
+ res.foreach(t => assert(t.getKey > 5 && t.getKey == t.getValue.intVal))
- assert(res.size == ENTRY_CNT - 5)
+ res = c.sql("intVal > 5").getAll
- res.foreach(t => assert(t.getKey > 5 && t.getKey == t.getValue.intVal))
+ assert(res.size == ENTRY_CNT - 5)
- res = c.sql("intVal > ?", 5).getAll
+ res.foreach(t => assert(t.getKey > 5 && t.getKey == t.getValue.intVal))
- assert(res.size == ENTRY_CNT - 5)
+ res = c.sql("intVal > ?", 5).getAll
- res.foreach(t => assert(t.getKey > 5 && t.getKey == t.getValue.intVal))
- }
+ assert(res.size == ENTRY_CNT - 5)
- it("should correctly execute TEXT queries") {
- var res = c.text(classOf[ObjectValue], "str").getAll
+ res.foreach(t => assert(t.getKey > 5 && t.getKey == t.getValue.intVal))
+ }
- assert(res.size == ENTRY_CNT)
+ it should "correctly execute TEXT queries" in {
+ var res = c.text(classOf[ObjectValue], "str").getAll
- res = c.text(classOf[ObjectValue], "five").getAll
+ assert(res.size == ENTRY_CNT)
- assert(res.size == 1)
- assert(res.head.getKey == 5)
+ res = c.text(classOf[ObjectValue], "five").getAll
- res = c.text("str").getAll
+ assert(res.size == 1)
+ assert(res.head.getKey == 5)
- assert(res.size == ENTRY_CNT)
+ res = c.text("str").getAll
- res = c.text("five").getAll
+ assert(res.size == ENTRY_CNT)
- assert(res.size == 1)
- assert(res.head.getKey == 5)
+ res = c.text("five").getAll
- res = c.text(classOf[ObjectValue], "str").getAll
+ assert(res.size == 1)
+ assert(res.head.getKey == 5)
- assert(res.size == ENTRY_CNT)
+ res = c.text(classOf[ObjectValue], "str").getAll
- res = c.text(classOf[ObjectValue], "five").getAll
+ assert(res.size == ENTRY_CNT)
- assert(res.size == 1)
- assert(res.head.getKey == 5)
+ res = c.text(classOf[ObjectValue], "five").getAll
- res = c.text("str").getAll
+ assert(res.size == 1)
+ assert(res.head.getKey == 5)
- assert(res.size == ENTRY_CNT)
+ res = c.text("str").getAll
- res = c.text("five").getAll
+ assert(res.size == ENTRY_CNT)
- assert(res.size == 1)
- assert(res.head.getKey == 5)
- }
+ res = c.text("five").getAll
- it("should correctly execute fields queries") {
- var res = c.sqlFields("select intVal from ObjectValue where intVal > 5").getAll
+ assert(res.size == 1)
+ assert(res.head.getKey == 5)
+ }
- assert(res.size == ENTRY_CNT - 5)
+ it should "correctly execute fields queries" in {
+ var res = c.sqlFields("select intVal from ObjectValue where intVal > 5").getAll
- res.foreach(t => assert(t.size == 1 && t.head.asInstanceOf[Int] > 5))
+ assert(res.size == ENTRY_CNT - 5)
- res = c.sqlFields("select intVal from ObjectValue where intVal > ?", 5).getAll
+ res.foreach(t => assert(t.size == 1 && t.head.asInstanceOf[Int] > 5))
- assert(res.size == ENTRY_CNT - 5)
+ res = c.sqlFields("select intVal from ObjectValue where intVal > ?", 5).getAll
- res.foreach(t => assert(t.size == 1 && t.head.asInstanceOf[Int] > 5))
- }
+ assert(res.size == ENTRY_CNT - 5)
+
+ res.foreach(t => assert(t.size == 1 && t.head.asInstanceOf[Int] > 5))
+ }
- it("should correctly execute queries with multiple arguments") {
- val res = c.sql("from ObjectValue where intVal in (?, ?, ?)", 1, 2, 3).getAll
+ it should "correctly execute queries with multiple arguments" in {
+ val res = c.sql("from ObjectValue where intVal in (?, ?, ?)", 1, 2, 3).getAll
- assert(res.size == 3)
- }
+ assert(res.size == 3)
}
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8a6dd007/modules/scalar/src/test/scala/org/apache/ignite/scalar/tests/ScalarCacheSpec.scala
----------------------------------------------------------------------
diff --git a/modules/scalar/src/test/scala/org/apache/ignite/scalar/tests/ScalarCacheSpec.scala b/modules/scalar/src/test/scala/org/apache/ignite/scalar/tests/ScalarCacheSpec.scala
index 853cc16..0fde48f 100644
--- a/modules/scalar/src/test/scala/org/apache/ignite/scalar/tests/ScalarCacheSpec.scala
+++ b/modules/scalar/src/test/scala/org/apache/ignite/scalar/tests/ScalarCacheSpec.scala
@@ -22,35 +22,32 @@ import org.apache.ignite.events.EventType._
import org.apache.ignite.lang.IgnitePredicate
import org.apache.ignite.scalar.scalar
import org.apache.ignite.scalar.scalar._
-
import org.junit.runner.RunWith
import org.scalatest._
import org.scalatest.junit.JUnitRunner
-
import scala.collection.JavaConversions._
/**
* Scalar cache test.
*/
@RunWith(classOf[JUnitRunner])
-class ScalarCacheSpec extends FunSpec with ShouldMatchers {
+class ScalarCacheSpec extends FlatSpec with ShouldMatchers {
private val CFG = "modules/scalar/src/test/resources/spring-cache.xml"
- describe("Scalar cache") {
+ behavior of "Scalar cache"
- it("should work properly via Java APIs") {
- scalar(CFG) {
- registerListener()
+ it should "work properly via Java APIs" in {
+ scalar(CFG) {
+ registerListener()
- val c = cache$[Int, Int]("partitioned").get
+ val c = cache$[Int, Int]("partitioned").get
- c.put(1, 1)
- c.put(2, 2)
+ c.put(1, 1)
+ c.put(2, 2)
- c.iterator() foreach println
+ c.iterator() foreach println
- println("Size is: " + c.size())
- }
+ println("Size is: " + c.size())
}
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8a6dd007/modules/scalar/src/test/scala/org/apache/ignite/scalar/tests/ScalarConversionsSpec.scala
----------------------------------------------------------------------
diff --git a/modules/scalar/src/test/scala/org/apache/ignite/scalar/tests/ScalarConversionsSpec.scala b/modules/scalar/src/test/scala/org/apache/ignite/scalar/tests/ScalarConversionsSpec.scala
index c766422..b20c755 100644
--- a/modules/scalar/src/test/scala/org/apache/ignite/scalar/tests/ScalarConversionsSpec.scala
+++ b/modules/scalar/src/test/scala/org/apache/ignite/scalar/tests/ScalarConversionsSpec.scala
@@ -21,7 +21,7 @@ import org.apache.ignite.internal.util.lang._
import org.apache.ignite.lang._
import org.apache.ignite.scalar.scalar._
import org.junit.runner.RunWith
-import org.scalatest._
+import org.scalatest.FlatSpec
import org.scalatest.junit.JUnitRunner
import org.scalatest.matchers.ShouldMatchers
@@ -31,10 +31,10 @@ import java.util.concurrent.atomic._
*
*/
@RunWith(classOf[JUnitRunner])
-class ScalarConversionsSpec extends FunSpec with ShouldMatchers {
- describe("Scalar mixin") {
+class ScalarConversionsSpec extends FlatSpec with ShouldMatchers {
+ behavior of "Scalar mixin"
- it("should convert reducer") {
+ it should "convert reducer" in {
val r = new IgniteReducer[Int, Int] {
var sum = 0
@@ -52,7 +52,7 @@ class ScalarConversionsSpec extends FunSpec with ShouldMatchers {
assert(r.scala.apply(Seq(1, 2, 3)) == 6)
}
- it("should convert reducer 2") {
+ it should "convert reducer 2" in {
val r = new IgniteReducer2[Int, Int, Int] {
var sum = 0
@@ -70,7 +70,7 @@ class ScalarConversionsSpec extends FunSpec with ShouldMatchers {
assert(r.scala.apply(Seq(1, 2), Seq(3, 4)) == 21)
}
- it("should convert reducer 3") {
+ it should "convert reducer 3" in {
val r = new IgniteReducer3[Int, Int, Int, Int] {
var sum = 0
@@ -88,14 +88,14 @@ class ScalarConversionsSpec extends FunSpec with ShouldMatchers {
assert(r.scala.apply(Seq(1, 2), Seq(1, 2), Seq(1, 2)) == 27)
}
- it("should convert tuple 2") {
+ it should "convert tuple 2" in {
val t = new IgniteBiTuple[Int, Int](1, 2)
assert(t.scala._1 == 1)
assert(t.scala._2 == 2)
}
- it("should convert tuple 3") {
+ it should "convert tuple 3" in {
val t = new GridTuple3[Int, Int, Int](1, 2, 3)
assert(t.scala._1 == 1)
@@ -103,7 +103,7 @@ class ScalarConversionsSpec extends FunSpec with ShouldMatchers {
assert(t.scala._3 == 3)
}
- it("should convert tuple 4") {
+ it should "convert tuple 4" in {
val t = new GridTuple4[Int, Int, Int, Int](1, 2, 3, 4)
assert(t.scala._1 == 1)
@@ -112,7 +112,7 @@ class ScalarConversionsSpec extends FunSpec with ShouldMatchers {
assert(t.scala._4 == 4)
}
- it("should convert tuple 5") {
+ it should "convert tuple 5" in {
val t = new GridTuple5[Int, Int, Int, Int, Int](1, 2, 3, 4, 5)
assert(t.scala._1 == 1)
@@ -122,7 +122,7 @@ class ScalarConversionsSpec extends FunSpec with ShouldMatchers {
assert(t.scala._5 == 5)
}
- it("should convert in closure") {
+ it should "convert in closure" in {
val i = new AtomicInteger()
val f = new IgniteInClosure[Int] {
@@ -136,7 +136,7 @@ class ScalarConversionsSpec extends FunSpec with ShouldMatchers {
assert(i.get == 9)
}
- it("should convert in closure 2") {
+ it should "convert in closure 2" in {
val i = new AtomicInteger()
val f = new IgniteBiInClosure[Int, Int] {
@@ -150,7 +150,7 @@ class ScalarConversionsSpec extends FunSpec with ShouldMatchers {
assert(i.get == 6)
}
- it("should convert in closure 3") {
+ it should "convert in closure 3" in {
val i = new AtomicInteger()
val f = new GridInClosure3[Int, Int, Int] {
@@ -164,7 +164,7 @@ class ScalarConversionsSpec extends FunSpec with ShouldMatchers {
assert(i.get == 9)
}
- it("should convert absolute closure") {
+ it should "convert absolute closure" in {
val i = new AtomicInteger()
val f = new GridAbsClosure {
@@ -178,7 +178,7 @@ class ScalarConversionsSpec extends FunSpec with ShouldMatchers {
assert(i.get == 3)
}
- it("should convert absolute predicate") {
+ it should "convert absolute predicate" in {
val i = new AtomicInteger()
val p = new GridAbsPredicate {
@@ -195,7 +195,7 @@ class ScalarConversionsSpec extends FunSpec with ShouldMatchers {
assert(p.scala.apply())
}
- it("should convert predicate") {
+ it should "convert predicate" in {
val p = new IgnitePredicate[Int] {
override def apply(e: Int): Boolean =
e > 5
@@ -205,7 +205,7 @@ class ScalarConversionsSpec extends FunSpec with ShouldMatchers {
assert(p.scala.apply(6))
}
- it("should convert predicate 2") {
+ it should "convert predicate 2" in {
val p = new IgniteBiPredicate[Int, Int] {
override def apply(e1: Int, e2: Int): Boolean =
e1 + e2 > 5
@@ -215,7 +215,7 @@ class ScalarConversionsSpec extends FunSpec with ShouldMatchers {
assert(p.scala.apply(3, 3))
}
- it("should convert predicate 3") {
+ it should "convert predicate 3" in {
val p = new GridPredicate3[Int, Int, Int] {
override def apply(e1: Int, e2: Int, e3: Int): Boolean =
e1 + e2 + e3 > 5
@@ -225,7 +225,7 @@ class ScalarConversionsSpec extends FunSpec with ShouldMatchers {
assert(p.scala.apply(2, 2, 2))
}
- it("should convert closure") {
+ it should "convert closure" in {
val f = new IgniteClosure[Int, Int] {
override def apply(e: Int): Int =
e * 3
@@ -234,7 +234,7 @@ class ScalarConversionsSpec extends FunSpec with ShouldMatchers {
assert(f.scala.apply(3) == 9)
}
- it("should convert closure 2") {
+ it should "convert closure 2" in {
val f = new IgniteBiClosure[Int, Int, Int] {
override def apply(e1: Int, e2: Int): Int =
e1 + e2
@@ -243,7 +243,7 @@ class ScalarConversionsSpec extends FunSpec with ShouldMatchers {
assert(f.scala.apply(3, 3) == 6)
}
- it("should convert closure 3") {
+ it should "convert closure 3" in {
val f = new GridClosure3[Int, Int, Int, Int] {
override def apply(e1: Int, e2: Int, e3: Int): Int =
e1 + e2 + e3
@@ -251,5 +251,4 @@ class ScalarConversionsSpec extends FunSpec with ShouldMatchers {
assert(f.scala.apply(3, 3, 3) == 9)
}
- }
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8a6dd007/modules/scalar/src/test/scala/org/apache/ignite/scalar/tests/ScalarProjectionSpec.scala
----------------------------------------------------------------------
diff --git a/modules/scalar/src/test/scala/org/apache/ignite/scalar/tests/ScalarProjectionSpec.scala b/modules/scalar/src/test/scala/org/apache/ignite/scalar/tests/ScalarProjectionSpec.scala
index ecb1e5a..a035550 100644
--- a/modules/scalar/src/test/scala/org/apache/ignite/scalar/tests/ScalarProjectionSpec.scala
+++ b/modules/scalar/src/test/scala/org/apache/ignite/scalar/tests/ScalarProjectionSpec.scala
@@ -23,7 +23,6 @@ import org.apache.ignite.configuration.IgniteConfiguration
import org.apache.ignite.messaging.MessagingListenActor
import org.apache.ignite.scalar.scalar
import org.apache.ignite.scalar.scalar._
-
import org.junit.runner.RunWith
import org.scalatest._
import org.scalatest.junit.JUnitRunner
@@ -36,7 +35,7 @@ import scala.collection.JavaConversions._
* Scalar cache test.
*/
@RunWith(classOf[JUnitRunner])
-class ScalarProjectionSpec extends FunSpec with ShouldMatchers with BeforeAndAfterAll {
+class ScalarProjectionSpec extends FlatSpec with ShouldMatchers with BeforeAndAfterAll {
/**
*
*/
@@ -69,95 +68,82 @@ class ScalarProjectionSpec extends FunSpec with ShouldMatchers with BeforeAndAft
cfg
}
- describe("ScalarProjectionPimp class") {
- it("should return all nodes") {
- scalar(gridConfig("node-scalar", true)) {
- assertResult(3)(ignite$("node-scalar").get.cluster().nodes().size)
- }
- }
+ behavior of "ScalarProjectionPimp class"
- it("should return shown nodes") {
- scalar(gridConfig("node-scalar", true)) {
- assert(ignite$("node-scalar").get.nodes$(
- (node: ClusterNode) => node.attribute[Boolean]("shown")).size == 2)
- }
+ it should "return all nodes" in scalar(gridConfig("node-scalar", true)) {
+ assertResult(3) {
+ ignite$("node-scalar").get.cluster().nodes().size
}
+ }
- it("should return all remote nodes") {
- scalar(gridConfig("node-scalar", true)) {
- assertResult(2)(ignite$("node-scalar").get.remoteNodes$().size)
- }
+ it should "return shown nodes" in scalar(gridConfig("node-scalar", true)) {
+ assert(ignite$("node-scalar").get.nodes$((node: ClusterNode) => node.attribute[Boolean]("shown")).size == 2)
+ }
+
+ it should "return all remote nodes" in scalar(gridConfig("node-scalar", true)) {
+ assertResult(2) {
+ ignite$("node-scalar").get.remoteNodes$().size
}
+ }
+
+ it should "return shown remote nodes" in scalar(gridConfig("node-scalar", true)) {
+ assert(ignite$("node-scalar").get.remoteNodes$((node: ClusterNode) =>
+ node.attribute[Boolean]("shown")).size == 1)
+ }
+
+ it should "correctly send messages" in scalar(gridConfig("node-scalar", true)) {
- it("should return shown remote nodes") {
- scalar(gridConfig("node-scalar", true)) {
- assert(ignite$("node-scalar").get.remoteNodes$((node: ClusterNode) =>
- node.attribute[Boolean]("shown")).size == 1)
+ ignite$("node-1").get.message().remoteListen(null, new MessagingListenActor[Any]() {
+ def receive(nodeId: UUID, msg: Any) {
+ println("node-1 received " + msg)
}
- }
+ })
- it("should correctly send messages") {
- scalar(gridConfig("node-scalar", true)) {
- ignite$("node-1").get.message().remoteListen(null, new MessagingListenActor[Any]() {
- def receive(nodeId: UUID, msg: Any) {
- println("node-1 received " + msg)
- }
- })
-
- ignite$("node-2").get.message().remoteListen(null, new MessagingListenActor[Any]() {
- def receive(nodeId: UUID, msg: Any) {
- println("node-2 received " + msg)
- }
- })
-
- ignite$("node-scalar").get !<("Message", null)
- ignite$("node-scalar").get !<(Seq("Message1", "Message2"), null)
+ ignite$("node-2").get.message().remoteListen(null, new MessagingListenActor[Any]() {
+ def receive(nodeId: UUID, msg: Any) {
+ println("node-2 received " + msg)
}
- }
+ })
+
+ ignite$("node-scalar").get !< ("Message", null)
+ ignite$("node-scalar").get !< (Seq("Message1", "Message2"), null)
+ }
- it("should correctly make calls") {
- scalar(gridConfig("node-scalar", true)) {
- println("CALL RESULT: " + ignite$("node-scalar").get #<(() => "Message", null))
+ it should "correctly make calls" in scalar(gridConfig("node-scalar", true)) {
+ println("CALL RESULT: " + ignite$("node-scalar").get #< (() => "Message", null))
- println("ASYNC CALL RESULT: " + ignite$("node-scalar").get.callAsync$[String](() => "Message", null).get)
+ println("ASYNC CALL RESULT: " + ignite$("node-scalar").get.callAsync$[String](() => "Message", null).get)
- val call1: () => String = () => "Message1"
- val call2: () => String = () => "Message2"
+ val call1: () => String = () => "Message1"
+ val call2: () => String = () => "Message2"
- println("MULTIPLE CALL RESULT: " + ignite$("node-scalar").get #<(Seq(call1, call2), null))
+ println("MULTIPLE CALL RESULT: " + ignite$("node-scalar").get #< (Seq(call1, call2), null))
- println("MULTIPLE ASYNC CALL RESULT: " +
- (ignite$("node-scalar").get #?(Seq(call1, call2), null)).get)
- }
- }
+ println("MULTIPLE ASYNC CALL RESULT: " +
+ (ignite$("node-scalar").get #? (Seq(call1, call2), null)).get)
+ }
- it("should correctly make runs") {
- scalar(gridConfig("node-scalar", true)) {
- ignite$("node-scalar").get *<(() => println("RUN RESULT: Message"), null)
+ it should "correctly make runs" in scalar(gridConfig("node-scalar", true)) {
+ ignite$("node-scalar").get *< (() => println("RUN RESULT: Message"), null)
- (ignite$("node-scalar").get *?(() => println("ASYNC RUN RESULT: Message"), null)).get
+ (ignite$("node-scalar").get *? (() => println("ASYNC RUN RESULT: Message"), null)).get
- val run1: () => Unit = () => println("RUN 1 RESULT: Message1")
- val run2: () => Unit = () => println("RUN 2 RESULT: Message2")
+ val run1: () => Unit = () => println("RUN 1 RESULT: Message1")
+ val run2: () => Unit = () => println("RUN 2 RESULT: Message2")
- ignite$("node-scalar").get *<(Seq(run1, run2), null)
+ ignite$("node-scalar").get *< (Seq(run1, run2), null)
- val runAsync1: () => Unit = () => println("ASYNC RUN 1 RESULT: Message1")
- val runAsync2: () => Unit = () => println("ASYNC RUN 2 RESULT: Message2")
+ val runAsync1: () => Unit = () => println("ASYNC RUN 1 RESULT: Message1")
+ val runAsync2: () => Unit = () => println("ASYNC RUN 2 RESULT: Message2")
- (ignite$("node-scalar").get *?(Seq(runAsync1, runAsync2), null)).get
- }
- }
+ (ignite$("node-scalar").get *? (Seq(runAsync1, runAsync2), null)).get
+ }
- it("should correctly reduce") {
- scalar(gridConfig("node-scalar", true)) {
- val call1: () => Int = () => 15
- val call2: () => Int = () => 82
+ it should "correctly reduce" in scalar(gridConfig("node-scalar", true)) {
+ val call1: () => Int = () => 15
+ val call2: () => Int = () => 82
- assert(ignite$("node-scalar").get @<(Seq(call1, call2), (n: Seq[Int]) => n.sum, null) == 97)
- assert(ignite$("node-scalar").get.reduceAsync$(Seq(call1, call2), (
- n: Seq[Int]) => n.sum, null).get == 97)
- }
- }
+ assert(ignite$("node-scalar").get @< (Seq(call1, call2), (n: Seq[Int]) => n.sum, null) == 97)
+ assert(ignite$("node-scalar").get.reduceAsync$(Seq(call1, call2), (n: Seq[Int]) => n.sum, null).get == 97)
}
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8a6dd007/modules/scalar/src/test/scala/org/apache/ignite/scalar/tests/ScalarReturnableSpec.scala
----------------------------------------------------------------------
diff --git a/modules/scalar/src/test/scala/org/apache/ignite/scalar/tests/ScalarReturnableSpec.scala b/modules/scalar/src/test/scala/org/apache/ignite/scalar/tests/ScalarReturnableSpec.scala
index 2927dd7..21e8cef 100644
--- a/modules/scalar/src/test/scala/org/apache/ignite/scalar/tests/ScalarReturnableSpec.scala
+++ b/modules/scalar/src/test/scala/org/apache/ignite/scalar/tests/ScalarReturnableSpec.scala
@@ -18,7 +18,6 @@
package org.apache.ignite.scalar.tests
import org.apache.ignite.scalar.scalar._
-
import org.junit.runner.RunWith
import org.scalatest._
import org.scalatest.junit.JUnitRunner
@@ -29,32 +28,30 @@ import scala.util.control.Breaks._
*
*/
@RunWith(classOf[JUnitRunner])
-class ScalarReturnableSpec extends FunSpec with ShouldMatchers {
- describe("Scalar '^^'") {
- it("should work") {
- var i = 0
-
- breakable {
- while (true) {
- if (i == 0)
- println("Only once!") ^^
-
- i += 1
- }
- }
+class ScalarReturnableSpec extends FlatSpec with ShouldMatchers {
+ "Scalar '^^'" should "work" in {
+ var i = 0
- assert(i == 0)
- }
-
- // Ignore exception below.
- def test() = breakable {
+ breakable {
while (true) {
- println("Only once!") ^^
+ if (i == 0)
+ println("Only once!") ^^
+
+ i += 1
}
}
- it("should also work") {
- test()
+ assert(i == 0)
+ }
+
+ "Scalar '^^'" should "also work" in {
+ test()
+ }
+
+ // Ignore exception below.
+ def test() = breakable {
+ while (true) {
+ println("Only once!") ^^
}
}
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8a6dd007/modules/visor-console/pom.xml
----------------------------------------------------------------------
diff --git a/modules/visor-console/pom.xml b/modules/visor-console/pom.xml
index 95eb6cf..45e0f30 100644
--- a/modules/visor-console/pom.xml
+++ b/modules/visor-console/pom.xml
@@ -100,7 +100,7 @@
<dependency>
<groupId>org.scalatest</groupId>
<artifactId>scalatest_2.11</artifactId>
- <version>2.2.4</version>
+ <version>2.2.2</version>
<scope>test</scope>
<exclusions>
<exclusion>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8a6dd007/modules/visor-console/src/test/scala/org/apache/ignite/visor/VisorRuntimeBaseSpec.scala
----------------------------------------------------------------------
diff --git a/modules/visor-console/src/test/scala/org/apache/ignite/visor/VisorRuntimeBaseSpec.scala b/modules/visor-console/src/test/scala/org/apache/ignite/visor/VisorRuntimeBaseSpec.scala
index f27bae3..aa6ab84 100644
--- a/modules/visor-console/src/test/scala/org/apache/ignite/visor/VisorRuntimeBaseSpec.scala
+++ b/modules/visor-console/src/test/scala/org/apache/ignite/visor/VisorRuntimeBaseSpec.scala
@@ -24,7 +24,7 @@ import org.scalatest._
/**
* Base abstract class for unit tests requiring Visor runtime.
*/
-abstract class VisorRuntimeBaseSpec(private[this] val num: Int) extends FunSpec with Matchers
+abstract class VisorRuntimeBaseSpec(private[this] val num: Int) extends FlatSpec with Matchers
with BeforeAndAfterAll with BeforeAndAfterEach {
assert(num >= 1)