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.MuleMessage; 10 import org.mule.module.client.MuleClient; 11 import org.mule.transport.NullPayload; 12 13 import org.junit.Test; 14 15 import static org.junit.Assert.assertFalse; 16 import static org.junit.Assert.assertNotNull; 17 18 public class XmppFunctionalTestCase extends XmppEnableDisableTestCase 19 { 20 21 @Override 22 protected String getConfigResources() 23 { 24 return "xmpp-functional-config.xml"; 25 } 26 27 // @Test 28 // public void testDispatchNormalMessage() throws Exception 29 // { 30 // MuleClient client = new MuleClient(muleContext); 31 // Map<String, String> messageProperties = new HashMap<String, String>(); 32 // messageProperties.put(XmppConnector.XMPP_SUBJECT, "da subject"); 33 // client.dispatch("vm://in", TEST_MESSAGE, messageProperties); 34 // 35 // Thread.sleep(10000); 36 // } 37 38 // @Test 39 // public void testSendNormalMessage() throws Exception 40 // { 41 // MuleClient client = new MuleClient(muleContext); 42 // MuleMessage result = client.send("vm://in", TEST_MESSAGE, null); 43 // assertNotNull(result); 44 // assertFalse(result.getPayload() instanceof NullPayload); 45 // } 46 47 // @Test 48 // public void testDispatchChat() throws Exception 49 // { 50 // MuleClient client = new MuleClient(muleContext); 51 // client.dispatch("vm://in", TEST_MESSAGE, null); 52 // 53 // Thread.sleep(10000); 54 // } 55 56 @Test 57 public void testSendChat() throws Exception 58 { 59 MuleClient client = new MuleClient(muleContext); 60 MuleMessage result = client.send("vm://in", TEST_MESSAGE, null); 61 assertNotNull(result); 62 assertFalse(result.getPayload() instanceof NullPayload); 63 } 64 }