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

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


  @Mock PersistenceProvider mockProvider;
 
  @BeforeTest
  public void setup() {
    MockitoAnnotations.initMocks(this);
    new PlatformAccess().setPlatform(mockPlatform);
    Mockito.when(mockPlatform.getPersistenceProvider()).thenReturn(mockProvider);
    mockRegistry = new ComponentRegistry() {

      @SuppressWarnings("unchecked")
      @Override
View Full Code Here


    wizard = new GraphicalComponentWizardUI();
  }
 
  @AfterTest
  public void teardown() {
    new PlatformAccess().setPlatform(null);
  }
View Full Code Here

  public void setup() throws Exception {
      MockitoAnnotations.initMocks(this);
      tmpDir.create();
      access = new ComponentRegistryAccess();
     
      (new PlatformAccess()).setPlatform(mockPlatform);
      when(mockRegistry
                   .isCreatable(Mockito.any(AbstractComponent.class.getClass())))
             .thenReturn(true);
      when(mockPlatform.getPersistenceProvider()).thenReturn(persistenceProvider);
      when(mockPlatform.getPolicyManager()).thenReturn(mockPolicyManager);
View Full Code Here

  public void setupPlatform() {
    oldPlatform = PlatformAccess.getPlatform();
    mockPlatform = Mockito.mock(Platform.class);
    mockPolicy = Mockito.mock(PolicyManager.class);
    Mockito.when(mockPlatform.getPolicyManager()).thenReturn(mockPolicy);
    new PlatformAccess().setPlatform(mockPlatform);
  }
View Full Code Here

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

   
    Mockito.when(mockPlatform.getPolicyManager()).thenReturn(mockPolicyManager);
    Mockito.when(mockRegistryAccess.getComponentRegistry()).thenReturn(mockRegistry);
    Mockito.when(mockPlatform.getPersistenceProvider())
           .thenReturn(mockPersistenceProvider);
    (new PlatformAccess()).setPlatform(mockPlatform);
   
    Mockito.when(mockPolicyManager.execute(Mockito.anyString(),
                   Mockito.any(PolicyContext.class)))
             .thenReturn(new ExecutionResult(null,true,""));
   
View Full Code Here

 
  @BeforeClass
  public void setupClass() {
    oldPlatform = PlatformAccess.getPlatform();
   
    new PlatformAccess().setPlatform(mockPlatform);   
  }
View Full Code Here

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

        Mockito.when(mockPersistenceProvider.getReferencedComponents(Mockito.any(AbstractComponent.class))).thenReturn(Collections.<AbstractComponent>emptyList());

    Mockito.when(mockComponentRegistry.getViewInfos(Mockito.anyString(), Mockito.any(ViewType.class)))
      .thenReturn(Collections.singleton(new ViewInfo(TableViewManifestation.class,"","",ViewType.EMBEDDED)));
    Mockito.when(mockPolicyManager.execute(Mockito.anyString(), Mockito.any(PolicyContext.class))).thenReturn(new ExecutionResult(null, true, ""));
    (new PlatformAccess()).setPlatform(mockPlatform);
   
    new ServiceAccess().bind(policyManager);
    success = new ExecutionResult(new PolicyContext(), true, "success");
    failure = new ExecutionResult(new PolicyContext(), false, "failure");
View Full Code Here

   
    private void initServicesAndHandlers(BundleContext bc) {
        @SuppressWarnings("rawtypes")
        Dictionary d = new Properties();
        PlatformImpl.getInstance().setBundleContext(bc);
        (new PlatformAccess()).setPlatform(PlatformImpl.getInstance());
        try {
            GlobalContext.getGlobalContext().setIdManager(IdentityManagerFactory.newIdentityManager(null));
        } catch (MCTException e) {
            throw new RuntimeException(e);
        } catch (IOException e) {
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.