1
2
3
4
5
6
7
8
9
10
11 package org.mule.test.integration.transport.xmpp;
12
13 import org.mule.api.endpoint.EndpointException;
14 import org.mule.api.endpoint.EndpointURI;
15 import org.mule.api.transport.Connector;
16 import org.mule.endpoint.MuleEndpointURI;
17 import org.mule.tck.FunctionalTestCase;
18 import org.mule.transport.xmpp.XmppConnector;
19
20 import org.jivesoftware.smack.XMPPConnection;
21
22
23 public class XmppFunctionalTestCase extends FunctionalTestCase
24 {
25 private XMPPConnection cnn;
26 private XmppConnector connector;
27
28 public void testSanity()
29 {
30 fail("Convert this test to an XML-based configuration");
31 }
32
33 protected String getConfigResources()
34 {
35
36 return null;
37 }
38
39 protected void sendTestData(int iterations) throws Exception
40 {
41 cnn = connector.createXmppConnection(getInDest());
42 for (int i = 0; i < 100; i++)
43 {
44 cnn.createChat("mule1").sendMessage("Test Message:" + i);
45 }
46 }
47
48 protected void receiveAndTestResults() throws Exception
49 {
50
51 Thread.sleep(7000);
52
53
54
55 }
56
57 protected EndpointURI getInDest()
58 {
59 try
60 {
61 return new MuleEndpointURI("xmpp://mule1:mule@jabber.org.au/foo");
62 }
63 catch (EndpointException e)
64 {
65 fail(e.getMessage());
66 return null;
67 }
68 }
69
70 protected EndpointURI getOutDest()
71 {
72 try
73 {
74 return new MuleEndpointURI("xmpp://mule2:mule@jabber.org.au/foobar");
75 }
76 catch (EndpointException e)
77 {
78 fail(e.getMessage());
79 return null;
80 }
81 }
82
83 protected Connector createConnector() throws Exception
84 {
85 connector = new XmppConnector();
86 connector.setName("test");
87 return connector;
88 }
89
90 }