Hi,

I'm trying to add some page test into a running application, code is just
simple:

        PageTester tester = new PageTester(appPackage, appName, 
"src/main/webapp");
        PageTester tester = new PageTester(appPackage, appName, 
"src/main/webapp");
    Document doc = tester.renderPage("Index");

but I got an nullPointer exception when MyServices refers to globals:

        public MyServicesImp(ApplicationGlobals globals) {
                String infoName =
globals.getServletContext().getInitParameter("info.file.name");
        }
        
adding this into AppModule fix the error:

public static void contributeAliasOverrides(Configuration<AliasContribution>
conf) {
   conf.add(AliasContribution.create(ApplicationGlobals.class,
EasyMock.createMock(ApplicationGlobals.class)));
}

but another error comes out:
Caused by: java.lang.RuntimeException: Exception constructing service
'ComponentMessagesSource': Error invoking service builder method
org.apache.tapestry5.internal.services.InternalModule.buildComponentMessagesSource(AssetFactory,
String) (at InternalModule.java:132) (for service
'ComponentMessagesSource'): Parameter context was null. 
        
Any idea how to fix this? is it a good idea to add PageTester to an app that
uses a lot of services?

Thanks,

Angelo  
        
-- 
View this message in context: 
http://www.nabble.com/T5%3A-PageTester-and-services-in-AppModule-tp22013582p22013582.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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

Reply via email to