polishing XMPP samples

This commit is contained in:
Oleg Zhurakousky
2010-11-15 19:54:36 -05:00
parent 4e048f7072
commit 706a360eda
2 changed files with 12 additions and 8 deletions

View File

@@ -24,13 +24,7 @@
password="${user.1.password}"
host="${user.1.host}"
service-name="${user.1.service}"/>
<beans:bean id="eventProducer" class="org.springframework.integration.xmpp.presence.XmppRosterEventProducer"/>
<inbound-channel-adapter ref="eventProducer" channel="outboundPresenceChannel">
<poller fixed-rate="1000">
</inbound-channel-adapter>
<channel id="outboundPresenceChannel"/>
<xmpp:presence-outbound-channel-adapter xmpp-connection="testConnection" channel="outboundPresenceChannel"/>

View File

@@ -16,10 +16,15 @@
package org.springframework.integration.xmpp.ignore;
import org.jivesoftware.smack.packet.Presence;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.integration.channel.DirectChannel;
import org.springframework.integration.message.GenericMessage;
import org.springframework.integration.xmpp.outbound.PresenceSendingMessageHandler;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@@ -34,9 +39,14 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@RunWith(SpringJUnit4ClassRunner.class)
public class OutboundPresenceTests {
@Autowired
@Qualifier("outboundPresenceChannel")
private DirectChannel input;
@Test
@Ignore
//@Ignore
public void testOutbound() throws Throwable {
Presence presence = new Presence(Presence.Type.available);
input.send(new GenericMessage<Presence>(presence));
Thread.sleep(60 * 1000);
}
}