Search in sources :

Example 1 with ThingGroupHelper

use of com.aws.greengrass.deployment.ThingGroupHelper in project aws-greengrass-nucleus by aws-greengrass.

the class DeploymentTaskIntegrationTest method setupKernel.

@BeforeAll
static void setupKernel() throws IOException {
    kernel = new Kernel();
    rootDir = Paths.get(System.getProperty("root"));
    NoOpPathOwnershipHandler.register(kernel);
    ConfigPlatformResolver.initKernelWithMultiPlatformConfig(kernel, DeploymentTaskIntegrationTest.class.getResource("onlyMain.yaml"));
    kernel.launch();
    // get required instances from context
    componentManager = kernel.getContext().get(ComponentManager.class);
    componentStore = kernel.getContext().get(ComponentStore.class);
    dependencyResolver = kernel.getContext().get(DependencyResolver.class);
    kernelConfigResolver = kernel.getContext().get(KernelConfigResolver.class);
    deploymentConfigMerger = kernel.getContext().get(DeploymentConfigMerger.class);
    deploymentDocumentDownloader = kernel.getContext().get(DeploymentDocumentDownloader.class);
    thingGroupHelper = kernel.getContext().get(ThingGroupHelper.class);
}
Also used : ThingGroupHelper(com.aws.greengrass.deployment.ThingGroupHelper) DeploymentDocumentDownloader(com.aws.greengrass.deployment.DeploymentDocumentDownloader) DeploymentConfigMerger(com.aws.greengrass.deployment.DeploymentConfigMerger) ComponentManager(com.aws.greengrass.componentmanager.ComponentManager) KernelConfigResolver(com.aws.greengrass.componentmanager.KernelConfigResolver) Kernel(com.aws.greengrass.lifecyclemanager.Kernel) ComponentStore(com.aws.greengrass.componentmanager.ComponentStore) DependencyResolver(com.aws.greengrass.componentmanager.DependencyResolver) BeforeAll(org.junit.jupiter.api.BeforeAll)

Example 2 with ThingGroupHelper

use of com.aws.greengrass.deployment.ThingGroupHelper in project aws-greengrass-nucleus by aws-greengrass.

the class PluginComponentTest method launchAndWait.

private void launchAndWait() throws InterruptedException {
    CountDownLatch mainRunning = new CountDownLatch(1);
    kernel.getContext().addGlobalStateChangeListener((service, oldState, newState) -> {
        if (service.getName().equals("main") && newState.equals(State.FINISHED)) {
            mainRunning.countDown();
        }
    });
    kernel.launch();
    thingGroupHelper = kernel.getContext().get(ThingGroupHelper.class);
    assertTrue(mainRunning.await(5, TimeUnit.SECONDS));
}
Also used : ThingGroupHelper(com.aws.greengrass.deployment.ThingGroupHelper) CountDownLatch(java.util.concurrent.CountDownLatch)

Aggregations

ThingGroupHelper (com.aws.greengrass.deployment.ThingGroupHelper)2 ComponentManager (com.aws.greengrass.componentmanager.ComponentManager)1 ComponentStore (com.aws.greengrass.componentmanager.ComponentStore)1 DependencyResolver (com.aws.greengrass.componentmanager.DependencyResolver)1 KernelConfigResolver (com.aws.greengrass.componentmanager.KernelConfigResolver)1 DeploymentConfigMerger (com.aws.greengrass.deployment.DeploymentConfigMerger)1 DeploymentDocumentDownloader (com.aws.greengrass.deployment.DeploymentDocumentDownloader)1 Kernel (com.aws.greengrass.lifecyclemanager.Kernel)1 CountDownLatch (java.util.concurrent.CountDownLatch)1 BeforeAll (org.junit.jupiter.api.BeforeAll)1