Hi all,
I'm running test against simple application that depends on Gemini blueprint. The test is run from Eclipse's JUnit Plugin Test. The app consists of 1 bundle and 1 test fragment.
Below is the content of spring context file in META-INF/spring:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:osgi="http://www.eclipse.org/gemini/blueprint/schema/blueprint"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.eclipse.org/gemini/blueprint/schema/blueprint
http://www.eclipse.org/gemini/blueprint/schema/blueprint/gemini-blueprint.xsd">
<bean class="com.mycompany.service.impl.SpringContextProvider"/>
</beans>
Below is the content of SpringContextProvider class:
public class SpringContextProvider implements ApplicationContextAware
{
private static ApplicationContext context;
@Override
public void setApplicationContext(ApplicationContext injectedContext) throws BeansException
{
context = injectedContext;
}
static final ApplicationContext getContext(){return context;}
}
The above snippets runs well in Eclipse's OSGI Framework runner where the Spring's ApplicationContext is injected properly.
but in JUnit Plugin Test, the following test fails:
@Test
public void testSpringContextProviderAvailability()
{
assertNotNull(SpringContextProvider.getContext());
}
Below is what the log says:
SEVERE: Expecting state (RESOLVING_DEPENDENCIES) not (INTERRUPTED) for context [OsgiBundleXmlApplicationContext(bundle=com.mycompany.service, config=osgibundle:/META-INF/spring/*.xml)]; assuming an interruption and bailing out
I was wondering if it is possible to run test against bundles containing Gemini Blueprint dependency or else I have to use test fixtures provided by GB instead.
Any help would be greatly appreciated.
Thanks & Regards,
Setya