INT-1222 added @Ignore to all integration tests that depend on an XMPP server, etc.

This commit is contained in:
Mark Fisher
2010-07-05 21:29:04 +00:00
parent 12bc7e4024
commit 862d27bb3d
9 changed files with 127 additions and 34 deletions

View File

@@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.integration.xmpp.config;
import org.junit.Test;

View File

@@ -16,6 +16,7 @@
package org.springframework.integration.xmpp.messages;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.test.context.ContextConfiguration;
@@ -29,7 +30,7 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@RunWith(SpringJUnit4ClassRunner.class)
public class ConsoleChatTests {
@Test
@Test @Ignore
public void run() throws Exception {
Thread.sleep( 10 * 1000 );
}

View File

@@ -16,6 +16,7 @@
package org.springframework.integration.xmpp.messages;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.test.context.ContextConfiguration;
@@ -29,7 +30,7 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@RunWith(SpringJUnit4ClassRunner.class)
public class InboundXmppEndpointTests {
@Test
@Test @Ignore
public void run() throws Exception {
Thread.sleep( 10 * 1000 );
}

View File

@@ -16,6 +16,7 @@
package org.springframework.integration.xmpp.messages;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -32,7 +33,7 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@RunWith(SpringJUnit4ClassRunner.class)
public class OutboundXmppEndpointTests {
@Test
@Test @Ignore
public void run() throws Exception {
Thread.sleep(10 * 1000);
}

View File

@@ -1,5 +1,22 @@
/*
* Copyright 2002-2010 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.integration.xmpp.presence;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.test.context.ContextConfiguration;
@@ -16,7 +33,7 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@RunWith(SpringJUnit4ClassRunner.class)
public class InboundXmppRosterEventsEndpointTests {
@Test
@Test @Ignore
public void run() throws Exception {
Thread.sleep( 60 * 1000);
}

View File

@@ -1,5 +1,22 @@
/*
* Copyright 2002-2010 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.integration.xmpp.presence;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.test.context.ContextConfiguration;
@@ -16,7 +33,8 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@ContextConfiguration
@RunWith(SpringJUnit4ClassRunner.class)
public class OutboundXmppRosterEventsEndpointTests {
@Test
@Test @Ignore
public void testOutbound() throws Throwable {
Thread.sleep( 60 * 1000);
}

View File

@@ -1,5 +1,22 @@
/*
* Copyright 2002-2010 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.integration.xmpp.presence;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.test.context.ContextConfiguration;
@@ -20,7 +37,7 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@RunWith(SpringJUnit4ClassRunner.class)
public class PresenceMessageComboTests {
@Test
@Test @Ignore
public void run () throws Throwable {
Thread.sleep( 60 * 1000);
}

View File

@@ -1,3 +1,19 @@
/*
* Copyright 2002-2010 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.integration.xmpp.presence;
import org.apache.commons.lang.StringUtils;
@@ -6,24 +22,24 @@ import org.springframework.integration.core.Message;
import org.springframework.integration.core.MessageHeaders;
import org.springframework.integration.xmpp.XmppHeaders;
import java.util.Collection;
/**
*
* This class reacts to changes in {@link org.jivesoftware.smack.packet.Presence} objects for a given account.
*
* This class reacts to changes in
* {@link org.jivesoftware.smack.packet.Presence} objects for a given account.
*
* @author Josh Long
* @since 2.0
*/
public class XmppRosterEventConsumer {
@ServiceActivator
public void presenceChanged ( Message<?> presenceEventMsg ) throws Exception {
System.out.println(StringUtils.repeat( "-" , 100));
String whosePresence = (String)presenceEventMsg.getHeaders().get( XmppHeaders.PRESENCE_FROM);
System.out.println( "entries affected: " + whosePresence);
MessageHeaders messageHeaders = presenceEventMsg.getHeaders();
for( String h : messageHeaders.keySet() )
System.out.println( String.format( "%s = %s", h, messageHeaders.get(h)));
@ServiceActivator
public void presenceChanged(Message<?> presenceEventMsg) throws Exception {
System.out.println(StringUtils.repeat("-", 100));
String whosePresence = (String) presenceEventMsg.getHeaders().get(XmppHeaders.PRESENCE_FROM);
System.out.println("entries affected: " + whosePresence);
MessageHeaders messageHeaders = presenceEventMsg.getHeaders();
for (String h : messageHeaders.keySet()) {
System.out.println(String.format("%s = %s", h, messageHeaders.get(h)));
}
}
}

View File

@@ -1,3 +1,19 @@
/*
* Copyright 2002-2010 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.integration.xmpp.presence;
import org.apache.commons.lang.StringUtils;
@@ -8,24 +24,29 @@ import org.springframework.integration.core.Message;
import org.springframework.integration.message.*;
import org.springframework.integration.xmpp.XmppHeaders;
/**
* This is used in {@link org.springframework.integration.xmpp.presence.OutboundXmppRosterEventsEndpointTests} to produce fake status / presence updates.
*
* This is used in
* {@link org.springframework.integration.xmpp.presence.OutboundXmppRosterEventsEndpointTests}
* to produce fake status / presence updates.
*
* @author Josh Long
* @since 2.0
*/
public class XmppRosterEventProducer implements MessageSource<String> {
public Message<String> receive() {
try {
Thread.sleep(1000 * 10);
} catch (InterruptedException e) {
// eat it
}
return (Math.random() > .5) ?
MessageBuilder.withPayload(StringUtils.EMPTY).setHeader(XmppHeaders.PRESENCE_MODE, Presence.Mode.chat).setHeader(XmppHeaders.PRESENCE_TYPE, Presence.Type.available)
.setHeader(XmppHeaders.PRESENCE_STATUS, "She Loves me").build() :
MessageBuilder.withPayload(StringUtils.EMPTY).setHeader(XmppHeaders.PRESENCE_MODE, Presence.Mode.dnd).setHeader(XmppHeaders.PRESENCE_TYPE, Presence.Type.available)
.setHeader(XmppHeaders.PRESENCE_STATUS, "She Loves me not").build();
}
public Message<String> receive() {
try {
Thread.sleep(1000 * 10);
}
catch (InterruptedException e) {
// eat it
}
return (Math.random() > .5) ? MessageBuilder.withPayload(StringUtils.EMPTY).setHeader(
XmppHeaders.PRESENCE_MODE, Presence.Mode.chat).setHeader(XmppHeaders.PRESENCE_TYPE,
Presence.Type.available).setHeader(XmppHeaders.PRESENCE_STATUS, "She Loves me").build()
: MessageBuilder.withPayload(StringUtils.EMPTY).setHeader(XmppHeaders.PRESENCE_MODE, Presence.Mode.dnd)
.setHeader(XmppHeaders.PRESENCE_TYPE, Presence.Type.available).setHeader(
XmppHeaders.PRESENCE_STATUS, "She Loves me not").build();
}
}