Package com.mockobjects.naming

# Class MockContext

java.lang.Object
com.mockobjects.MockObject
com.mockobjects.naming.MockContext

All Implemented Interfaces:
  `Verifiable`, `Context`

Direct Known Subclasses:
  `MockDirContext`

public class MockContext extends MockObject implements Context

## Field Summary

### Fields inherited from interface javax.naming.Context

`APPLET, AUTHORITATIVE, BATCHSIZE, DNS_URL, INITIAL_CONTEXT_FACTORY, LANGUAGE, OBJECT_FACTORIES, PROVIDER_URL, REFERRAL, SECURITY_AUTHENTICATION, SECURITY_CREDENTIALS, SECURITY_PRINCIPAL, SECURITY_PROTOCOL, STATE_FACTORIES, URL_PKG_PREFIXES`

## Constructor Summary

Constructors
Constructor
Description
`MockContext()`

## Method Summary

Modifier and Type
Method
Description
`Object`
`addToEnvironment(String name, Object object)`
`void`
`bind(String aBindName, Object aBindObject)`
`void`
`bind(Name aBindName, Object aBindObject)`
`void`
`close()`
`String`
`composeName(String name, String name2)`
`Name`
`composeName(Name name, Name name2)`
`Context`
`createSubcontext(String name)`
`Context`
`createSubcontext(Name name)`
`void`
`destroySubcontext(String name)`
`void`
`destroySubcontext(Name name)`
`Hashtable`
`getEnvironment()`
`String`
`getNameInNamespace()`
`NameParser`
`getNameParser(String name)`
`NameParser`
`getNameParser(Name name)`
`NamingEnumeration`
`list(String name)`
`NamingEnumeration`
`list(Name name)`
`NamingEnumeration`
`listBindings(String name)`
`NamingEnumeration`
`listBindings(Name name)`
`Object`
`lookup(String name)`
`Object`
`lookup(Name name)`
`Object`
`lookupLink(String name)`
`Object`
`lookupLink(Name name)`
`void`
`rebind(String aBindName, Object aBindObject)`
`void`
`rebind(Name aBindName, Object aBindObject)`
`Object`
`removeFromEnvironment(String name)`
`void`
`rename(String name, String name2)`
`void`
`rename(Name name, Name name2)`
`void`
`setExpectedBind(String aBindName, Object aBindObject)`
`void`
`setExpectedCreateSubContext(String name)`
`void`
`setExpectedLookupName(String aLookupName)`
`void`
`setExpectedReBind(String aBindName, Object aBindObject)`
`void`
`setupAddCreateSubContext(Context aContext)`
`void`
`setupAddLookup(Object aObjectToReturn)`
`void`
`unbind(String name)`
`void`
`unbind(Name name)`

### Methods inherited from class com.mockobjects.MockObject

`notImplemented, notYetImplemented, verify`

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### MockContext

public MockContext()

## Method Details

### setupAddLookup

public void setupAddLookup(Object aObjectToReturn)

### setExpectedLookupName

public void setExpectedLookupName(String aLookupName)

### lookup

public Object lookup(Name name) throws NamingException

Specified by:
  `lookup` in interface `Context`
Throws:
  `NamingException`

### lookup

public Object lookup(String name) throws NamingException

Specified by:
  `lookup` in interface `Context`
Throws:
  `NamingException`

### bind

public void bind(Name aBindName, Object aBindObject) throws NamingException

Specified by:
  `bind` in interface `Context`
Throws:
  `NamingException`

### setExpectedBind

public void setExpectedBind(String aBindName, Object aBindObject)

### setExpectedReBind

public void setExpectedReBind(String aBindName, Object aBindObject)

### bind

public void bind(String aBindName, Object aBindObject) throws NamingException

Specified by:
  `bind` in interface `Context`
Throws:
  `NamingException`

### rebind

public void rebind(Name aBindName, Object aBindObject) throws NamingException

Specified by:
  `rebind` in interface `Context`
Throws:
  `NamingException`

### rebind

public void rebind(String aBindName, Object aBindObject) throws NamingException

Specified by:
  `rebind` in interface `Context`
Throws:
  `NamingException`

### unbind

public void unbind(Name name) throws NamingException

Specified by:
  `unbind` in interface `Context`
Throws:
  `NamingException`

### unbind

public void unbind(String name) throws NamingException

Specified by:
  `unbind` in interface `Context`
Throws:
  `NamingException`

### rename

public void rename(Name name, Name name2) throws NamingException

Specified by:
  `rename` in interface `Context`
Throws:
  `NamingException`

### rename

public void rename(String name, String name2) throws NamingException

Specified by:
  `rename` in interface `Context`
Throws:
  `NamingException`

### list

public NamingEnumeration list(Name name) throws NamingException

Specified by:
  `list` in interface `Context`
Throws:
  `NamingException`

### list

public NamingEnumeration list(String name) throws NamingException

Specified by:
  `list` in interface `Context`
Throws:
  `NamingException`

### listBindings

public NamingEnumeration listBindings(Name name) throws NamingException

Specified by:
  `listBindings` in interface `Context`
Throws:
  `NamingException`

### listBindings

public NamingEnumeration listBindings(String name) throws NamingException

Specified by:
  `listBindings` in interface `Context`
Throws:
  `NamingException`

### destroySubcontext

public void destroySubcontext(Name name) throws NamingException

Specified by:
  `destroySubcontext` in interface `Context`
Throws:
  `NamingException`

### destroySubcontext

public void destroySubcontext(String name) throws NamingException

Specified by:
  `destroySubcontext` in interface `Context`
Throws:
  `NamingException`

### createSubcontext

public Context createSubcontext(Name name) throws NamingException

Specified by:
  `createSubcontext` in interface `Context`
Throws:
  `NamingException`

### setupAddCreateSubContext

public void setupAddCreateSubContext(Context aContext)

### setExpectedCreateSubContext

public void setExpectedCreateSubContext(String name)

### createSubcontext

public Context createSubcontext(String name) throws NamingException

Specified by:
  `createSubcontext` in interface `Context`
Throws:
  `NamingException`

### lookupLink

public Object lookupLink(Name name) throws NamingException

Specified by:
  `lookupLink` in interface `Context`
Throws:
  `NamingException`

### lookupLink

public Object lookupLink(String name) throws NamingException

Specified by:
  `lookupLink` in interface `Context`
Throws:
  `NamingException`

### getNameParser

public NameParser getNameParser(Name name) throws NamingException

Specified by:
  `getNameParser` in interface `Context`
Throws:
  `NamingException`

### getNameParser

public NameParser getNameParser(String name) throws NamingException

Specified by:
  `getNameParser` in interface `Context`
Throws:
  `NamingException`

### composeName

public Name composeName(Name name, Name name2) throws NamingException

Specified by:
  `composeName` in interface `Context`
Throws:
  `NamingException`

### composeName

public String composeName(String name, String name2) throws NamingException

Specified by:
  `composeName` in interface `Context`
Throws:
  `NamingException`

### addToEnvironment

public Object addToEnvironment(String name, Object object) throws NamingException

Specified by:
  `addToEnvironment` in interface `Context`
Throws:
  `NamingException`

### removeFromEnvironment

public Object removeFromEnvironment(String name) throws NamingException

Specified by:
  `removeFromEnvironment` in interface `Context`
Throws:
  `NamingException`

### getEnvironment

public Hashtable getEnvironment() throws NamingException

Specified by:
  `getEnvironment` in interface `Context`
Throws:
  `NamingException`

### close

public void close() throws NamingException

Specified by:
  `close` in interface `Context`
Throws:
  `NamingException`

### getNameInNamespace

public String getNameInNamespace() throws NamingException

Specified by:
  `getNameInNamespace` in interface `Context`
Throws:
  `NamingException`