Package org.candlepin.model

Examples of org.candlepin.model.ConsumerType


        pool1.setAttribute("product_family", "test family");
        pool1.setProductAttribute("product_family", "bad test family",
            pool1.getProductId());

        ConsumerType type = consumerTypeCurator.lookupByLabel("system");
        Consumer consumer = new Consumer("test-consumer", "test-user", owner, type);
        consumerCurator.create(consumer);

        EntitlementCertificate cert = createEntitlementCertificate("fake", "fake");
        Entitlement entitlement = createEntitlement(owner, consumer, pool1, cert);
View Full Code Here


    public void testOwnerInfoEntitlementsConsumedByFamilySortsByFamily() {
        owner.addEntitlementPool(pool1);

        pool1.setProductAttribute("product_family", "test family", pool1.getProductId());

        ConsumerType type = consumerTypeCurator.lookupByLabel("system");
        Consumer consumer = new Consumer("test-consumer", "test-user", owner, type);
        consumerCurator.create(consumer);

        EntitlementCertificate cert = createEntitlementCertificate("fake", "fake");
        Entitlement entitlement = createEntitlement(owner, consumer, pool1, cert);
View Full Code Here

        // other tests look at physical, so just do virtual
        owner.addEntitlementPool(pool1);

        pool1.setProductAttribute("virt_only", "true", pool1.getProductId());

        ConsumerType type = consumerTypeCurator.lookupByLabel("system");
        Consumer consumer = new Consumer("test-consumer", "test-user", owner, type);
        consumerCurator.create(consumer);

        EntitlementCertificate cert = createEntitlementCertificate("fake", "fake");
        Entitlement entitlement = createEntitlement(owner, consumer, pool1, cert);
View Full Code Here

        owner.addEntitlementPool(pool1);

        pool1.setProductAttribute("product_family", "test family", pool1.getProductId());
        pool1.setProductAttribute("virt_only", "true", pool1.getProductId());

        ConsumerType type = consumerTypeCurator.lookupByLabel("system");
        Consumer consumer = new Consumer("test-consumer", "test-user", owner, type);
        consumerCurator.create(consumer);

        EntitlementCertificate cert = createEntitlementCertificate("fake", "fake");
        Entitlement entitlement = createEntitlement(owner, consumer, pool1, cert);
View Full Code Here

        assertEquals(expected, info.getEntitlementsConsumedByFamily());
    }

    @Test
    public void testConsumerGuestCount() {
        ConsumerType type = consumerTypeCurator.lookupByLabel("system");
        Consumer guest1 = new Consumer("test-consumer", "test-user", owner, type);
        guest1.setFact("virt.is_guest", "true");
        consumerCurator.create(guest1);

        Consumer guest2 = new Consumer("test-consumer", "test-user", owner, type);
View Full Code Here

    @Test
    public void testConsumerCountsByEntitlementStatusExcludesUebercertConsumers() {
        setupConsumerCountTest("test-user");

        ConsumerType ueberType = consumerTypeCurator.lookupByLabel("uebercert");
        Consumer ueberConsumer = new Consumer("test-ueber", "test-user", owner,
            ueberType);
        ueberConsumer.setEntitlementStatus(ComplianceStatus.GREEN);
        consumerCurator.create(ueberConsumer);
View Full Code Here

    @Test
    public void testPermissionsAppliedForConsumerCounts() {
        User mySystemsUser = setupOnlyMyConsumersPrincipal();

        ConsumerType type = consumerTypeCurator.lookupByLabel("system");
        Consumer consumer = new Consumer("my-system-1", mySystemsUser.getUsername(),
            owner, type);
        consumerCurator.create(consumer);

        consumer = new Consumer("not-my-system", "another-user", owner, type);
View Full Code Here

    @Test
    public void testPermissionsAppliedForConsumerTypeEntitlementEntitlementsConsumedByType() {
        User mySystemsUser = setupOnlyMyConsumersPrincipal();

        ConsumerType type = consumerTypeCurator.lookupByLabel("system");
        Consumer consumer = new Consumer("my-system-1", mySystemsUser.getUsername(),
            owner, type);
        consumerCurator.create(consumer);

        EntitlementCertificate myConsumersCert = createEntitlementCertificate("mine",
View Full Code Here

        assertEquals(expectedConsumers, info.getConsumerCounts());
        assertEquals(expectedEntitlementsConsumed, info.getEntitlementsConsumedByType());
    }

    private void setupConsumerCountTest(String username) {
        ConsumerType systemType = consumerTypeCurator.lookupByLabel("system");
        Consumer consumer1 = new Consumer("test-consumer1", username, owner, systemType);
        consumer1.setEntitlementStatus(ComplianceStatus.GREEN);
        consumerCurator.create(consumer1);

        Consumer consumer2 = new Consumer("test-consumer2", username, owner, systemType);
View Full Code Here

    @Before
    public void setUp() {
        owner = new Owner("test-owner", "Test Owner");
        owner = ownerCurator.create(owner);
        ct = new ConsumerType(ConsumerTypeEnum.SYSTEM);
        ct = consumerTypeCurator.create(ct);
        key = new ActivationKey("a key", owner);
        activationKeyCurator.create(key);
    }
View Full Code Here

TOP

Related Classes of org.candlepin.model.ConsumerType

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.