Examples of JndiTemplate


Examples of org.springframework.jndi.JndiTemplate

    final MyHome home = (MyHome) mc.getMock();
    home.create();
    mc.setThrowable(cex);
    mc.replay();
 
    JndiTemplate jt = new JndiTemplate() {
      public Object lookup(String name) {
        // parameterize
        assertTrue(name.equals(jndiName));
        return home;
      }
View Full Code Here

Examples of org.springframework.jndi.JndiTemplate

    final MyHome home = (MyHome) mc.getMock();
    home.create();
    mc.setThrowable(cex);
    mc.replay();

    JndiTemplate jt = new JndiTemplate() {
      public Object lookup(String name) {
        // parameterize
        assertTrue(name.equals(jndiName));
        return home;
      }
View Full Code Here

Examples of org.springframework.jndi.JndiTemplate

    MockControl mc = MockControl.createControl(MyHome.class);
    final MyHome home = (MyHome) mc.getMock();
    mc.replay();

    JndiTemplate jt = new JndiTemplate() {
      public Object lookup(String name) throws NamingException {
        // parameterize
        assertTrue(name.equals(jndiName));
        return home;
      }
View Full Code Here

Examples of org.springframework.jndi.JndiTemplate

    final MyHome home = (MyHome) mc.getMock();
    home.create();
    mc.setReturnValue(myEjb, 1);
    mc.replay();
   
    JndiTemplate jt = new JndiTemplate() {
      public Object lookup(String name) throws NamingException {
        // parameterize
        assertTrue(name.equals("java:comp/env/" + jndiName));
        return home;
      }
View Full Code Here

Examples of org.springframework.jndi.JndiTemplate

    final MyEjb myEjb = (MyEjb) ec.getMock();
    myEjb.getValue();
    ec.setReturnValue(value, 1);
    ec.replay();

    JndiTemplate jt = new JndiTemplate() {
      public Object lookup(String name) throws NamingException {
        // parameterize
        assertTrue(name.equals("java:comp/env/" + jndiName));
        return myEjb;
      }
View Full Code Here

Examples of org.springframework.jndi.JndiTemplate

    final MyHome home = (MyHome) mc.getMock();
    home.create();
    mc.setThrowable(cex);
    mc.replay();
 
    JndiTemplate jt = new JndiTemplate() {
      public Object lookup(String name) throws NamingException {
        // parameterize
        assertTrue(name.equals(jndiName));
        return home;
      }
View Full Code Here

Examples of org.springframework.jndi.JndiTemplate

    MockControl mc = MockControl.createControl(MyHome.class);
    final MyHome home = (MyHome) mc.getMock();
    mc.replay();

    JndiTemplate jt = new JndiTemplate() {
      public Object lookup(String name) throws NamingException {
        // parameterize
        assertTrue(name.equals("java:comp/env/" + jndiName));
        return home;
      }
View Full Code Here

Examples of org.springframework.jndi.JndiTemplate

  private SimpleRemoteSlsbInvokerInterceptor configuredInterceptor(
      MockControl ctxControl, String jndiName) throws Exception {

    final Context mockCtx = (Context) ctxControl.getMock();
    SimpleRemoteSlsbInvokerInterceptor si = createInterceptor();
    si.setJndiTemplate(new JndiTemplate() {
      protected Context createInitialContext() {
        return mockCtx;
      }
    });
    si.setResourceRef(true);
View Full Code Here

Examples of org.springframework.jndi.JndiTemplate

  }

  public void testLookupFailure() throws Exception {
    final NamingException nex = new NamingException();
    final String jndiName = "foobar";
    JndiTemplate jt = new JndiTemplate() {
      public Object lookup(String name) throws NamingException {
        assertTrue(jndiName.equals(name));
        throw nex;
      }
    };
View Full Code Here

Examples of org.springframework.jndi.JndiTemplate

        endpoint.setJndiInitialContextFactory("org.apache.activemq.jndi.ActiveMQInitialContextFactory");
        endpoint.setJndiURL("tcp://localhost:" + JMS_PORT);
        endpoint.setJndiConnectionFactoryName("ConnectionFactory");

        final JMSConfiguration jmsConfig = new JMSConfiguration();       
        JndiTemplate jt = new JndiTemplate();
       
        jt.setEnvironment(JMSOldConfigHolder.getInitialContextEnv(endpoint));
       
        JNDIConfiguration jndiConfig = new JNDIConfiguration();
        jndiConfig.setJndiConnectionFactoryName(endpoint.getJndiConnectionFactoryName());
        jmsConfig.setJndiTemplate(jt);
        jmsConfig.setJndiConfig(jndiConfig);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.