You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by pt...@apache.org on 2016/09/28 11:51:54 UTC
[1/8] ignite git commit: Code style fixes.
Repository: ignite
Updated Branches:
refs/heads/master 4ffb5860b -> ed4739235
Code style fixes.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/ec9ddcd3
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/ec9ddcd3
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/ec9ddcd3
Branch: refs/heads/master
Commit: ec9ddcd3d99d19403bf19e1172ede2afdab6c86f
Parents: a53c399
Author: sboikov <sb...@gridgain.com>
Authored: Wed Sep 28 12:05:28 2016 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Wed Sep 28 12:05:28 2016 +0300
----------------------------------------------------------------------
.../stream/jms11/IgniteJmsStreamerTest.java | 206 ++++++++++++-------
.../jms11/IgniteJmsStreamerTestSuite.java | 2 +-
2 files changed, 134 insertions(+), 74 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/ec9ddcd3/modules/jms11/src/test/java/org/apache/ignite/stream/jms11/IgniteJmsStreamerTest.java
----------------------------------------------------------------------
diff --git a/modules/jms11/src/test/java/org/apache/ignite/stream/jms11/IgniteJmsStreamerTest.java b/modules/jms11/src/test/java/org/apache/ignite/stream/jms11/IgniteJmsStreamerTest.java
index 238d939..290185e 100644
--- a/modules/jms11/src/test/java/org/apache/ignite/stream/jms11/IgniteJmsStreamerTest.java
+++ b/modules/jms11/src/test/java/org/apache/ignite/stream/jms11/IgniteJmsStreamerTest.java
@@ -59,26 +59,39 @@ import static org.apache.ignite.events.EventType.EVT_CACHE_OBJECT_PUT;
* @author Raul Kripalani
*/
public class IgniteJmsStreamerTest extends GridCommonAbstractTest {
-
+ /** */
private static final int CACHE_ENTRY_COUNT = 100;
+
+ /** */
private static final String QUEUE_NAME = "ignite.test.queue";
+
+ /** */
private static final String TOPIC_NAME = "ignite.test.topic";
+
+ /** */
private static final Map<String, String> TEST_DATA = new HashMap<>();
+ /** */
+ private BrokerService broker;
+
+ /** */
+ private ConnectionFactory connFactory;
+
static {
for (int i = 1; i <= CACHE_ENTRY_COUNT; i++)
TEST_DATA.put(Integer.toString(i), "v" + i);
}
- private BrokerService broker;
- private ConnectionFactory connectionFactory;
-
/** Constructor. */
public IgniteJmsStreamerTest() {
super(true);
}
- @Before @SuppressWarnings("unchecked")
+ /**
+ * @throws Exception If failed.
+ */
+ @Before
+ @SuppressWarnings("unchecked")
public void beforeTest() throws Exception {
grid().<Integer, String>getOrCreateCache(defaultCacheConfiguration());
@@ -88,21 +101,24 @@ public class IgniteJmsStreamerTest extends GridCommonAbstractTest {
broker.setPersistenceAdapter(null);
broker.setPersistenceFactory(null);
- PolicyMap policyMap = new PolicyMap();
- PolicyEntry policy = new PolicyEntry();
+ PolicyMap plcMap = new PolicyMap();
+ PolicyEntry plc = new PolicyEntry();
- policy.setQueuePrefetch(1);
+ plc.setQueuePrefetch(1);
- broker.setDestinationPolicy(policyMap);
- broker.getDestinationPolicy().setDefaultEntry(policy);
+ broker.setDestinationPolicy(plcMap);
+ broker.getDestinationPolicy().setDefaultEntry(plc);
broker.setSchedulerSupport(false);
broker.start(true);
- connectionFactory = new ActiveMQConnectionFactory(BrokerRegistry.getInstance().findFirst().getVmConnectorURI());
-
+ connFactory = new ActiveMQConnectionFactory(BrokerRegistry.getInstance().findFirst().getVmConnectorURI());
}
+ /**
+ *
+ * @throws Exception Iff ailed.
+ */
@After
public void afterTest() throws Exception {
grid().cache(null).clear();
@@ -111,11 +127,14 @@ public class IgniteJmsStreamerTest extends GridCommonAbstractTest {
broker.deleteAllMessages();
}
+ /**
+ * @throws Exception If failed.
+ */
public void testQueueFromName() throws Exception {
- Destination destination = new ActiveMQQueue(QUEUE_NAME);
+ Destination dest = new ActiveMQQueue(QUEUE_NAME);
// produce messages into the queue
- produceObjectMessages(destination, false);
+ produceObjectMessages(dest, false);
try (IgniteDataStreamer<String, String> dataStreamer = grid().dataStreamer(null)) {
JmsStreamer<ObjectMessage, String, String> jmsStreamer = newJmsStreamer(ObjectMessage.class, dataStreamer);
@@ -137,8 +156,11 @@ public class IgniteJmsStreamerTest extends GridCommonAbstractTest {
}
+ /**
+ * @throws Exception If failed.
+ */
public void testTopicFromName() throws JMSException, InterruptedException {
- Destination destination = new ActiveMQTopic(TOPIC_NAME);
+ Destination dest = new ActiveMQTopic(TOPIC_NAME);
// should not produced messages until subscribed to the topic; otherwise they will be missed because this is not
// a durable subscriber (for which a dedicated test exists)
@@ -154,7 +176,7 @@ public class IgniteJmsStreamerTest extends GridCommonAbstractTest {
jmsStreamer.start();
// produce messages
- produceObjectMessages(destination, false);
+ produceObjectMessages(dest, false);
// all cache PUT events received in 10 seconds
latch.await(10, TimeUnit.SECONDS);
@@ -166,15 +188,18 @@ public class IgniteJmsStreamerTest extends GridCommonAbstractTest {
}
+ /**
+ * @throws Exception If failed.
+ */
public void testQueueFromExplicitDestination() throws Exception {
- Destination destination = new ActiveMQQueue(QUEUE_NAME);
+ Destination dest = new ActiveMQQueue(QUEUE_NAME);
// produce messages into the queue
- produceObjectMessages(destination, false);
+ produceObjectMessages(dest, false);
try (IgniteDataStreamer<String, String> dataStreamer = grid().dataStreamer(null)) {
JmsStreamer<ObjectMessage, String, String> jmsStreamer = newJmsStreamer(ObjectMessage.class, dataStreamer);
- jmsStreamer.setDestination(destination);
+ jmsStreamer.setDestination(dest);
// subscribe to cache PUT events and return a countdown latch starting at CACHE_ENTRY_COUNT
CountDownLatch latch = subscribeToPutEvents(CACHE_ENTRY_COUNT);
@@ -192,15 +217,18 @@ public class IgniteJmsStreamerTest extends GridCommonAbstractTest {
}
+ /**
+ * @throws Exception If failed.
+ */
public void testTopicFromExplicitDestination() throws JMSException, InterruptedException {
- Destination destination = new ActiveMQTopic(TOPIC_NAME);
+ Destination dest = new ActiveMQTopic(TOPIC_NAME);
// should not produced messages until subscribed to the topic; otherwise they will be missed because this is not
// a durable subscriber (for which a dedicated test exists)
try (IgniteDataStreamer<String, String> dataStreamer = grid().dataStreamer(null)) {
JmsStreamer<ObjectMessage, String, String> jmsStreamer = newJmsStreamer(ObjectMessage.class, dataStreamer);
- jmsStreamer.setDestination(destination);
+ jmsStreamer.setDestination(dest);
// subscribe to cache PUT events and return a countdown latch starting at CACHE_ENTRY_COUNT
CountDownLatch latch = subscribeToPutEvents(CACHE_ENTRY_COUNT);
@@ -208,7 +236,7 @@ public class IgniteJmsStreamerTest extends GridCommonAbstractTest {
jmsStreamer.start();
// produce messages
- produceObjectMessages(destination, false);
+ produceObjectMessages(dest, false);
// all cache PUT events received in 10 seconds
latch.await(10, TimeUnit.SECONDS);
@@ -220,15 +248,18 @@ public class IgniteJmsStreamerTest extends GridCommonAbstractTest {
}
+ /**
+ * @throws Exception If failed.
+ */
public void testInsertMultipleCacheEntriesFromOneMessage() throws Exception {
- Destination destination = new ActiveMQQueue(QUEUE_NAME);
+ Destination dest = new ActiveMQQueue(QUEUE_NAME);
// produce A SINGLE MESSAGE, containing all data, into the queue
- produceStringMessages(destination, true);
+ produceStringMessages(dest, true);
try (IgniteDataStreamer<String, String> dataStreamer = grid().dataStreamer(null)) {
JmsStreamer<TextMessage, String, String> jmsStreamer = newJmsStreamer(TextMessage.class, dataStreamer);
- jmsStreamer.setDestination(destination);
+ jmsStreamer.setDestination(dest);
// subscribe to cache PUT events and return a countdown latch starting at CACHE_ENTRY_COUNT
CountDownLatch latch = subscribeToPutEvents(CACHE_ENTRY_COUNT);
@@ -245,12 +276,15 @@ public class IgniteJmsStreamerTest extends GridCommonAbstractTest {
}
+ /**
+ * @throws Exception If failed.
+ */
public void testDurableSubscriberStartStopStart() throws Exception {
- Destination destination = new ActiveMQTopic(TOPIC_NAME);
+ Destination dest = new ActiveMQTopic(TOPIC_NAME);
try (IgniteDataStreamer<String, String> dataStreamer = grid().dataStreamer(null)) {
JmsStreamer<TextMessage, String, String> jmsStreamer = newJmsStreamer(TextMessage.class, dataStreamer);
- jmsStreamer.setDestination(destination);
+ jmsStreamer.setDestination(dest);
jmsStreamer.setDurableSubscription(true);
jmsStreamer.setClientId(Long.toString(System.currentTimeMillis()));
jmsStreamer.setDurableSubscriptionName("ignite-test-durable");
@@ -265,7 +299,7 @@ public class IgniteJmsStreamerTest extends GridCommonAbstractTest {
assertEquals(0, broker.getCurrentConnections());
// we send messages while we're still away
- produceStringMessages(destination, false);
+ produceStringMessages(dest, false);
// subscribe to cache PUT events and return a countdown latch starting at CACHE_ENTRY_COUNT
CountDownLatch latch = subscribeToPutEvents(CACHE_ENTRY_COUNT);
@@ -282,15 +316,18 @@ public class IgniteJmsStreamerTest extends GridCommonAbstractTest {
}
+ /**
+ * @throws Exception If failed.
+ */
public void testQueueMessagesConsumedInBatchesCompletionSizeBased() throws Exception {
- Destination destination = new ActiveMQQueue(QUEUE_NAME);
+ Destination dest = new ActiveMQQueue(QUEUE_NAME);
// produce multiple messages into the queue
- produceStringMessages(destination, false);
+ produceStringMessages(dest, false);
try (IgniteDataStreamer<String, String> dataStreamer = grid().dataStreamer(null)) {
JmsStreamer<TextMessage, String, String> jmsStreamer = newJmsStreamer(TextMessage.class, dataStreamer);
- jmsStreamer.setDestination(destination);
+ jmsStreamer.setDestination(dest);
jmsStreamer.setBatched(true);
jmsStreamer.setBatchClosureSize(99);
@@ -309,7 +346,7 @@ public class IgniteJmsStreamerTest extends GridCommonAbstractTest {
// we expect all entries to be loaded, but still one (uncommitted) message should remain in the queue
// as observed by the broker
- DestinationStatistics qStats = broker.getBroker().getDestinationMap().get(destination).getDestinationStatistics();
+ DestinationStatistics qStats = broker.getBroker().getDestinationMap().get(dest).getDestinationStatistics();
assertEquals(1, qStats.getMessages().getCount());
assertEquals(1, qStats.getInflight().getCount());
@@ -318,15 +355,18 @@ public class IgniteJmsStreamerTest extends GridCommonAbstractTest {
}
+ /**
+ * @throws Exception If failed.
+ */
public void testQueueMessagesConsumedInBatchesCompletionTimeBased() throws Exception {
- Destination destination = new ActiveMQQueue(QUEUE_NAME);
+ Destination dest = new ActiveMQQueue(QUEUE_NAME);
// produce multiple messages into the queue
- produceStringMessages(destination, false);
+ produceStringMessages(dest, false);
try (IgniteDataStreamer<String, String> dataStreamer = grid().dataStreamer(null)) {
JmsStreamer<TextMessage, String, String> jmsStreamer = newJmsStreamer(TextMessage.class, dataStreamer);
- jmsStreamer.setDestination(destination);
+ jmsStreamer.setDestination(dest);
jmsStreamer.setBatched(true);
jmsStreamer.setBatchClosureMillis(2000);
// disable size-based session commits
@@ -334,7 +374,7 @@ public class IgniteJmsStreamerTest extends GridCommonAbstractTest {
// subscribe to cache PUT events and return a countdown latch starting at CACHE_ENTRY_COUNT
CountDownLatch latch = subscribeToPutEvents(CACHE_ENTRY_COUNT);
- DestinationStatistics qStats = broker.getBroker().getDestinationMap().get(destination).getDestinationStatistics();
+ DestinationStatistics qStats = broker.getBroker().getDestinationMap().get(dest).getDestinationStatistics();
jmsStreamer.start();
@@ -365,17 +405,20 @@ public class IgniteJmsStreamerTest extends GridCommonAbstractTest {
}
+ /**
+ * @throws Exception If failed.
+ */
public void testGenerateNoEntries() throws Exception {
- Destination destination = new ActiveMQQueue(QUEUE_NAME);
+ Destination dest = new ActiveMQQueue(QUEUE_NAME);
// produce multiple messages into the queue
- produceStringMessages(destination, false);
+ produceStringMessages(dest, false);
try (IgniteDataStreamer<String, String> dataStreamer = grid().dataStreamer(null)) {
JmsStreamer<TextMessage, String, String> jmsStreamer = newJmsStreamer(TextMessage.class, dataStreamer);
// override the transformer with one that generates no cache entries
jmsStreamer.setTransformer(TestTransformers.generateNoEntries());
- jmsStreamer.setDestination(destination);
+ jmsStreamer.setDestination(dest);
// subscribe to cache PUT events and return a countdown latch starting at CACHE_ENTRY_COUNT
CountDownLatch latch = subscribeToPutEvents(1);
@@ -390,16 +433,19 @@ public class IgniteJmsStreamerTest extends GridCommonAbstractTest {
}
+ /**
+ * @throws Exception If failed.
+ */
public void testTransactedSessionNoBatching() throws Exception {
- Destination destination = new ActiveMQQueue(QUEUE_NAME);
+ Destination dest = new ActiveMQQueue(QUEUE_NAME);
// produce multiple messages into the queue
- produceStringMessages(destination, false);
+ produceStringMessages(dest, false);
try (IgniteDataStreamer<String, String> dataStreamer = grid().dataStreamer(null)) {
JmsStreamer<TextMessage, String, String> jmsStreamer = newJmsStreamer(TextMessage.class, dataStreamer);
jmsStreamer.setTransacted(true);
- jmsStreamer.setDestination(destination);
+ jmsStreamer.setDestination(dest);
// subscribe to cache PUT events and return a countdown latch starting at CACHE_ENTRY_COUNT
CountDownLatch latch = subscribeToPutEvents(CACHE_ENTRY_COUNT);
@@ -416,15 +462,18 @@ public class IgniteJmsStreamerTest extends GridCommonAbstractTest {
}
+ /**
+ * @throws Exception If failed.
+ */
public void testQueueMultipleThreads() throws Exception {
- Destination destination = new ActiveMQQueue(QUEUE_NAME);
+ Destination dest = new ActiveMQQueue(QUEUE_NAME);
// produce messages into the queue
- produceObjectMessages(destination, false);
+ produceObjectMessages(dest, false);
try (IgniteDataStreamer<String, String> dataStreamer = grid().dataStreamer(null)) {
JmsStreamer<ObjectMessage, String, String> jmsStreamer = newJmsStreamer(ObjectMessage.class, dataStreamer);
- jmsStreamer.setDestination(destination);
+ jmsStreamer.setDestination(dest);
jmsStreamer.setThreads(5);
// subscribe to cache PUT events and return a countdown latch starting at CACHE_ENTRY_COUNT
@@ -433,14 +482,14 @@ public class IgniteJmsStreamerTest extends GridCommonAbstractTest {
// start the streamer
jmsStreamer.start();
- DestinationStatistics qStats = broker.getBroker().getDestinationMap().get(destination).getDestinationStatistics();
+ DestinationStatistics qStats = broker.getBroker().getDestinationMap().get(dest).getDestinationStatistics();
assertEquals(5, qStats.getConsumers().getCount());
// all cache PUT events received in 10 seconds
latch.await(10, TimeUnit.SECONDS);
// assert that all consumers received messages - given that the prefetch is 1
- for (Subscription subscription : broker.getBroker().getDestinationMap().get(destination).getConsumers())
+ for (Subscription subscription : broker.getBroker().getDestinationMap().get(dest).getConsumers())
assertTrue(subscription.getDequeueCounter() > 0);
assertAllCacheEntriesLoaded();
@@ -450,6 +499,9 @@ public class IgniteJmsStreamerTest extends GridCommonAbstractTest {
}
+ /**
+ *
+ */
private void assertAllCacheEntriesLoaded() {
// Get the cache and check that the entries are present
IgniteCache<String, String> cache = grid().cache(null);
@@ -464,39 +516,44 @@ public class IgniteJmsStreamerTest extends GridCommonAbstractTest {
JmsStreamer<T, String, String> jmsStreamer = new JmsStreamer<>();
jmsStreamer.setIgnite(grid());
jmsStreamer.setStreamer(dataStreamer);
- jmsStreamer.setConnectionFactory(connectionFactory);
+ jmsStreamer.setConnectionFactory(connFactory);
- if (type == ObjectMessage.class) {
+ if (type == ObjectMessage.class)
jmsStreamer.setTransformer((MessageTransformer<T, String, String>) TestTransformers.forObjectMessage());
- }
- else {
+ else
jmsStreamer.setTransformer((MessageTransformer<T, String, String>) TestTransformers.forTextMessage());
- }
dataStreamer.allowOverwrite(true);
dataStreamer.autoFlushFrequency(10);
return jmsStreamer;
}
+ /**
+ * @param expect Expected events number.
+ * @return Event receive latch.
+ */
private CountDownLatch subscribeToPutEvents(int expect) {
Ignite ignite = grid();
// Listen to cache PUT events and expect as many as messages as test data items
final CountDownLatch latch = new CountDownLatch(expect);
- @SuppressWarnings("serial") IgniteBiPredicate<UUID, CacheEvent> callback = new IgniteBiPredicate<UUID, CacheEvent>() {
+
+ @SuppressWarnings("serial") IgniteBiPredicate<UUID, CacheEvent> cb = new IgniteBiPredicate<UUID, CacheEvent>() {
@Override public boolean apply(UUID uuid, CacheEvent evt) {
latch.countDown();
return true;
}
};
- ignite.events(ignite.cluster().forCacheNodes(null)).remoteListen(callback, null, EVT_CACHE_OBJECT_PUT);
+ ignite.events(ignite.cluster().forCacheNodes(null)).remoteListen(cb, null, EVT_CACHE_OBJECT_PUT);
return latch;
}
- private void produceObjectMessages(Destination destination, boolean singleMessage) throws JMSException {
- Session session = connectionFactory.createConnection().createSession(false, Session.AUTO_ACKNOWLEDGE);
- MessageProducer mp = session.createProducer(destination);
+ private void produceObjectMessages(Destination dest, boolean singleMsg) throws JMSException {
+ Session ses = connFactory.createConnection().createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+ MessageProducer mp = ses.createProducer(dest);
+
HashSet<TestTransformers.TestObject> set = new HashSet<>();
for (String key : TEST_DATA.keySet()) {
@@ -505,20 +562,21 @@ public class IgniteJmsStreamerTest extends GridCommonAbstractTest {
}
int messagesSent;
- if (singleMessage) {
- mp.send(session.createObjectMessage(set));
+
+ if (singleMsg) {
+ mp.send(ses.createObjectMessage(set));
messagesSent = 1;
}
else {
for (TestTransformers.TestObject to : set)
- mp.send(session.createObjectMessage(to));
+ mp.send(ses.createObjectMessage(to));
messagesSent = set.size();
}
- if (destination instanceof Queue) {
+ if (dest instanceof Queue) {
try {
- assertEquals(messagesSent, broker.getBroker().getDestinationMap().get(destination)
+ assertEquals(messagesSent, broker.getBroker().getDestinationMap().get(dest)
.getDestinationStatistics().getMessages().getCount());
}
catch (Exception e) {
@@ -528,36 +586,39 @@ public class IgniteJmsStreamerTest extends GridCommonAbstractTest {
}
- private void produceStringMessages(Destination destination, boolean singleMessage) throws JMSException {
- Session session = connectionFactory.createConnection().createSession(false, Session.AUTO_ACKNOWLEDGE);
- MessageProducer mp = session.createProducer(destination);
+ private void produceStringMessages(Destination dest, boolean singleMsg) throws JMSException {
+ Session ses = connFactory.createConnection().createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+ MessageProducer mp = ses.createProducer(dest);
+
HashSet<String> set = new HashSet<>();
for (String key : TEST_DATA.keySet())
set.add(key + "," + TEST_DATA.get(key));
int messagesSent;
- if (singleMessage) {
+
+ if (singleMsg) {
StringBuilder sb = new StringBuilder();
for (String s : set)
sb.append(s).append("|");
sb.deleteCharAt(sb.length() - 1);
- mp.send(session.createTextMessage(sb.toString()));
+ mp.send(ses.createTextMessage(sb.toString()));
messagesSent = 1;
}
else {
- for (String s : set) {
- mp.send(session.createTextMessage(s));
- }
+ for (String s : set)
+ mp.send(ses.createTextMessage(s));
+
messagesSent = set.size();
}
- if (destination instanceof Queue) {
+ if (dest instanceof Queue) {
try {
- assertEquals(messagesSent, broker.getBroker().getDestinationMap().get(destination)
+ assertEquals(messagesSent, broker.getBroker().getDestinationMap().get(dest)
.getDestinationStatistics().getMessages().getCount());
}
catch (Exception e) {
@@ -566,5 +627,4 @@ public class IgniteJmsStreamerTest extends GridCommonAbstractTest {
}
}
-
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/ec9ddcd3/modules/jms11/src/test/java/org/apache/ignite/stream/jms11/IgniteJmsStreamerTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/jms11/src/test/java/org/apache/ignite/stream/jms11/IgniteJmsStreamerTestSuite.java b/modules/jms11/src/test/java/org/apache/ignite/stream/jms11/IgniteJmsStreamerTestSuite.java
index e299f04..071ff9b 100644
--- a/modules/jms11/src/test/java/org/apache/ignite/stream/jms11/IgniteJmsStreamerTestSuite.java
+++ b/modules/jms11/src/test/java/org/apache/ignite/stream/jms11/IgniteJmsStreamerTestSuite.java
@@ -30,5 +30,5 @@ import org.junit.runners.*;
IgniteJmsStreamerTest.class
})
public class IgniteJmsStreamerTestSuite {
-
+ // No-op.
}
\ No newline at end of file
[3/8] ignite git commit: IGNITE-3965 Fixed issues found on review.
Posted by pt...@apache.org.
IGNITE-3965 Fixed issues found on review.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/daf974d2
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/daf974d2
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/daf974d2
Branch: refs/heads/master
Commit: daf974d261efa525678d5fabc6191642c07f9ad4
Parents: 89c30c8
Author: AKuznetsov <ak...@gridgain.com>
Authored: Wed Sep 28 17:22:10 2016 +0700
Committer: AKuznetsov <ak...@gridgain.com>
Committed: Wed Sep 28 17:22:10 2016 +0700
----------------------------------------------------------------------
.../src/main/java/org/apache/ignite/internal/IgnitionEx.java | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/daf974d2/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java b/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
index 4f64da2..aad96fb 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
@@ -2061,11 +2061,8 @@ public class IgnitionEx {
for (LoadBalancingSpi spi : cfg.getLoadBalancingSpi()) {
spis.add(spi);
- if (spi instanceof RoundRobinLoadBalancingSpi) {
+ if (!dfltLoadBalancingSpi && spi instanceof RoundRobinLoadBalancingSpi)
dfltLoadBalancingSpi = true;
-
- break;
- }
}
// Add default load balancing SPI for internal tasks.
[7/8] ignite git commit: Merge remote-tracking branch
'remotes/community/ignite-1.6.9' into ignite-1.7.3
Posted by pt...@apache.org.
Merge remote-tracking branch 'remotes/community/ignite-1.6.9' into ignite-1.7.3
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/c7fa918c
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/c7fa918c
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/c7fa918c
Branch: refs/heads/master
Commit: c7fa918c10d771efa91cde1017662c26d0a61085
Parents: 17c2fc0 ccfaaf8
Author: Pavel Tupitsyn <pt...@apache.org>
Authored: Wed Sep 28 14:47:17 2016 +0300
Committer: Pavel Tupitsyn <pt...@apache.org>
Committed: Wed Sep 28 14:47:17 2016 +0300
----------------------------------------------------------------------
.../TcpDiscoveryCloudIpFinderSelfTest.java | 6 ++--
.../ignite/testsuites/IgniteCloudTestSuite.java | 5 +--
.../org/apache/ignite/internal/IgnitionEx.java | 5 +--
modules/ignored-tests/pom.xml | 14 ++++++++
.../testsuites/IgniteIgnoredTestSuite.java | 3 ++
.../ProjectFilesTest.cs | 37 +++++++++++++-------
6 files changed, 49 insertions(+), 21 deletions(-)
----------------------------------------------------------------------
[2/8] ignite git commit: ignite-2833 Need call 'touch' for cache
entry if it was obtained using 'entryEx'.
Posted by pt...@apache.org.
ignite-2833 Need call 'touch' for cache entry if it was obtained using 'entryEx'.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/17c2fc0b
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/17c2fc0b
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/17c2fc0b
Branch: refs/heads/master
Commit: 17c2fc0b69abd023b2a1e5da344e67951fd49408
Parents: ec9ddcd
Author: sboikov <sb...@gridgain.com>
Authored: Wed Sep 28 12:56:17 2016 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Wed Sep 28 12:56:17 2016 +0300
----------------------------------------------------------------------
.../processors/cache/GridCacheTtlManager.java | 32 +++++++++++---------
.../cache/GridCacheAbstractFullApiSelfTest.java | 2 +-
2 files changed, 18 insertions(+), 16 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/17c2fc0b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheTtlManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheTtlManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheTtlManager.java
index 996544f..0f855fe 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheTtlManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheTtlManager.java
@@ -129,26 +129,28 @@ public class GridCacheTtlManager extends GridCacheManagerAdapter {
if (log.isTraceEnabled())
log.trace("Trying to remove expired entry from cache: " + e);
- boolean touch = false;
+ boolean touch = e.ctx.isSwapOrOffheapEnabled();
- GridCacheEntryEx entry = e.ctx.cache().entryEx(e.key);
+ GridCacheEntryEx entry = touch ? e.ctx.cache().entryEx(e.key) : e.ctx.cache().peekEx(e.key);
- while (true) {
- try {
- if (entry.onTtlExpired(obsoleteVer))
- touch = false;
+ if (entry != null) {
+ while (true) {
+ try {
+ if (entry.onTtlExpired(obsoleteVer))
+ touch = false;
- break;
- }
- catch (GridCacheEntryRemovedException e0) {
- entry = entry.context().cache().entryEx(entry.key());
+ break;
+ }
+ catch (GridCacheEntryRemovedException e0) {
+ entry = entry.context().cache().entryEx(entry.key());
- touch = true;
+ touch = true;
+ }
}
- }
- if (touch)
- entry.context().evicts().touch(entry, null);
+ if (touch)
+ entry.context().evicts().touch(entry, null);
+ }
}
}
@@ -216,7 +218,7 @@ public class GridCacheTtlManager extends GridCacheManagerAdapter {
private final GridCacheContext ctx;
/** Cache Object Key */
- private final CacheObject key;
+ private final KeyCacheObject key;
/**
* @param entry Cache entry to create wrapper for.
http://git-wip-us.apache.org/repos/asf/ignite/blob/17c2fc0b/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 c0318c8..f2cf414 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
@@ -4059,7 +4059,7 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
// Peek will actually remove entry from cache.
assertNull(cache.localPeek(key));
- assert cache.localSize() == 0;
+ assertEquals(0, cache.localSize());
// Clear readers, if any.
cache.remove(key);
[4/8] ignite git commit: IGNITE-3970 .NET: Fix Cyrillic 'C' letters
in code - add test
Posted by pt...@apache.org.
IGNITE-3970 .NET: Fix Cyrillic 'C' letters in code - add test
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/d643dcf2
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/d643dcf2
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/d643dcf2
Branch: refs/heads/master
Commit: d643dcf2dd2caac4c3ff04cb72f31bbfbf97339a
Parents: daf974d
Author: Pavel Tupitsyn <pt...@apache.org>
Authored: Wed Sep 28 14:34:23 2016 +0300
Committer: Pavel Tupitsyn <pt...@apache.org>
Committed: Wed Sep 28 14:34:23 2016 +0300
----------------------------------------------------------------------
.../ProjectFilesTest.cs | 37 +++++++++++++-------
1 file changed, 24 insertions(+), 13 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/d643dcf2/modules/platforms/dotnet/Apache.Ignite.Core.Tests/ProjectFilesTest.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/ProjectFilesTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/ProjectFilesTest.cs
index 75167b5..a030bf2 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/ProjectFilesTest.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/ProjectFilesTest.cs
@@ -18,6 +18,7 @@
namespace Apache.Ignite.Core.Tests
{
using System;
+ using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
@@ -37,11 +38,7 @@ namespace Apache.Ignite.Core.Tests
var projFiles = GetDotNetSourceDir().GetFiles("*.csproj", SearchOption.AllDirectories);
Assert.GreaterOrEqual(projFiles.Length, 7);
- var invalidFiles =
- projFiles.Where(x => !File.ReadAllText(x.FullName).Contains("ToolsVersion=\"4.0\"")).ToArray();
-
- Assert.AreEqual(0, invalidFiles.Length,
- "Invalid csproj files: " + string.Join(", ", invalidFiles.Select(x => x.FullName)));
+ CheckFiles(projFiles, x => !x.Contains("ToolsVersion=\"4.0\""), "Invalid csproj files: ");
}
/// <summary>
@@ -53,17 +50,31 @@ namespace Apache.Ignite.Core.Tests
var slnFiles = GetDotNetSourceDir().GetFiles("*.sln", SearchOption.AllDirectories);
Assert.GreaterOrEqual(slnFiles.Length, 2);
- var invalidFiles =
- slnFiles.Where(x =>
- {
- var text = File.ReadAllText(x.FullName);
+ CheckFiles(slnFiles, x => !x.Contains("# Visual Studio 2010") ||
+ !x.Contains("Microsoft Visual Studio Solution File, Format Version 11.00"),
+ "Invalid sln files: ");
+ }
- return !text.Contains("# Visual Studio 2010") ||
- !text.Contains("Microsoft Visual Studio Solution File, Format Version 11.00");
- }).ToArray();
+ /// <summary>
+ /// Tests that there are no Cyrillic C instead of English C (which are on the same keyboard key).
+ /// </summary>
+ [Test]
+ public void TestCyrillicChars()
+ {
+ var srcFiles = GetDotNetSourceDir().GetFiles("*.cs", SearchOption.AllDirectories);
+
+ CheckFiles(srcFiles, x => x.Contains('\u0441') || x.Contains('\u0421'), "Files with Cyrillic 'C': ");
+ }
+
+ /// <summary>
+ /// Checks the files.
+ /// </summary>
+ private static void CheckFiles(IEnumerable<FileInfo> files, Func<string, bool> isInvalid, string errorText)
+ {
+ var invalidFiles = files.Where(x => isInvalid(File.ReadAllText(x.FullName))).ToArray();
Assert.AreEqual(0, invalidFiles.Length,
- "Invalid sln files: " + string.Join(", ", invalidFiles.Select(x => x.FullName)));
+ errorText + string.Join(", ", invalidFiles.Select(x => x.FullName)));
}
/// <summary>
[8/8] ignite git commit: Merge remote-tracking branch
'remotes/community/ignite-1.7.3' into UPSTREAM_master
Posted by pt...@apache.org.
Merge remote-tracking branch 'remotes/community/ignite-1.7.3' into UPSTREAM_master
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/ed473923
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/ed473923
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/ed473923
Branch: refs/heads/master
Commit: ed473923532d8c978768a34b50d3f3def0f53684
Parents: 4ffb586 c7fa918
Author: Pavel Tupitsyn <pt...@apache.org>
Authored: Wed Sep 28 14:50:21 2016 +0300
Committer: Pavel Tupitsyn <pt...@apache.org>
Committed: Wed Sep 28 14:50:21 2016 +0300
----------------------------------------------------------------------
.../TcpDiscoveryCloudIpFinderSelfTest.java | 6 +-
.../ignite/testsuites/IgniteCloudTestSuite.java | 5 +-
.../org/apache/ignite/internal/IgnitionEx.java | 5 +-
.../processors/cache/GridCacheTtlManager.java | 32 +--
.../cache/GridCacheAbstractFullApiSelfTest.java | 2 +-
modules/ignored-tests/pom.xml | 14 ++
.../testsuites/IgniteIgnoredTestSuite.java | 3 +
.../stream/jms11/IgniteJmsStreamerTest.java | 206 ++++++++++++-------
.../jms11/IgniteJmsStreamerTestSuite.java | 2 +-
.../ProjectFilesTest.cs | 37 ++--
10 files changed, 201 insertions(+), 111 deletions(-)
----------------------------------------------------------------------
[6/8] ignite git commit: Merge remote-tracking branch
'upstream/ignite-1.6.9' into ignite-1.6.9
Posted by pt...@apache.org.
Merge remote-tracking branch 'upstream/ignite-1.6.9' into ignite-1.6.9
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/ccfaaf8d
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/ccfaaf8d
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/ccfaaf8d
Branch: refs/heads/master
Commit: ccfaaf8d060ef984678d2376b16b5a17e7c17e9d
Parents: 474ade2 d643dcf
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Wed Sep 28 14:38:17 2016 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Wed Sep 28 14:38:17 2016 +0300
----------------------------------------------------------------------
.../org/apache/ignite/internal/IgnitionEx.java | 5 +--
.../ProjectFilesTest.cs | 37 +++++++++++++-------
2 files changed, 25 insertions(+), 17 deletions(-)
----------------------------------------------------------------------
[5/8] ignite git commit: IGNITE-3988: Moved failing cloud tests to
ignore module.
Posted by pt...@apache.org.
IGNITE-3988: Moved failing cloud tests to ignore module.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/474ade27
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/474ade27
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/474ade27
Branch: refs/heads/master
Commit: 474ade276c4ae3e8f93cce37473d37270b4e7ad9
Parents: 89c30c8
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Wed Sep 28 14:38:04 2016 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Wed Sep 28 14:38:04 2016 +0300
----------------------------------------------------------------------
.../cloud/TcpDiscoveryCloudIpFinderSelfTest.java | 6 ++++--
.../ignite/testsuites/IgniteCloudTestSuite.java | 5 +++--
modules/ignored-tests/pom.xml | 14 ++++++++++++++
.../ignite/testsuites/IgniteIgnoredTestSuite.java | 3 +++
4 files changed, 24 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/474ade27/modules/cloud/src/test/java/org/apache/ignite/spi/discovery/tcp/ipfinder/cloud/TcpDiscoveryCloudIpFinderSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/cloud/src/test/java/org/apache/ignite/spi/discovery/tcp/ipfinder/cloud/TcpDiscoveryCloudIpFinderSelfTest.java b/modules/cloud/src/test/java/org/apache/ignite/spi/discovery/tcp/ipfinder/cloud/TcpDiscoveryCloudIpFinderSelfTest.java
index bf0cbd5..4bddb18 100644
--- a/modules/cloud/src/test/java/org/apache/ignite/spi/discovery/tcp/ipfinder/cloud/TcpDiscoveryCloudIpFinderSelfTest.java
+++ b/modules/cloud/src/test/java/org/apache/ignite/spi/discovery/tcp/ipfinder/cloud/TcpDiscoveryCloudIpFinderSelfTest.java
@@ -20,9 +20,11 @@ package org.apache.ignite.spi.discovery.tcp.ipfinder.cloud;
import com.google.common.collect.ImmutableList;
import java.net.InetSocketAddress;
import java.util.Collection;
+
import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi;
import org.apache.ignite.spi.discovery.tcp.ipfinder.TcpDiscoveryIpFinderAbstractSelfTest;
import org.apache.ignite.testsuites.IgniteCloudTestSuite;
+import org.apache.ignite.testsuites.IgniteIgnore;
/**
* TcpDiscoveryCloudIpFinder test.
@@ -58,6 +60,7 @@ public class TcpDiscoveryCloudIpFinderSelfTest extends
*
* @throws Exception If any error occurs.
*/
+ @IgniteIgnore("https://issues.apache.org/jira/browse/IGNITE-845")
public void testAmazonWebServices() throws Exception {
testCloudProvider("aws-ec2");
}
@@ -67,9 +70,8 @@ public class TcpDiscoveryCloudIpFinderSelfTest extends
*
* @throws Exception If any error occurs.
*/
+ @IgniteIgnore("https://issues.apache.org/jira/browse/IGNITE-1585")
public void testGoogleComputeEngine() throws Exception {
- fail("https://issues.apache.org/jira/browse/IGNITE-1585");
-
testCloudProvider("google-compute-engine");
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/474ade27/modules/cloud/src/test/java/org/apache/ignite/testsuites/IgniteCloudTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/cloud/src/test/java/org/apache/ignite/testsuites/IgniteCloudTestSuite.java b/modules/cloud/src/test/java/org/apache/ignite/testsuites/IgniteCloudTestSuite.java
index 12a67e7..632cddc 100644
--- a/modules/cloud/src/test/java/org/apache/ignite/testsuites/IgniteCloudTestSuite.java
+++ b/modules/cloud/src/test/java/org/apache/ignite/testsuites/IgniteCloudTestSuite.java
@@ -21,6 +21,7 @@ import java.util.Collection;
import java.util.LinkedList;
import junit.framework.TestSuite;
import org.apache.ignite.spi.discovery.tcp.ipfinder.cloud.TcpDiscoveryCloudIpFinderSelfTest;
+import org.apache.ignite.testframework.IgniteTestSuite;
/**
* Ignite Cloud integration test.
@@ -31,10 +32,10 @@ public class IgniteCloudTestSuite extends TestSuite {
* @throws Exception Thrown in case of the failure.
*/
public static TestSuite suite() throws Exception {
- TestSuite suite = new TestSuite("Cloud Integration Test Suite");
+ TestSuite suite = new IgniteTestSuite("Cloud Integration Test Suite");
// Cloud Nodes IP finder.
- suite.addTest(new TestSuite(TcpDiscoveryCloudIpFinderSelfTest.class));
+ suite.addTestSuite(TcpDiscoveryCloudIpFinderSelfTest.class);
return suite;
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/474ade27/modules/ignored-tests/pom.xml
----------------------------------------------------------------------
diff --git a/modules/ignored-tests/pom.xml b/modules/ignored-tests/pom.xml
index cfeacb2..9fdff2c 100644
--- a/modules/ignored-tests/pom.xml
+++ b/modules/ignored-tests/pom.xml
@@ -78,6 +78,20 @@
<dependency>
<groupId>org.apache.ignite</groupId>
+ <artifactId>ignite-cloud</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.ignite</groupId>
+ <artifactId>ignite-cloud</artifactId>
+ <version>${project.version}</version>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.ignite</groupId>
<artifactId>ignite-web</artifactId>
<version>${project.version}</version>
</dependency>
http://git-wip-us.apache.org/repos/asf/ignite/blob/474ade27/modules/ignored-tests/src/test/java/org/apache/ignite/testsuites/IgniteIgnoredTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/ignored-tests/src/test/java/org/apache/ignite/testsuites/IgniteIgnoredTestSuite.java b/modules/ignored-tests/src/test/java/org/apache/ignite/testsuites/IgniteIgnoredTestSuite.java
index fa60721..3ab1d7f 100644
--- a/modules/ignored-tests/src/test/java/org/apache/ignite/testsuites/IgniteIgnoredTestSuite.java
+++ b/modules/ignored-tests/src/test/java/org/apache/ignite/testsuites/IgniteIgnoredTestSuite.java
@@ -37,6 +37,9 @@ public class IgniteIgnoredTestSuite extends TestSuite {
/* --- AWS --- */
suite.addTest(IgniteS3TestSuite.suite());
+ /* --- CLOUDS --- */
+ suite.addTest(IgniteCloudTestSuite.suite());
+
/* --- WEB SESSIONS --- */
suite.addTest(IgniteWebSessionSelfTestSuite.suite());