Examples of WebModuleChangeListener


Examples of org.impalaframework.web.module.listener.WebModuleChangeListener

    public final void testEmpty() throws Exception {

        ServletContext servletContext = createMock(ServletContext.class);

        final WebModuleChangeListener listener = new WebModuleChangeListener();
        listener.setServletContext(servletContext);

        ArrayList<ModuleChangeInfo> info = new ArrayList<ModuleChangeInfo>();
        ModuleChangeEvent event = new ModuleChangeEvent(info);

        replay(servletContext);

        listener.moduleContentsModified(event);

        verify(servletContext);

        info.add(new ModuleChangeInfo("p1"));
        info.add(new ModuleChangeInfo("p2"));
View Full Code Here

Examples of org.impalaframework.web.module.listener.WebModuleChangeListener

        info.add(new ModuleChangeInfo("p1"));

        ModuleChangeEvent event = new ModuleChangeEvent(info);
        ServletContext servletContext = createMock(ServletContext.class);
        final WebModuleChangeListener listener = new WebModuleChangeListener();
        listener.setServletContext(servletContext);
        ModuleManagementFacade facade = createMock(ModuleManagementFacade.class);
        ModuleOperationRegistry moduleOperationRegistry = createMock(ModuleOperationRegistry.class);
        ModuleOperation moduleOperation = createMock(ModuleOperation.class);

        expect(servletContext.getAttribute(WebConstants.IMPALA_FACTORY_ATTRIBUTE)).andReturn(facade);
        ApplicationManager applicationManager = TestApplicationManager.newApplicationManager();
        Application application = applicationManager.getCurrentApplication();
       
        expect(facade.getApplicationManager()).andReturn(applicationManager);
        expect(facade.getModuleOperationRegistry()).andReturn(moduleOperationRegistry);
        expect(moduleOperationRegistry.getOperation(ModuleOperationConstants.ReloadNamedModuleOperation)).andReturn(moduleOperation);
        expect(moduleOperation.execute(eq(application), isA(ModuleOperationInput.class))).andReturn(ModuleOperationResult.EMPTY);
       
        replay(servletContext);
        replay(facade);
        replay(moduleOperationRegistry);
        replay(moduleOperation);
       
        listener.moduleContentsModified(event);

        verify(servletContext);
        verify(facade);
        verify(moduleOperationRegistry);
        verify(moduleOperation);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.