Package org.candlepin

Examples of org.candlepin.CandlepinCommonTestingModule


    private ImportRecordJob job;

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


    @Before
    public void init() {
        Module guiceOverrideModule = getGuiceOverrideModule();
        CandlepinCommonTestConfig config = new CandlepinCommonTestConfig();
        CandlepinCommonTestingModule testingModule = new CandlepinCommonTestingModule(config);
        if (guiceOverrideModule == null) {
            injector = Guice.createInjector(testingModule,
                new CandlepinNonServletEnvironmentTestingModule());
        }
        else {
            injector = Guice.createInjector(Modules.override(testingModule)
                .with(guiceOverrideModule),
                new CandlepinNonServletEnvironmentTestingModule());
        }
        insertValidationEventListeners(injector);

        cpSingletonScope = injector.getInstance(CandlepinSingletonScope.class);
        // Because all candlepin operations are running in the CandlepinSingletonScope
        // we'll force the instance creations to be done inside the scope.
        // Exit the scope to make sure that it is clean before starting the test.
        cpSingletonScope.exit();
        cpSingletonScope.enter();

        injector.getInstance(EntityManagerFactory.class);
        emf = injector.getProvider(EntityManagerFactory.class).get();

        ownerCurator = injector.getInstance(OwnerCurator.class);
        userCurator = injector.getInstance(UserCurator.class);
        productCurator = injector.getInstance(ProductCurator.class);
        productCertificateCurator = injector
            .getInstance(ProductCertificateCurator.class);
        consumerCurator = injector.getInstance(ConsumerCurator.class);
        eventCurator = injector.getInstance(EventCurator.class);
        permissionCurator = injector.getInstance(PermissionBlueprintCurator.class);
        roleCurator = injector.getInstance(RoleCurator.class);

        consumerTypeCurator = injector.getInstance(ConsumerTypeCurator.class);
        consumerContentOverrideCurator = injector.getInstance(
            ConsumerContentOverrideCurator.class);
        activationKeyContentOverrideCurator = injector.getInstance(
            ActivationKeyContentOverrideCurator.class);
        certificateCurator = injector
            .getInstance(SubscriptionsCertificateCurator.class);
        poolCurator = injector.getInstance(PoolCurator.class);
        poolAttributeCurator = injector.getInstance(PoolAttributeCurator.class);
        productPoolAttributeCurator = injector
            .getInstance(ProductPoolAttributeCurator.class);
        entitlementCurator = injector.getInstance(EntitlementCurator.class);
        attributeCurator = injector.getInstance(ProductAttributeCurator.class);
        rulesCurator = injector.getInstance(RulesCurator.class);
        subCurator = injector.getInstance(SubscriptionCurator.class);
        activationKeyCurator = injector.getInstance(ActivationKeyCurator.class);
        contentCurator = injector.getInstance(ContentCurator.class);
        envCurator = injector.getInstance(EnvironmentCurator.class);
        envContentCurator = injector.getInstance(EnvironmentContentCurator.class);
        unitOfWork = injector.getInstance(UnitOfWork.class);

        productAdapter = injector.getInstance(ProductServiceAdapter.class);
        subAdapter = injector.getInstance(SubscriptionServiceAdapter.class);
        ownerAdapter = injector.getInstance(OwnerServiceAdapter.class);
        entCertCurator = injector
            .getInstance(EntitlementCertificateCurator.class);
        certSerialCurator = injector
            .getInstance(CertificateSerialCurator.class);
        entitlementCertService = injector
            .getInstance(EntitlementCertServiceAdapter.class);
        poolManager = injector.getInstance(CandlepinPoolManager.class);
        statisticCurator = injector.getInstance(StatisticCurator.class);
        i18n = injector.getInstance(I18n.class);
        uniqueIdGenerator = injector.getInstance(UniqueIdGenerator.class);
        ueberCertGenerator = injector.getInstance(UeberCertificateGenerator.class);
        permFactory = injector.getInstance(PermissionFactory.class);

        securityInterceptor = testingModule.securityInterceptor();

        dateSource = (DateSourceForTesting) injector
            .getInstance(DateSource.class);
        dateSource.currentDate(TestDateUtil.date(2010, 1, 1));
        serviceLevelValidator = injector.getInstance(ServiceLevelValidator.class);
View Full Code Here

    @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

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

TOP

Related Classes of org.candlepin.CandlepinCommonTestingModule

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.