Package org.candlepin.model

Examples of org.candlepin.model.ProductPoolAttribute


            sub.getEndDate(), sub.getContractNumber(), sub.getAccountNumber(),
            sub.getOrderNumber());
        p.setSourceSubscription(new SourceSubscription(sub.getId(), "master"));

        for (ProductAttribute attr : sub.getProduct().getAttributes()) {
            p.addProductAttribute(new ProductPoolAttribute(attr.getName(), attr.getValue(),
                sub.getProduct().getId()));
        }

        // Copy sub-product data if there is any:
        if (sub.getDerivedProduct() != null) {
View Full Code Here


    @Test
    public void filterTimestampsOffAttributes() {
        Pool p = new Pool();

        ProductPoolAttribute prodAttr = new ProductPoolAttribute("a", "1", "PRODID");
        prodAttr.setCreated(new Date());
        prodAttr.setUpdated(new Date());
        p.addProductAttribute(prodAttr);

        PoolAttribute poolAttr = new PoolAttribute("a", "1");
        poolAttr.setCreated(new Date());
        poolAttr.setUpdated(new Date());
View Full Code Here

        Random gen = new Random();
        int id = gen.nextInt(Integer.MAX_VALUE);
        e.setId(String.valueOf(id));
        Pool p = e.getPool();
        // Setup the attributes for stacking:
        p.addProductAttribute(new ProductPoolAttribute("stacking_id", stackId, productId));
        return e;
    }
View Full Code Here

        Entitlement e = mockEntitlement(consumer, productId, range, providedProductIds);
        e.setQuantity(quantity);
        Pool p = e.getPool();

        // Setup the attributes for stacking:
        p.addProductAttribute(new ProductPoolAttribute("stacking_id", stackId, productId));
        p.addProductAttribute(new ProductPoolAttribute("sockets", "2", productId));

        return e;
    }
View Full Code Here

        assertEquals(2, pool.getProvidedProducts().size());
    }

    @Test
    public void nullAttributeValue() {
        ProductPoolAttribute ppa = new ProductPoolAttribute("Name", null, "Product");
        PoolAttribute pa = new PoolAttribute("Name", null);
        ppa.toString();
        pa.toString();
        ppa.hashCode();
        pa.hashCode();
    }
View Full Code Here

            new HashSet<Product>(), quantity, startDate, endDate,
            TestUtil.createDate(2010, 2, 12));
        subCurator.create(sub);
        p.setSourceSubscription(new SourceSubscription(sub.getId(), "master"));
        for (ProductAttribute pa : product.getAttributes()) {
            p.addProductAttribute(new ProductPoolAttribute(pa.getName(),
                pa.getValue(), product.getId()));
        }
        return poolCurator.create(p);
    }
View Full Code Here

    }

    @Test
    public void managementEnabledByAttribute() throws Exception {

        pool.addProductAttribute(new ProductPoolAttribute("management_enabled", "1", "p"));
        certServiceAdapter.createX509Certificate(entitlement,
            product, new HashSet<Product>(), new BigInteger("1234"), keyPair(), true);

        verify(mockedPKI).createX509Certificate(any(String.class),
            argThat(new ListContainsProvidesManagement("1")), any(Set.class),
View Full Code Here

    }

    @Test
    public void stackingIdByAttribute() throws Exception {

        pool.addProductAttribute(new ProductPoolAttribute("stacking_id", "3456", "p"));
        certServiceAdapter.createX509Certificate(entitlement,
            product, new HashSet<Product>(), new BigInteger("1234"), keyPair(), true);

        verify(mockedPKI).createX509Certificate(any(String.class),
            argThat(new ListContainsStackingId("3456")), any(Set.class), any(Date.class),
View Full Code Here

        assertEquals(1, updates.size());
        PoolUpdate update = updates.get(0);
        Pool updatedPool = update.getPool();
        assertTrue(updatedPool.hasProductAttribute(testAttributeKey));

        ProductPoolAttribute provided =
            updatedPool.getProductAttribute(testAttributeKey);
        assertEquals("Wrong product id.", expectedProductId, provided.getProductId());
    }
View Full Code Here

        e.setId(String.valueOf(id));

        Pool p = e.getPool();

        // Setup the attributes for stacking:
        p.addProductAttribute(new ProductPoolAttribute("stacking_id", stackId, productId));

        return e;
    }
View Full Code Here

TOP

Related Classes of org.candlepin.model.ProductPoolAttribute

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.