Search in sources :

Example 6 with AuditModule

use of co.cask.cdap.data2.audit.AuditModule in project cdap by caskdata.

the class MetadataStoreTest method setup.

@BeforeClass
public static void setup() throws IOException {
    Injector injector = Guice.createInjector(new ConfigModule(), Modules.override(new DataSetsModules().getInMemoryModules()).with(new AbstractModule() {

        @Override
        protected void configure() {
            // Need the distributed metadata store.
            bind(MetadataStore.class).to(DefaultMetadataStore.class);
        }
    }), new LocationRuntimeModule().getInMemoryModules(), new TransactionInMemoryModule(), new SystemDatasetRuntimeModule().getInMemoryModules(), new NamespaceClientRuntimeModule().getInMemoryModules(), new AuthorizationTestModule(), new AuthorizationEnforcementModule().getInMemoryModules(), new AuthenticationContextModules().getMasterModule(), new AuditModule().getInMemoryModules());
    cConf = injector.getInstance(CConfiguration.class);
    txManager = injector.getInstance(TransactionManager.class);
    txManager.startAndWait();
    store = injector.getInstance(MetadataStore.class);
    auditPublisher = injector.getInstance(InMemoryAuditPublisher.class);
}
Also used : NamespaceClientRuntimeModule(co.cask.cdap.common.namespace.guice.NamespaceClientRuntimeModule) TransactionInMemoryModule(org.apache.tephra.runtime.TransactionInMemoryModule) ConfigModule(co.cask.cdap.common.guice.ConfigModule) AuthenticationContextModules(co.cask.cdap.security.auth.context.AuthenticationContextModules) DataSetsModules(co.cask.cdap.data.runtime.DataSetsModules) LocationRuntimeModule(co.cask.cdap.common.guice.LocationRuntimeModule) AuthorizationTestModule(co.cask.cdap.security.authorization.AuthorizationTestModule) CConfiguration(co.cask.cdap.common.conf.CConfiguration) AbstractModule(com.google.inject.AbstractModule) InMemoryAuditPublisher(co.cask.cdap.data2.audit.InMemoryAuditPublisher) Injector(com.google.inject.Injector) TransactionManager(org.apache.tephra.TransactionManager) SystemDatasetRuntimeModule(co.cask.cdap.data.runtime.SystemDatasetRuntimeModule) AuditModule(co.cask.cdap.data2.audit.AuditModule) AuthorizationEnforcementModule(co.cask.cdap.security.authorization.AuthorizationEnforcementModule) BeforeClass(org.junit.BeforeClass)

Example 7 with AuditModule

use of co.cask.cdap.data2.audit.AuditModule in project cdap by caskdata.

the class AuditPublishTest method init.

@BeforeClass
public static void init() throws Exception {
    cConf = CConfiguration.create();
    cConf.set(Constants.CFG_LOCAL_DATA_DIR, TEMP_FOLDER.newFolder().getAbsolutePath());
    Injector injector = AppFabricTestHelper.getInjector(cConf, new AuditModule().getDistributedModules());
    messagingService = injector.getInstance(MessagingService.class);
    if (messagingService instanceof Service) {
        ((Service) messagingService).startAndWait();
    }
    auditTopic = NamespaceId.SYSTEM.topic(cConf.get(Constants.Audit.TOPIC));
}
Also used : Injector(com.google.inject.Injector) MessagingService(co.cask.cdap.messaging.MessagingService) Service(com.google.common.util.concurrent.Service) AuditModule(co.cask.cdap.data2.audit.AuditModule) MessagingService(co.cask.cdap.messaging.MessagingService) BeforeClass(org.junit.BeforeClass)

Aggregations

AuditModule (co.cask.cdap.data2.audit.AuditModule)7 Injector (com.google.inject.Injector)6 BeforeClass (org.junit.BeforeClass)6 ConfigModule (co.cask.cdap.common.guice.ConfigModule)5 InMemoryAuditPublisher (co.cask.cdap.data2.audit.InMemoryAuditPublisher)5 AbstractModule (com.google.inject.AbstractModule)5 DataSetsModules (co.cask.cdap.data.runtime.DataSetsModules)4 AuthorizationEnforcementModule (co.cask.cdap.security.authorization.AuthorizationEnforcementModule)4 DiscoveryRuntimeModule (co.cask.cdap.common.guice.DiscoveryRuntimeModule)3 NonCustomLocationUnitTestModule (co.cask.cdap.common.guice.NonCustomLocationUnitTestModule)3 NamespaceQueryAdmin (co.cask.cdap.common.namespace.NamespaceQueryAdmin)3 NamespacedLocationFactory (co.cask.cdap.common.namespace.NamespacedLocationFactory)3 SystemDatasetRuntimeModule (co.cask.cdap.data.runtime.SystemDatasetRuntimeModule)3 StreamAdminModules (co.cask.cdap.data.stream.StreamAdminModules)3 ViewAdminModules (co.cask.cdap.data.view.ViewAdminModules)3 ExploreClientModule (co.cask.cdap.explore.guice.ExploreClientModule)3 AuthenticationContextModules (co.cask.cdap.security.auth.context.AuthenticationContextModules)3 AuthorizationTestModule (co.cask.cdap.security.authorization.AuthorizationTestModule)3 DefaultOwnerAdmin (co.cask.cdap.security.impersonation.DefaultOwnerAdmin)3 OwnerAdmin (co.cask.cdap.security.impersonation.OwnerAdmin)3