Hi
The following applicationContext-jms.xml inside our application:
When I tried to use this for running the unit tests all failed with initalization beans error,Code:<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd"> <bean id="jndiTemplate" class="org.springframework.jndi.JndiTemplate"> <property name="environment"> <props> <prop key="java.naming.provider.url">${java.naming.provider.url}</prop> <prop key="java.naming.factory.url.pkgs">org.jnp.interfaces:org.jboss.naming</prop> <prop key="java.naming.factory.initial">org.jnp.interfaces.NamingContextFactory</prop> </props> </property> </bean> <!--reference to jboss jms connection factory , can use httpConnection factory--> <bean id="connectionFactory" class="org.springframework.jndi.JndiObjectFactoryBean"> <property name="jndiTemplate" ref="jndiTemplate"/> <property name="jndiName" value="ConnectionFactory"/> </bean> <!--JMSTemplate bean used to manage all connection and session, it's Spring way to overcome the JMS unnecessary repetitives code, set to non persistent mode--> <bean id="jmsGenaralTempalte" class="org.springframework.jms.core.JmsTemplate"> <property name="connectionFactory" ref="connectionFactory"/> <property name="defaultDestination" ref="sendEmailDestination"/> <property name="deliveryPersistent" value="false"/> <property name="sessionTransacted" value="true"/> </bean> <!--destination for sending emails--> <bean id="sendEmailDestination" class="org.springframework.jndi.JndiObjectFactoryBean"> <property name="jndiTemplate" ref="jndiTemplate"/> <property name="jndiName" value="queue/SendMailQueue"/> </bean> <!--MDP listener bean, consume and send emails--> <bean id="emailMessageListenerMDP" class="org.springframework.jms.listener.adapter.MessageListenerAdapter"> <constructor-arg> <bean class="com.supportspace.stargate.jms.email.MailMDP"> <property name="mailEngine" ref="mailEngine"/> <property name="mailManager" ref="mailManager"/> </bean> </constructor-arg> </bean> <!--use DefaultMessageListenerContainer to support JTA transaction--> <bean id="jmsContainer" class="org.springframework.jms.listener.DefaultMessageListenerContainer"> <property name="connectionFactory" ref="connectionFactory"/> <property name="destination" ref="sendEmailDestination"/> <property name="messageListener" ref="emailMessageListenerMDP"/> <property name="transactionManager" ref="transactionManager"/> </bean> </beans>
I need help with creating applicationTest.xml for that porpuse and I don't understand how to use rg.springframework.mock.jndi.ExpectedLookupTemplat e
Please help


Reply With Quote