Package org.candlepin.model

Examples of org.candlepin.model.ProductAttribute


    }

    @Test
    public void testListForInsufficientCores() {
        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)", "2");
        consumer.setFact("cpu.core(s)_per_socket", "10");
View Full Code Here


    }

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

        consumer.setFacts(new HashMap<String, String>());
        consumer.setFact("memory.memtotal", "16777216");
View Full Code Here

    }

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

        consumer.setFacts(new HashMap<String, String>());
        consumer.setFact("memory.memtotal", "16777216");
View Full Code Here

    }

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

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

    }

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

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

    }

    @Test
    public void testBindFromSameProductAllowedWithMultiEntitlementAttribute() {
        Product product = new Product(productId, "A product for testing");
        product.addAttribute(new ProductAttribute("multi-entitlement", "yes"));
        Pool pool = createPool(owner, product);

        Entitlement e = new Entitlement(pool, consumer, 1);
        consumer.addEntitlement(e);
View Full Code Here

    @Test
    public void missingConsumerArchitectureShouldNotGenerateWarningForNonSystem() {

        String nonSystemType = "somethingElse";
        Product product = new Product(productId, "A product for testing");
        product.addAttribute(new ProductAttribute("arch", "x86_64"));
        product.setAttribute("requires_consumer_type", nonSystemType);
        Pool pool = TestUtil.createPool(owner, product);
        pool.setId("fakeid" + TestUtil.randomInt());
        consumer.setType(new ConsumerType(nonSystemType));
View Full Code Here

    private Pool setupArchTest(final String attributeName,
        String attributeValue, final String factName, final String factValue) {

        Product product = new Product(productId, "A product for testing");
        product
            .addAttribute(new ProductAttribute(attributeName, attributeValue));
        Pool pool = TestUtil.createPool(owner, product);
        pool.setId("fakeid" + TestUtil.randomInt());

        consumer.setFacts(new HashMap<String, String>() {
            {
View Full Code Here

    }

    @Test
    public void testListForSufficientCoresList() {
        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

        consumer = new Consumer("consumer", "registeredbybob", owner,
            new ConsumerType(ConsumerTypeEnum.SYSTEM));

        // Two subtly different products stacked together:
        prod1 = TestUtil.createProduct();
        prod1.addAttribute(new ProductAttribute("virt_limit", "2"));
        prod1.addAttribute(new ProductAttribute("stacking_id", STACK));
        prod1.addAttribute(new ProductAttribute("testattr1", "1"));
        when(productAdapterMock.getProductById(prod1.getId())).thenReturn(prod1);

        prod2 = TestUtil.createProduct();
        prod2.addAttribute(new ProductAttribute("virt_limit", "unlimited"));
        prod2.addAttribute(new ProductAttribute("stacking_id", STACK));
        prod2.addAttribute(new ProductAttribute("testattr2", "2"));
        when(productAdapterMock.getProductById(prod2.getId())).thenReturn(prod2);

        provided1 = TestUtil.createProduct();
        provided2 = TestUtil.createProduct();
        provided3 = TestUtil.createProduct();
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.