Class MockBundle
- java.lang.Object
-
- org.apache.sling.commons.testing.osgi.MockBundle
-
- All Implemented Interfaces:
Comparable<org.osgi.framework.Bundle>,org.osgi.framework.Bundle
public class MockBundle extends Object implements org.osgi.framework.Bundle
-
-
Constructor Summary
Constructors Constructor Description MockBundle(long bundleId)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <A> Aadapt(Class<A> type)intcompareTo(org.osgi.framework.Bundle o)Enumeration<URL>findEntries(String path, String filePattern, boolean recurse)org.osgi.framework.BundleContextgetBundleContext()longgetBundleId()FilegetDataFile(String filename)URLgetEntry(String name)Enumeration<String>getEntryPaths(String path)Dictionary<String,String>getHeaders()Dictionary<String,String>getHeaders(String locale)longgetLastModified()StringgetLocation()org.osgi.framework.ServiceReference[]getRegisteredServices()URLgetResource(String name)Enumeration<URL>getResources(String name)org.osgi.framework.ServiceReference[]getServicesInUse()MapgetSignerCertificates(int signersType)intgetState()StringgetSymbolicName()org.osgi.framework.VersiongetVersion()booleanhasPermission(Object permission)Class<?>loadClass(String name)voidstart()voidstart(int options)voidstop()voidstop(int options)voiduninstall()voidupdate()voidupdate(InputStream in)
-
-
-
Method Detail
-
getBundleId
public long getBundleId()
- Specified by:
getBundleIdin interfaceorg.osgi.framework.Bundle
-
findEntries
public Enumeration<URL> findEntries(String path, String filePattern, boolean recurse)
- Specified by:
findEntriesin interfaceorg.osgi.framework.Bundle
-
getEntry
public URL getEntry(String name)
- Specified by:
getEntryin interfaceorg.osgi.framework.Bundle
-
getEntryPaths
public Enumeration<String> getEntryPaths(String path)
- Specified by:
getEntryPathsin interfaceorg.osgi.framework.Bundle
-
getHeaders
public Dictionary<String,String> getHeaders()
- Specified by:
getHeadersin interfaceorg.osgi.framework.Bundle
-
getHeaders
public Dictionary<String,String> getHeaders(String locale)
- Specified by:
getHeadersin interfaceorg.osgi.framework.Bundle
-
getLastModified
public long getLastModified()
- Specified by:
getLastModifiedin interfaceorg.osgi.framework.Bundle
-
getLocation
public String getLocation()
- Specified by:
getLocationin interfaceorg.osgi.framework.Bundle
-
getRegisteredServices
public org.osgi.framework.ServiceReference[] getRegisteredServices()
- Specified by:
getRegisteredServicesin interfaceorg.osgi.framework.Bundle
-
getResource
public URL getResource(String name)
- Specified by:
getResourcein interfaceorg.osgi.framework.Bundle
-
getResources
public Enumeration<URL> getResources(String name)
- Specified by:
getResourcesin interfaceorg.osgi.framework.Bundle
-
getServicesInUse
public org.osgi.framework.ServiceReference[] getServicesInUse()
- Specified by:
getServicesInUsein interfaceorg.osgi.framework.Bundle
-
getState
public int getState()
- Specified by:
getStatein interfaceorg.osgi.framework.Bundle
-
getSymbolicName
public String getSymbolicName()
- Specified by:
getSymbolicNamein interfaceorg.osgi.framework.Bundle
-
hasPermission
public boolean hasPermission(Object permission)
- Specified by:
hasPermissionin interfaceorg.osgi.framework.Bundle
-
loadClass
public Class<?> loadClass(String name) throws ClassNotFoundException
- Specified by:
loadClassin interfaceorg.osgi.framework.Bundle- Throws:
ClassNotFoundException
-
start
public void start()
- Specified by:
startin interfaceorg.osgi.framework.Bundle
-
stop
public void stop()
- Specified by:
stopin interfaceorg.osgi.framework.Bundle
-
uninstall
public void uninstall()
- Specified by:
uninstallin interfaceorg.osgi.framework.Bundle
-
update
public void update()
- Specified by:
updatein interfaceorg.osgi.framework.Bundle
-
update
public void update(InputStream in)
- Specified by:
updatein interfaceorg.osgi.framework.Bundle
-
getBundleContext
public org.osgi.framework.BundleContext getBundleContext()
- Specified by:
getBundleContextin interfaceorg.osgi.framework.Bundle
-
start
public void start(int options) throws org.osgi.framework.BundleException- Specified by:
startin interfaceorg.osgi.framework.Bundle- Throws:
org.osgi.framework.BundleException
-
stop
public void stop(int options) throws org.osgi.framework.BundleException- Specified by:
stopin interfaceorg.osgi.framework.Bundle- Throws:
org.osgi.framework.BundleException
-
getSignerCertificates
public Map getSignerCertificates(int signersType)
- Specified by:
getSignerCertificatesin interfaceorg.osgi.framework.Bundle
-
getVersion
public org.osgi.framework.Version getVersion()
- Specified by:
getVersionin interfaceorg.osgi.framework.Bundle
-
compareTo
public int compareTo(org.osgi.framework.Bundle o)
- Specified by:
compareToin interfaceComparable<org.osgi.framework.Bundle>
-
adapt
public <A> A adapt(Class<A> type)
- Specified by:
adaptin interfaceorg.osgi.framework.Bundle
-
-