Updated Branches: refs/heads/master 999911e74 -> 41b4c8825
CAMEL-6826: Use Mock Objects Instead of Live HazelcastInstances to Speed Up Testing - Fixing checkstyle errors. Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/41b4c882 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/41b4c882 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/41b4c882 Branch: refs/heads/master Commit: 41b4c88250cab4e509d5f473da0b6ea844e64285 Parents: f83c64b Author: James W. Carman <jcar...@apache.org> Authored: Wed Oct 9 01:14:49 2013 -0400 Committer: James W. Carman <jcar...@apache.org> Committed: Wed Oct 9 01:15:02 2013 -0400 ---------------------------------------------------------------------- .../hazelcast/HazelcastMapConsumerTest.java | 10 +++++----- .../hazelcast/HazelcastMultimapConsumerTest.java | 15 ++++++--------- 2 files changed, 11 insertions(+), 14 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/41b4c882/components/camel-hazelcast/src/test/java/org/apache/camel/component/hazelcast/HazelcastMapConsumerTest.java ---------------------------------------------------------------------- diff --git a/components/camel-hazelcast/src/test/java/org/apache/camel/component/hazelcast/HazelcastMapConsumerTest.java b/components/camel-hazelcast/src/test/java/org/apache/camel/component/hazelcast/HazelcastMapConsumerTest.java index 6b697f5..5762120 100644 --- a/components/camel-hazelcast/src/test/java/org/apache/camel/component/hazelcast/HazelcastMapConsumerTest.java +++ b/components/camel-hazelcast/src/test/java/org/apache/camel/component/hazelcast/HazelcastMapConsumerTest.java @@ -39,7 +39,7 @@ import static org.mockito.Mockito.when; public class HazelcastMapConsumerTest extends HazelcastCamelTestSupport { @Mock - private IMap<Object,Object> map; + private IMap<Object, Object> map; private ArgumentCaptor<EntryListener> argument; @@ -64,7 +64,7 @@ public class HazelcastMapConsumerTest extends HazelcastCamelTestSupport { MockEndpoint out = getMockEndpoint("mock:added"); out.expectedMessageCount(1); - EntryEvent<Object,Object> event = new EntryEvent<Object,Object>("foo", null, EntryEventType.ADDED.getType(), "4711", "my-foo"); + EntryEvent<Object, Object> event = new EntryEvent<Object, Object>("foo", null, EntryEventType.ADDED.getType(), "4711", "my-foo"); argument.getValue().entryAdded(event); assertMockEndpointsSatisfied(5000, TimeUnit.MILLISECONDS); @@ -77,7 +77,7 @@ public class HazelcastMapConsumerTest extends HazelcastCamelTestSupport { MockEndpoint out = super.getMockEndpoint("mock:envicted"); out.expectedMessageCount(1); - EntryEvent<Object,Object> event = new EntryEvent<Object,Object>("foo", null, EntryEventType.EVICTED.getType(), "4711", "my-foo"); + EntryEvent<Object, Object> event = new EntryEvent<Object, Object>("foo", null, EntryEventType.EVICTED.getType(), "4711", "my-foo"); argument.getValue().entryEvicted(event); assertMockEndpointsSatisfied(30000, TimeUnit.MILLISECONDS); @@ -89,7 +89,7 @@ public class HazelcastMapConsumerTest extends HazelcastCamelTestSupport { MockEndpoint out = getMockEndpoint("mock:updated"); out.expectedMessageCount(1); - EntryEvent<Object,Object> event = new EntryEvent<Object,Object>("foo", null, EntryEventType.UPDATED.getType(), "4711", "my-foo"); + EntryEvent<Object, Object> event = new EntryEvent<Object, Object>("foo", null, EntryEventType.UPDATED.getType(), "4711", "my-foo"); argument.getValue().entryUpdated(event); assertMockEndpointsSatisfied(5000, TimeUnit.MILLISECONDS); @@ -103,7 +103,7 @@ public class HazelcastMapConsumerTest extends HazelcastCamelTestSupport { MockEndpoint out = getMockEndpoint("mock:removed"); out.expectedMessageCount(1); - EntryEvent<Object,Object> event = new EntryEvent<Object,Object>("foo", null, EntryEventType.REMOVED.getType(), "4711", "my-foo"); + EntryEvent<Object, Object> event = new EntryEvent<Object, Object>("foo", null, EntryEventType.REMOVED.getType(), "4711", "my-foo"); argument.getValue().entryRemoved(event); assertMockEndpointsSatisfied(5000, TimeUnit.MILLISECONDS); http://git-wip-us.apache.org/repos/asf/camel/blob/41b4c882/components/camel-hazelcast/src/test/java/org/apache/camel/component/hazelcast/HazelcastMultimapConsumerTest.java ---------------------------------------------------------------------- diff --git a/components/camel-hazelcast/src/test/java/org/apache/camel/component/hazelcast/HazelcastMultimapConsumerTest.java b/components/camel-hazelcast/src/test/java/org/apache/camel/component/hazelcast/HazelcastMultimapConsumerTest.java index 55fc5bb..55d4fc2 100644 --- a/components/camel-hazelcast/src/test/java/org/apache/camel/component/hazelcast/HazelcastMultimapConsumerTest.java +++ b/components/camel-hazelcast/src/test/java/org/apache/camel/component/hazelcast/HazelcastMultimapConsumerTest.java @@ -23,14 +23,10 @@ import com.hazelcast.core.EntryEvent; import com.hazelcast.core.EntryEventType; import com.hazelcast.core.EntryListener; import com.hazelcast.core.HazelcastInstance; -import com.hazelcast.core.IMap; import com.hazelcast.core.MultiMap; import org.apache.camel.builder.RouteBuilder; import org.apache.camel.component.mock.MockEndpoint; -import org.apache.camel.test.junit4.CamelTestSupport; - -import org.junit.Ignore; import org.junit.Test; import org.mockito.ArgumentCaptor; import org.mockito.Mock; @@ -43,7 +39,7 @@ import static org.mockito.Mockito.when; public class HazelcastMultimapConsumerTest extends HazelcastCamelTestSupport { @Mock - private MultiMap<Object,Object> map; + private MultiMap<Object, Object> map; private ArgumentCaptor<EntryListener> argument; @@ -68,7 +64,7 @@ public class HazelcastMultimapConsumerTest extends HazelcastCamelTestSupport { MockEndpoint out = getMockEndpoint("mock:added"); out.expectedMessageCount(1); - EntryEvent<Object,Object> event = new EntryEvent<Object,Object>("foo", null, EntryEventType.ADDED.getType(), "4711", "my-foo"); + EntryEvent<Object, Object> event = new EntryEvent<Object, Object>("foo", null, EntryEventType.ADDED.getType(), "4711", "my-foo"); argument.getValue().entryAdded(event); assertMockEndpointsSatisfied(5000, TimeUnit.MILLISECONDS); @@ -85,18 +81,19 @@ public class HazelcastMultimapConsumerTest extends HazelcastCamelTestSupport { MockEndpoint out = getMockEndpoint("mock:envicted"); out.expectedMessageCount(1); - EntryEvent<Object,Object> event = new EntryEvent<Object,Object>("foo", null, EntryEventType.EVICTED.getType(), "4711", "my-foo"); + EntryEvent<Object, Object> event = new EntryEvent<Object, Object>("foo", null, EntryEventType.EVICTED.getType(), "4711", "my-foo"); argument.getValue().entryEvicted(event); assertMockEndpointsSatisfied(30000, TimeUnit.MILLISECONDS); } @Test + @SuppressWarnings("unchecked") public void testRemove() throws InterruptedException { MockEndpoint out = getMockEndpoint("mock:removed"); out.expectedMessageCount(1); - EntryEvent<Object,Object> event = new EntryEvent<Object,Object>("foo", null, EntryEventType.REMOVED.getType(), "4711", "my-foo"); + EntryEvent<Object, Object> event = new EntryEvent<Object, Object>("foo", null, EntryEventType.REMOVED.getType(), "4711", "my-foo"); argument.getValue().entryRemoved(event); assertMockEndpointsSatisfied(5000, TimeUnit.MILLISECONDS); @@ -112,7 +109,7 @@ public class HazelcastMultimapConsumerTest extends HazelcastCamelTestSupport { .when(header(HazelcastConstants.LISTENER_ACTION).isEqualTo(HazelcastConstants.ADDED)).log("...added").to("mock:added") .when(header(HazelcastConstants.LISTENER_ACTION).isEqualTo(HazelcastConstants.ENVICTED)).log("...envicted").to("mock:envicted") .when(header(HazelcastConstants.LISTENER_ACTION).isEqualTo(HazelcastConstants.REMOVED)).log("...removed").to("mock:removed").otherwise().log("fail!"); - }; + } }; }