org.apache.commons.configuration
Class MockInitialContextFactory

java.lang.Object
  extended by org.apache.commons.configuration.MockInitialContextFactory
All Implemented Interfaces:
InitialContextFactory

public class MockInitialContextFactory
extends Object
implements InitialContextFactory

A mock implementation of the InitialContextFactory interface. This implementation will return a mock context that contains some test data.

Version:
$Id: MockInitialContextFactory.java 1222455 2011-12-22 21:10:10Z oheger $
Author:
Commons Configuration team

Field Summary
static String PROP_CYCLES
          Constant for the use cycles environment property.
 
Constructor Summary
MockInitialContextFactory()
           
 
Method Summary
 Context getInitialContext(Hashtable env)
          Creates a Context object that is backed by a mock object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROP_CYCLES

public static final String PROP_CYCLES
Constant for the use cycles environment property. If this property is present in the environment, a cyclic context will be created.

See Also:
Constant Field Values
Constructor Detail

MockInitialContextFactory

public MockInitialContextFactory()
Method Detail

getInitialContext

public Context getInitialContext(Hashtable env)
                          throws NamingException
Creates a Context object that is backed by a mock object. The mock context can be queried for the values of certain test properties. It also supports listing the contained (sub) properties.

Specified by:
getInitialContext in interface InitialContextFactory
Parameters:
env - the environment
Returns:
the context mock
Throws:
NamingException


Copyright © 2001-2012 The Apache Software Foundation. All Rights Reserved.