Package org.candlepin.model

Examples of org.candlepin.model.Product.addContent()


    @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());
View Full Code Here


    @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());
View Full Code Here

    @Test
    public void testSaveOrUpdateProductNoDuplicateProdContent() {
        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.createOrUpdate(p);

        p = createTestProduct();
        // The content isn't quite the same.  We just care about matching
View Full Code Here

        p = createTestProduct();
        // The content isn't quite the same.  We just care about matching
        // product ids with content ids
        content = new Content("best-content", "best-content",
            "best-content", "yum", "us", "here", "differnet", "test-arch");
        p.addContent(content);
        productCurator.createOrUpdate(p);

        Product result = productCurator.find(p.getId());
        assertEquals(1, result.getProductContent().size());
    }
View Full Code Here

        Set<String> modified = new HashSet<String>();
        modified.add(PRODUCT_VIRT_HOST);
        Content content = new Content("modifier-content", "modifier-content",
            "modifer-content", "yum", "us", "here", "here", "");
        content.setModifiedProductIds(modified);
        modifier.addContent(content);

        contentCurator.create(content);
        productAdapter.createProduct(modifier);

        subCurator.create(new Subscription(o, modifier, new HashSet<Product>(),
View Full Code Here

        modContent.setLabel("mod content");
        Set<String> modifiedProductIds = new HashSet<String>(
            Arrays.asList(new String[]{ "product1", "product2" }));
        modContent.setModifiedProductIds(modifiedProductIds);

        modProduct.addContent(normalContent);
        modProduct.addContent(modContent);

        // First check that if we have no entitlements providing the modified
        // products,
        // the content set is filtered out:
View Full Code Here

        Set<String> modifiedProductIds = new HashSet<String>(
            Arrays.asList(new String[]{ "product1", "product2" }));
        modContent.setModifiedProductIds(modifiedProductIds);

        modProduct.addContent(normalContent);
        modProduct.addContent(modContent);

        // First check that if we have no entitlements providing the modified
        // products,
        // the content set is filtered out:
        when(
View Full Code Here

        Product newProduct = TestUtil.createProduct("fake id", "fake name");
        Product oldProduct = TestUtil.createProduct("fake id", "fake name");

        Content content = new Content();

        oldProduct.addContent(content);

        Set<Product> products = new HashSet<Product>();
        products.add(newProduct);

        when(productCuratorMock.lookupById(oldProduct.getId())).thenReturn(oldProduct);
View Full Code Here

        Product oldProduct = TestUtil.createProduct("fake id", "fake name");

        Content content = new Content("foobar", null, null, null, null, null, null, null);
        Content content2 = new Content("baz", null, null, null, null, null, null, null);

        oldProduct.addContent(content);
        newProduct.addContent(content2);

        Set<Product> products = new HashSet<Product>();
        products.add(newProduct);
View Full Code Here

        Product newProduct = TestUtil.createProduct("fake id", "fake name");
        Product oldProduct = TestUtil.createProduct("fake id", "fake name");

        Content content = new Content("foobar", null, null, null, null, null, null, null);

        oldProduct.addContent(content);
        newProduct.addEnabledContent(content);

        Set<Product> products = new HashSet<Product>();
        products.add(newProduct);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.