INT-1521 polished the structure of the module to be consistent with other modules

This commit is contained in:
Oleg Zhurakousky
2010-10-14 15:17:15 -04:00
parent 3ddde2e450
commit 8d83fa7919
8 changed files with 2 additions and 6 deletions

View File

@@ -0,0 +1,43 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 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.
-->
<beans:beans
xmlns="http://www.springframework.org/schema/integration"
xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:util="http://www.springframework.org/schema/util"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xmpp="http://www.springframework.org/schema/integration/xmpp"
xsi:schemaLocation="
http://www.springframework.org/schema/integration/xmpp http://www.springframework.org/schema/integration/xmpp/spring-integration-xmpp.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/beans/spring-context.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd
http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd">
<channel id="input"/>
<channel id="output"/>
<xmpp:header-enricher input-channel="input" output-channel="output">
<xmpp:presence-from value="test@example.org"/>
<xmpp:presence-mode value="available"/>
<xmpp:message-to value="test1@example.org"/>
<xmpp:presence-type value="unavailable"/>
</xmpp:header-enricher>
</beans:beans>

View File

@@ -0,0 +1,63 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 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.
-->
<beans:beans xmlns="http://www.springframework.org/schema/integration"
xmlns:beans="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p" xmlns:context="http://www.springframework.org/schema/context"
xmlns:util="http://www.springframework.org/schema/util" xmlns:xmpp="http://www.springframework.org/schema/integration/xmpp"
xmlns:tool="http://www.springframework.org/schema/tool" xmlns:lang="http://www.springframework.org/schema/lang"
xmlns:console="http://www.springframework.org/schema/integration/stream"
xsi:schemaLocation="http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd
http://www.springframework.org/schema/tool http://www.springframework.org/schema/tool/spring-tool-3.0.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/integration/xmpp http://www.springframework.org/schema/integration/xmpp/spring-integration-xmpp.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd
http://www.springframework.org/schema/lang http://www.springframework.org/schema/lang/spring-lang-3.0.xsd
http://www.springframework.org/schema/integration/stream http://www.springframework.org/schema/integration/stream/spring-integration-stream.xsd">
<beans:bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer" p:ignoreUnresolvablePlaceholders="false">
<beans:property name="location" value="classpath:test.properties"/>
</beans:bean>
<xmpp:xmpp-connection
id="testConnection"
user="${user.2.login}"
password="${user.2.password}"
host="${user.2.host}"
port="${user.2.port}"
resource="${user.2.resource}"
sasl-mechanism-supported="${user.2.sasl.mechanism}"
sasl-mechanism-supported-index="${user.2.sasl.index}"
service-name="${user.2.service}"
/>
<console:stdout-channel-adapter id="stdout" append-newline="true"/>
<console:stdin-channel-adapter id="stdin"/>
<header-enricher input-channel="stdin" output-channel="messagesToSend">
<header name="#{T(org.springframework.integration.xmpp.XmppHeaders).CHAT_TO_USER}" value="${user.1.login}"/>
</header-enricher>
<xmpp:message-inbound-channel-adapter channel="stdout" xmpp-connection="testConnection"/>
<channel id="messagesToSend"/>
<xmpp:message-outbound-channel-adapter channel="messagesToSend" xmpp-connection="testConnection"/>
<poller default="true">
<interval-trigger interval="1" time-unit="SECONDS"/>
</poller>
</beans:beans>

View File

@@ -0,0 +1,58 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 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.
-->
<beans:beans
xmlns="http://www.springframework.org/schema/integration"
xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:util="http://www.springframework.org/schema/util"
xmlns:xmpp="http://www.springframework.org/schema/integration/xmpp"
xmlns:tool="http://www.springframework.org/schema/tool"
xmlns:lang="http://www.springframework.org/schema/lang"
xsi:schemaLocation="http://www.springframework.org/schema/integration/xmpp
http://www.springframework.org/schema/integration/xmpp/spring-integration-xmpp.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd
http://www.springframework.org/schema/tool http://www.springframework.org/schema/tool/spring-tool-3.0.xsd
http://www.springframework.org/schema/lang http://www.springframework.org/schema/lang/spring-lang-3.0.xsd">
<context:component-scan base-package="org.springframework.integration.xmpp"/>
<context:property-placeholder location="#{ systemProperties['user.home'] }/Desktop/test.properties"/>
<channel id="xmppInbound"/>
<xmpp:xmpp-connection
id="testConnection"
user="${user.2.login}"
password="${user.2.password}"
host="${user.2.host}"
port="${user.2.port}"
resource="${user.2.resource}"
sasl-mechanism-supported="${user.2.sasl.mechanism}"
sasl-mechanism-supported-index="${user.2.sasl.index}"
service-name="${user.2.service}"
/>
<xmpp:message-inbound-channel-adapter channel="xmppInbound" xmpp-connection="testConnection"/>
<service-activator input-channel="xmppInbound" ref="xmppMessageConsumer"/>
</beans:beans>

View File

@@ -0,0 +1,58 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 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.
-->
<beans:beans xmlns="http://www.springframework.org/schema/integration"
xmlns:beans="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p" xmlns:context="http://www.springframework.org/schema/context"
xmlns:util="http://www.springframework.org/schema/util" xmlns:xmpp="http://www.springframework.org/schema/integration/xmpp"
xmlns:tool="http://www.springframework.org/schema/tool" xmlns:lang="http://www.springframework.org/schema/lang"
xsi:schemaLocation="http://www.springframework.org/schema/integration/xmpp http://www.springframework.org/schema/integration/xmpp/spring-integration-xmpp.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd
http://www.springframework.org/schema/tool http://www.springframework.org/schema/tool/spring-tool-3.0.xsd
http://www.springframework.org/schema/lang http://www.springframework.org/schema/lang/spring-lang-3.0.xsd">
<context:component-scan base-package="org.springframework.integration.xmpp"/>
<context:property-placeholder location="file://${user.home}/Desktop/xmpp.properties" ignore-unresolvable="true"/>
<beans:bean id="xmppProducer"
class="org.springframework.integration.xmpp.messages.XmppMessageProducer"
p:recipient="starbuxman@gmail.com"/>
<poller default="true">
<interval-trigger fixed-rate="true" interval="10" time-unit="SECONDS"/>
</poller>
<xmpp:xmpp-connection
id="testConnection"
user="${user.2.login}"
password="${user.2.password}"
host="${user.2.host}"
port="${user.2.port}"
resource="${user.2.resource}"
sasl-mechanism-supported="${user.2.sasl.mechanism}"
sasl-mechanism-supported-index="0"
service-name="${user.2.service}"
/>
<inbound-channel-adapter ref="xmppProducer" channel="outboundChannel"/>
<channel id="outboundChannel"/>
<xmpp:message-outbound-channel-adapter channel="outboundChannel" xmpp-connection="testConnection"/>
</beans:beans>

View File

@@ -33,7 +33,7 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
public class OutboundXmppEndpointTests {
@Test
//@Ignore
@Ignore
public void run() throws Exception {
Thread.sleep(10 * 1000);
}

View File

@@ -0,0 +1,57 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 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.
-->
<beans:beans xmlns="http://www.springframework.org/schema/integration"
xmlns:beans="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p" xmlns:context="http://www.springframework.org/schema/context"
xmlns:util="http://www.springframework.org/schema/util" xmlns:xmpp="http://www.springframework.org/schema/integration/xmpp"
xmlns:tool="http://www.springframework.org/schema/tool" xmlns:lang="http://www.springframework.org/schema/lang"
xmlns:console="http://www.springframework.org/schema/integration/stream"
xsi:schemaLocation="http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd
http://www.springframework.org/schema/tool http://www.springframework.org/schema/tool/spring-tool-3.0.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/integration/xmpp http://www.springframework.org/schema/integration/xmpp/spring-integration-xmpp.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd
http://www.springframework.org/schema/lang http://www.springframework.org/schema/lang/spring-lang-3.0.xsd
http://www.springframework.org/schema/integration/stream http://www.springframework.org/schema/integration/stream/spring-integration-stream.xsd">
<beans:bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer" p:ignoreUnresolvablePlaceholders="false">
<beans:property name="location">
<beans:bean class="org.springframework.core.io.FileSystemResource">
<beans:constructor-arg value="#{ systemProperties['user.home'] }/Desktop/test.properties"/>
</beans:bean>
</beans:property>
</beans:bean>
<beans:bean id="xmppRosterEventConsumer" class="org.springframework.integration.xmpp.presence.XmppRosterEventConsumer"/>
<xmpp:xmpp-connection
id="testConnection"
user="${user.1.login}"
password="${user.1.password}"
host="${user.1.host}"
port="${user.1.port}"
resource="${user.1.resource}"
sasl-mechanism-supported="${user.1.sasl.mechanism}"
sasl-mechanism-supported-index="${user.1.sasl.index}"
service-name="${user.1.service}"
/>
<channel id="inboundRosterEventChannel"/>
<xmpp:roster-event-inbound-channel-adapter channel="inboundRosterEventChannel" xmpp-connection="testConnection"/>
<service-activator input-channel="inboundRosterEventChannel" ref="xmppRosterEventConsumer"/>
</beans:beans>

View File

@@ -0,0 +1,63 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 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.
-->
<beans:beans xmlns="http://www.springframework.org/schema/integration"
xmlns:beans="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p" xmlns:context="http://www.springframework.org/schema/context"
xmlns:util="http://www.springframework.org/schema/util" xmlns:xmpp="http://www.springframework.org/schema/integration/xmpp"
xmlns:tool="http://www.springframework.org/schema/tool" xmlns:lang="http://www.springframework.org/schema/lang"
xmlns:console="http://www.springframework.org/schema/integration/stream"
xsi:schemaLocation="http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd
http://www.springframework.org/schema/tool http://www.springframework.org/schema/tool/spring-tool-3.0.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/integration/xmpp http://www.springframework.org/schema/integration/xmpp/spring-integration-xmpp.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd
http://www.springframework.org/schema/lang http://www.springframework.org/schema/lang/spring-lang-3.0.xsd
http://www.springframework.org/schema/integration/stream http://www.springframework.org/schema/integration/stream/spring-integration-stream.xsd">
<beans:bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer" p:ignoreUnresolvablePlaceholders="false">
<beans:property name="location">
<beans:bean class="org.springframework.core.io.FileSystemResource">
<beans:constructor-arg value="#{ systemProperties['user.home'] }/Desktop/test.properties"/>
</beans:bean>
</beans:property>
</beans:bean>
<xmpp:xmpp-connection
id="testConnection"
user="${user.1.login}"
password="${user.1.password}"
host="${user.1.host}"
port="${user.1.port}"
resource="${user.1.resource}"
sasl-mechanism-supported="${user.1.sasl.mechanism}"
sasl-mechanism-supported-index="${user.1.sasl.index}"
service-name="${user.1.service}"
/>
<beans:bean id="eventProducer" class="org.springframework.integration.xmpp.presence.XmppRosterEventProducer"/>
<inbound-channel-adapter ref="eventProducer" channel="rosterPresenceUpdatingProducerChannel">
<poller>
<interval-trigger interval="10000"/>
</poller>
</inbound-channel-adapter>
<channel id="rosterPresenceUpdatingProducerChannel"/>
<xmpp:roster-event-outbound-channel-adapter xmpp-connection="testConnection" channel="rosterPresenceUpdatingProducerChannel"/>
</beans:beans>

View File

@@ -0,0 +1,32 @@
#
# Copyright 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.
#
# to be able to run these tests, put this file on your desktop and configure as appropriate
user.1.login=user1@gmail.com
user.1.password=password
user.1.host=talk.google.com
user.1.service=gmail.com
user.1.sasl.mechanism=PLAIN
user.1.sasl.index=0
user.1.resource=resource
user.1.port=5222
user.2.login=user2@gmail.com
user.2.password=password
user.2.host=talk.google.com
user.2.service=gmail.com
user.2.sasl.mechanism=PLAIN
user.2.sasl.index=0
user.2.resource=resource
user.2.port=5222