labs-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ber...@apache.org
Subject svn commit: r570415 - in /labs/vysper/src: main/java/org/apache/vysper/xmpp/delivery/ test/java/org/apache/vysper/xmpp/applicationdomains/base/handler/ test/java/org/apache/vysper/xmpp/protocol/ test/java/org/apache/vysper/xmpp/server/
Date Tue, 28 Aug 2007 13:28:09 GMT
Author: berndf
Date: Tue Aug 28 06:28:08 2007
New Revision: 570415

URL: http://svn.apache.org/viewvc?rev=570415&view=rev
Log:
[vysper] 
meta: resuming work on the project
code: working on infrastructure for relaying messages to decoupled consumer

Added:
    labs/vysper/src/main/java/org/apache/vysper/xmpp/delivery/RecordingStanzaRelay.java
    labs/vysper/src/main/java/org/apache/vysper/xmpp/delivery/StanzaReceiverRelay.java
      - copied, changed from r542950, labs/vysper/src/main/java/org/apache/vysper/xmpp/delivery/StanzaRelayImpl.java
    labs/vysper/src/test/java/org/apache/vysper/xmpp/applicationdomains/base/handler/MessageHandlerRelayTestCase.java
      - copied, changed from r542950, labs/vysper/src/test/java/org/apache/vysper/xmpp/applicationdomains/base/handler/IQHandlerTestCase.java
Modified:
    labs/vysper/src/test/java/org/apache/vysper/xmpp/protocol/ProtocolStateTestCase.java
    labs/vysper/src/test/java/org/apache/vysper/xmpp/protocol/ProtocolWorkerAquireTestCase.java
    labs/vysper/src/test/java/org/apache/vysper/xmpp/protocol/ProtocolWorkerProcessTestCase.java
    labs/vysper/src/test/java/org/apache/vysper/xmpp/protocol/ProtocolWorkerStateAwarenessTestCase.java
    labs/vysper/src/test/java/org/apache/vysper/xmpp/server/TestSessionContext.java

Added: labs/vysper/src/main/java/org/apache/vysper/xmpp/delivery/RecordingStanzaRelay.java
URL: http://svn.apache.org/viewvc/labs/vysper/src/main/java/org/apache/vysper/xmpp/delivery/RecordingStanzaRelay.java?rev=570415&view=auto
==============================================================================
--- labs/vysper/src/main/java/org/apache/vysper/xmpp/delivery/RecordingStanzaRelay.java (added)
+++ labs/vysper/src/main/java/org/apache/vysper/xmpp/delivery/RecordingStanzaRelay.java Tue
Aug 28 06:28:08 2007
@@ -0,0 +1,75 @@
+/***********************************************************************
+ * Copyright (c) 2006-2007 The Apache Software Foundation.             *
+ * All rights reserved.                                                *
+ * ------------------------------------------------------------------- *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you *
+ * may not use this file except in compliance with the License. You    *
+ * may obtain a copy of the License at:                                *
+ *                                                                     *
+ *     http://www.apache.org/licenses/LICENSE-2.0                      *
+ *                                                                     *
+ * Unless required by applicable law or agreed to in writing, software *
+ * distributed under the License is distributed on an "AS IS" BASIS,   *
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or     *
+ * implied.  See the License for the specific language governing       *
+ * permissions and limitations under the License.                      *
+ ***********************************************************************/
+package org.apache.vysper.xmpp.delivery;
+
+import org.apache.vysper.xmpp.addressing.Entity;
+import org.apache.vysper.xmpp.stanza.Stanza;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+
+/**
+ * a relay which simply records the sequence of entity/stanza pairs received
+ * and makes it accessible for debugging or testing purposes
+ */
+public class RecordingStanzaRelay implements StanzaRelay {
+    
+    private final ArrayList<Pair> entityStanzaPairs = new ArrayList<Pair>();
+    private boolean acceptingMode = true;
+
+    public void relay(Entity receiver, Stanza stanza) throws DeliveryException {
+        entityStanzaPairs.add(new Pair(receiver, stanza));
+    }
+
+    public boolean receiverExists(Entity receiver) {
+        return acceptingMode;
+    }
+    
+    public Iterator<Pair> iterator() {
+        return entityStanzaPairs.iterator();
+    }
+
+    public void reset() {
+        entityStanzaPairs.clear();
+    }
+
+    /**
+     * to easily set mode to accept all receivers (default) or to decline all
+     * this is useful for setting the behavior when testing
+     */
+    public void setAcceptingMode(boolean accepting) {
+        this.acceptingMode = accepting;
+    }
+
+    public class Pair {
+        private Entity entity;
+        private Stanza stanza;
+
+        Pair(Entity entity, Stanza stanza) {
+            this.entity = entity;
+            this.stanza = stanza;
+        }
+
+        public Entity getEntity() {
+            return entity;
+        }
+
+        public Stanza getStanza() {
+            return stanza;
+        }
+    }
+}

Copied: labs/vysper/src/main/java/org/apache/vysper/xmpp/delivery/StanzaReceiverRelay.java
(from r542950, labs/vysper/src/main/java/org/apache/vysper/xmpp/delivery/StanzaRelayImpl.java)
URL: http://svn.apache.org/viewvc/labs/vysper/src/main/java/org/apache/vysper/xmpp/delivery/StanzaReceiverRelay.java?p2=labs/vysper/src/main/java/org/apache/vysper/xmpp/delivery/StanzaReceiverRelay.java&p1=labs/vysper/src/main/java/org/apache/vysper/xmpp/delivery/StanzaRelayImpl.java&r1=542950&r2=570415&rev=570415&view=diff
==============================================================================
--- labs/vysper/src/main/java/org/apache/vysper/xmpp/delivery/StanzaRelayImpl.java (original)
+++ labs/vysper/src/main/java/org/apache/vysper/xmpp/delivery/StanzaReceiverRelay.java Tue
Aug 28 06:28:08 2007
@@ -24,9 +24,9 @@
 import java.util.HashMap;
 
 /**
- * relays stanzas to a receiver identified by a Entity
+ * relays stanzas to a StanzaReceiver identified by a Entity
  */
-public class StanzaRelayImpl implements StanzaRelay {
+public class StanzaReceiverRelay implements StanzaRelay {
 
     private Map<Entity, StanzaReceiver> receiverMap = new HashMap<Entity, StanzaReceiver>();
 

Copied: labs/vysper/src/test/java/org/apache/vysper/xmpp/applicationdomains/base/handler/MessageHandlerRelayTestCase.java
(from r542950, labs/vysper/src/test/java/org/apache/vysper/xmpp/applicationdomains/base/handler/IQHandlerTestCase.java)
URL: http://svn.apache.org/viewvc/labs/vysper/src/test/java/org/apache/vysper/xmpp/applicationdomains/base/handler/MessageHandlerRelayTestCase.java?p2=labs/vysper/src/test/java/org/apache/vysper/xmpp/applicationdomains/base/handler/MessageHandlerRelayTestCase.java&p1=labs/vysper/src/test/java/org/apache/vysper/xmpp/applicationdomains/base/handler/IQHandlerTestCase.java&r1=542950&r2=570415&rev=570415&view=diff
==============================================================================
--- labs/vysper/src/test/java/org/apache/vysper/xmpp/applicationdomains/base/handler/IQHandlerTestCase.java
(original)
+++ labs/vysper/src/test/java/org/apache/vysper/xmpp/applicationdomains/base/handler/MessageHandlerRelayTestCase.java
Tue Aug 28 06:28:08 2007
@@ -17,21 +17,20 @@
 
 package org.apache.vysper.xmpp.applicationdomains.base.handler;
 
+import junit.framework.TestCase;
+import org.apache.vysper.xmpp.addressing.EntityImpl;
+import org.apache.vysper.xmpp.delivery.RecordingStanzaRelay;
 import org.apache.vysper.xmpp.protocol.NamespaceURIs;
 import org.apache.vysper.xmpp.protocol.ResponseStanzaContainer;
 import org.apache.vysper.xmpp.protocol.SessionStateHolder;
 import org.apache.vysper.xmpp.server.TestSessionContext;
-import org.apache.vysper.xmpp.stanza.IQStanza;
-import org.apache.vysper.xmpp.stanza.IQStanzaType;
 import org.apache.vysper.xmpp.stanza.Stanza;
 import org.apache.vysper.xmpp.stanza.StanzaBuilder;
-import org.apache.vysper.xmpp.stanza.XMPPCoreStanzaVerifier;
 import org.apache.vysper.xmpp.xmlfragment.XMLElementVerifier;
-import junit.framework.TestCase;
 
 /**
  */
-public class IQHandlerTestCase extends TestCase {
+public class MessageHandlerRelayTestCase extends TestCase {
     private TestSessionContext sessionContext;
 
     private SessionStateHolder sessionStateHolder = new SessionStateHolder();
@@ -41,121 +40,39 @@
         sessionContext = new TestSessionContext(sessionStateHolder);
     }
 
-    public void testMissingToInServerCall() {
-        StanzaBuilder stanzaBuilder = new StanzaBuilder("iq", NamespaceURIs.JABBER_SERVER);
-        stanzaBuilder.addAttribute("type", "get");
-        // missing stanzaBuilder.addAttribute("to", "test@example.com");
-        stanzaBuilder.addAttribute("id", "anyway");
-        stanzaBuilder.startInnerElement("inner").endInnerElement();
-
-        TestSessionContext sessionContext = this.sessionContext;
-        sessionContext.setServerToServer();
-
-        TestIQHandler iqHandler = new TestIQHandler();
-        ResponseStanzaContainer responseStanzaContainer = iqHandler.execute(stanzaBuilder.getFinalStanza(),
sessionContext, null);
-        Stanza responseStanza = responseStanzaContainer.getResponseStanza();
-        XMLElementVerifier verifier = responseStanza.getVerifier();
-        assertTrue("error", verifier.nameEquals("error"));
-    }
-
-    public void testMissingID() {
-        StanzaBuilder stanzaBuilder = new StanzaBuilder("iq", NamespaceURIs.JABBER_CLIENT);
-        stanzaBuilder.addAttribute("type", "get");
-        assertIQError(stanzaBuilder.getFinalStanza());
-    }
+    public void testStanzaRelayed() {
 
-    public void testDoNotRespondToErrorWithError() {
-        StanzaBuilder stanzaBuilder = new StanzaBuilder("iq", NamespaceURIs.JABBER_CLIENT);
-        stanzaBuilder.addAttribute("type", "error");
-        Stanza stanza = stanzaBuilder.getFinalStanza(); // this stanza has no ID
-
-        IQHandler iqHandler = new IQHandler();
-        ResponseStanzaContainer responseStanzaContainer = iqHandler.execute(stanza, sessionContext,
null);
-        Stanza responseStanza = responseStanzaContainer.getResponseStanza();
-        XMLElementVerifier verifier = responseStanza.getVerifier();
-        assertTrue("error", verifier.nameEquals("error")); // response is _not_ IQ stanza
-    }
+        String timestamp = "" + System.currentTimeMillis();
 
-    private void assertIQError(Stanza stanza) {
-        TestIQHandler iqHandler = new TestIQHandler();
-        ResponseStanzaContainer responseStanzaContainer = iqHandler.execute(stanza, sessionContext,
null);
-        Stanza responseStanza = responseStanzaContainer.getResponseStanza();
-        XMLElementVerifier verifier = responseStanza.getVerifier();
-        assertTrue("iq", verifier.nameEquals("iq"));
-        assertTrue("error type", verifier.attributeEquals("type", IQStanzaType.ERROR.value()));
-        assertTrue("iq-error", verifier.subElementPresent("error"));
-    }
+        StanzaBuilder stanzaBuilder = new StanzaBuilder("message", NamespaceURIs.JABBER_SERVER);
+        String receiver = "test@example.com";
+        stanzaBuilder.addAttribute("to", receiver);
+        stanzaBuilder.startInnerElement("timestamp").addAttribute("value", timestamp).endInnerElement();
 
-    public void testMissingType() {
-        StanzaBuilder stanzaBuilder = new StanzaBuilder("iq", NamespaceURIs.JABBER_CLIENT);
-        stanzaBuilder.addAttribute("id", "1");
-        // missing: stanzaBuilder.addAttribute("type", "get");
-        assertIQError(stanzaBuilder.getFinalStanza());
-    }
-
-    public void testUnsupportedType() {
-        StanzaBuilder stanzaBuilder = new StanzaBuilder("iq", NamespaceURIs.JABBER_CLIENT);
-        stanzaBuilder.addAttribute("id", "1");
-        stanzaBuilder.addAttribute("type", "bogus");
-        assertIQError(stanzaBuilder.getFinalStanza());
-    }
-
-    public void testGetAndSetSubelements() {
-        // get and set must have exactly one subelement
-
-        String type = "get";
-        assertAnySub(type);  // test with zero
-        assertNotTwoSubs(type); // test with 2
-
-        type = "set";
-        assertAnySub(type);
-        assertNotTwoSubs(type);
-    }
-
-    public void testResultSubelements() {
-        // result must have zero or one subelements
-        String type = "result";
-        assertNotTwoSubs(type); // test with two
-    }
-
-    private void assertNotTwoSubs(String type) {
-        StanzaBuilder stanzaTwoSubs = new StanzaBuilder("iq", NamespaceURIs.JABBER_CLIENT);
-        stanzaTwoSubs.addAttribute("id", "1");
-        stanzaTwoSubs.addAttribute("type", type);
-        stanzaTwoSubs.startInnerElement("firstSub").endInnerElement();
-        stanzaTwoSubs.startInnerElement("secondSub").endInnerElement();
-        assertIQError(stanzaTwoSubs.getFinalStanza());
-    }
-
-    private void assertAnySub(String type) {
-        StanzaBuilder stanzaNoSub = new StanzaBuilder("iq", NamespaceURIs.JABBER_CLIENT);
-        stanzaNoSub.addAttribute("id", "1");
-        stanzaNoSub.addAttribute("type", type);
-        assertIQError(stanzaNoSub.getFinalStanza());
-    }
-
-    public void testGet() {
-        StanzaBuilder stanzaBuilder = new StanzaBuilder("iq", NamespaceURIs.JABBER_CLIENT);
-        stanzaBuilder.addAttribute("id", "1");
-        stanzaBuilder.addAttribute("type", "get");
-        stanzaBuilder.startInnerElement("getRequest").endInnerElement();
-
-        TestIQHandler iqHandler = new TestIQHandler();
-        ResponseStanzaContainer responseStanzaContainer = iqHandler.execute(stanzaBuilder.getFinalStanza(),
sessionContext, null);
-        IQStanza incomingStanza = iqHandler.getIncomingStanza();
-
-        XMPPCoreStanzaVerifier verifier = incomingStanza.getCoreVerifier();
-        assertTrue("iq", verifier.nameEquals("iq"));
-        assertTrue("iq-id", verifier.attributeEquals("id", "1"));
-        assertTrue("iq-type-get", verifier.attributeEquals("type", "get"));
-
-        // response is "result"
-        Stanza responseStanza = responseStanzaContainer.getResponseStanza();
-        XMLElementVerifier responseVerifier = responseStanza.getVerifier();
-        assertTrue("iq", responseVerifier.nameEquals("iq"));
-        assertTrue("iq-id", responseVerifier.attributeEquals("id", "1"));
-        assertTrue("iq-type-result", responseVerifier.attributeEquals("type", "result"));
+        TestSessionContext sessionContext = this.sessionContext;
+        sessionContext.setServerToServer();
+        
+        RecordingStanzaRelay stanzaRelay = (RecordingStanzaRelay) sessionContext.getServerRuntimeContext().getStanzaRelay();
+        assertFalse(stanzaRelay.iterator().hasNext());
+
+        MessageHandler messageHandler = new MessageHandler();
+        Stanza stanza = stanzaBuilder.getFinalStanza();
+        ResponseStanzaContainer responseStanzaContainer = messageHandler.execute(stanza,
sessionContext, null);
+
+        RecordingStanzaRelay.Pair pair = stanzaRelay.iterator().next();
+        XMLElementVerifier timestampVerifier = pair.getStanza().getFirstInnerElement().getVerifier();
+        
+        assertTrue("stanza relayed to", pair.getStanza().getVerifier().toAttributeEquals(receiver));
+        assertTrue("stanza relayed inner", timestampVerifier.attributeEquals("value", timestamp));
+        assertEquals("stanza relayed to correct receiver", new EntityImpl("test", "example.com",
null), pair.getEntity());
+
+        // clean and do not accept follow-up relays
+        stanzaRelay.reset();
+        stanzaRelay.setAcceptingMode(false);
+        
+        responseStanzaContainer = messageHandler.execute(stanza, sessionContext, null);
+        assertFalse(stanzaRelay.iterator().hasNext());
+       
     }
 
-}
-
+}
\ No newline at end of file

Modified: labs/vysper/src/test/java/org/apache/vysper/xmpp/protocol/ProtocolStateTestCase.java
URL: http://svn.apache.org/viewvc/labs/vysper/src/test/java/org/apache/vysper/xmpp/protocol/ProtocolStateTestCase.java?rev=570415&r1=570414&r2=570415&view=diff
==============================================================================
--- labs/vysper/src/test/java/org/apache/vysper/xmpp/protocol/ProtocolStateTestCase.java (original)
+++ labs/vysper/src/test/java/org/apache/vysper/xmpp/protocol/ProtocolStateTestCase.java Tue
Aug 28 06:28:08 2007
@@ -22,7 +22,7 @@
 import org.apache.vysper.xmpp.server.XMPPVersion;
 import org.apache.vysper.xmpp.server.SessionState;
 import org.apache.vysper.xmpp.server.response.ServerResponses;
-import org.apache.vysper.xmpp.delivery.StanzaRelayImpl;
+import org.apache.vysper.xmpp.delivery.StanzaReceiverRelay;
 import org.apache.vysper.xmpp.applicationdomains.base.handler.BaseStreamStanzaDictionary;
 import org.apache.vysper.xmpp.stanza.Stanza;
 import org.apache.vysper.xmpp.stanza.StanzaBuilder;
@@ -44,7 +44,7 @@
         super.setUp();
 
         protocolWorker = new ProtocolWorker();
-        serverRuntimeContext = new DefaultServerRuntimeContext(serverEnitity, new StanzaRelayImpl());
+        serverRuntimeContext = new DefaultServerRuntimeContext(serverEnitity, new StanzaReceiverRelay());
         serverRuntimeContext.addDictionary(new BaseStreamStanzaDictionary());
         sessionStateHolder = new SessionStateHolder();
         sessionContext = new TestSessionContext(serverRuntimeContext, sessionStateHolder);

Modified: labs/vysper/src/test/java/org/apache/vysper/xmpp/protocol/ProtocolWorkerAquireTestCase.java
URL: http://svn.apache.org/viewvc/labs/vysper/src/test/java/org/apache/vysper/xmpp/protocol/ProtocolWorkerAquireTestCase.java?rev=570415&r1=570414&r2=570415&view=diff
==============================================================================
--- labs/vysper/src/test/java/org/apache/vysper/xmpp/protocol/ProtocolWorkerAquireTestCase.java
(original)
+++ labs/vysper/src/test/java/org/apache/vysper/xmpp/protocol/ProtocolWorkerAquireTestCase.java
Tue Aug 28 06:28:08 2007
@@ -18,7 +18,7 @@
 package org.apache.vysper.xmpp.protocol;
 
 import org.apache.vysper.xmpp.addressing.EntityImpl;
-import org.apache.vysper.xmpp.delivery.StanzaRelayImpl;
+import org.apache.vysper.xmpp.delivery.StanzaReceiverRelay;
 import org.apache.vysper.xmpp.parser.StreamParser;
 import org.apache.vysper.xmpp.parser.StringStreamParser;
 import org.apache.vysper.xmpp.server.DefaultServerRuntimeContext;
@@ -40,7 +40,7 @@
 
         protocolWorker = new ProtocolWorker();
         sessionStateHolder = new SessionStateHolder();
-        sessionContext = new TestSessionContext(new DefaultServerRuntimeContext(new EntityImpl(null,
"test", null), new StanzaRelayImpl()), sessionStateHolder);
+        sessionContext = new TestSessionContext(new DefaultServerRuntimeContext(new EntityImpl(null,
"test", null), new StanzaReceiverRelay()), sessionStateHolder);
     }
 
     public void testAquireSimpleStanza() {

Modified: labs/vysper/src/test/java/org/apache/vysper/xmpp/protocol/ProtocolWorkerProcessTestCase.java
URL: http://svn.apache.org/viewvc/labs/vysper/src/test/java/org/apache/vysper/xmpp/protocol/ProtocolWorkerProcessTestCase.java?rev=570415&r1=570414&r2=570415&view=diff
==============================================================================
--- labs/vysper/src/test/java/org/apache/vysper/xmpp/protocol/ProtocolWorkerProcessTestCase.java
(original)
+++ labs/vysper/src/test/java/org/apache/vysper/xmpp/protocol/ProtocolWorkerProcessTestCase.java
Tue Aug 28 06:28:08 2007
@@ -26,7 +26,7 @@
 import org.apache.vysper.xmpp.addressing.EntityImpl;
 import org.apache.vysper.xmpp.xmlfragment.XMLElementVerifier;
 import org.apache.vysper.xmpp.xmlfragment.XMLElement;
-import org.apache.vysper.xmpp.delivery.StanzaRelayImpl;
+import org.apache.vysper.xmpp.delivery.StanzaReceiverRelay;
 import junit.framework.TestCase;
 
 /**
@@ -46,7 +46,7 @@
 
         protocolWorker = new ProtocolWorker();
         namespaceHandlerDictionary = new NamespaceHandlerDictionary("testNSURI");
-        serverRuntimeContext = new DefaultServerRuntimeContext(serverEnitity, new StanzaRelayImpl());
+        serverRuntimeContext = new DefaultServerRuntimeContext(serverEnitity, new StanzaReceiverRelay());
         serverRuntimeContext.addDictionary(namespaceHandlerDictionary);
         sessionStateHolder = new SessionStateHolder();
         sessionContext = new TestSessionContext(serverRuntimeContext, sessionStateHolder);

Modified: labs/vysper/src/test/java/org/apache/vysper/xmpp/protocol/ProtocolWorkerStateAwarenessTestCase.java
URL: http://svn.apache.org/viewvc/labs/vysper/src/test/java/org/apache/vysper/xmpp/protocol/ProtocolWorkerStateAwarenessTestCase.java?rev=570415&r1=570414&r2=570415&view=diff
==============================================================================
--- labs/vysper/src/test/java/org/apache/vysper/xmpp/protocol/ProtocolWorkerStateAwarenessTestCase.java
(original)
+++ labs/vysper/src/test/java/org/apache/vysper/xmpp/protocol/ProtocolWorkerStateAwarenessTestCase.java
Tue Aug 28 06:28:08 2007
@@ -19,7 +19,7 @@
 
 import org.apache.vysper.xmpp.addressing.EntityImpl;
 import org.apache.vysper.xmpp.addressing.Entity;
-import org.apache.vysper.xmpp.delivery.StanzaRelayImpl;
+import org.apache.vysper.xmpp.delivery.StanzaReceiverRelay;
 import org.apache.vysper.xmpp.server.DefaultServerRuntimeContext;
 import org.apache.vysper.xmpp.server.TestSessionContext;
 import org.apache.vysper.xmpp.server.SessionState;
@@ -44,7 +44,7 @@
         protocolWorker = new ProtocolWorker();
         sessionStateHolder = new SessionStateHolder();
         Entity serverEnitity = new EntityImpl(null, "vysper-server.org", null);
-        DefaultServerRuntimeContext serverRuntimeContext = new DefaultServerRuntimeContext(serverEnitity,
new StanzaRelayImpl());
+        DefaultServerRuntimeContext serverRuntimeContext = new DefaultServerRuntimeContext(serverEnitity,
new StanzaReceiverRelay());
         serverRuntimeContext.addDictionary(new BaseStreamStanzaDictionary());
         sessionStateHolder = new SessionStateHolder();
         sessionContext = new TestSessionContext(serverRuntimeContext, sessionStateHolder);

Modified: labs/vysper/src/test/java/org/apache/vysper/xmpp/server/TestSessionContext.java
URL: http://svn.apache.org/viewvc/labs/vysper/src/test/java/org/apache/vysper/xmpp/server/TestSessionContext.java?rev=570415&r1=570414&r2=570415&view=diff
==============================================================================
--- labs/vysper/src/test/java/org/apache/vysper/xmpp/server/TestSessionContext.java (original)
+++ labs/vysper/src/test/java/org/apache/vysper/xmpp/server/TestSessionContext.java Tue Aug
28 06:28:08 2007
@@ -17,11 +17,11 @@
 
 package org.apache.vysper.xmpp.server;
 
-import org.apache.vysper.xmpp.stanza.Stanza;
-import org.apache.vysper.xmpp.writer.StanzaWriter;
-import org.apache.vysper.xmpp.delivery.StanzaRelayImpl;
 import org.apache.vysper.xmpp.addressing.EntityImpl;
+import org.apache.vysper.xmpp.delivery.RecordingStanzaRelay;
 import org.apache.vysper.xmpp.protocol.SessionStateHolder;
+import org.apache.vysper.xmpp.stanza.Stanza;
+import org.apache.vysper.xmpp.writer.StanzaWriter;
 
 /**
  * makes response available for testing
@@ -32,7 +32,7 @@
     private boolean closed = false;
 
     public TestSessionContext(SessionStateHolder sessionStateHolder) {
-        this(new DefaultServerRuntimeContext(new EntityImpl(null, "test", null), new StanzaRelayImpl()),
sessionStateHolder);
+        this(new DefaultServerRuntimeContext(new EntityImpl(null, "test", null), new RecordingStanzaRelay()),
sessionStateHolder);
     }
 
     public TestSessionContext(ServerRuntimeContext serverRuntimeContext, SessionStateHolder
sessionStateHolder) {



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@labs.apache.org
For additional commands, e-mail: commits-help@labs.apache.org


Mime
View raw message