Examples of Branding


Examples of org.candlepin.model.Branding

    @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

Examples of org.candlepin.model.Branding

                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

Examples of org.candlepin.model.Branding

     * Something has changed, sync the branding.
     */
    private void syncBranding(Subscription sub, Pool pool) {
        pool.getBranding().clear();
        for (Branding b : sub.getBranding()) {
            pool.getBranding().add(new Branding(b.getProductId(), b.getType(),
                b.getName()));
        }
    }
View Full Code Here

Examples of org.candlepin.model.Branding

        String version = product.hasAttribute("version") ?
            product.getAttributeValue("version") : "";
        toReturn.setVersion(version);

        Branding brand = getBranding(ent.getPool(), product.getId());
        toReturn.setBrandType(brand.getType());
        toReturn.setBrandName(brand.getName());

        String productArches = product.getAttributeValue("arch");
        Set<String> productArchSet = Arch.parseArches(productArches);

        // FIXME: getParsedArches might make more sense to just return a list
View Full Code Here

Examples of org.candlepin.model.Branding

    /*
     * Return a branding object for the given engineering product ID if one exists for
     * the pool in question.
     */
    private Branding getBranding(Pool pool, String productId) {
        Branding resultBranding = null;
        for (Branding b : pool.getBranding()) {
            if (b.getProductId().equals(productId)) {
                if (resultBranding == null) {
                    resultBranding = b;
                }
                else {
                    // Warn, but use the first brand name we encountered:
                    log.warn("Found multiple brand names: product={}, contract={}, " +
                        "owner={}", productId, pool.getContractNumber(),
                        pool.getOwner().getKey());
                }
            }
        }
        // If none exist, use null strings
        return resultBranding != null ? resultBranding :
            new Branding(productId, null, null);
    }
View Full Code Here

Examples of org.glassfish.api.branding.Branding

    /**
     * Sun One AppServer SE/EE can override to specify their product version
     */
    protected String getProductId() {

        Branding branding = null;
        // I have to use Globals rather than injection because the formatter lifecyle
        // is managed by the JDK and therefore this instance can be "in-use" long
        // before the habitat is ready. We still need to function, even in a degraded
        // mode.
        if (Globals.getDefaultHabitat() != null) {
            branding = Globals.getDefaultHabitat().getByContract(Branding.class);
        }
        if (branding == null) {
            return null;
        }
        String version = branding.getAbbreviatedVersion() + branding.getVersionPrefix() + branding.getMajorVersion() + "." + branding.getMinorVersion() + "." + branding.getUpdateVersion();
        return (version);
    }
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.