Search in sources :

Example 1 with PageTesterContext

use of org.apache.tapestry5.internal.test.PageTesterContext in project tapestry-5 by apache.

the class JpaTest method setupRegistry.

// @BeforeSuite
public final void setupRegistry() {
    RegistryBuilder builder = new RegistryBuilder();
    builder.add(TapestryModule.class);
    builder.add(JpaModule.class);
    builder.add(JpaTestModule.class);
    registry = builder.build();
    // set PageTesterContext, otherwise T5 tries to load classpath assets
    ApplicationGlobals globals = registry.getObject(ApplicationGlobals.class, null);
    globals.storeContext(new PageTesterContext(""));
    registry.performRegistryStartup();
    entityManagerManager = registry.getService(EntityManagerManager.class);
    topLevelService = registry.getService(TopLevelService.class);
}
Also used : PageTesterContext(org.apache.tapestry5.internal.test.PageTesterContext) EntityManagerManager(org.apache.tapestry5.jpa.EntityManagerManager) RegistryBuilder(org.apache.tapestry5.ioc.RegistryBuilder) ApplicationGlobals(org.apache.tapestry5.http.services.ApplicationGlobals)

Aggregations

ApplicationGlobals (org.apache.tapestry5.http.services.ApplicationGlobals)1 PageTesterContext (org.apache.tapestry5.internal.test.PageTesterContext)1 RegistryBuilder (org.apache.tapestry5.ioc.RegistryBuilder)1 EntityManagerManager (org.apache.tapestry5.jpa.EntityManagerManager)1