camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ningji...@apache.org
Subject svn commit: r1380156 - in /camel/trunk/components/camel-hazelcast/src/test/java/org/apache/camel/component/hazelcast: HazelcastMultimapProducerForSpringTest.java HazelcastMultimapProducerTest.java
Date Mon, 03 Sep 2012 07:53:16 GMT
Author: ningjiang
Date: Mon Sep  3 07:53:15 2012
New Revision: 1380156

URL: http://svn.apache.org/viewvc?rev=1380156&view=rev
Log:
Fixed the hang unit tests of camel-hazelcast

Modified:
    camel/trunk/components/camel-hazelcast/src/test/java/org/apache/camel/component/hazelcast/HazelcastMultimapProducerForSpringTest.java
    camel/trunk/components/camel-hazelcast/src/test/java/org/apache/camel/component/hazelcast/HazelcastMultimapProducerTest.java

Modified: camel/trunk/components/camel-hazelcast/src/test/java/org/apache/camel/component/hazelcast/HazelcastMultimapProducerForSpringTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-hazelcast/src/test/java/org/apache/camel/component/hazelcast/HazelcastMultimapProducerForSpringTest.java?rev=1380156&r1=1380155&r2=1380156&view=diff
==============================================================================
--- camel/trunk/components/camel-hazelcast/src/test/java/org/apache/camel/component/hazelcast/HazelcastMultimapProducerForSpringTest.java
(original)
+++ camel/trunk/components/camel-hazelcast/src/test/java/org/apache/camel/component/hazelcast/HazelcastMultimapProducerForSpringTest.java
Mon Sep  3 07:53:15 2012
@@ -17,8 +17,12 @@
 package org.apache.camel.component.hazelcast;
 
 import java.util.Collection;
+import java.util.Set;
 
+import com.hazelcast.config.Config;
+import com.hazelcast.config.XmlConfigBuilder;
 import com.hazelcast.core.Hazelcast;
+import com.hazelcast.core.HazelcastInstance;
 import com.hazelcast.core.MultiMap;
 
 import org.apache.camel.test.junit4.CamelSpringTestSupport;
@@ -30,15 +34,15 @@ import org.springframework.context.suppo
 import org.springframework.context.support.ClassPathXmlApplicationContext;
 
 public class HazelcastMultimapProducerForSpringTest extends CamelSpringTestSupport {
-
+    private HazelcastInstance hazelcastInstance;
     private MultiMap<String, Object> map;
-
+    
     @Override
-    public void setUp() throws Exception {
-        this.map = Hazelcast.getMultiMap("foo");
+    protected void doPostSetup() throws Exception {
+        HazelcastComponent component = context().getComponent("hazelcast", HazelcastComponent.class);
+        HazelcastInstance hazelcastInstance = component.getHazelcastInstance();
+        this.map = hazelcastInstance.getMultiMap("foo");
         this.map.clear();
-
-        super.setUp();
     }
 
     @AfterClass

Modified: camel/trunk/components/camel-hazelcast/src/test/java/org/apache/camel/component/hazelcast/HazelcastMultimapProducerTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-hazelcast/src/test/java/org/apache/camel/component/hazelcast/HazelcastMultimapProducerTest.java?rev=1380156&r1=1380155&r2=1380156&view=diff
==============================================================================
--- camel/trunk/components/camel-hazelcast/src/test/java/org/apache/camel/component/hazelcast/HazelcastMultimapProducerTest.java
(original)
+++ camel/trunk/components/camel-hazelcast/src/test/java/org/apache/camel/component/hazelcast/HazelcastMultimapProducerTest.java
Mon Sep  3 07:53:15 2012
@@ -18,7 +18,10 @@ package org.apache.camel.component.hazel
 
 import java.util.Collection;
 
+import com.hazelcast.config.Config;
+import com.hazelcast.config.XmlConfigBuilder;
 import com.hazelcast.core.Hazelcast;
+import com.hazelcast.core.HazelcastInstance;
 import com.hazelcast.core.MultiMap;
 
 import org.apache.camel.builder.RouteBuilder;
@@ -31,10 +34,11 @@ public class HazelcastMultimapProducerTe
     private MultiMap<String, Object> map;
 
     @Override
-    public void setUp() throws Exception {
-        this.map = Hazelcast.getMultiMap("bar");
+    protected void doPostSetup() throws Exception {
+        HazelcastComponent component = context().getComponent("hazelcast", HazelcastComponent.class);
+        HazelcastInstance hazelcastInstance = component.getHazelcastInstance();
+        this.map = hazelcastInstance.getMultiMap("bar");
         this.map.clear();
-        super.setUp();
     }
 
     @AfterClass



Mime
View raw message