You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mina.apache.org by be...@apache.org on 2012/07/12 18:25:19 UTC
svn commit: r1360753 -
/mina/vysper/trunk/server/extensions/xep0124-xep0206-bosh/src/test/java/org/apache/vysper/xmpp/extension/xep0124/BoshHandlerTest.java
Author: berndf
Date: Thu Jul 12 16:25:19 2012
New Revision: 1360753
URL: http://svn.apache.org/viewvc?rev=1360753&view=rev
Log:
trailing commit: refactored BOSH test class
Modified:
mina/vysper/trunk/server/extensions/xep0124-xep0206-bosh/src/test/java/org/apache/vysper/xmpp/extension/xep0124/BoshHandlerTest.java
Modified: mina/vysper/trunk/server/extensions/xep0124-xep0206-bosh/src/test/java/org/apache/vysper/xmpp/extension/xep0124/BoshHandlerTest.java
URL: http://svn.apache.org/viewvc/mina/vysper/trunk/server/extensions/xep0124-xep0206-bosh/src/test/java/org/apache/vysper/xmpp/extension/xep0124/BoshHandlerTest.java?rev=1360753&r1=1360752&r2=1360753&view=diff
==============================================================================
--- mina/vysper/trunk/server/extensions/xep0124-xep0206-bosh/src/test/java/org/apache/vysper/xmpp/extension/xep0124/BoshHandlerTest.java (original)
+++ mina/vysper/trunk/server/extensions/xep0124-xep0206-bosh/src/test/java/org/apache/vysper/xmpp/extension/xep0124/BoshHandlerTest.java Thu Jul 12 16:25:19 2012
@@ -21,10 +21,9 @@ package org.apache.vysper.xmpp.extension
import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.assertNotNull;
-import static org.easymock.EasyMock.anyLong;
-import static org.easymock.EasyMock.createControl;
-import static org.easymock.EasyMock.eq;
-import static org.easymock.EasyMock.expect;
+import static org.apache.vysper.xmpp.extension.xep0124.BoshBackedSessionContext.BOSH_REQUEST_ATTRIBUTE;
+import static org.apache.vysper.xmpp.extension.xep0124.BoshBackedSessionContext.BOSH_RESPONSE_ATTRIBUTE;
+import static org.easymock.EasyMock.*;
import java.io.IOException;
import java.util.Arrays;
@@ -86,7 +85,7 @@ public class BoshHandlerTest {
expect(httpServletRequest.getAsyncContext()).andReturn(asyncContext).atLeastOnce();
asyncContext.setTimeout(anyLong());
Capture<BoshRequest> br = new Capture<BoshRequest>();
- httpServletRequest.setAttribute(eq("request"), EasyMock.<BoshRequest> capture(br));
+ httpServletRequest.setAttribute(eq(BOSH_REQUEST_ATTRIBUTE), EasyMock.<BoshRequest>capture(br));
asyncContext.addListener(EasyMock.<AsyncListener> anyObject());
asyncContext.dispatch();
@@ -96,7 +95,7 @@ public class BoshHandlerTest {
expect(serverRuntimeContext.getModule(InBandRegistrationModule.class)).andReturn(null);
Capture<BoshResponse> captured = new Capture<BoshResponse>();
- httpServletRequest.setAttribute(eq("response"), EasyMock.<BoshResponse> capture(captured));
+ httpServletRequest.setAttribute(eq(BOSH_RESPONSE_ATTRIBUTE), EasyMock.<BoshResponse> capture(captured));
mocksControl.replay();
Stanza boshRequest = createSessionRequest();
@@ -129,7 +128,7 @@ public class BoshHandlerTest {
expect(httpServletRequest.startAsync()).andReturn(asyncContext).atLeastOnce();
expect(httpServletRequest.getAsyncContext()).andReturn(asyncContext).anyTimes();
asyncContext.setTimeout(anyLong());
- httpServletRequest.setAttribute(eq("request"), EasyMock.<BoshRequest> capture(br));
+ httpServletRequest.setAttribute(eq(BOSH_REQUEST_ATTRIBUTE), EasyMock.<BoshRequest> capture(br));
asyncContext.addListener(EasyMock.<AsyncListener> anyObject());
StanzaProcessor stanzaProcessor = mocksControl.createMock(StanzaProcessor.class);
expect(serverRuntimeContext.getStanzaProcessor()).andReturn(stanzaProcessor);