Search in sources :

Example 1 with JNDIContext

use of org.apache.openejb.client.JNDIContext in project tomee by apache.

the class ClientContextCipheringTest method customCipher.

@Test
public void customCipher() throws NamingException {
    final JNDIContext jndiContext = new JNDIContext();
    final Hashtable<String, Object> env = new Hashtable<>();
    env.put(Context.PROVIDER_URL, "cipher:Static3DES:" + String.valueOf(new StaticDESPasswordCipher().encrypt("ejbd://localhost:1234")));
    jndiContext.getInitialContext(env);
    Assert.assertEquals("ejbd://localhost:1234", jndiContext.getEnvironment().get(Context.PROVIDER_URL).toString());
}
Also used : StaticDESPasswordCipher(org.apache.openejb.cipher.StaticDESPasswordCipher) Hashtable(java.util.Hashtable) JNDIContext(org.apache.openejb.client.JNDIContext) Test(org.junit.Test)

Aggregations

Hashtable (java.util.Hashtable)1 StaticDESPasswordCipher (org.apache.openejb.cipher.StaticDESPasswordCipher)1 JNDIContext (org.apache.openejb.client.JNDIContext)1 Test (org.junit.Test)1