org.apache.commons.configuration
Class MockInitialContextFactory

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

public class MockInitialContextFactory
extends java.lang.Object
implements javax.naming.spi.InitialContextFactory

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

Version:
$Id: MockInitialContextFactory.java 561230 2007-07-31 04:17:09Z rahul $
Author:
Commons Configuration team

Field Summary
static java.lang.String PROP_CYCLES
          Constant for the use cycles environment property.
 
Constructor Summary
MockInitialContextFactory()
           
 
Method Summary
 javax.naming.Context getInitialContext(java.util.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 java.lang.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 javax.naming.Context getInitialContext(java.util.Hashtable env)
                                       throws javax.naming.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 javax.naming.spi.InitialContextFactory
Parameters:
env - the environment
Returns:
the context mock
Throws:
javax.naming.NamingException


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