Package com.mockobjects.naming.directory

# Class MockDirContext

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

All Implemented Interfaces:
  `Verifiable`, `Context`, `DirContext`

public class MockDirContext extends MockContext implements DirContext

## 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`

### Fields inherited from interface javax.naming.directory.DirContext

`ADD_ATTRIBUTE, REMOVE_ATTRIBUTE, REPLACE_ATTRIBUTE`

## Constructor Summary

Constructors
Constructor
Description
`MockDirContext()`

## Method Summary

Modifier and Type
Method
Description
`void`
`bind(String aName, Object object, Attributes attributes)`
`void`
`bind(Name aName, Object object, Attributes attributes)`
`DirContext`
`createSubcontext(String aName, Attributes attributes)`
`DirContext`
`createSubcontext(Name aName, Attributes attributes)`
`Attributes`
`getAttributes(String aName)`
`Attributes`
`getAttributes(String aName, String[] attrIds)`
`Attributes`
`getAttributes(Name aName)`
`Attributes`
`getAttributes(Name aName, String[] attrIds)`
`DirContext`
`getSchema(String aName)`
`DirContext`
`getSchema(Name aName)`
`DirContext`
`getSchemaClassDefinition(String aName)`
`DirContext`
`getSchemaClassDefinition(Name aName)`
`void`
`modifyAttributes(String aName, int aModificationOperation, Attributes attributes)`
`void`
`modifyAttributes(String aName, ModificationItem[] mods)`
`void`
`modifyAttributes(Name aName, int aModificationOperation, Attributes attributes)`
`void`
`modifyAttributes(Name aName, ModificationItem[] mods)`
`void`
`rebind(String aName, Object object, Attributes attributes)`
`void`
`rebind(Name aName, Object object, Attributes attributes)`
`NamingEnumeration`
`search(String aName, String aFilter, Object[] filterArgs, SearchControls cons)`
`NamingEnumeration`
`search(String aSearchName, String aFilter, SearchControls searchControls)`
`NamingEnumeration`
`search(String aName, Attributes attributes)`
`NamingEnumeration`
`search(String aName, Attributes attributes, String[] anAttributeToReturn)`
`NamingEnumeration`
`search(Name aName, String aFilter, Object[] filterArgs, SearchControls cons)`
`NamingEnumeration`
`search(Name aName, String aFilter, SearchControls cons)`
`NamingEnumeration`
`search(Name aName, Attributes attributes)`
`NamingEnumeration`
`search(Name aName, Attributes attributes, String[] anAttributeToReturn)`
`void`
`setExpectedGetAttributesCount(int callCount)`
`void`
`setExpectedGetAttributesName(Object aName)`
`void`
`setExpectedModifyAttributes(String aName, int aModificationOperation, Attributes attributes)`
`void`
`setExpectedSearch(String aSearchName, String aFilter, SearchControls searchControls)`
`void`
`setupAttributes(Attributes anAttributeToReturn)`
`void`
`setupSearchResult(NamingEnumeration results)`

### Methods inherited from class com.mockobjects.naming.MockContext

`addToEnvironment, bind, bind, close, composeName, composeName, createSubcontext, createSubcontext, destroySubcontext, destroySubcontext, getEnvironment, getNameInNamespace, getNameParser, getNameParser, list, list, listBindings, listBindings, lookup, lookup, lookupLink, lookupLink, rebind, rebind, removeFromEnvironment, rename, rename, setExpectedBind, setExpectedCreateSubContext, setExpectedLookupName, setExpectedReBind, setupAddCreateSubContext, setupAddLookup, unbind, unbind`

### 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`

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

`addToEnvironment, bind, bind, close, composeName, composeName, createSubcontext, createSubcontext, destroySubcontext, destroySubcontext, getEnvironment, getNameInNamespace, getNameParser, getNameParser, list, list, listBindings, listBindings, lookup, lookup, lookupLink, lookupLink, rebind, rebind, removeFromEnvironment, rename, rename, unbind, unbind`

## Constructor Details

### MockDirContext

public MockDirContext()

## Method Details

### setupAttributes

public void setupAttributes(Attributes anAttributeToReturn)

### setExpectedGetAttributesName

public void setExpectedGetAttributesName(Object aName)

### setExpectedGetAttributesCount

public void setExpectedGetAttributesCount(int callCount)

### getAttributes

public Attributes getAttributes(Name aName) throws NamingException

Specified by:
  `getAttributes` in interface `DirContext`
Throws:
  `NamingException`

### getAttributes

public Attributes getAttributes(String aName) throws NamingException

Specified by:
  `getAttributes` in interface `DirContext`
Throws:
  `NamingException`

### getAttributes

public Attributes getAttributes(Name aName, String[] attrIds) throws NamingException

Specified by:
  `getAttributes` in interface `DirContext`
Throws:
  `NamingException`

### getAttributes

public Attributes getAttributes(String aName, String[] attrIds) throws NamingException

Specified by:
  `getAttributes` in interface `DirContext`
Throws:
  `NamingException`

### setExpectedModifyAttributes

public void setExpectedModifyAttributes(String aName, int aModificationOperation, Attributes attributes)

### modifyAttributes

public void modifyAttributes(Name aName, int aModificationOperation, Attributes attributes) throws NamingException

Specified by:
  `modifyAttributes` in interface `DirContext`
Throws:
  `NamingException`

### modifyAttributes

public void modifyAttributes(String aName, int aModificationOperation, Attributes attributes) throws NamingException

Specified by:
  `modifyAttributes` in interface `DirContext`
Throws:
  `NamingException`

### modifyAttributes

public void modifyAttributes(Name aName, ModificationItem[] mods) throws NamingException

Specified by:
  `modifyAttributes` in interface `DirContext`
Throws:
  `NamingException`

### modifyAttributes

public void modifyAttributes(String aName, ModificationItem[] mods) throws NamingException

Specified by:
  `modifyAttributes` in interface `DirContext`
Throws:
  `NamingException`

### bind

public void bind(Name aName, Object object, Attributes attributes) throws NamingException

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

### bind

public void bind(String aName, Object object, Attributes attributes) throws NamingException

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

### rebind

public void rebind(Name aName, Object object, Attributes attributes) throws NamingException

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

### rebind

public void rebind(String aName, Object object, Attributes attributes) throws NamingException

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

### createSubcontext

public DirContext createSubcontext(Name aName, Attributes attributes) throws NamingException

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

### createSubcontext

public DirContext createSubcontext(String aName, Attributes attributes) throws NamingException

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

### getSchema

public DirContext getSchema(Name aName) throws NamingException

Specified by:
  `getSchema` in interface `DirContext`
Throws:
  `NamingException`

### getSchema

public DirContext getSchema(String aName) throws NamingException

Specified by:
  `getSchema` in interface `DirContext`
Throws:
  `NamingException`

### getSchemaClassDefinition

public DirContext getSchemaClassDefinition(Name aName) throws NamingException

Specified by:
  `getSchemaClassDefinition` in interface `DirContext`
Throws:
  `NamingException`

### getSchemaClassDefinition

public DirContext getSchemaClassDefinition(String aName) throws NamingException

Specified by:
  `getSchemaClassDefinition` in interface `DirContext`
Throws:
  `NamingException`

### search

public NamingEnumeration search(Name aName, Attributes attributes, String[] anAttributeToReturn) throws NamingException

Specified by:
  `search` in interface `DirContext`
Throws:
  `NamingException`

### search

public NamingEnumeration search(String aName, Attributes attributes, String[] anAttributeToReturn) throws NamingException

Specified by:
  `search` in interface `DirContext`
Throws:
  `NamingException`

### search

public NamingEnumeration search(Name aName, Attributes attributes) throws NamingException

Specified by:
  `search` in interface `DirContext`
Throws:
  `NamingException`

### search

public NamingEnumeration search(String aName, Attributes attributes) throws NamingException

Specified by:
  `search` in interface `DirContext`
Throws:
  `NamingException`

### search

public NamingEnumeration search(Name aName, String aFilter, SearchControls cons) throws NamingException

Specified by:
  `search` in interface `DirContext`
Throws:
  `NamingException`

### setExpectedSearch

public void setExpectedSearch(String aSearchName, String aFilter, SearchControls searchControls)

### setupSearchResult

public void setupSearchResult(NamingEnumeration results)

### search

public NamingEnumeration search(String aSearchName, String aFilter, SearchControls searchControls) throws NamingException

Specified by:
  `search` in interface `DirContext`
Throws:
  `NamingException`

### search

public NamingEnumeration search(Name aName, String aFilter, Object[] filterArgs, SearchControls cons) throws NamingException

Specified by:
  `search` in interface `DirContext`
Throws:
  `NamingException`

### search

public NamingEnumeration search(String aName, String aFilter, Object[] filterArgs, SearchControls cons) throws NamingException

Specified by:
  `search` in interface `DirContext`
Throws:
  `NamingException`