Package org.candlepin.policy.js.pool

Examples of org.candlepin.policy.js.pool.PoolUpdate


            .thenReturn(s.getProduct());
        List<Pool> existingPools = Arrays.asList(p);
        List<PoolUpdate> updates = this.poolRules.updatePools(s, existingPools);

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


        List<Pool> existingPools = Arrays.asList(p);
        List<PoolUpdate> updates = this.poolRules.updatePools(s, existingPools);

        assertEquals(1, updates.size());
        PoolUpdate update = updates.get(0);
        Pool updatedPool = update.getPool();
        assertTrue(updatedPool.hasSubProductAttribute("a"));
    }
View Full Code Here

        List<Pool> existingPools = Arrays.asList(p);
        List<PoolUpdate> updates = this.poolRules.updatePools(s, existingPools);

        assertEquals(1, updates.size());
        PoolUpdate update = updates.get(0);
        Pool updatedPool = update.getPool();
        assertTrue(updatedPool.hasProductAttribute("a"));
        assertFalse(updatedPool.hasSubProductAttribute("a"));
    }
View Full Code Here

        List<Pool> existingPools = new LinkedList<Pool>();
        existingPools.add(p);
        List<PoolUpdate> updates = this.poolRules.updatePools(s, existingPools);

        assertEquals(1, updates.size());
        PoolUpdate update = updates.get(0);
        Pool updatedPool = update.getPool();
        assertTrue(updatedPool.hasProductAttribute(testAttributeKey));
        assertEquals(expectedAttributeValue,
            updatedPool.getProductAttribute(testAttributeKey).getValue());
    }
View Full Code Here

        List<Pool> existingPools = Arrays.asList(p);
        List<PoolUpdate> updates = this.poolRules.updatePools(s, existingPools);

        assertEquals(1, updates.size());
        PoolUpdate update = updates.get(0);
        Pool updatedPool = update.getPool();
        assertTrue(updatedPool.hasSubProductAttribute("a"));
        assertEquals(newVal, updatedPool.getDerivedProductAttribute("a").getValue());
    }
View Full Code Here

        List<Pool> existingPools = Arrays.asList(p);
        List<PoolUpdate> updates = this.poolRules.updatePools(s, existingPools);

        assertEquals(1, updates.size());
        PoolUpdate update = updates.get(0);
        Pool updatedPool = update.getPool();
        assertTrue(updatedPool.hasProductAttribute("a"));
        assertEquals(newVal, updatedPool.getProductAttribute("a").getValue());
        assertFalse(updatedPool.hasSubProductAttribute("a"));
    }
View Full Code Here

        List<Pool> existingPools = new LinkedList<Pool>();
        existingPools.add(p);
        List<PoolUpdate> updates = this.poolRules.updatePools(s, existingPools);

        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

        // Now we update the sub and see if that unlimited pool gets adjusted:
        s.getProduct().setAttribute("virt_limit", "10");
        List<PoolUpdate> updates = poolRules.updatePools(s, pools);
        assertEquals(2, updates.size());

        PoolUpdate virtUpdate = updates.get(1);
        assertEquals(new Long(100), virtUpdate.getPool().getQuantity());
    }
View Full Code Here

        s.getProduct().getAttributes().clear();
        List<PoolUpdate> updates = poolRules.updatePools(s, pools);
        assertEquals(2, updates.size());

        // Regular pool should be in a sane state:
        PoolUpdate baseUpdate = updates.get(0);
        assertEquals(new Long(10), baseUpdate.getPool().getQuantity());
        assertFalse(baseUpdate.getPool().isMarkedForDelete());

        // Virt bonus pool should have quantity 0 and be flagged for cleanup:
        PoolUpdate virtUpdate = updates.get(1);
        assertEquals(new Long(0), virtUpdate.getPool().getQuantity());
        assertTrue(virtUpdate.getPool().isMarkedForDelete());
    }
View Full Code Here

        List<Pool> existingPools = new LinkedList<Pool>();
        existingPools.add(p);
        List<PoolUpdate> updates = this.poolRules.updatePools(s, existingPools);

        assertEquals(1, updates.size());
        PoolUpdate update = updates.get(0);
        assertFalse(update.getProductsChanged());
        assertFalse(update.getDatesChanged());
        assertTrue(update.getQuantityChanged());
        assertEquals(Long.valueOf(10), update.getPool().getQuantity());
    }
View Full Code Here

TOP

Related Classes of org.candlepin.policy.js.pool.PoolUpdate

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.