View Javadoc
1   /*
2    * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
3    * The software in this package is published under the terms of the CPAL v1.0
4    * license, a copy of which has been included with this distribution in the
5    * LICENSE.txt file.
6    */
7   package org.mule.transport.xmpp;
8   
9   import org.mule.api.transport.Connector;
10  import org.mule.transport.AbstractConnectorTestCase;
11  
12  import org.jivesoftware.smack.packet.Message;
13  
14  public class XmppConnectorTestCase extends AbstractConnectorTestCase
15  {
16      @Override
17      protected boolean isDisabledInThisEnvironment()
18      {
19          return XmppEnableDisableTestCase.isTestDisabled();
20      }
21  
22      @Override
23      public Connector createConnector() throws Exception
24      {
25          XmppConnector cnn = new XmppConnector(muleContext);
26          cnn.setName("xmppConnector");
27          return cnn;
28      }
29  
30      public Object getValidMessage() throws Exception
31      {
32          Message message = new Message("ross@jabber.org");
33          message.setBody("Hello");
34          return message;
35      }
36  
37      protected String getProtocol()
38      {
39          return "xmpp";
40      }
41  
42      public String getTestEndpointURI()
43      {
44          return this.getProtocol() + "://mule1:mule@jabber.org.au/ross@jabber.org";
45      }
46  }