Package gov.nasa.arc.mct.platform.spi

Examples of gov.nasa.arc.mct.platform.spi.PlatformAccess


        }
        setTargetComponent(housingA);
    testMenu.fireMenuSelected();
    Assert.assertEquals(testMenu.getMenuComponentCount(), 4);
   
    PlatformAccess access = new PlatformAccess();
    Platform mockPlatform = Mockito.mock(Platform.class);
    PersistenceProvider mockPersistenceProvider = Mockito.mock(PersistenceProvider.class);
    access.setPlatform(mockPlatform);
    Mockito.when(mockPlatform.getPersistenceProvider()).thenReturn(mockPersistenceProvider);

    JMenuItem menuItem = (JMenuItem) testMenu.getMenuComponent(3);
    JCheckBoxMenuItem checkBoxMenuItem = (JCheckBoxMenuItem) menuItem;
    Action action = menuItem.getAction();
    Assert.assertNotNull(action);
    checkBoxMenuItem.doClick();
   
    testMenu.fireMenuDeselected();
    resetTargetComponent(housingA);
    access.setPlatform(null);
  }
View Full Code Here


                Mockito.when(view.getManifestedComponent()).thenReturn(component);
                return view;
            }
        };
       
        PlatformAccess access = new PlatformAccess();
        Platform mockPlatform = Mockito.mock(Platform.class);
        PersistenceProvider mockPersistenceProvider = Mockito.mock(PersistenceProvider.class);
        access.setPlatform(mockPlatform);
        Mockito.when(mockPlatform.getPersistenceProvider()).thenReturn(mockPersistenceProvider);
        Mockito.when(mockPersistenceProvider.getComponent(component.getComponentId())).thenReturn(component);
        MCTViewManifestationInfo manifInfo = Mockito.mock(MCTViewManifestationInfo.class);       
        View view = CanvasViewStrategy.CANVAS_OWNED.createViewFromManifestInfo(viewInfo, component, canvasComponent, manifInfo);
        Assert.assertEquals(view.getManifestedComponent().getComponentId(), canvasComponent.getComponentId());
View Full Code Here

    }
   
    @AfterClass
    public void restorePlatform() {
        frame.dispose();
        new PlatformAccess().setPlatform(oldPlatform);
    }
View Full Code Here

        Mockito.when(mockInfo.createView(mockComponent)).thenReturn(pseudoView);
        Mockito.when(mockContent.getHousedViewManifestation()).thenReturn(pseudoView);
        Mockito.when(mockPolicy.execute(Mockito.anyString(), Mockito.<PolicyContext>any()))
            .thenReturn(new ExecutionResult(null,true,""));
       
        new PlatformAccess().setPlatform(mockPlatform);
    }
View Full Code Here

    f.setAccessible(true);
    factory = (EntityManagerFactory) f.get(serviceImpl);
    em = factory.createEntityManager();
    Mockito.when(mockPlatform.getPolicyManager()).thenReturn(mockPolicyManager);
    Mockito.when(mockPolicyManager.execute(Mockito.anyString(), Mockito.any(PolicyContext.class))).thenReturn(new ExecutionResult(null,true,""));
    (new PlatformAccess()).setPlatform(mockPlatform);
    Mockito.when(mockPlatform.getPersistenceProvider()).thenReturn(serviceImpl);
  }
View Full Code Here

  }
 
  @AfterMethod
  protected void tearDown() throws Exception {
    factory.close();
    (new PlatformAccess()).setPlatform(null);
  }
View Full Code Here

    @BeforeMethod
    public void init() {
        MockitoAnnotations.initMocks(this);
        dir = new MCTDirectoryArea();
        handler = new StubbedHandler(dir, tree, model);
        (new PlatformAccess()).setPlatform(mockPlatform);
        when(mockPlatform.getPolicyManager()).thenReturn(mockPolicyManager);
        ExecutionResult result = new ExecutionResult(new PolicyContext(), true, "mock");
        when(mockPolicyManager.execute(Mockito.anyString(), Mockito.any(PolicyContext.class))).thenReturn(result);
     }
View Full Code Here

        when(mockPolicyManager.execute(Mockito.anyString(), Mockito.any(PolicyContext.class))).thenReturn(result);
     }
   
    @AfterMethod
    public void tearDown() {
        (new PlatformAccess()).releasePlatform();
    }
View Full Code Here

        when(mockView.getManifestedComponent()).thenReturn(mockComponent);
       
        when(transferable.getTransferData(eq(GOOD_FLAVOR))).thenReturn(new View[]{mockView});
       
        // Mock persistence provider, policy manager, and platform
        PlatformAccess access = new PlatformAccess();
        Platform mockPlatform = Mockito.mock(Platform.class);
        PersistenceProvider mockPersistenceProvider = Mockito.mock(PersistenceProvider.class);
        PolicyManager mockpoPolicyManager = Mockito.mock(PolicyManager.class);      
        CoreComponentRegistry mockComponentRegistry = Mockito.mock(CoreComponentRegistry.class);
        WindowManager mockWindowManager = Mockito.mock(WindowManager.class);
       
        access.setPlatform(mockPlatform);
        Mockito.when(mockPlatform.getPersistenceProvider()).thenReturn(mockPersistenceProvider);
        Mockito.when(mockPlatform.getPolicyManager()).thenReturn(mockPolicyManager);
        Mockito.when(mockPlatform.getComponentRegistry()).thenReturn(mockComponentRegistry);
        Mockito.when(mockPlatform.getWindowManager()).thenReturn(mockWindowManager);
        ExecutionResult mockResult = new ExecutionResult(new PolicyContext(), true, "");
View Full Code Here

        View sourceView = mock(View.class);
       
        when(transferable.getTransferData(eq(GOOD_FLAVOR))).thenReturn(new View[]{sourceView});
       
        // Mock persistence provider, policy manager, and platform.
        PlatformAccess access = new PlatformAccess();
        Platform mockPlatform = Mockito.mock(Platform.class);
        PersistenceProvider mockPersistenceProvider = Mockito.mock(PersistenceProvider.class);
        PolicyManager mockpoPolicyManager = Mockito.mock(PolicyManager.class);      
        CoreComponentRegistry mockComponentRegistry = Mockito.mock(CoreComponentRegistry.class);
        WindowManager mockWindowManager = Mockito.mock(WindowManager.class);
       
        access.setPlatform(mockPlatform);
        Mockito.when(mockPlatform.getPersistenceProvider()).thenReturn(mockPersistenceProvider);
        Mockito.when(mockPlatform.getPolicyManager()).thenReturn(mockPolicyManager);       
        ExecutionResult mockResult = new ExecutionResult(new PolicyContext(), true, "");
        Mockito.when(mockpoPolicyManager.execute(Mockito.anyString(), Mockito.any(PolicyContext.class))).thenReturn(mockResult);
        Mockito.when(mockPlatform.getComponentRegistry()).thenReturn(mockComponentRegistry);
View Full Code Here

TOP

Related Classes of gov.nasa.arc.mct.platform.spi.PlatformAccess

Copyright © 2018 www.massapicom. 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.