You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by matt2 <s1...@zoznam.sk> on 2011/03/18 19:31:36 UTC

Testing Services with injected Spring beans

Hi,
How can i test a service, if it needs Spring Manager in build?
How it is possible initialize spring context in setUp() ?

Thanks, thanks thanks in advance for any suggestions.

PS: sorry for my terrible english.

My JUnit Test:
public class MyWebApiServiceTest extends TestCase {
	//Using Spring Bean Manager
	private MyWebApiService _myWEBAPIService;

	public MyWebApiServiceTest(String name) {
		super(name);
	}
	
	protected void setUp() throws Exception {
		super.setUp();
		try {
			
			Registry registry =
RegistryBuilder.buildAndStartupRegistry(AppModule.class,
TapestryModule.class, SpringModule.class, AppModuleTest.class);

			_myWEBAPIService = registry.getService(MyWebApiService.class);
			
		} catch (Exception e) {
			e.printStackTrace();
		}
	
	}
	
	public void testLogin() {
		//...testing...
		_myWEBAPIService. 
	}
}


--
View this message in context: http://tapestry.1045711.n5.nabble.com/Testing-Services-with-injected-Spring-beans-tp3976774p3976774.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org