You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Dan Adams <da...@ifactory.com> on 2007/06/08 23:16:29 UTC

[T5] using the ioc and tapestry-hibernate in tests

I have some dao services that i would like to test and for that i need a
running hibernate session. I can't seem to get tapestry-hibernate to
load in my tests however. What I have to load the ioc is basically:

RegistryBuilder builder = new RegistryBuilder();
IOCUtilities.addDefaultModules(builder);
builder.add(AppModule.class);
builder.build();

The exception I'm getting is:

Caused by: java.lang.RuntimeException: No service implements the
interface org.apache.tapestry.services.ApplicationGlobals.
	at
org.apache.tapestry.ioc.internal.RegistryImpl.getService(RegistryImpl.java:475)
	at
org.apache.tapestry.ioc.internal.ObjectLocatorImpl.getService(ObjectLocatorImpl.java:45)

Anyone been able to load up a hibernate environment with t5 ioc in a
test yet?

-- 
Dan Adams
Senior Software Engineer
Interactive Factory
617.235.5857


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


Re: [T5] using the ioc and tapestry-hibernate in tests

Posted by Dan Adams <da...@ifactory.com>.
Also, If I do this:

public void testTest() throws Exception {
  RegistryBuilder builder = new RegistryBuilder();
  builder.add(TapestryModule.class);
  builder.add(HibernateModule.class);
  builder.add(AppModule.class);
	
  Registry registry = builder.build();
  ... get the service and do something ...
}

I get the exception:

Caused by: java.lang.RuntimeException: The Alias service's mode has not
been set. Unable to determine the correct set of alias properties.
	at
org.apache.tapestry.internal.services.AliasImpl.provide(AliasImpl.java:79)
	at org.apache.tapestry.services.TapestryModule
$2.provide(TapestryModule.java:590)

On Fri, 2007-06-08 at 17:16 -0400, Dan Adams wrote:
> I have some dao services that i would like to test and for that i need a
> running hibernate session. I can't seem to get tapestry-hibernate to
> load in my tests however. What I have to load the ioc is basically:
> 
> RegistryBuilder builder = new RegistryBuilder();
> IOCUtilities.addDefaultModules(builder);
> builder.add(AppModule.class);
> builder.build();
> 
> The exception I'm getting is:
> 
> Caused by: java.lang.RuntimeException: No service implements the
> interface org.apache.tapestry.services.ApplicationGlobals.
> 	at
> org.apache.tapestry.ioc.internal.RegistryImpl.getService(RegistryImpl.java:475)
> 	at
> org.apache.tapestry.ioc.internal.ObjectLocatorImpl.getService(ObjectLocatorImpl.java:45)
> 
> Anyone been able to load up a hibernate environment with t5 ioc in a
> test yet?
> 
-- 
Dan Adams
Senior Software Engineer
Interactive Factory
617.235.5857


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