Package org.candlepin.model

Examples of org.candlepin.model.Entitlement


        return ent;
    }

    @Test
    public void listProviding() {
        Entitlement ent = setupListProvidingEntitlement();
        // Test a successful query:
        Set<Entitlement> results = entitlementCurator.listProviding(consumer,
                ent.getPool().getProductId(), ent.getStartDate(), ent.getEndDate());
        assertEquals(1, results.size());
    }
View Full Code Here


        assertEquals(1, results.size());
    }

    @Test
    public void listProvidingProvidedProduct() {
        Entitlement ent = setupListProvidingEntitlement();
        // Test a successful query:
        Set<Entitlement> results = entitlementCurator.listProviding(consumer,
                providedProduct1.getId(), ent.getStartDate(), ent.getEndDate());
        assertEquals(1, results.size());
    }
View Full Code Here

    }


    @Test
    public void listProvidingNoResults() {
        Entitlement ent = setupListProvidingEntitlement();
        Set<Entitlement> results = entitlementCurator.listProviding(consumer,
            "nosuchproductid", ent.getStartDate(), ent.getEndDate());
        assertEquals(0, results.size());
    }
View Full Code Here

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

    @Test
    public void listProvidingStartDateOverlap() {
        Entitlement ent = setupListProvidingEntitlement();
        Set<Entitlement> results = entitlementCurator.listProviding(consumer,
            ent.getPool().getProductId(), overlappingDate, futureDate);
        assertEquals(1, results.size());

    }
View Full Code Here

    }

    @Test
    public void listProvidingEndDateOverlap() {
        Entitlement ent = setupListProvidingEntitlement();
        Set<Entitlement> results = entitlementCurator.listProviding(consumer,
            ent.getPool().getProductId(), pastDate, overlappingDate);
        assertEquals(1, results.size());
    }
View Full Code Here

        assertEquals(1, results.size());
    }

    @Test
    public void listProvidingTotalOverlap() {
        Entitlement ent = setupListProvidingEntitlement();
        Set<Entitlement> results = entitlementCurator.listProviding(consumer,
            ent.getPool().getProductId(), pastDate, futureDate);
        assertEquals(1, results.size());
    }
View Full Code Here

        assertEquals(1, results.size());
    }

    @Test
    public void listProvidingNoOverlap() {
        Entitlement ent = setupListProvidingEntitlement();
        Set<Entitlement> results = entitlementCurator.listProviding(consumer,
            ent.getPool().getProductId(), pastDate, pastDate);
        assertEquals(0, results.size());
    }
View Full Code Here

        poolCurator.create(consumerPool);

        CandlepinPoolManager anotherEntitler =
            injector.getInstance(CandlepinPoolManager.class);

        Entitlement e1 = poolManager.entitleByPool(consumer, consumerPool, 1);
        assertNotNull(e1);

        anotherEntitler.entitleByPool(consumer, consumerPool, 1);
    }
View Full Code Here

        providedProduct.setPool(pool);
        poolCurator.create(pool);

        Consumer c = createConsumer(o);
        EntitlementCertificate cert = createEntitlementCertificate("key", "certificate");
        Entitlement ent = createEntitlement(o, c, pool, cert);
        entitlementCurator.create(ent);
    }
View Full Code Here

        Consumer consumer = createConsumer(owner);
        consumerCurator.create(consumer);

        EntitlementCertificate cert = createEntitlementCertificate("key", "certificate");
        Entitlement ent = createEntitlement(owner, consumer, pool, cert);
        entitlementCurator.create(ent);

        List<String> productIds = new ArrayList<String>();
        productIds.add(provided.getId());
        List<Owner> results = ownerCurator.lookupOwnersByActiveProduct(productIds);
View Full Code Here

TOP

Related Classes of org.candlepin.model.Entitlement

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.