use of org.apache.aries.mocks.BundleContextMock in project aries by apache.
the class InitialContextTest method setup.
/**
* This method does the setup .
* @throws NoSuchFieldException
* @throws SecurityException
* @throws IllegalAccessException
* @throws IllegalArgumentException
*/
@Before
public void setup() throws SecurityException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException {
bc = Skeleton.newMock(new BundleContextMock(), BundleContext.class);
activator = new Activator();
activator.start(bc);
}
use of org.apache.aries.mocks.BundleContextMock in project aries by apache.
the class ParserProxyTest method getMockParserServiceProxy.
public static ParserProxy getMockParserServiceProxy() {
BundleContext mockCtx = Skeleton.newMock(new BundleContextMock(), BundleContext.class);
NamespaceHandlerRegistry nhri = new NamespaceHandlerRegistryImpl(mockCtx);
ParserService parserService = new ParserServiceImpl(nhri);
mockCtx.registerService(ParserService.class.getName(), parserService, new Hashtable<String, String>());
ParserProxyImpl parserProxyService = new ParserProxyImpl();
parserProxyService.setParserService(parserService);
parserProxyService.setBundleContext(mockCtx);
parserProxyService.setModellingManager(new ModellingManagerImpl());
return parserProxyService;
}
use of org.apache.aries.mocks.BundleContextMock in project aries by apache.
the class ObjectFactoryTest method setup.
/**
* This method does the setup .
* @throws NoSuchFieldException
* @throws SecurityException
* @throws IllegalAccessException
* @throws IllegalArgumentException
*/
@Before
public void setup() throws SecurityException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException {
bc = Skeleton.newMock(new BundleContextMock(), BundleContext.class);
activator = new Activator();
activator.start(bc);
env = new Hashtable<Object, Object>();
env.put(JNDIConstants.BUNDLE_CONTEXT, bc);
}
Aggregations