NIHVIVO-123 Create stubs for the JNDI naming context classes, so I can do unit tests on ConfigurationProperties.

This commit is contained in:
jeb228 2010-02-25 19:59:34 +00:00
parent b5730496d3
commit 925df8863b
3 changed files with 549 additions and 0 deletions

View file

@ -0,0 +1,30 @@
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
package stubs.javax.naming.spi;
import java.util.Hashtable;
import javax.naming.Context;
import javax.naming.NamingException;
import javax.naming.spi.InitialContextFactory;
import stubs.javax.naming.InitialContextStub;
/**
* In order to use this and the other naming stubs.javax.naming classes, do
* this:
*
* <pre>
* System.setProperty(Context.INITIAL_CONTEXT_FACTORY,
* InitialContextFactoryStub.class.getName());
* </pre>
*/
public class InitialContextFactoryStub implements InitialContextFactory {
/**
* It's just this easy.
*/
public Context getInitialContext(Hashtable<?, ?> environment)
throws NamingException {
return new InitialContextStub();
}
}