Examples of PoolUpdate


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

        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);
        assertTrue(update.getOrderChanged());
        assertEquals("123", update.getPool().getContractNumber());
    }
View Full Code Here

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

        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);
        assertTrue(update.getOrderChanged());
        assertEquals("123", update.getPool().getOrderNumber());
    }
View Full Code Here

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

        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);
        assertTrue(update.getOrderChanged());
        assertEquals("123", update.getPool().getAccountNumber());
    }
View Full Code Here

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

    }

    @Test
    public void addEarlierStartDate() {
        stackedEnts.add(createEntFromPool(pool1));
        PoolUpdate update = poolRules.updatePoolFromStack(stackDerivedPool);
        assertTrue(update.changed());
        assertTrue(update.getDatesChanged());
        assertEquals(pool1.getStartDate(), stackDerivedPool.getStartDate());
        assertEquals(pool2.getEndDate(), stackDerivedPool.getEndDate());
    }
View Full Code Here

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

    @Test
    public void addLaterEndDate() {
        stackedEnts.add(createEntFromPool(pool1));
        stackedEnts.add(createEntFromPool(pool3));
        PoolUpdate update = poolRules.updatePoolFromStack(stackDerivedPool);
        assertTrue(update.changed());
        assertTrue(update.getDatesChanged());
        assertEquals(pool1.getStartDate(), stackDerivedPool.getStartDate());
        assertEquals(pool3.getEndDate(), stackDerivedPool.getEndDate());
    }
View Full Code Here

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

    @Test
    public void mergedProductAttributes() {
        stackedEnts.add(createEntFromPool(pool1));
        stackedEnts.add(createEntFromPool(pool3));
        PoolUpdate update = poolRules.updatePoolFromStack(stackDerivedPool);
        assertTrue(update.changed());
        assertTrue(update.getProductAttributesChanged());
        assertEquals(6, stackDerivedPool.getProductAttributes().size());

        assertEquals("2", stackDerivedPool.getProductAttributeValue("testattr2"));
        assertEquals("1", stackDerivedPool.getProductAttributeValue("testattr1"));
    }
View Full Code Here

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

    @Test
    public void mergedProvidedProducts() {
        stackedEnts.add(createEntFromPool(pool1));
        stackedEnts.add(createEntFromPool(pool3));
        PoolUpdate update = poolRules.updatePoolFromStack(stackDerivedPool);
        assertTrue(update.getProductsChanged());
        assertEquals(3, stackDerivedPool.getProvidedProducts().size());
        assertTrue(stackDerivedPool.getProvidedProducts().contains(
            new ProvidedProduct(provided1.getId(), provided1.getName())));
        assertTrue(stackDerivedPool.getProvidedProducts().contains(
            new ProvidedProduct(provided2.getId(), provided2.getName())));
View Full Code Here

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

        stackedEnts.add(createEntFromPool(pool3));
        poolRules.updatePoolFromStack(stackDerivedPool);

        // Should change a variety of settings on the pool.
        stackedEnts.remove(0);
        PoolUpdate update = poolRules.updatePoolFromStack(stackDerivedPool);
        assertTrue(update.changed());
        assertFalse(update.getDatesChanged());

        // Should have changed from pool2 to pool1's info:
        assertEquals(pool1.getProductId(), stackDerivedPool.getProductId());
        assertEquals(pool1.getProductName(), stackDerivedPool.getProductName());
View Full Code Here

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

        stackedEnts.add(createEntFromPool(pool3));
        poolRules.updatePoolFromStack(stackDerivedPool);

        // Should change a variety of settings on the pool.
        stackedEnts.remove(1);
        PoolUpdate update = poolRules.updatePoolFromStack(stackDerivedPool);
        assertTrue(update.changed());
        assertTrue(update.getDatesChanged());

        assertEquals(pool2.getStartDate(), stackDerivedPool.getStartDate());
        assertEquals(pool3.getEndDate(), stackDerivedPool.getEndDate());
    }
View Full Code Here

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

    public void virtLimitFromFirstVirtLimitEnt() {
        stackedEnts.clear();
        stackedEnts.add(createEntFromPool(pool1));
        stackedEnts.add(createEntFromPool(pool3));

        PoolUpdate update = poolRules.updatePoolFromStack(stackDerivedPool);
        assertTrue(update.changed());
        assertTrue(update.getQuantityChanged());
        assertEquals((Long) 2L, stackDerivedPool.getQuantity());
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.