Package org.candlepin.model

Examples of org.candlepin.model.Owner


        throws EntitlementRefusedException {
        Consumer consumer = data.getConsumer();
        String[] productIds = data.getProductIds();
        Collection<String> fromPools = data.getPossiblePools();
        Date entitleDate = data.getOnDate();
        Owner owner = consumer.getOwner();

        List<Entitlement> entitlements = new LinkedList<Entitlement>();

        List<PoolQuantity> bestPools = getBestPools(consumer, productIds,
            entitleDate, owner, null, fromPools);
View Full Code Here


        if (!host.getOwner().equals(guest.getOwner())) {
            log.debug("Host " + host.getUuid() + " and guest " +
                guest.getUuid() + " have different owners.");
            return entitlements;
        }
        Owner owner = host.getOwner();

        // Use the current date if one wasn't provided:
        if (entitleDate == null) {
            entitleDate = new Date();
        }
View Full Code Here

    protected static Map<String, List<Pool>> subToPools;

    @Before
    public void init() throws Exception {
        product = TestUtil.createProduct();
        o = new Owner("key", "displayname");
        pool = TestUtil.createPool(o, product);

        when(mockConfig.getInt(eq(ConfigProperties.PRODUCT_CACHE_MAX))).thenReturn(100);
        when(eventFactory.getEventBuilder(any(Target.class), any(Type.class))).thenReturn(eventBuilder);
        when(eventBuilder.setNewEntity(any(AbstractHibernateObject.class))).thenReturn(eventBuilder);
View Full Code Here

    }

    @Test
    public void testRefreshPoolsRemovesOtherOwnerPoolsForSameSub() {
        PreUnbindHelper preHelper =  mock(PreUnbindHelper.class);
        Owner other = new Owner("otherkey", "othername");

        List<Subscription> subscriptions = Util.newList();

        Subscription sub = TestUtil.createSubscription(getOwner(),
            TestUtil.createProduct());
View Full Code Here

    public Principal get() {
        TestPrincipalProviderSetter principalSingleton = TestPrincipalProviderSetter.get();
        Principal principal = principalSingleton.getPrincipal();
        if (principal == null) {
            List<Permission> permissions = new ArrayList<Permission>();
            permissions.add(new OwnerPermission(new Owner(OWNER_NAME), Access.ALL));

            principal = new UserPrincipal("Default User", permissions, true);
        }
        return principal;
    }
View Full Code Here

     * Create a consumer with a new owner
     *
     * @return Consumer
     */
    public static Consumer createConsumer() {
        return createConsumer(createConsumerType(), new Owner("Test Owner " +
            randomInt()));
    }
View Full Code Here

        return new DerivedProvidedProduct("test-sub-provided-product-" + random,
            "Test Sub Provided Product " + random);
    }

    public static Subscription createSubscription(Product product) {
        Owner owner = new Owner("Test Owner " + randomInt());
        return createSubscription(owner, product);
    }
View Full Code Here

                2050, 1, 1), createDate(2000, 1, 1));
        return sub;
    }

    public static Pool createPool(Product product) {
        return createPool(new Owner("Test Owner " + randomInt()), product);
    }
View Full Code Here

            Arrays.asList(new Permission[]{ new OwnerPermission(owner, role) }),
            false);
    }

    public static UserPrincipal createOwnerPrincipal() {
        Owner owner = new Owner("Test Owner " + randomInt());
        return createPrincipal("someuser", owner, Access.ALL);
    }
View Full Code Here

        }
        return toReturn;
    }

    public static Entitlement createEntitlement() {
        Owner owner = new Owner("Test Owner |" + randomInt());
        owner.setId(String.valueOf(RANDOM.nextLong()));
        return createEntitlement(owner, createConsumer(owner),
            createPool(owner, createProduct()), null);
    }
View Full Code Here

TOP

Related Classes of org.candlepin.model.Owner

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.