Updated Branches:
  refs/heads/master eed23e3e8 -> c0c130072

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/c0c13007
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/c0c13007
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/c0c13007

Branch: refs/heads/master
Commit: c0c13007277b058d5130ec60a7323dab629222fc
Parents: eed23e3
Author: Willem Jiang <ningji...@apache.org>
Authored: Tue Sep 3 08:40:58 2013 +0800
Committer: Willem Jiang <ningji...@apache.org>
Committed: Tue Sep 3 08:40:58 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/c0c13007/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);

Reply via email to