Package org.candlepin.model

Examples of org.candlepin.model.ProductAttribute


    }

    @Test
    public void attributeFilterValuesAreNotCaseSensitive() {
        Product product1 = TestUtil.createProduct();
        product1.addAttribute(new ProductAttribute("A", "foo"));
        product1.addAttribute(new ProductAttribute("B", "bar"));
        productCurator.create(product1);

        Date activeDate = TestUtil.createDate(2000, 3, 2);

        Pool pool = createPoolAndSub(owner, product1, 100L,
View Full Code Here


     */
    @Test
    public void testAttributeFilterLogic() {

        Product product1 = TestUtil.createProduct();
        product1.addAttribute(new ProductAttribute("A", "foo"));
        product1.addAttribute(new ProductAttribute("B", "bar"));
        productCurator.create(product1);

        Product product2 = TestUtil.createProduct();
        product2.addAttribute(new ProductAttribute("A", "foo"));
        product2.addAttribute(new ProductAttribute("B", "zoo"));
        productCurator.create(product2);

        Product product3 = TestUtil.createProduct();
        product3.addAttribute(new ProductAttribute("A", "biz"));
        product3.addAttribute(new ProductAttribute("B", "zoo"));
        productCurator.create(product3);

        Date activeDate = TestUtil.createDate(2000, 3, 2);

        Pool pool1 = createPoolAndSub(owner, product1, 100L,
View Full Code Here

    }

    @Test
    public void testExempt() {
        Product product1 = TestUtil.createProduct();
        product1.addAttribute(new ProductAttribute("support_level", "premium"));
        product1.addAttribute(new ProductAttribute("support_level_exempt", "true"));
        productCurator.create(product1);
        Product product2 = TestUtil.createProduct();
        product2.addAttribute(new ProductAttribute("support_level", "Premium"));
        productCurator.create(product2);
        Product product3 = TestUtil.createProduct();
        product3.addAttribute(new ProductAttribute("support_level", "super"));
        productCurator.create(product3);
        Product product4 = TestUtil.createProduct();
        product4.addAttribute(new ProductAttribute("support_level", "high"));
        product4.addAttribute(new ProductAttribute("support_level_exempt", "false"));
        productCurator.create(product4);
        Product product5 = TestUtil.createProduct();
        product5.addAttribute(new ProductAttribute("support_level", "HIGH"));
        productCurator.create(product5);

        Pool pool1 = createPoolAndSub(owner, product1, 100L,
            TestUtil.createDate(2000, 3, 2), TestUtil.createDate(2055, 3, 2));
        poolCurator.create(pool1);
View Full Code Here

    }

    @Test
    public void testSupportCasing() {
        Product product1 = TestUtil.createProduct();
        product1.addAttribute(new ProductAttribute("support_level", "premium"));
        productCurator.create(product1);
        Product product2 = TestUtil.createProduct();
        product2.addAttribute(new ProductAttribute("support_level", "Premium"));
        productCurator.create(product2);
        Product product3 = TestUtil.createProduct();
        product3.addAttribute(new ProductAttribute("support_level", "Premiums"));
        productCurator.create(product3);

        Pool pool1 = createPoolAndSub(owner, product1, 100L,
            TestUtil.createDate(2000, 3, 2), TestUtil.createDate(2055, 3, 2));
        poolCurator.create(pool1);
View Full Code Here

    public void ensureV3CertificateCreationOkWhenConsumerSupportsV3Dot1Certs()
        throws Exception {
        Configuration mockConfig = mock(Configuration.class);

        when(consumer.getFact(eq("system.certificate_version"))).thenReturn("3.2");
        ProductAttribute attr = new ProductAttribute("ram", "4");
        subscription.getProduct().addAttribute(attr);

        X509V3ExtensionUtil mockV3extensionUtil = mock(X509V3ExtensionUtil.class);
        X509ExtensionUtil mockExtensionUtil = mock(X509ExtensionUtil.class);
View Full Code Here

    @Test
    public void testPrepareV1ExtensionsBrandedProduct() throws IOException,
        GeneralSecurityException {
        Set<Product> products = new HashSet<Product>();

        ProductAttribute brandAttr = new ProductAttribute("brand_type", "os");
        product.addAttribute(brandAttr);
        products.add(product);
        setupEntitlements(ARCH_LABEL, "1.0");

        Set<X509ExtensionWrapper> extensions =
View Full Code Here

        Pool pool1 = createPoolAndSub(owner, product, 100L,
            activeDate, TestUtil.createDate(2005, 3, 2));
        poolCurator.create(pool1);

        Product product2 = TestUtil.createProduct();
        product2.addAttribute(new ProductAttribute("cores", "8"));
        productCurator.create(product2);

        Pool pool2 = createPoolAndSub(owner, product2, 100L,
            activeDate, TestUtil.createDate(2005, 3, 2));
        poolCurator.create(pool2);
View Full Code Here

    @Test
    public void hostedVirtLimitBadValueDoesntTraceBack() {
        when(configMock.getBoolean(ConfigProperties.STANDALONE)).thenReturn(false);
        Subscription s = TestUtil.createSubscription(owner, TestUtil.createProduct());
        s.getProduct().addAttribute(new ProductAttribute("virt_limit", "badvalue"));
        s.setQuantity(10L);


        List<Pool> pools = null;
        try {
View Full Code Here

    }

    @Test
    public void virtOnlyQuantityChanged() {
        Subscription s = TestUtil.createSubscription(owner, TestUtil.createProduct());
        s.getProduct().addAttribute(new ProductAttribute("virt_limit", "5"));
        s.setQuantity(10L);

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

    }

    @Test
    public void testListForSufficientCores() {
        Product product = new Product(productId, "A product for testing");
        product.addAttribute(new ProductAttribute("cores", "10"));
        Pool pool = createPool(owner, product);

        consumer.setFacts(new HashMap<String, String>());
        consumer.setFact("cpu.cpu_socket(s)", "1");
        consumer.setFact("cpu.core(s)_per_socket", "10");
View Full Code Here

TOP

Related Classes of org.candlepin.model.ProductAttribute

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.