Package org.candlepin.common.config

Examples of org.candlepin.common.config.MapConfiguration


            while ((n = zis.read(buf, 0, 1024)) > -1) {
                os.write(buf, 0, n);
            }
            os.flush();
            os.close();
            ObjectMapper om = SyncUtils.getObjectMapper(new MapConfiguration(
                    new HashMap<String, String>() {

                        {
                            put(ConfigProperties.FAIL_ON_UNKNOWN_IMPORT_PROPERTIES,
                                    "false");
View Full Code Here


        jcurator = mock(JobCurator.class);
        jlistener = mock(JobListener.class);
        sfactory = mock(StdSchedulerFactory.class);
        lm = mock(ListenerManager.class);

        config = new MapConfiguration(
            new HashMap<String, String>() {
                {
                    put("org.quartz.threadPool.class",
                        "org.quartz.simpl.SimpleThreadPool");
                    put("org.quartz.threadPool.threadCount", "25");
View Full Code Here

        verify(sched, atMost(2)).scheduleJob(any(JobDetail.class), any(Trigger.class));
    }

    @Test
    public void disablePinsetter() throws Exception {
        config = new MapConfiguration(
            new HashMap<String, String>() {
                {
                    put(ConfigProperties.DEFAULT_TASKS, JobCleaner.class.getName());
                    put(ConfigProperties.TASKS, StatisticHistoryTask.class.getName());
                    put(ConfigProperties.ENABLE_PINSETTER, "false");
View Full Code Here

        Map<String, String> props = new HashMap<String, String>();
        props.put(ConfigProperties.DEFAULT_TASKS, JobCleaner.class.getName());
        props.put("org.quartz.jobStore.isClustered", "true");
        props.put("pinsetter.org.candlepin.pinsetter.tasks." +
            "JobCleaner.schedule", "*/1 * * * * ?");
        Configuration config = new MapConfiguration(props);
        JobDetail jobDetail = mock(JobDetail.class);

        String crongrp = "cron group";
        Set<JobKey> jobs = new HashSet<JobKey>();
        JobKey key = jobKey("org.candlepin.pinsetter.tasks.JobCleaner");
View Full Code Here

        Map<String, String> props = new HashMap<String, String>();
        props.put(ConfigProperties.DEFAULT_TASKS, JobCleaner.class.getName());
        props.put("org.quartz.jobStore.isClustered", "true");
        props.put("pinsetter.org.candlepin.pinsetter.tasks." +
            "JobCleaner.schedule", "*/1 * * * * ?");
        Configuration config = new MapConfiguration(props);
        JobDetail jobDetail = mock(JobDetail.class);

        // Hack multiple job schedules for same job:
        String crongrp = "cron group";
        Set<JobKey> jobs = new HashSet<JobKey>();
View Full Code Here

    }

    @Test
    public void clusteredShutdown() throws Exception {

        config = new MapConfiguration(
            new HashMap<String, String>() {
                {
                    put(ConfigProperties.DEFAULT_TASKS, JobCleaner.class.getName());
                    put(ConfigProperties.TASKS, StatisticHistoryTask.class.getName());
                    put("org.quartz.jobStore.isClustered", "true");
View Full Code Here

        verify(sched, atMost(1)).shutdown();
    }

    @Test
    public void clusteredStartupWithJobs() throws Exception {
        config = new MapConfiguration(
            new HashMap<String, String>() {
                {
                    put(ConfigProperties.DEFAULT_TASKS, JobCleaner.class.getName());
                    put(ConfigProperties.TASKS, StatisticHistoryTask.class.getName());
                    put("org.quartz.jobStore.isClustered", "true");
View Full Code Here

        verify(sched, atMost(2)).scheduleJob(any(JobDetail.class), any(Trigger.class));
    }

    @Test
    public void clusteredStartupWithoutJobs() throws Exception {
        config = new MapConfiguration(
            new HashMap<String, String>() {
                {
                    put(ConfigProperties.DEFAULT_TASKS, JobCleaner.class.getName());
                    put(ConfigProperties.TASKS, StatisticHistoryTask.class.getName());
                    put("org.quartz.jobStore.isClustered", "true");
View Full Code Here

        curator = mock(OwnerCurator.class);
        serialCurator = mock(CertificateSerialCurator.class);
        idCertCurator = mock(IdentityCertificateCurator.class);
        i18n = I18nFactory.getI18n(getClass(), Locale.US, I18nFactory.FALLBACK);
        importer = new ConsumerImporter(curator, idCertCurator, i18n, serialCurator);
        mapper = SyncUtils.getObjectMapper(new MapConfiguration(
                new HashMap<String, String>() {

                    {
                        put(ConfigProperties.FAIL_ON_UNKNOWN_IMPORT_PROPERTIES,
                                "false");
View Full Code Here

    public void importHandlesUnknownPropertiesGracefully() throws Exception {

        // Override default config to error out on unknown properties:
        Map<String, String> configProps = new HashMap<String, String>();
        configProps.put(ConfigProperties.FAIL_ON_UNKNOWN_IMPORT_PROPERTIES, "false");
        mapper = SyncUtils.getObjectMapper(new MapConfiguration(configProps));

        ConsumerDto consumer =
            importer.createObject(mapper, new StringReader(
                "{\"uuid\":\"test-uuid\", \"unknown\":\"notreal\"}"));
        assertEquals("test-uuid", consumer.getUuid());
View Full Code Here

TOP

Related Classes of org.candlepin.common.config.MapConfiguration

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.