Examples of addPool()


Examples of org.candlepin.model.activationkeys.ActivationKey.addPool()

        keys.add(key1);

        Product prod1 = TestUtil.createProduct();
        Pool ghost = TestUtil.createPool(owner, prod1, 5);
        ghost.setId("ghost-pool");
        key1.addPool(ghost, 10L);

        Consumer consumer = new Consumer("sys.example.com", null, null, system);
        when(entitler.bindByPool(eq(ghost.getId()), eq(consumer), eq(10)))
            .thenThrow(new ForbiddenException("fail"));
        consumerBindUtil.handleActivationKeys(consumer, keys);
View Full Code Here

Examples of org.candlepin.model.activationkeys.ActivationKey.addPool()

        keys.add(key1);

        Product prod1 = TestUtil.createProduct();
        Pool pool1 = TestUtil.createPool(owner, prod1, 5);
        pool1.setId("pool1");
        key1.addPool(pool1, 10L);
        Product prod2 = TestUtil.createProduct();
        Pool pool2 = TestUtil.createPool(owner, prod2, 5);
        pool2.setId("pool2");
        key1.addPool(pool2, 10L);
        Product prod3 = TestUtil.createProduct();
View Full Code Here

Examples of org.candlepin.model.activationkeys.ActivationKey.addPool()

        pool1.setId("pool1");
        key1.addPool(pool1, 10L);
        Product prod2 = TestUtil.createProduct();
        Pool pool2 = TestUtil.createPool(owner, prod2, 5);
        pool2.setId("pool2");
        key1.addPool(pool2, 10L);
        Product prod3 = TestUtil.createProduct();
        Pool pool3 = TestUtil.createPool(owner, prod3, 5);
        pool3.setId("pool3");
        key1.addPool(pool3, 5L);
View Full Code Here

Examples of org.candlepin.model.activationkeys.ActivationKey.addPool()

        pool2.setId("pool2");
        key1.addPool(pool2, 10L);
        Product prod3 = TestUtil.createProduct();
        Pool pool3 = TestUtil.createPool(owner, prod3, 5);
        pool3.setId("pool3");
        key1.addPool(pool3, 5L);

        Consumer consumer = new Consumer("sys.example.com", null, null, system);
        when(entitler.bindByPool(eq(pool1.getId()), eq(consumer), eq(10)))
            .thenThrow(new ForbiddenException("fail"));
        when(entitler.bindByPool(eq(pool2.getId()), eq(consumer), eq(10)))
View Full Code Here

Examples of org.candlepin.model.activationkeys.ActivationKey.addPool()

        pool2.setId("pool2");
        key1.addPool(pool2, 10L);
        Product prod3 = TestUtil.createProduct();
        Pool pool3 = TestUtil.createPool(owner, prod3, 5);
        pool3.setId("pool3");
        key2.addPool(pool3, 5L);

        Consumer consumer = new Consumer("sys.example.com", null, null, system);
        when(entitler.bindByPool(eq(pool1.getId()), eq(consumer), eq(10)))
            .thenThrow(new ForbiddenException("fail"));
        when(entitler.bindByPool(eq(pool2.getId()), eq(consumer), eq(10)))
View Full Code Here

Examples of org.candlepin.model.activationkeys.ActivationKey.addPool()

        productCurator.create(p);

        ActivationKey ak = new ActivationKey();
        Pool akpool = new Pool();
        akpool.setAttribute("physical_only", "true");
        ak.addPool(akpool, 1L);
        Page<List<Pool>> results =
            poolManager.listAvailableEntitlementPools(null, ak,
                parentSystem.getOwner(), null, null, true, true,
                new PoolFilterBuilder(), new PageRequest());
        assertEquals(4, results.getPageData().size());
View Full Code Here

Examples of org.candlepin.model.activationkeys.ActivationKey.addPool()

    }

    @Test
    public void testActivationKeyRules() {
        ActivationKey key = new ActivationKey();
        key.addPool(genPool(), new Long(1));
        key.addPool(genPool(), new Long(1));

        Pool pool = genPool();
        ValidationResult result = actKeyRules.runPreActKey(key, pool, new Long(1));
        assertTrue(result.getErrors().isEmpty());
View Full Code Here

Examples of org.candlepin.model.activationkeys.ActivationKey.addPool()

    @Test
    public void testActivationKeyRules() {
        ActivationKey key = new ActivationKey();
        key.addPool(genPool(), new Long(1));
        key.addPool(genPool(), new Long(1));

        Pool pool = genPool();
        ValidationResult result = actKeyRules.runPreActKey(key, pool, new Long(1));
        assertTrue(result.getErrors().isEmpty());
        assertTrue(result.getWarnings().isEmpty());
View Full Code Here

Examples of org.candlepin.model.activationkeys.ActivationKey.addPool()

    }

    @Test
    public void testVirtOnlyOnKeyWithPhysical() {
        ActivationKey key = new ActivationKey();
        key.addPool(genPhysOnlyPool(), new Long(1));

        Pool pool = genVirtOnlyPool();
        ValidationResult result = actKeyRules.runPreActKey(key, pool, new Long(1));
        assertTrue(result.getWarnings().isEmpty());
        assertEquals(1, result.getErrors().size());
View Full Code Here

Examples of org.candlepin.model.activationkeys.ActivationKey.addPool()

    }

    @Test
    public void testPhysicalOnlyOnKeyWithVirt() {
        ActivationKey key = new ActivationKey();
        key.addPool(genVirtOnlyPool(), new Long(1));

        Pool pool = genPhysOnlyPool();
        ValidationResult result = actKeyRules.runPreActKey(key, pool, new Long(1));
        assertTrue(result.getWarnings().isEmpty());
        assertEquals(1, result.getErrors().size());
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.