Package org.candlepin.config

Examples of org.candlepin.config.CandlepinCommonTestConfig


                .thenThrow(new RuntimeException());

            ConsumerResource cr = new ConsumerResource(cc, null,
                null, sa, null, null, null, i18n, null, null, null, null, null,
                null, null, null, null, null, e, null, null, null, null,
                new CandlepinCommonTestConfig(), null, null, null, consumerBindUtil);
            cr.bind("fakeConsumer", null, prodIds, null, null, null, false, null, null);
        }
        catch (Throwable t) {
            fail("Runtime exception should be caught in ConsumerResource.bind");
        }
View Full Code Here


    @Ignore("needs mock connection to test with")
    @Test
    public void connect() {
        CandlepinConnection conn = new CandlepinConnection(
            new CandlepinCommonTestConfig());
        Credentials creds = new UsernamePasswordCredentials("admin", "admin");
        OwnerClient client = conn.connect(OwnerClient.class, creds,
            "http://localhost:8080/candlepin/");
        ClientResponse<Owner> resp = client.replicateOwner("admin");
View Full Code Here

    @Ignore("needs mock connection to test with")
    @Test
    public void doesnotexist() {
        CandlepinConnection conn = new CandlepinConnection(
            new CandlepinCommonTestConfig());
        Credentials creds = new UsernamePasswordCredentials("admin", "admin");
        OwnerClient client = conn.connect(OwnerClient.class, creds,
            "http://localhost:8080/candlepin/");
        ClientResponse<Owner> resp = client.replicateOwner("doesnotexist");
View Full Code Here

    private RootResource rootResource;

    @Before
    public void setUp() {
        rootResource = new RootResource(new CandlepinCommonTestConfig());
    }
View Full Code Here

        this.consumerResource = new ConsumerResource(this.consumerCurator,
            this.consumerTypeCurator, null, this.subscriptionService, null,
            this.idCertService, null, this.i18n, this.sink, this.eventFactory, null, null,
            this.userService, null, null, null, this.ownerCurator,
            this.activationKeyCurator, null, this.complianceRules,
            this.deletedConsumerCurator, null, null, new CandlepinCommonTestConfig(),
            null, null, null, this.consumerBindUtil);

        hypervisorResource = new HypervisorResource(consumerResource,
            consumerCurator, i18n, ownerCurator);
View Full Code Here

     */
    private EventSinkImpl createEventSink(
            final ClientSessionFactory sessionFactory) throws Exception {
        HornetqEventDispatcher dispatcher =
                new HornetqEventDispatcher(mapper,
                        new CandlepinCommonTestConfig()) {

                    @Override
                    protected ClientSessionFactory createClientSessionFactory() {
                        return sessionFactory;
                    }
View Full Code Here

        assertEquals(consumer, consumerCurator.findByUser(user));
    }

    @Test
    public void testConsumerFactsFilter() {
        CandlepinCommonTestConfig config =
            (CandlepinCommonTestConfig) injector.getInstance(Configuration.class);
        String oldValue = config.getString(ConfigProperties.CONSUMER_FACTS_MATCHER);
        config.setProperty(ConfigProperties.CONSUMER_FACTS_MATCHER, "^goodkey.*");

        Consumer consumer = new Consumer("a consumer", "username", owner, consumerType);

        Map<String, String> facts = new HashMap<String, String>();
        facts.put("badkey.something", "zaz");
        facts.put("goodkey.something", "foobar");

        consumer.setFacts(facts);

        consumer = consumerCurator.create(consumer);

        assertNull(consumer.getFact("badkey.something"));
        assertEquals("foobar", consumer.getFact("goodkey.something"));

        consumer.setFact("anotherbadkey", "zippy");

        consumer = consumerCurator.update(consumer);

        assertNull(consumer.getFact("anotherbadkey"));

        config.setProperty(ConfigProperties.CONSUMER_FACTS_MATCHER, oldValue);
    }
View Full Code Here

        owner = new Owner("test-owner", "Test Owner");
        owner = ownerCurator.create(owner);
        ct = new ConsumerType(ConsumerTypeEnum.SYSTEM);
        ct = consumerTypeCurator.create(ct);

        CandlepinCommonTestConfig config =
            (CandlepinCommonTestConfig) injector.getInstance(Configuration.class);
        config.setProperty(ConfigProperties.INTEGER_FACTS,
            "system.count, system.multiplier");
        config.setProperty(ConfigProperties.NON_NEG_INTEGER_FACTS, "system.count");
    }
View Full Code Here

        when(cc.verifyAndLookupConsumer(eq("fakeConsumer"))).thenReturn(c);

        ConsumerResource cr = new ConsumerResource(cc, null, null, sa,
            null, null, null, null, null, null, null, null, null, null,
            null, null, null, null, e, null, null, null, null,
            new CandlepinCommonTestConfig(), null, null, null, consumerBindUtil);
        String dtStr = "2011-09-26T18:10:50.184081+00:00";
        Date dt = ResourceDateParser.parseDateString(dtStr);
        cr.bind("fakeConsumer", null, null, null, null, null, false, dtStr, null);
        AutobindData data = AutobindData.create(c).on(dt);
        verify(e).bindByProducts(eq(data));
View Full Code Here

        when(entitlementCurator.find(any(Serializable.class))).thenReturn(null);

        ConsumerResource consumerResource = new ConsumerResource(consumerCurator, null,
            null, null, entitlementCurator, null, null, i18n, null, null, null,
            null, null, null, null, null, null, null, null, null, null, null,
            null, new CandlepinCommonTestConfig(), null, null, null, consumerBindUtil);

        consumerResource.unbindBySerial("fake uuid",
            Long.valueOf(1234L));
    }
View Full Code Here

TOP

Related Classes of org.candlepin.config.CandlepinCommonTestConfig

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.