Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Gemini » JUnit Plugin Test using Gemini Blueprint(JUnit Plugin Test using Gemini Blueprint)
JUnit Plugin Test using Gemini Blueprint [message #1714347] Thu, 12 November 2015 03:51 Go to next message
Setya Nugdjaja is currently offline Setya NugdjajaFriend
Messages: 567
Registered: July 2009
Senior Member
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
Re: JUnit Plugin Test using Gemini Blueprint [message #1714517 is a reply to message #1714347] Fri, 13 November 2015 11:01 Go to previous message
Setya Nugdjaja is currently offline Setya NugdjajaFriend
Messages: 567
Registered: July 2009
Senior Member
Hi All,

Any updates ?

Thanks & Regards,
Setya
Previous Topic:Test using AbstractConfigurableBundleCreatorTests
Next Topic:[Gemini Blueprint] Testing Eclipse Plugin Projects
Goto Forum:
  


Current Time: Tue Nov 20 00:28:46 GMT 2018

Powered by FUDForum. Page generated in 0.02821 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top