Package org.candlepin.model

Examples of org.candlepin.model.ConsumerType


        largeContentPool = new Pool();
        largeContentPool.setProductId(largeContentProduct.getId());
        largeContentPool.setProductName(largeContentProduct.getName());

        when(consumer.getType()).thenReturn(
            new ConsumerType(ConsumerType.ConsumerTypeEnum.SYSTEM));
        entitlement = new Entitlement();
        entitlement.setQuantity(new Integer(ENTITLEMENT_QUANTITY));
        entitlement.setConsumer(consumer);
        entitlement.setPool(pool);
        entitlement.setOwner(owner);
View Full Code Here


    @Test
    public void ensureV3CertIsCreatedWhenV3CapabilityPresent() throws Exception {
        Configuration mockConfig = mock(Configuration.class);

        when(consumer.getType()).thenReturn(
            new ConsumerType(ConsumerType.ConsumerTypeEnum.CANDLEPIN));

        Set<ConsumerCapability> set = new HashSet<ConsumerCapability>();
        set.add(new ConsumerCapability(consumer, "cert_v3"));
        when(consumer.getCapabilities()).thenReturn(set);
View Full Code Here

    @Test
    public void ensureV1CertIsCreatedWhenV3factNotPresent() throws Exception {
        Configuration mockConfig = mock(Configuration.class);

        when(consumer.getType()).thenReturn(
            new ConsumerType(ConsumerType.ConsumerTypeEnum.SYSTEM));

        X509V3ExtensionUtil mockV3extensionUtil = mock(X509V3ExtensionUtil.class);
        X509ExtensionUtil mockExtensionUtil = mock(X509ExtensionUtil.class);

        DefaultEntitlementCertServiceAdapter entAdapter =
View Full Code Here

    @Test
    public void ensureV3CertIsCreatedWhenHypervisor() throws Exception {
        Configuration mockConfig = mock(Configuration.class);

        when(consumer.getType()).thenReturn(
            new ConsumerType(ConsumerType.ConsumerTypeEnum.HYPERVISOR));

        X509V3ExtensionUtil mockV3extensionUtil = mock(X509V3ExtensionUtil.class);
        X509ExtensionUtil mockExtensionUtil = mock(X509ExtensionUtil.class);

        DefaultEntitlementCertServiceAdapter entAdapter =
View Full Code Here

        setupPrincipal(owner, Access.ALL);
        securityInterceptor.enable();

        Set<String> types = new HashSet<String>();
        types.add("type");
        consumerTypeCurator.create(new ConsumerType("type"));

        List<Consumer> results = ownerResource.listConsumers(
            owner.getKey(), "username", types, uuids, null, null, new PageRequest());

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

        ConsumerCapability ccc = new ConsumerCapability(c, "capability_c");
        caps.add(cca);
        caps.add(ccb);
        caps.add(ccc);
        c.setCapabilities(caps);
        ConsumerType ct = new ConsumerType();
        ct.setManifest(true);
        c.setType(ct);
        assertEquals(3, c.getCapabilities().size());

        // no capability list in update object does not change existing
        // also shows that setCapabilites can accept null and not error
View Full Code Here

    @Test
    public void consumerLastCheckin() {
        Consumer c = getFakeConsumer();
        Date now = new Date();
        c.setLastCheckin(now);
        ConsumerType ct = new ConsumerType();
        ct.setManifest(true);
        c.setType(ct);

        Consumer updated = new Consumer();
        Date then = new Date(now.getTime() + 10000L);
        updated.setLastCheckin(then);
View Full Code Here

    }

    @Test
    public void manifestConsumerVirtOnlyNoRequiresHost() {
        // create a manifest consumer
        ConsumerType type = new ConsumerType(ConsumerType.ConsumerTypeEnum.CANDLEPIN);
        consumerTypeCurator.create(type);
        Consumer c = new Consumer("test-consumer", "test-user", owner, type);
        consumerCurator.create(c);

        Consumer host = createConsumer(owner);
View Full Code Here

    }

    @Test
    public void manifestConsumerVirtOnly() {
        // create a manifest consumer
        ConsumerType type = new ConsumerType(ConsumerType.ConsumerTypeEnum.CANDLEPIN);
        consumerTypeCurator.create(type);
        Consumer c = new Consumer("test-consumer", "test-user", owner, type);
        consumerCurator.create(c);

        Consumer host = createConsumer(owner);
View Full Code Here

        compliance.getStatus(c, TestUtil.createDate(2011, 8, 30));
    }

    private Consumer mockConsumer(String ... installedProducts) {
        Consumer c = new Consumer();
        c.setType(new ConsumerType(ConsumerType.ConsumerTypeEnum.SYSTEM));
        for (String pid : installedProducts) {
            c.addInstalledProduct(new ConsumerInstalledProduct(pid, pid));
        }
        c.setFact("cpu.cpu_socket(s)", "8"); // 8 socket machine
        return c;
View Full Code Here

TOP

Related Classes of org.candlepin.model.ConsumerType

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.