Package org.candlepin.common.config

Examples of org.candlepin.common.config.Configuration


    protected Injector injector;
    private EventCurator ec;

    @Before
    public void init() {
        Configuration config = mock(Configuration.class);
        ec = mock(EventCurator.class);
        injector = Guice.createInjector(
            new CandlepinCommonTestingModule(config),
            new CandlepinNonServletEnvironmentTestingModule()
        );
View Full Code Here


            });
        }
    }

    public Configuration initConfig() {
        Configuration config = new ConfigForTesting();
        return config;
    }
View Full Code Here

                }
            });
        }
    }
    public Configuration initConfig() {
        Configuration config = new ConfigForTesting();
        return config;
    }
View Full Code Here

    private Injector injector;
    private I18n i18n;

    @Before
    public void setUp() {
        Configuration config = mock(Configuration.class);
        injector = Guice.createInjector(
            new CandlepinCommonTestingModule(config),
            new CandlepinNonServletEnvironmentTestingModule()
        );
        i18n = injector.getInstance(I18n.class);
View Full Code Here

    }

    private static class ConsumerResourceVirtEntitlementModule extends AbstractModule {
        @Override
        protected void configure() {
            Configuration config = mock(Configuration.class);
            when(config.getBoolean(ConfigProperties.STANDALONE)).thenReturn(false);
            when(config.getString(eq(ConfigProperties.CONSUMER_FACTS_MATCHER)))
                .thenReturn("^virt.*");
            when(config.getString(eq(ConfigProperties.CONSUMER_SYSTEM_NAME_PATTERN)))
                .thenReturn("[\\#\\?\\'\\`\\!@{}()\\[\\]\\?&\\w-\\.]+");
            when(config.getString(eq(ConfigProperties.CONSUMER_PERSON_NAME_PATTERN)))
                .thenReturn("[\\#\\?\\'\\`\\!@{}()\\[\\]\\?&\\w-\\.]+");
            bind(Configuration.class).toInstance(config);
            bind(Enforcer.class).to(EntitlementRules.class);
        }
View Full Code Here

    public static class StatusConfig extends JukitoModule {
        @Override
        protected void configureTest() {
            bindScope(RequestScoped.class, TestScope.EAGER_SINGLETON);

            Configuration c = new MapConfiguration();
            c.setProperty("gutterball.version", "X.Y.Z");
            bind(Configuration.class).toInstance(c);
            bind(I18n.class).toProvider(I18nProvider.class);
            bind(Status.class);
        }
View Full Code Here

        // merge the defaults with the system configuration. ORDER MATTERS.
        // system config must be read FIRST otherwise settings won't be applied.

        // merge does NOT affect systemConfig, it just returns a new object
        // not sure I like that.
        Configuration merged = PropertiesFileConfiguration.merge(systemConfig, defaults);

        log.debug("Configuration: " + merged);
        return merged;
    }
View Full Code Here

        pinsetterListener.contextDestroyed();
        loggerListener = injector.getInstance(LoggerContextListener.class);
        loggerListener.contextDestroyed();

        // if amqp is enabled, close all connections.
        Configuration config = injector.getInstance(Configuration.class);
        if (config.getBoolean(ConfigProperties.AMQP_INTEGRATION_ENABLED)) {
            Util.closeSafely(injector.getInstance(AMQPBusPublisher.class),
                "AMQPBusPublisher");
            Util.closeSafely(injector.getInstance(AMQPBusPubProvider.class),
                "AMQPBusPubProvider");
        }
View Full Code Here

TOP

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

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.