Package org.candlepin.model

Examples of org.candlepin.model.Product


        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(range3.getStartDate(), validRange.getStartDate());
        assertEquals(range3.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

        ComplianceStatus status = compliance.getStatus(c, now);
        assertEquals("valid", status.getStatus());
        ConsumerInstalledProductEnricher calculator =
            new ConsumerInstalledProductEnricher(c, status, compliance);
        Product p1 = new Product(PRODUCT_1, "Awesome Product");
        DateRange validRange = calculator.getValidDateRange(p1);
        assertNotNull(validRange);

        assertEquals(hypervisorRange.getStartDate(), validRange.getStartDate());
        assertEquals(hypervisorRange.getEndDate(), validRange.getEndDate());
View Full Code Here

    private static final String USER_NAME = "user33908";

    @Before
    public void setUpTestObjects() {
        owner = new Owner("Example Corporation");
        rhel = new Product("rhel", "Red Hat Enterprise Linux");
        jboss = new Product("jboss", "JBoss");

        ownerCurator.create(owner);
        productCurator.create(rhel);
        productCurator.create(jboss);
View Full Code Here

        assertEquals(lookedUp.getUuid(), consumer2.getUuid());
    }

    @Test
    public void testAddEntitlements() {
        Product newProduct = TestUtil.createProduct();
        productCurator.create(newProduct);
        Pool pool = createPoolAndSub(createOwner(), newProduct,
            1000L, TestUtil.createDate(2009, 11, 30),
            TestUtil.createDate(2015, 11, 30));
        entityManager().persist(pool.getOwner());
View Full Code Here

        productCurator.createOrUpdate(original);
    }

    @Test(expected = BadRequestException.class)
    public void testProductAttributeUpdateFailNumberBool() {
        Product original = createTestProduct();
        productCurator.create(original);
        assertTrue(original.getId() != null);
        original.addAttribute(new ProductAttribute("product.bool_val_num", "6"));
        productCurator.createOrUpdate(original);
    }
View Full Code Here

        productCurator.createOrUpdate(original);
    }

    @Test
    public void testSubstringConfigList() {
        Product original = createTestProduct();
        original.addAttribute(new ProductAttribute("product.pos", "-5"));
        productCurator.create(original);
    }
View Full Code Here

        productCurator.create(original);
    }

    @Test
    public void testRemoveProductContent() {
        Product p = createTestProduct();
        Content content = new Content("test-content", "test-content",
            "test-content", "yum", "us", "here", "here", "test-arch");
        p.addContent(content);
        contentCurator.create(content);
        productCurator.create(p);

        p = productCurator.find(p.getId());
        assertEquals(1, p.getProductContent().size());

        productCurator.removeProductContent(p, content);
        p = productCurator.find(p.getId());
        assertEquals(0, p.getProductContent().size());
    }
View Full Code Here

    @Test
    public void listByIds() {
        List<Product> products = new ArrayList<Product>();
        List<String> pids = new ArrayList<String>();
        for (int i = 0; i < 5; i++) {
            Product p = TestUtil.createProduct();
            productCurator.create(p);
            products.add(p);
            pids.add(p.getId());
        }

        // ok get first 3 items to lookup
        List<Product> returned = productCurator.listAllByIds(pids.subList(0, 3));
        assertEquals(3, returned.size());
View Full Code Here

        assertFalse(returned.contains(products.get(4)));
    }

    @Test
    public void testGetProductIdFromContentId() {
        Product p = createTestProduct();
        Content content = new Content("best-content", "best-content",
            "best-content", "yum", "us", "here", "here", "test-arch");
        p.addContent(content);
        contentCurator.create(content);
        productCurator.create(p);

        List<String> contentIds = new LinkedList<String>();
        contentIds.add(content.getId());
        List<String> productIds = productCurator.getProductIdsWithContent(contentIds);
        assertEquals(1, productIds.size());
        assertEquals(p.getId(), productIds.get(0));
    }
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.