Examples of canHandle()


Examples of com.cibuddy.core.build.configuration.IConfigurationInstaller.canHandle()

                            // no services, no point in trying to register anything
                            break;
                        } else {
                            for (int j = 0; j < srs.length; j++) {
                                IConfigurationInstaller ci = (IConfigurationInstaller) Activator.getBundleContext().getService(srs[j]);
                                if (ci.canHandle(entry)) {
                                    try {
                                        ci.install(entry, event.getBundle());
                                    } catch (Exception ex) {
                                        LOG.debug("Installation failed for configuration file found under URL: {}", entry);
                                    }
View Full Code Here

Examples of com.cloud.deploy.DeploymentPlanner.canHandle()

        }
       
        DeploymentPlanner planner = ComponentContext.getComponent(plannerToUse);
        DeployDestination dest = null;
       
        if (planner.canHandle(vmProfile, plan, exclude)) {
            dest = planner.plan(vmProfile, plan, exclude);
        }

        if (dest != null) {
           //save destination with VMEntityVO
View Full Code Here

Examples of com.pugh.sockso.web.action.api.ApiAction.canHandle()

        assertContains( res.getOutput(), "errorMessage" );
    }
   
    public void testErrorReturnedWhenActionRequiresLoginAndUserIsNotLoggedIn() throws Exception {
        ApiAction action = createNiceMock( ApiAction.class );
        expect( action.canHandle((Request)anyObject()) ).andReturn( Boolean.TRUE );
        expect( action.requiresLogin() ).andReturn( Boolean.TRUE );
        replay( action );
        //
        api.setUser( null );
        boolean gotException = false;
View Full Code Here

Examples of com.pugh.sockso.web.action.api.ApiAction.canHandle()

        verify( action );
    }
   
    public void testActionIsRunWhenUserNotLoggedInAndActionDoesNotRequireLogin() throws Exception {
        ApiAction action = createNiceMock( ApiAction.class );
        expect( action.canHandle((Request)anyObject()) ).andReturn( Boolean.TRUE );
        expect( action.requiresLogin() ).andReturn( Boolean.FALSE );
        action.handleRequest();
        replay( action );
        //
        api.setUser( null );
View Full Code Here

Examples of com.pugh.sockso.web.action.api.ApiAction.canHandle()

        verify( action );
    }
   
    public void testActionIsRunWhenActionRequiresLoginButServerDoesNot() throws Exception {
        ApiAction action = createNiceMock( ApiAction.class );
        expect( action.canHandle((Request)anyObject()) ).andReturn( Boolean.TRUE );
        action.handleRequest();
        replay( action );
        //
        p.set( Constants.WWW_USERS_REQUIRE_LOGIN, p.NO );
        api.setUser( null );
View Full Code Here

Examples of gov.nasa.arc.mct.gui.ContextAwareAction.canHandle()

        // Should always be enabled if canHandle
        ContextAwareAction refresh = new RefreshAction();
       
        // Verify precondition (also verifed in previous test)
        // canHandle is a necessary part of ContextAwareAction life cycle
        Assert.assertTrue(refresh.canHandle(mockContext));
       
        // Verify that refresh menu item is enabled
        Assert.assertTrue(refresh.isEnabled());
    }
   
View Full Code Here

Examples of gov.nasa.arc.mct.gui.ContextAwareAction.canHandle()

        View newerView = Mockito.mock(View.class);
        Mockito.when(mockViewInfo.createView(newerComponent)).thenReturn(newerView);
       
        // Create refresh action, obey life cycle
        ContextAwareAction refresh = new RefreshAction();
        Assert.assertTrue(refresh.canHandle(mockContext));
       
        // Verify preconditions
        Mockito.verifyZeroInteractions(mockWindowManager);
        Mockito.verifyZeroInteractions(mockContentArea);
        Mockito.verifyZeroInteractions(mockViewInfo);
View Full Code Here

Examples of gov.nasa.arc.mct.gui.ContextAwareMenu.canHandle()

            menu.initialize();

            if (menuIndex > 0)
                popupMenu.addSeparator();
           
            if (menu.canHandle(context)) {
                int lastPopulatedIndex = -1;
                List<MenuSection> sections = menu.getMenuSections();
                for (int sectionIndex = 0; sectionIndex < sections.size(); sectionIndex++) {
                    MenuSection section = sections.get(sectionIndex);
                    List<MenuItemInfo> menuItemInfoList = section.getMenuItemInfoList();
View Full Code Here

Examples of gov.nasa.arc.mct.gui.menu.ExportMenu.ObjectsExportMenu.canHandle()

        Assert.assertEquals(thisMenu.getText(), "Export");
        Assert.assertEquals(objsMenu.getText(), "Export");
       
        // Should always return true to canHandle
        Assert.assertTrue(thisMenu.canHandle(null));
        Assert.assertTrue(objsMenu.canHandle(null));
       
        // Verify that expected extension points are published
        String[] thisExts = thisMenu.getExtensionMenubarPaths();
        String[] objsExts = objsMenu.getExtensionMenubarPaths();
        Assert.assertEquals(thisExts[0], "/this/export.ext");
View Full Code Here

Examples of gov.nasa.arc.mct.gui.menu.ExportMenu.ThisExportMenu.canHandle()

        // Name is specified in code, so verify it
        Assert.assertEquals(thisMenu.getText(), "Export");
        Assert.assertEquals(objsMenu.getText(), "Export");
       
        // Should always return true to canHandle
        Assert.assertTrue(thisMenu.canHandle(null));
        Assert.assertTrue(objsMenu.canHandle(null));
       
        // Verify that expected extension points are published
        String[] thisExts = thisMenu.getExtensionMenubarPaths();
        String[] objsExts = objsMenu.getExtensionMenubarPaths();
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.