Examples of PlatformAccess


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

        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

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

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

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

                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

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

    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

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

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

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

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

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

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

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

  @Mock User user;

  @BeforeMethod
  public void testSetup() {
    MockitoAnnotations.initMocks(this);
    (new PlatformAccess()).setPlatform(mockPlatform);
    Mockito.when(mockPlatform.getCurrentUser()).thenReturn(user);
  }
View Full Code Here

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

    public void setup() {
        platform = PlatformAccess.getPlatform();

       
        mockPlatform = Mockito.mock(Platform.class);
        new PlatformAccess().setPlatform(mockPlatform);
       
        PolicyManager mockPolicyManager = Mockito.mock(PolicyManager.class);
       
        Mockito.when(mockPlatform.getPolicyManager()).thenReturn(mockPolicyManager);
       
View Full Code Here

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

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