Package org.candlepin.model

Examples of org.candlepin.model.Product


    @Test
    public void preEntitlementShouldNotAllowListOfRequiresHostPools() {
        Consumer c = TestUtil.createConsumer();
        c.getType().setManifest(true);

        Product prod = TestUtil.createProduct();
        Pool p = TestUtil.createPool(prod);
        p.setAttribute("virt_only", "true");
        p.setAttribute("requires_host", "true");

        ValidationResult results = enforcer.preEntitlement(c, p, 1, CallerType.LIST_POOLS);
View Full Code Here


    @Test
    public void preEntitlementShouldNotAllowOverConsumptionOfEntitlements() {
        Consumer c = TestUtil.createConsumer();
        c.getType().setManifest(true);

        Product prod = TestUtil.createProduct();
        Pool p = TestUtil.createPool(prod);
        p.setQuantity(5L);

        ValidationResult results = enforcer.preEntitlement(c, p, 10);
        assertNotNull(results);
View Full Code Here

    public void preEntitlementNoDerivedProductCapabilityProducesErrorOnBind() {
        Consumer c = TestUtil.createConsumer();
        c.setCapabilities(new HashSet<ConsumerCapability>());
        c.getType().setManifest(true);

        Product prod = TestUtil.createProduct();
        Pool p = TestUtil.createPool(prod);
        p.setDerivedProductId("sub-prod-id");

        ValidationResult results = enforcer.preEntitlement(c, p, 1, CallerType.BIND);
        assertNotNull(results);
View Full Code Here

    public void preEntitlementNoDerivedProductCapabilityProducesWarningOnList() {
        Consumer c = TestUtil.createConsumer();
        c.setCapabilities(new HashSet<ConsumerCapability>());
        c.getType().setManifest(true);

        Product prod = TestUtil.createProduct();
        Pool p = TestUtil.createPool(prod);
        p.setDerivedProductId("sub-prod-id");

        ValidationResult results = enforcer.preEntitlement(c, p, 1, CallerType.LIST_POOLS);
        assertNotNull(results);
View Full Code Here

    public void preEntitlementNoDerivedProductCapabilityProducesErrorOnBestPools() {
        Consumer c = TestUtil.createConsumer();
        c.setCapabilities(new HashSet<ConsumerCapability>());
        c.getType().setManifest(true);

        Product prod = TestUtil.createProduct();
        Pool p = TestUtil.createPool(prod);
        p.setDerivedProductId("sub-prod-id");

        ValidationResult results = enforcer.preEntitlement(c, p, 1, CallerType.BEST_POOLS);
        assertNotNull(results);
View Full Code Here

        HashSet<ConsumerCapability> capabilities = new HashSet<ConsumerCapability>();
        capabilities.add(new ConsumerCapability(c, "derived_product"));
        c.setCapabilities(capabilities);
        c.getType().setManifest(true);

        Product prod = TestUtil.createProduct();
        Pool p = TestUtil.createPool(prod);
        p.setDerivedProductId("sub-prod-id");

        ValidationResult results = enforcer.preEntitlement(c, p, 1, CallerType.BIND);
        assertNotNull(results);
View Full Code Here

        HashSet<ConsumerCapability> capabilities = new HashSet<ConsumerCapability>();
        capabilities.add(new ConsumerCapability(c, "derived_product"));
        c.setCapabilities(capabilities);
        c.getType().setManifest(true);

        Product prod = TestUtil.createProduct();
        Pool p = TestUtil.createPool(prod);
        p.setDerivedProductId("sub-prod-id");

        ValidationResult results = enforcer.preEntitlement(c, p, 1, CallerType.BEST_POOLS);
        assertNotNull(results);
View Full Code Here

        mockEntCurator(c, ents);

        ComplianceStatus status = compliance.getStatus(c, now);
        ConsumerInstalledProductEnricher calculator =
            new ConsumerInstalledProductEnricher(c, status, compliance);
        Product p = new Product(PRODUCT_1, "Awesome Product");
        DateRange validRange = calculator.getValidDateRange(p);
        assertEquals(entRange.getStartDate(), validRange.getStartDate());
        assertEquals(entRange.getEndDate(), validRange.getEndDate());
    }
View Full Code Here

        mockEntCurator(c, ents);

        ComplianceStatus status = compliance.getStatus(c, now);
        ConsumerInstalledProductEnricher calculator =
            new ConsumerInstalledProductEnricher(c, status, compliance);
        Product p = new Product(PRODUCT_1, "Awesome Product");
        DateRange validRange = calculator.getValidDateRange(p);
        assertEquals(range2.getStartDate(), validRange.getStartDate());
        assertEquals(range2.getEndDate(), validRange.getEndDate());
    }
View Full Code Here

        mockEntCurator(c, ents);

        ComplianceStatus status = compliance.getStatus(c, now);
        ConsumerInstalledProductEnricher calculator =
            new ConsumerInstalledProductEnricher(c, status, compliance);
        Product p = new Product(PRODUCT_1, "Awesome Product");
        DateRange validRange = calculator.getValidDateRange(p);
        assertEquals(range2.getStartDate(), validRange.getStartDate());
        assertEquals(range2.getEndDate(), validRange.getEndDate());
    }
View Full Code Here

TOP

Related Classes of org.candlepin.model.Product

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.