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

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


    @Mock private PolicyManager mockPolicyManager;
   
    @BeforeMethod
    protected void postSetup() {
        MockitoAnnotations.initMocks(this);
        (new PlatformAccess()).setPlatform(mockPlatform);
        Mockito.when(mockPlatform.getPolicyManager()).thenReturn(mockPolicyManager);
        Mockito.when(mockPolicyManager.execute(Mockito.anyString(), Mockito.any(PolicyContext.class))).thenReturn(new ExecutionResult(null,true,""));
        Mockito.when(mockComponent.getComponentId()).thenReturn("abc");
    }
View Full Code Here


        Mockito.when(mockComponent.getComponentId()).thenReturn("abc");
    }
   
    @AfterMethod
    protected void tearDown() {
        (new PlatformAccess()).setPlatform(null);
    }
View Full Code Here

        // Verify that deprecated methods are redirected to getAsset
        Platform oldPlatform = PlatformAccess.getPlatform();
        Platform mockPlatform = Mockito.mock(Platform.class);
        CoreComponentRegistry mockRegistry = Mockito.mock(CoreComponentRegistry.class);
        Mockito.when(mockPlatform.getComponentRegistry()).thenReturn(mockRegistry);
        new PlatformAccess().setPlatform(mockPlatform);
       
        ComponentTypeInfo info;
        info = new ComponentTypeInfo("","",AbstractComponent.class);
        info.getIcon();
        Mockito.verify(mockRegistry).getAsset(info, javax.swing.ImageIcon.class);
       
        info = new ComponentTypeInfo("","",AbstractComponent.class);
        info.getWizardUI();
        Mockito.verify(mockRegistry).getAsset(info, CreateWizardUI.class);
       
       
        new PlatformAccess().setPlatform(oldPlatform);
    }
View Full Code Here

        Icon mockIcon = Mockito.mock(Icon.class);
       
        TypeInfo<?> info = new TypeInfo<TypeInfoTest>(TypeInfoTest.class){};
       
        // Try with a null platform - should fail to retrieve asset
        new PlatformAccess().setPlatform(null);
        Assert.assertNull(info.getAsset(Icon.class));       
       
        // Try with a platform but no registry - should fail to retrieve asset
        new PlatformAccess().setPlatform(mockPlatform);
        Assert.assertNull(info.getAsset(Icon.class));       
              
        // Try with a mock registry (but no assets) - should fail to retrieve
        Mockito.when(mockPlatform.getComponentRegistry()).thenReturn(mockRegistry);
        Assert.assertNull(info.getAsset(Icon.class));       
               
        // Try with a mock registry that has the requested asset - should retrieve it
        Mockito.when(mockRegistry.getAsset(info, Icon.class)).thenReturn(mockIcon);
        Assert.assertEquals(info.getAsset(Icon.class), mockIcon);       
       
        // Restore old platform
        new PlatformAccess().setPlatform(oldPlatform);
    }
View Full Code Here

    @Mock private Platform mockPlatform;
    @Mock private AbstractComponent mockRoot;
   
    @AfterMethod
    protected void teardown() {
        (new PlatformAccess()).setPlatform(null);
    }
View Full Code Here

                return null;
            }
           
        }, null);
        Mockito.when(mockPlatform.getRootComponent()).thenReturn(mockRoot);
        (new PlatformAccess()).setPlatform(mockPlatform);
        testHousing = TestSetupUtilities.setUpActiveHousing();
        viewShow = new MyLocalViewShowControlAreaAction();
        viewShow.setTestHousing(testHousing);
    }
View Full Code Here

    selected.add(viewManifestation1);
    selected.add(viewManifestation2);

    Mockito.when(ac.getSelectedManifestations()).thenReturn(selected)
    Mockito.when(mockPlatform.getPersistenceProvider()).thenReturn(mockPersistence);
    new PlatformAccess().setPlatform(mockPlatform);
  }
View Full Code Here

    new PlatformAccess().setPlatform(mockPlatform);
  }
 
  @AfterTest
  public void teardown() {
    new PlatformAccess().setPlatform(mockPlatform);
  }
View Full Code Here

   
    @BeforeClass
    public void setup() {
        platform = PlatformAccess.getPlatform();
        mockPlatform = Mockito.mock(Platform.class);
        new PlatformAccess().setPlatform(mockPlatform);       
    }
View Full Code Here

        new PlatformAccess().setPlatform(mockPlatform);       
    }
   
    @AfterClass
    public void teardown() {
        new PlatformAccess().setPlatform(platform);
    }
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.