camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ningji...@apache.org
Subject [2/4] git commit: Fixed the unit test error of SmppConsumerTest
Date Tue, 03 Sep 2013 01:40:24 GMT
Fixed the unit test error of SmppConsumerTest


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/b7121442
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/b7121442
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/b7121442

Branch: refs/heads/camel-2.12.x
Commit: b7121442aebcc82a694792c74b0a054eed711dce
Parents: 72807c4
Author: Willem Jiang <ningjiang@apache.org>
Authored: Tue Sep 3 08:40:58 2013 +0800
Committer: Willem Jiang <ningjiang@apache.org>
Committed: Tue Sep 3 09:36:34 2013 +0800

----------------------------------------------------------------------
 .../org/apache/camel/component/smpp/SmppConsumerTest.java     | 7 +++++++
 1 file changed, 7 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/b7121442/components/camel-smpp/src/test/java/org/apache/camel/component/smpp/SmppConsumerTest.java
----------------------------------------------------------------------
diff --git a/components/camel-smpp/src/test/java/org/apache/camel/component/smpp/SmppConsumerTest.java
b/components/camel-smpp/src/test/java/org/apache/camel/component/smpp/SmppConsumerTest.java
index 0c8729e..3349e1f 100644
--- a/components/camel-smpp/src/test/java/org/apache/camel/component/smpp/SmppConsumerTest.java
+++ b/components/camel-smpp/src/test/java/org/apache/camel/component/smpp/SmppConsumerTest.java
@@ -16,6 +16,7 @@
  */
 package org.apache.camel.component.smpp;
 
+import org.apache.camel.CamelContext;
 import org.apache.camel.Processor;
 import org.jsmpp.bean.BindType;
 import org.jsmpp.bean.NumberingPlanIndicator;
@@ -42,6 +43,7 @@ public class SmppConsumerTest {
     private SmppConfiguration configuration;
     private Processor processor;
     private SMPPSession session;
+    private CamelContext camelContext;
 
     @Before
     public void setUp() {
@@ -50,6 +52,7 @@ public class SmppConsumerTest {
         processor = createMock(Processor.class);
         session = createMock(SMPPSession.class);
         
+        // the construction of SmppConsumer will trigger the getCamelContext call
         consumer = new SmppConsumer(
                 endpoint, 
                 configuration,
@@ -63,6 +66,7 @@ public class SmppConsumerTest {
 
     @Test
     public void doStartShouldStartANewSmppSession() throws Exception {
+        resetToNice(endpoint, session);
         expect(endpoint.getConnectionString())
             .andReturn("smpp://smppclient@localhost:2775")
             .times(2);
@@ -82,9 +86,11 @@ public class SmppConsumerTest {
                         NumberingPlanIndicator.UNKNOWN,
                         ""))).andReturn("1");
         expect(endpoint.getConnectionString()).andReturn("smpp://smppclient@localhost:2775");
+     
         
         replay(endpoint, processor, session);
         
+        
         consumer.doStart();
         
         verify(endpoint, processor, session);
@@ -92,6 +98,7 @@ public class SmppConsumerTest {
 
     @Test
     public void doStopShouldNotCloseTheSMPPSessionIfItIsNull() throws Exception {
+        resetToNice(endpoint, session);
         expect(endpoint.getConnectionString())
             .andReturn("smpp://smppclient@localhost:2775")
             .times(3);


Mime
View raw message