View Javadoc

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