Package org.candlepin.model

Examples of org.candlepin.model.Branding


        for (Product prod : sub.getProvidedProducts()) {
            p.addProvidedProduct(new ProvidedProduct(prod.getId(), prod.getName()));
        }

        for (Branding b : sub.getBranding()) {
            p.getBranding().add(new Branding(b.getProductId(), b.getType(), b.getName()));
        }

        return p;
    }
View Full Code Here


        String brandedName = "Branded Eng Product";
        Product p = new Product(engProdId, "Eng Product 1000");
        p.setAttribute("brand_type", "OS");
        Set<Product> prods = new HashSet<Product>(Arrays.asList(p));
        Pool pool = TestUtil.createPool(new Product("mkt", "MKT SKU"));
        pool.getBranding().add(new Branding(engProdId, "OS", brandedName));
        Consumer consumer = new Consumer();
        Entitlement e = new Entitlement(pool, consumer, 10);

        List<org.candlepin.json.model.Product> certProds = util.createProducts(prods, "",
            new HashMap<String, EnvironmentContent>()new Consumer(), e);
View Full Code Here

        String brandedName = "Branded Eng Product";
        Product p = new Product(engProdId, "Eng Product 1000");
        p.setAttribute("brand_type", "OS");
        Set<Product> prods = new HashSet<Product>(Arrays.asList(p));
        Pool pool = TestUtil.createPool(new Product("mkt", "MKT SKU"));
        pool.getBranding().add(new Branding(engProdId, "OS", brandedName));
        pool.getBranding().add(new Branding(engProdId, "OS", "another brand name"));
        pool.getBranding().add(new Branding(engProdId, "OS", "number 3"));
        Set<String> possibleBrandNames = new HashSet<String>();
        for (Branding b : pool.getBranding()) {
            possibleBrandNames.add(b.getName());
        }
        Consumer consumer = new Consumer();
View Full Code Here

        assertTrue(results.contains(sub2));
    }

    @Test
    public void testAddBranding() {
        s1.getBranding().add(new Branding("8000", "OS", "Awesome OS Branded"));
        subCurator.merge(s1);
        Subscription lookedUp = subCurator.find(s1.getId());
        assertEquals(1, lookedUp.getBranding().size());
        assertEquals("8000", lookedUp.getBranding().iterator().next().getProductId());
    }
View Full Code Here

        assertEquals("8000", lookedUp.getBranding().iterator().next().getProductId());
    }

    @Test
    public void testRemoveBranding() {
        s1.getBranding().add(new Branding("8000", "OS", "Awesome OS Branded"));
        subCurator.merge(s1);
        Subscription lookedUp = subCurator.find(s1.getId());
        assertEquals(1, lookedUp.getBranding().size());

        lookedUp.getBranding().clear();
View Full Code Here

        subscription.setOrderNumber(entitlement.getPool().getOrderNumber());

        subscription.setQuantity(entitlement.getQuantity().longValue());

        for (Branding b : entitlement.getPool().getBranding()) {
            subscription.getBranding().add(new Branding(b.getProductId(), b.getType(),
                b.getName()));
        }

        subscription.setProduct(findProduct(productsById, entitlement.getProductId()));
        String cdnLabel = meta.getCdnLabel();
View Full Code Here

        Subscription s = TestUtil.createSubscription(owner, TestUtil.createProduct());

        Pool p = TestUtil.copyFromSub(s);

        // Add some branding to the subscription and do an update:
        Branding b1 = new Branding("8000", "OS", "Awesome OS Branded");
        Branding b2 = new Branding("8001", "OS", "Awesome OS Branded 2");
        s.getBranding().add(b1);
        s.getBranding().add(b2);

        List<Pool> existingPools = Arrays.asList(p);
        List<PoolUpdate> updates = this.poolRules.updatePools(s, existingPools);
View Full Code Here

    @Test
    public void brandingDidntChange() {
        Subscription s = TestUtil.createSubscription(owner, TestUtil.createProduct());

        // Add some branding to the subscription and do an update:
        Branding b1 = new Branding("8000", "OS", "Awesome OS Branded");
        Branding b2 = new Branding("8001", "OS", "Awesome OS Branded 2");
        s.getBranding().add(b1);
        s.getBranding().add(b2);

        when(productAdapterMock.getProductById(s.getProduct().getId()))
            .thenReturn(s.getProduct());
View Full Code Here

    @Test
    public void brandingCopiedWhenCreatingPools() {
        Product product = TestUtil.createProduct();

        Subscription sub = TestUtil.createSubscription(owner, product);
        Branding b1 = new Branding("8000", "OS", "Branded Awesome OS");
        Branding b2 = new Branding("8001", "OS", "Branded Awesome OS 2");
        sub.getBranding().add(b1);
        sub.getBranding().add(b2);

        when(this.productAdapterMock.getProductById(anyString())).thenReturn(product);
View Full Code Here

                helper.copySubProductAttributesOntoPool(sub.getDerivedProduct().getId(),
                    newPool);
            }

            for (Branding b : sub.getBranding()) {
                newPool.getBranding().add(new Branding(b.getProductId(), b.getType(),
                    b.getName()));
            }

            newPool.setSourceSubscription(new SourceSubscription(sub.getId(), "master"));
            ProductAttribute virtAtt = sub.getProduct().getAttribute("virt_only");
View Full Code Here

TOP

Related Classes of org.candlepin.model.Branding

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.