package org.superbiz.client;

import org.junit.BeforeClass;
import org.junit.Test;

import javax.jms.ConnectionFactory;
import javax.jms.Queue;
import javax.naming.Context;
import javax.naming.InitialContext;
import java.util.Properties;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;

public class SenderTest {
    @BeforeClass
    public static void configureClientResources() {
        // can be set this way or with the key Resource/<type>
        // in fact we create on client side a mini jndi tree
        // the key is the jndi name (the one used for the lookup)
        System.setProperty("aConnectionFactory",
"connectionfactory:org.apache.activemq.ActiveMQConnectionFactory:tcp://localhost:11616");
        System.setProperty("aQueue",
"queue:org.apache.activemq.command.ActiveMQQueue:LISTENER");
    }

    @Test
    public void send() throws Exception {
        final Properties properties = new Properties();
        properties.setProperty(Context.INITIAL_CONTEXT_FACTORY,
"org.apache.openejb.client.RemoteInitialContextFactory");
        final Context context = new InitialContext(properties);

        final Queue destination = (Queue) context.lookup("java:aQueue");
        assertNotNull(destination);
        assertEquals("LISTENER", destination.getQueueName());

        final ConnectionFactory connectionFactory = (ConnectionFactory)
context.lookup("java:aConnectionFactory");
        assertNotNull(connectionFactory);
    }
}

this sample?

tcp://localhost:11616? I try but result is same! ra or core.jar

no use any config file!



--
View this message in context: 
http://openejb.979440.n4.nabble.com/Re-Help-one-MDB-deploy-standalone-openejb-but-Can-not-lookup-ConnectionFactory-tp4660279p4660304.html
Sent from the OpenEJB Dev mailing list archive at Nabble.com.

Reply via email to