Package org.candlepin.model

Examples of org.candlepin.model.ProductPoolAttribute


    public void testArchitectureMismatch() {
        Consumer c = mockConsumer(PRODUCT_1, PRODUCT_2);
        c.setFact("uname.machine", "x86_64");
        List<Entitlement> ents = new LinkedList<Entitlement>();
        ents.add(mockEntitlement(c, "Awesome Product", PRODUCT_1));
        ents.get(0).getPool().addProductAttribute(new ProductPoolAttribute("arch",
            "PPC64", "Awesome Product"));
        ents.add(mockEntitlement(c, "Awesome Product", PRODUCT_2));
        ents.get(1).getPool().addProductAttribute(new ProductPoolAttribute("arch",
            "x86_64", "Awesome Product"));
        mockEntCurator(c, ents);

        ComplianceStatus status = compliance.getStatus(c, TestUtil.createDate(2011, 8, 30));
View Full Code Here


    public void testMultiArchitectureMatch() {
        Consumer c = mockConsumer(PRODUCT_1, PRODUCT_2);
        c.setFact("uname.machine", "x86_64");
        List<Entitlement> ents = new LinkedList<Entitlement>();
        ents.add(mockEntitlement(c, "Awesome Product", PRODUCT_1));
        ents.get(0).getPool().addProductAttribute(new ProductPoolAttribute("arch",
            "PPC64,x86_64", "Awesome Product"));
        ents.add(mockEntitlement(c, "Awesome Product", PRODUCT_2));
        ents.get(1).getPool().addProductAttribute(new ProductPoolAttribute("arch",
            "x86_64", "Awesome Product"));
        mockEntCurator(c, ents);

        ComplianceStatus status = compliance.getStatus(c, TestUtil.createDate(2011, 8, 30));
View Full Code Here

    @Test
    public void regularEntButLackingSocketCoverage() {
        Consumer c = mockConsumer(PRODUCT_1);
        List<Entitlement> ents = new LinkedList<Entitlement>();
        ents.add(mockEntitlement(c, "Awesome Product", PRODUCT_1));
        ents.get(0).getPool().addProductAttribute(new ProductPoolAttribute("sockets",
            "4", PRODUCT_1));
        ents.get(0).setQuantity(1000); // quantity makes no difference outside stacking
        mockEntCurator(c, ents);

        ComplianceStatus status = compliance.getStatus(c, TestUtil.createDate(2011, 8, 30));
View Full Code Here

        Consumer c = mockConsumer(PRODUCT_1);
        List<Entitlement> ents = new LinkedList<Entitlement>();

        // One entitlement that only provides four sockets:
        ents.add(mockEntitlement(c, "Awesome Product", PRODUCT_1));
        ents.get(0).getPool().addProductAttribute(new ProductPoolAttribute("sockets",
            "4", PRODUCT_1));

        // One entitlement that provides ten sockets:
        ents.add(mockEntitlement(c, "Awesome Product", PRODUCT_1));
        ents.get(1).getPool().addProductAttribute(new ProductPoolAttribute("sockets",
            "10", PRODUCT_1));
        mockEntCurator(c, ents);

        ComplianceStatus status = compliance.getStatus(c, TestUtil.createDate(2011, 8, 30));
View Full Code Here

        Consumer c = mockConsumer(PRODUCT_1);
        List<Entitlement> ents = new LinkedList<Entitlement>();

        // One entitlement that only provides four sockets:
        ents.add(mockEntitlement(c, "Awesome Product", PRODUCT_1));
        ents.get(0).getPool().addProductAttribute(new ProductPoolAttribute("sockets",
            "4", PRODUCT_1));

        // One entitlement that provides 6 sockets:
        ents.add(mockEntitlement(c, "Awesome Product", PRODUCT_1));
        ents.get(1).getPool().addProductAttribute(new ProductPoolAttribute("sockets",
            "6", PRODUCT_1));
        mockEntCurator(c, ents);

        ComplianceStatus status = compliance.getStatus(c, TestUtil.createDate(2011, 8, 30));
View Full Code Here

            PRODUCT_1));
        ents.add(mockStackedEntitlement(c, STACK_ID_1, "Awesome Product",
            PRODUCT_1));
        ents.add(mockStackedEntitlement(c, STACK_ID_1, "Awesome Product",
            PRODUCT_1));
        ents.get(0).getPool().addProductAttribute(new
            ProductPoolAttribute("arch", "x86_64", "Awesome Product"));
        ents.get(1).getPool().addProductAttribute(new
            ProductPoolAttribute("arch", "PPC64", "Awesome Product"));
        ents.get(2).getPool().addProductAttribute(new
            ProductPoolAttribute("arch", "x86_64", "Awesome Product"));
        ents.get(3).getPool().addProductAttribute(new
            ProductPoolAttribute("arch", "PPC64", "Awesome Product"));
        ents.get(4).getPool().addProductAttribute(new
            ProductPoolAttribute("arch", "PPC64", "Awesome Product"));
        mockEntCurator(c, ents);

        ComplianceStatus status =
            compliance.getStatus(c, TestUtil.createDate(2011, 8, 30));
View Full Code Here

        // Consumer with 8 sockets:
        Consumer c = mockConsumer(PRODUCT_1);
        List<Entitlement> ents = new LinkedList<Entitlement>();

        ents.add(mockEntitlement(c, "Awesome Product", PRODUCT_1));
        ents.get(0).getPool().addProductAttribute(new ProductPoolAttribute("sockets",
            "0", PRODUCT_1));

        mockEntCurator(c, ents);

        ComplianceStatus status = compliance.getStatus(c, TestUtil.createDate(2011, 8, 30));
View Full Code Here

        ents.add(mockStackedEntitlement(c, STACK_ID_1, "Awesome Product",
            PRODUCT_1, PRODUCT_2));
        ents.add(mockStackedEntitlement(c, STACK_ID_1, "Awesome Product",
            PRODUCT_1, PRODUCT_2));
        ents.get(0).getPool().addProductAttribute(
            new ProductPoolAttribute("arch", "x86_64", "Awesome Product"));
        ents.get(1).getPool().addProductAttribute(
            new ProductPoolAttribute("arch", "PPC64", "Awesome Product"));
        ents.get(2).getPool().addProductAttribute(
            new ProductPoolAttribute("arch", "x86_64", "Awesome Product"));
        ents.get(3).getPool().addProductAttribute(
            new ProductPoolAttribute("arch", "x86_64", "Awesome Product"));
        mockEntCurator(c, ents);

        ComplianceStatus status = compliance.getStatus(c, TestUtil.createDate(2011, 8, 30));

        assertEquals(0, status.getCompliantProducts().size());
View Full Code Here

        ents.add(mockStackedEntitlement(c, STACK_ID_1, "Awesome Product",
            PRODUCT_1));
        ents.add(mockStackedEntitlement(c, STACK_ID_1, "Awesome Product",
            PRODUCT_1));
        ents.get(0).getPool().addProductAttribute(
            new ProductPoolAttribute("arch", "x86_64", "Awesome Product"));
        ents.get(1).getPool().addProductAttribute(
            new ProductPoolAttribute("arch", "PPC64", "Awesome Product"));
        ents.get(2).getPool().addProductAttribute(
            new ProductPoolAttribute("arch", "x86_64", "Awesome Product"));
        ents.get(3).getPool().addProductAttribute(
            new ProductPoolAttribute("arch", "PPC64", "Awesome Product"));
        mockEntCurator(c, ents);

        ComplianceStatus status = compliance.getStatus(c, TestUtil.createDate(2011, 8, 30));

        assertEquals(0, status.getNonCompliantProducts().size());
View Full Code Here

    @Test
    public void virtLimitNotChangedWhenLastVirtEntIsRemovedFromStack() {
        // Remove virt_limit from pool1 so that it is not considered
        // as virt limiting.
        pool1.getProductAttributes().clear();
        pool1.getProductAttributes().add(new ProductPoolAttribute(
            "stacking_id", STACK, pool1.getProductId()));
        pool1.getProductAttributes().add(new ProductPoolAttribute(
            "testattr2", "2", pool1.getProductId()));

        stackedEnts.clear();
        stackedEnts.add(createEntFromPool(pool1));
        stackedEnts.add(createEntFromPool(pool2));
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.