[jboss-user] [IronJacamar] - Accessing JCA from junit testcase

Dimitri Bouras do-not-reply at jboss.com
Tue Sep 18 05:42:58 EDT 2012


Dimitri Bouras [https://community.jboss.org/people/dim5b] created the discussion

"Accessing JCA from junit testcase"

To view the discussion, visit: https://community.jboss.org/message/760121#760121

--------------------------------------------------------------
I have deployed the HelloWorld example provided by ironjacamar on jboss 7.1.
I would like to call it from a junit test  is this possible?


private static final String INITIAL_CONTEXT_FACTORY = "org.jboss.naming.remote.client.InitialContextFactory";
    private static final String PROVIDER_URL = "remote://localhost:4447";
  
          @Test
          public void testHelloWorldNoArgs() throws Throwable {
 
 
  
                     final Properties env = new Properties();
         env.put(Context.INITIAL_CONTEXT_FACTORY, INITIAL_CONTEXT_FACTORY);
         env.put(Context.PROVIDER_URL, System.getProperty(Context.PROVIDER_URL, PROVIDER_URL));
 
 
         final InitialContext context = new InitialContext(env);
         
                    final Object ref = context.lookup("java:/eis/HelloWorld");
                    System.out.println("echo, ra/DirContextFactory=" + ref);
 
 
                    final HelloWorldConnectionFactory dcf = (HelloWorldConnectionFactory) ref;
                    System.out.println("echo, found dcf=" + dcf);
 
 
                    final HelloWorldConnection dc = dcf.getConnection();
                    System.out.println("echo, lookup dc=" + dc);
                    dc.helloWorld("Dimtris");
                    dc.close();
                    }
 


I am getting...
Remote connection failed: javax.security.sasl.SaslException: Authentication failed: all available authentication mechanisms failed

Is there any i call the JCA adapter from a nonmaneged enviroment?

thanks in advance
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/760121#760121]

Start a new discussion in IronJacamar at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2098]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20120918/ef229948/attachment.html 


More information about the jboss-user mailing list