Package org.candlepin.model

Examples of org.candlepin.model.ConsumerContentOverride


    }

    private void handleActivationKeyOverrides(Consumer consumer,
            Set<ActivationKeyContentOverride> overrides) {
        for (ActivationKeyContentOverride akco : overrides) {
            ConsumerContentOverride consumerOverride =
                akco.buildConsumerContentOverride(consumer);
            this.consumerContentOverrideCurator.addOrUpdate(consumer, consumerOverride);
        }
    }
View Full Code Here


        consumerCurator.create(consumer);
    }

    @Test
    public void normalCreateAndRetrieve() {
        ConsumerContentOverride cco = new ConsumerContentOverride(
            consumer, "test-content", "name", "value");
        consumerContentOverrideCurator.create(cco);

        ConsumerContentOverride cco2 = consumerContentOverrideCurator.retrieve(
            consumer, "test-content", "name");
        assert (cco2 != null);
        assertEquals("value", cco2.getValue());
    }
View Full Code Here

        assertEquals("value", cco2.getValue());
    }

    @Test
    public void normalCreateAndUpdate() {
        ConsumerContentOverride cco = new ConsumerContentOverride(
            consumer, "test-content", "name", "value");
        consumerContentOverrideCurator.create(cco);

        cco.setValue("value-update");
        consumerContentOverrideCurator.merge(cco);

        ConsumerContentOverride cco2 = consumerContentOverrideCurator.retrieve(
            consumer, "test-content", "name");
        assert (cco2 != null);
        assertEquals("value-update", cco2.getValue());
    }
View Full Code Here

        assertEquals("value-update", cco2.getValue());
    }

    @Test
    public void deleteByName() {
        ConsumerContentOverride cco = new ConsumerContentOverride(
            consumer, "test-content", "name", "value");
        consumerContentOverrideCurator.create(cco);

        consumerContentOverrideCurator.removeByName(consumer, "test-content", "name");
        ConsumerContentOverride cco2 = consumerContentOverrideCurator.retrieve(
            consumer, "test-content", "name");
        assert (cco2 == null);
    }
View Full Code Here

        assert (cco2 == null);
    }

    @Test
    public void deleteByLabel() {
        ConsumerContentOverride cco1 = new ConsumerContentOverride(
            consumer, "test-content", "name1", "value");
        consumerContentOverrideCurator.create(cco1);
        ConsumerContentOverride cco2 = new ConsumerContentOverride(
            consumer, "test-content", "name2", "value");
        consumerContentOverrideCurator.create(cco2);

        consumerContentOverrideCurator.removeByContentLabel(consumer, "test-content");
        List<ConsumerContentOverride> ccoList = consumerContentOverrideCurator.listAll();
View Full Code Here

        assertEquals(ccoList.size(), 0);
    }

    @Test
    public void deleteByConsumer() {
        ConsumerContentOverride cco1 = new ConsumerContentOverride(
            consumer, "test-content1", "name1", "value");
        consumerContentOverrideCurator.create(cco1);
        ConsumerContentOverride cco2 = new ConsumerContentOverride(
            consumer, "test-content2", "name2", "value");
        consumerContentOverrideCurator.create(cco2);

        consumerContentOverrideCurator.removeByParent(consumer);
        List<ConsumerContentOverride> ccoList = consumerContentOverrideCurator.listAll();
View Full Code Here

        assertEquals(ccoList.size(), 0);
    }

    @Test
    public void testAddOrUpdateUpdatesValue() {
        ConsumerContentOverride cco1 = new ConsumerContentOverride(
            consumer, "test-content1", "name1", "value");
        consumerContentOverrideCurator.create(cco1);
        ConsumerContentOverride cco2 = new ConsumerContentOverride(
            consumer, "test-content1", "name1", "value2");
        consumerContentOverrideCurator.addOrUpdate(consumer, cco2);

        List<ConsumerContentOverride> ccoList = consumerContentOverrideCurator.listAll();
        assertEquals(1, ccoList.size());
View Full Code Here

        assertEquals("value2", ccoList.get(0).getValue());
    }

    @Test
    public void testAddOrUpdateCreatesNew() {
        ConsumerContentOverride cco1 = new ConsumerContentOverride(
            consumer, "test-content1", "name1", "value");
        consumerContentOverrideCurator.create(cco1);
        ConsumerContentOverride cco2 = new ConsumerContentOverride(
            consumer, "test-content2", "name2", "value2");
        consumerContentOverrideCurator.addOrUpdate(consumer, cco2);

        List<ConsumerContentOverride> ccoList = consumerContentOverrideCurator.listAll();
        assertEquals(2, ccoList.size());
View Full Code Here

        assertEquals(2, ccoList.size());
    }

    @Test
    public void testCreateOverride() {
        ConsumerContentOverride override = new ConsumerContentOverride(consumer,
            "test-repo", "gpgcheck", "1");
        assertEquals(override, this.consumerContentOverrideCurator.create(override));
    }
View Full Code Here

        assertEquals(override, this.consumerContentOverrideCurator.create(override));
    }

    @Test
    public void testCreateOverrideForcesLowercaseName() {
        ConsumerContentOverride override = new ConsumerContentOverride(consumer,
            "test-repo", "GpGCheck", "1");
        ConsumerContentOverride created =
            this.consumerContentOverrideCurator.create(override);
        assertEquals("gpgcheck", created.getName());
    }
View Full Code Here

TOP

Related Classes of org.candlepin.model.ConsumerContentOverride

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.