Author: mjakl
Date: Sun Jul  5 10:40:57 2009
New Revision: 791216

URL: http://svn.apache.org/viewvc?rev=791216&view=rev
Log:
Failing testcase for VYSPER-92. Shows problems when no "from" address is added 
by the client.

Modified:
    
mina/sandbox/vysper/trunk/src/test/java/org/apache/vysper/xmpp/modules/extension/xep0060_pubsub/handler/PubSubSubscribeTestCase.java

Modified: 
mina/sandbox/vysper/trunk/src/test/java/org/apache/vysper/xmpp/modules/extension/xep0060_pubsub/handler/PubSubSubscribeTestCase.java
URL: 
http://svn.apache.org/viewvc/mina/sandbox/vysper/trunk/src/test/java/org/apache/vysper/xmpp/modules/extension/xep0060_pubsub/handler/PubSubSubscribeTestCase.java?rev=791216&r1=791215&r2=791216&view=diff
==============================================================================
--- 
mina/sandbox/vysper/trunk/src/test/java/org/apache/vysper/xmpp/modules/extension/xep0060_pubsub/handler/PubSubSubscribeTestCase.java
 (original)
+++ 
mina/sandbox/vysper/trunk/src/test/java/org/apache/vysper/xmpp/modules/extension/xep0060_pubsub/handler/PubSubSubscribeTestCase.java
 Sun Jul  5 10:40:57 2009
@@ -77,6 +77,27 @@
         assertNotNull(sub.getAttributeValue("subid")); // it should be present 
- value unknown
         assertEquals("subscribed", sub.getAttributeValue("subscription"));
     }
+    
+    public void testSubscribeNoFrom() throws Exception {
+        AbstractStanzaGenerator sg = getDefaultStanzaGenerator();
+        Stanza stanza = sg.getStanza(null, pubsubService, "id123", testNode);
+        ResponseStanzaContainer result = sendStanza(stanza, true);
+        assertTrue(result.hasResponse());
+        IQStanza response = new IQStanza(result.getResponseStanza());
+        assertEquals(IQStanzaType.RESULT.value(),response.getType());
+        assertTrue(node.isSubscribed(client));
+
+        assertEquals("id123", response.getAttributeValue("id")); // IDs must 
match
+
+        // get the subscription Element
+        XMLElement sub = 
response.getFirstInnerElement().getFirstInnerElement();
+
+        assertEquals("subscription", sub.getName());
+        assertEquals(testNode, sub.getAttributeValue("node"));
+        assertEquals(client.getFullQualifiedName(), 
sub.getAttributeValue("jid"));
+        assertNotNull(sub.getAttributeValue("subid")); // it should be present 
- value unknown
+        assertEquals("subscribed", sub.getAttributeValue("subscription"));
+    }
 
     public void testSubscribeNonMatchingJIDs() {
         DefaultSubscribeStanzaGenerator sg = new 
DefaultSubscribeStanzaGenerator();


Reply via email to