Package org.candlepin.policy

Examples of org.candlepin.policy.ValidationResult


        Product prod = TestUtil.createProduct();
        prod.setAttribute("cores", "2");
        Pool p = TestUtil.createPool(prod);

        ValidationResult results = enforcer.preEntitlement(c, p, 1, CallerType.LIST_POOLS);
        assertNotNull(results);
        assertEquals(0, results.getErrors().size());
        ValidationWarning warning = results.getWarnings().get(0);
        assertEquals("rulewarning.cores.unsupported.by.consumer", warning.getResourceKey());
    }
View Full Code Here


        Product prod = TestUtil.createProduct();
        prod.setAttribute("cores", "2");
        Pool p = TestUtil.createPool(prod);

        ValidationResult results = enforcer.preEntitlement(c, p, 1, CallerType.BEST_POOLS);
        assertNotNull(results);
        assertEquals(0, results.getErrors().size());
        assertEquals(0, results.getWarnings().size());
    }
View Full Code Here

        Product prod = TestUtil.createProduct();
        prod.setAttribute("ram", "2");
        Pool p = TestUtil.createPool(prod);

        ValidationResult results = enforcer.preEntitlement(c, p, 1, CallerType.BIND);
        assertNotNull(results);
        assertEquals(0, results.getWarnings().size());
        ValidationError error = results.getErrors().get(0);
        assertEquals("rulefailed.ram.unsupported.by.consumer", error.getResourceKey());
    }
View Full Code Here

        Product prod = TestUtil.createProduct();
        prod.setAttribute("ram", "2");
        Pool p = TestUtil.createPool(prod);

        ValidationResult results = enforcer.preEntitlement(c, p, 1, CallerType.LIST_POOLS);
        assertNotNull(results);
        assertEquals(0, results.getErrors().size());
        ValidationWarning warning = results.getWarnings().get(0);
        assertEquals("rulewarning.ram.unsupported.by.consumer", warning.getResourceKey());
    }
View Full Code Here

        Product prod = TestUtil.createProduct();
        prod.setAttribute("ram", "2");
        Pool p = TestUtil.createPool(prod);

        ValidationResult results = enforcer.preEntitlement(c, p, 1, CallerType.BEST_POOLS);
        assertNotNull(results);
        assertEquals(0, results.getErrors().size());
        assertEquals(0, results.getWarnings().size());
    }
View Full Code Here

        Product prod = TestUtil.createProduct();
        prod.setAttribute("instance_multiplier", "2");
        Pool p = TestUtil.createPool(prod);

        ValidationResult results = enforcer.preEntitlement(c, p, 1, CallerType.BIND);
        assertNotNull(results);
        assertEquals(0, results.getWarnings().size());
        ValidationError error = results.getErrors().get(0);
        assertEquals("rulefailed.instance.unsupported.by.consumer", error.getResourceKey());
    }
View Full Code Here

        Product prod = TestUtil.createProduct();
        prod.setAttribute("instance_multiplier", "2");
        Pool p = TestUtil.createPool(prod);

        ValidationResult results = enforcer.preEntitlement(c, p, 1, CallerType.LIST_POOLS);
        assertNotNull(results);
        assertEquals(0, results.getErrors().size());
        ValidationWarning warning = results.getWarnings().get(0);
        assertEquals("rulewarning.instance.unsupported.by.consumer",
            warning.getResourceKey());
    }
View Full Code Here

        Product prod = TestUtil.createProduct();
        prod.setAttribute("instance_multiplier", "2");
        Pool p = TestUtil.createPool(prod);

        ValidationResult results = enforcer.preEntitlement(c, p, 1, CallerType.BEST_POOLS);
        assertNotNull(results);
        assertEquals(0, results.getErrors().size());
        assertEquals(0, results.getWarnings().size());
    }
View Full Code Here

        Product prod = TestUtil.createProduct();
        Pool p = TestUtil.createPool(prod);
        p.setAttribute("virt_only", "true");
        p.setAttribute("pool_derived", "true");

        ValidationResult results = enforcer.preEntitlement(c, p, 1, CallerType.BIND);
        assertNotNull(results);
        assertEquals(1, results.getErrors().size());
        ValidationError error = results.getErrors().get(0);
        assertEquals("pool.not.available.to.manifest.consumers", error.getResourceKey());
    }
View Full Code Here

        Product prod = TestUtil.createProduct();
        Pool p = TestUtil.createPool(prod);
        p.setAttribute("virt_only", "true");
        p.setAttribute("pool_derived", "true");

        ValidationResult results = enforcer.preEntitlement(c, p, 1, CallerType.LIST_POOLS);
        assertNotNull(results);
        assertEquals(1, results.getErrors().size());
        ValidationError error = results.getErrors().get(0);
        assertEquals("pool.not.available.to.manifest.consumers", error.getResourceKey());
    }
View Full Code Here

TOP

Related Classes of org.candlepin.policy.ValidationResult

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.