org.springframework.osgi.mock
Class EntryLookupControllingMockBundle

java.lang.Object
  extended by org.springframework.osgi.mock.MockBundle
      extended by org.springframework.osgi.mock.EntryLookupControllingMockBundle
All Implemented Interfaces:
Bundle

public class EntryLookupControllingMockBundle
extends MockBundle

Mock Bundle that allows the entry to return on future calls.

Author:
Adrian Colyer

Field Summary
protected  URL nextEntryResult
           
protected  Enumeration nextFindResult
           
 
Fields inherited from interface org.osgi.framework.Bundle
ACTIVE, INSTALLED, RESOLVED, STARTING, STOPPING, UNINSTALLED
 
Constructor Summary
EntryLookupControllingMockBundle(Dictionary headers)
           
 
Method Summary
protected  Enumeration createEnumerationOver(String[] entries)
           
 Enumeration findEntries(String path, String filePattern, boolean recurse)
          Delegates to the classloader.
 BundleContext getContext()
           
 URL getEntry(String name)
           
 URL getResource(String name)
           
 void setEntryReturnOnNextCallToGetEntry(URL entry)
           
 void setResultsToReturnOnNextCallToFindEntries(String[] findResult)
           
 
Methods inherited from class org.springframework.osgi.mock.MockBundle
getBundleContext, getBundleId, getEntryPaths, getHeaders, getHeaders, getLastModified, getLocation, getRegisteredServices, getResources, getServicesInUse, getState, getSymbolicName, hasPermission, loadClass, setBundleId, setLocation, start, start, stop, stop, toString, uninstall, update, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

nextFindResult

protected Enumeration nextFindResult

nextEntryResult

protected URL nextEntryResult
Constructor Detail

EntryLookupControllingMockBundle

public EntryLookupControllingMockBundle(Dictionary headers)
Method Detail

setResultsToReturnOnNextCallToFindEntries

public void setResultsToReturnOnNextCallToFindEntries(String[] findResult)

findEntries

public Enumeration findEntries(String path,
                               String filePattern,
                               boolean recurse)
Description copied from class: MockBundle
Delegates to the classloader. Identical to classLoader.getResources(path + filePattern);

Specified by:
findEntries in interface Bundle
Overrides:
findEntries in class MockBundle
See Also:
Bundle.findEntries(java.lang.String, java.lang.String, boolean)

setEntryReturnOnNextCallToGetEntry

public void setEntryReturnOnNextCallToGetEntry(URL entry)

getEntry

public URL getEntry(String name)
Specified by:
getEntry in interface Bundle
Overrides:
getEntry in class MockBundle

getResource

public URL getResource(String name)
Specified by:
getResource in interface Bundle
Overrides:
getResource in class MockBundle

getContext

public BundleContext getContext()
Overrides:
getContext in class MockBundle

createEnumerationOver

protected Enumeration createEnumerationOver(String[] entries)


Copyright © 2006-2009 Spring Framework. All Rights Reserved.