Package io.fabric8.agent

Examples of io.fabric8.agent.DeploymentBuilder.resolve()


        properties.setProperty("org.osgi.framework.system.capabilities.extra",
                        "osgi.service;effective:=active;objectClass=org.osgi.service.packageadmin.PackageAdmin," +
                        "osgi.service;effective:=active;objectClass=org.osgi.service.startlevel.StartLevel," +
                        "osgi.service;effective:=active;objectClass=org.osgi.service.url.URLHandlers");
        Framework felix = new Felix(properties);
        Collection<Resource> resources = builder.resolve(felix.adapt(BundleRevision.class), false);

        for (Resource resource : resources) {
            System.out.println("Resource: " + getUri(resource));
        }
View Full Code Here


            }

            Resource systemBundle = getSystemBundleResource(getMetadata(properties, "metadata#"));

            try {
                Collection<Resource> resources = builder.resolve(systemBundle, resolveOptionalImports);
                // TODO: find unused resources ?
            } catch (Exception e) {
                throw new MojoExecutionException("Feature resolution failed for " + feature
                        + "\nMessage: " + e.getMessage() + (e.getCause() != null ? "\n" + e.getCause().getMessage() : "")
                        + "\nRepositories: " + toString(new TreeSet<>(repositories.keySet()))
View Full Code Here

        FabricService fabricService = createMock(FabricService.class);
        expect(fabricService.adapt(CuratorFramework.class)).andReturn(curator).anyTimes();
        replay(fabricService);

        PlaceholderResolver resolver = getEncryptedPropertyResolver();
        assertEquals("encryptedpassword",resolver.resolve(fabricService, null, null, null, "crypt:URdoo9++D3tsoC9ODrTfLNK5WzviknO3Ig6qbI2HuvQ="));
        verify(curator);
        verify(getDataBuilder);
    }

    @Test
View Full Code Here

        FabricService fabricService = createMock(FabricService.class);
        expect(fabricService.adapt(CuratorFramework.class)).andReturn(curator).anyTimes();
        replay(fabricService);

        PlaceholderResolver resolver = getEncryptedPropertyResolver();
        assertEquals("encryptedpassword",resolver.resolve(fabricService, null, null, null, "crypt:URdoo9++D3tsoC9ODrTfLNK5WzviknO3Ig6qbI2HuvQ="));
        verify(curator);
        verify(getDataBuilder);
    }

    private PlaceholderResolver getEncryptedPropertyResolver() {
View Full Code Here

        replay(fabricService);
        replay(dataStore);

        PlaceholderResolver resolver = getContainerPlaceholderResolver();
        assertEquals("root",resolver.resolve(fabricService, null, null, null, "container:name"));
        verify(fabricService);
        verify(dataStore);
    }

    @Test
View Full Code Here

    }

    @Test
    public void testResolveCurrentAttributes() throws Exception {
        PlaceholderResolver resolver = getContainerPlaceholderResolver();
        assertEquals(ip,resolver.resolve(fabricService, null, null, null, "container:ip"));
        assertEquals(localhostname,resolver.resolve(fabricService, null, null, null, "container:localhostname"));
        assertEquals(bindaddress,resolver.resolve(fabricService, null, null, null, "container:bindaddress"));
        assertEquals(containerResolver,resolver.resolve(fabricService, null, null, null, "container:resolver"));

        verify(fabricService);
View Full Code Here

    @Test
    public void testResolveCurrentAttributes() throws Exception {
        PlaceholderResolver resolver = getContainerPlaceholderResolver();
        assertEquals(ip,resolver.resolve(fabricService, null, null, null, "container:ip"));
        assertEquals(localhostname,resolver.resolve(fabricService, null, null, null, "container:localhostname"));
        assertEquals(bindaddress,resolver.resolve(fabricService, null, null, null, "container:bindaddress"));
        assertEquals(containerResolver,resolver.resolve(fabricService, null, null, null, "container:resolver"));

        verify(fabricService);
        verify(dataStore);
View Full Code Here

    @Test
    public void testResolveCurrentAttributes() throws Exception {
        PlaceholderResolver resolver = getContainerPlaceholderResolver();
        assertEquals(ip,resolver.resolve(fabricService, null, null, null, "container:ip"));
        assertEquals(localhostname,resolver.resolve(fabricService, null, null, null, "container:localhostname"));
        assertEquals(bindaddress,resolver.resolve(fabricService, null, null, null, "container:bindaddress"));
        assertEquals(containerResolver,resolver.resolve(fabricService, null, null, null, "container:resolver"));

        verify(fabricService);
        verify(dataStore);
    }
View Full Code Here

    public void testResolveCurrentAttributes() throws Exception {
        PlaceholderResolver resolver = getContainerPlaceholderResolver();
        assertEquals(ip,resolver.resolve(fabricService, null, null, null, "container:ip"));
        assertEquals(localhostname,resolver.resolve(fabricService, null, null, null, "container:localhostname"));
        assertEquals(bindaddress,resolver.resolve(fabricService, null, null, null, "container:bindaddress"));
        assertEquals(containerResolver,resolver.resolve(fabricService, null, null, null, "container:resolver"));

        verify(fabricService);
        verify(dataStore);
    }
View Full Code Here

    }

    @Test
    public void testResolveNameContainerAttributes() throws Exception {
        PlaceholderResolver resolver = getContainerPlaceholderResolver();
        assertEquals(ip,resolver.resolve(fabricService, null, null, null, "container:root/ip"));
        assertEquals(localhostname,resolver.resolve(fabricService, null, null, null, "container:root/localhostname"));
        assertEquals(bindaddress,resolver.resolve(fabricService, null, null, null, "container:root/bindaddress"));
        assertEquals(containerResolver,resolver.resolve(fabricService, null, null, null, "container:root/resolver"));

        verify(fabricService);
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.