Package gov.nasa.arc.mct.components

Examples of gov.nasa.arc.mct.components.Bootstrap


    }
   
    @SuppressWarnings("unchecked")
    @Test
    public void testPluginBootstraps() {
        final Bootstrap mockGlobal = Mockito.mock(Bootstrap.class);
        final Bootstrap mockNonGlobal = Mockito.mock(Bootstrap.class);
        Mockito.when(mockGlobal.isGlobal()).thenReturn(true);
        Mockito.when(mockNonGlobal.isGlobal()).thenReturn(false);
       
        class BootstrapComponent extends AbstractComponent {
            private boolean global;

            public BootstrapComponent(boolean global) {
View Full Code Here


    @Test
    public void testBootstrap() {
        // Test Bootstrap capability by getting one from the sandbox
        TelemetryDataTaxonomyComponent component = new TelemetryDataTaxonomyComponent();
        component.getCapability(ComponentInitializer.class).setId("id");
        Bootstrap capability = component.getCapability(Bootstrap.class);
       
        // Should support the bootstrap capability
        Assert.assertNotNull(capability);
       
        // Is not a sandbox
        Assert.assertFalse(capability.isSandbox());
       
        // Is globally accessible (for all users)
        Assert.assertTrue(capability.isGlobal());
       
        // Appears near the bottom, but not at the bottom
        Assert.assertEquals(capability.categoryIndex(), Integer.MAX_VALUE);
        Assert.assertTrue(capability.componentIndex() < Integer.MAX_VALUE);       
    }
View Full Code Here

    @Test
    public void testBootstrap() {
        // Test Bootstrap capability by getting one from the sandbox
        MineTaxonomyComponent mySandbox = new MineTaxonomyComponent();
        Bootstrap capability = mySandbox.getCapability(Bootstrap.class);
       
        // Should support the bootstrap capability
        Assert.assertNotNull(capability);
       
        // Is a sandbox
        Assert.assertTrue(capability.isSandbox());
       
        // Is not globally accessible (one per user)
        Assert.assertFalse(capability.isGlobal());
       
        // Appears at the end of sorted list of bootstraps
        Assert.assertEquals(capability.categoryIndex(), Integer.MAX_VALUE);
        Assert.assertEquals(capability.componentIndex(), Integer.MAX_VALUE);       
    }
View Full Code Here

        Collection<AbstractComponent> adminBootstraps = new ArrayList<AbstractComponent>();
       
        for (ComponentProvider provider : providers) {
            for (AbstractComponent bootstrap : provider.getBootstrapComponents()) {
                if (getComponent(bootstrap.getComponentId()) == null) {
                    Bootstrap capability = bootstrap.getCapability(Bootstrap.class);
                    boolean isGlobal = capability != null ?
                                    capability.isGlobal() :
                                    bootstrap.getCreator().equals("*");
                    bootstraps.add(bootstrap);
                    (isGlobal ? adminBootstraps : userBootstraps).add(bootstrap);
                }
            }
View Full Code Here

    public List<AbstractComponent> getBootstrapComponents() {
        // Inject root and My Sandbox components to GlobalComponentRegistry
        List<AbstractComponent> bootstrapComponents = getPersistenceProvider().getBootstrapComponents();
        for (AbstractComponent ac : bootstrapComponents) {
            // Check capability to determine if this is the sandbox
            Bootstrap capability = ac.getCapability(Bootstrap.class);
            if (capability != null && capability.isSandbox()) {
                mySandbox = ac;
            }
            if ("/UserDropBoxes".equals(ac.getExternalKey())) {
                userDropboxesId = ac.getComponentId();
            }
View Full Code Here

TOP

Related Classes of gov.nasa.arc.mct.components.Bootstrap

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.