Package org.candlepin.model

Examples of org.candlepin.model.EnvironmentContent


        @QueryParam("lazy_regen") @DefaultValue("true") Boolean lazyRegen) {

        Environment e = lookupEnvironment(envId);
        Set<String> demotedContentIds = new HashSet<String>();
        for (String contentId : contentIds) {
            EnvironmentContent envContent =
                envContentCurator.lookupByEnvironmentAndContent(e, contentId);
            envContentCurator.delete(envContent);
            demotedContentIds.add(contentId);
        }
View Full Code Here


    @Test
    public void deleteContent() {
        Content content = mock(Content.class);
        when(content.getId()).thenReturn("10");
        when(cc.find(eq("10"))).thenReturn(content);
        EnvironmentContent ec =
            new EnvironmentContent(mock(Environment.class), content.getId(), true);
        List<EnvironmentContent> envContents = listFrom(ec);
        when(envContentCurator.lookupByContent(content.getId())).thenReturn(envContents);

        cr.remove("10");
View Full Code Here

            "test-arch");
        contentCurator.create(c);
        p.addContent(c);
        productCurator.create(p);

        envContent = new EnvironmentContent(e, c.getId(), true);
        envContent = envContentCurator.create(envContent);
    }
View Full Code Here

        assertEquals(0, envContentCurator.listAll().size());
    }

    @Test(expected = PersistenceException.class)
    public void createDuplicate() {
        envContent = new EnvironmentContent(e, c.getId(), true);
        envContentCurator.create(envContent);
    }
View Full Code Here

    public void listWithContent() {
        envCurator.create(new Environment("env2", "Another Env", owner));

        final String contentId = "contentId";
        envContentCurator.create(
            new EnvironmentContent(environment, contentId, true));

        Set<String> ids = new HashSet<String>();
        ids.add(contentId);

        List<Environment> envs = envCurator.listWithContent(ids);
View Full Code Here

    public void testContentExtentionIncludesPromotedContent()
        throws CertificateSizeException {

        // Environment, with promoted content:
        Environment e = new Environment("env1", "Env 1", owner);
        e.getEnvironmentContent().add(new EnvironmentContent(e, content.getId(), true));
        when(entitlement.getConsumer().getEnvironment()).thenReturn(e);

        Map<String, EnvironmentContent> promotedContent =
            new HashMap<String, EnvironmentContent>();
        promotedContent.put(content.getId(), e.getEnvironmentContent().iterator().next());
View Full Code Here

    public void testPrefixExpandsEnvIfConsumerHasOne() throws Exception {
        owner.setContentPrefix("/someorg/$env/");

        // Setup an environment for the consumer:
        Environment e = new Environment("env1", "Awesome Environment #1", owner);
        e.getEnvironmentContent().add(new EnvironmentContent(e, content.getId(), true));
        when(entitlement.getConsumer().getEnvironment()).thenReturn(e);

        certServiceAdapter.createX509Certificate(entitlement,
            product, new HashSet<Product>(), new BigInteger("1234"), keyPair(), true);
View Full Code Here

    public void testURLEncoding() throws Exception {
        owner.setContentPrefix("/some org/$env/");

        // Setup an environment for the consumer:
        Environment e = new Environment("env1", "Awesome Environment #1", owner);
        e.getEnvironmentContent().add(new EnvironmentContent(e, content.getId(), true));
        when(entitlement.getConsumer().getEnvironment()).thenReturn(e);

        certServiceAdapter.createX509Certificate(entitlement,
            product, new HashSet<Product>(), new BigInteger("1234"), keyPair(), true);
View Full Code Here

        Environment environment = new Environment();
        when(consumer.getEnvironment()).thenReturn(environment);

        Map<String, EnvironmentContent> promotedContent =
            new HashMap<String, EnvironmentContent>();
        promotedContent.put(normalContent.getId(), new EnvironmentContent(environment,
            "content", true));

        assertEquals(1,
            extensionUtil.filterProductContent(modProduct, entitlement, entCurator,
                promotedContent, true)
View Full Code Here

TOP

Related Classes of org.candlepin.model.EnvironmentContent

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.