use of co.cask.cdap.common.conf.CConfiguration in project cdap by caskdata.
the class DefaultAuthorizationEnforcerTest method testAuthenticationDisabled.
@Test
public void testAuthenticationDisabled() throws Exception {
CConfiguration cConfCopy = CConfiguration.copy(CCONF);
cConfCopy.setBoolean(Constants.Security.ENABLED, false);
verifyDisabled(cConfCopy);
}
use of co.cask.cdap.common.conf.CConfiguration in project cdap by caskdata.
the class StandaloneTester method before.
@Override
protected void before() throws Throwable {
tmpFolder.create();
CConfiguration cConf = CConfiguration.create();
cConf.set(Constants.CFG_LOCAL_DATA_DIR, tmpFolder.newFolder().getAbsolutePath());
cConf.set(Constants.Router.ADDRESS, getLocalHostname());
cConf.setInt(Constants.Router.ROUTER_PORT, Networks.getRandomPort());
cConf.setBoolean(Constants.Dangerous.UNRECOVERABLE_RESET, true);
cConf.setBoolean(Constants.Explore.EXPLORE_ENABLED, true);
cConf.setBoolean(Constants.Explore.START_ON_DEMAND, false);
cConf.setBoolean(StandaloneMain.DISABLE_UI, true);
cConf.setBoolean(Constants.Audit.ENABLED, false);
for (int i = 0; i < configs.length; i += 2) {
cConf.set(configs[i].toString(), configs[i + 1].toString());
}
this.cConf = cConf;
// Start standalone
standaloneMain = StandaloneMain.create(cConf, new Configuration());
standaloneMain.startUp();
try {
waitForStandalone();
} catch (Throwable t) {
standaloneMain.shutDown();
throw t;
}
}
use of co.cask.cdap.common.conf.CConfiguration in project cdap by caskdata.
the class EntityExistenceTest method setup.
@BeforeClass
public static void setup() throws Exception {
CConfiguration cConf = CConfiguration.create();
cConf.set(Constants.INSTANCE_NAME, EXISTS);
Injector injector = AppFabricTestHelper.getInjector(cConf);
NamespaceStore nsStore = injector.getInstance(NamespaceStore.class);
ArtifactRepository artifactRepository = injector.getInstance(ArtifactRepository.class);
cConf = injector.getInstance(CConfiguration.class);
nsStore.create(new NamespaceMeta.Builder().setName(EXISTS).build());
existenceVerifier = injector.getInstance(EntityExistenceVerifier.class);
LocalLocationFactory lf = new LocalLocationFactory(TEMPORARY_FOLDER.newFolder());
File artifactFile = new File(AppJarHelper.createDeploymentJar(lf, AllProgramsApp.class).toURI());
artifactRepository.addArtifact(ARTIFACT.toId(), artifactFile);
AppFabricTestHelper.deployApplication(NAMESPACE.toId(), AllProgramsApp.class, null, cConf);
StreamAdmin streamAdmin = injector.getInstance(StreamAdmin.class);
streamAdmin.createOrUpdateView(VIEW, new ViewSpecification(new FormatSpecification("csv", null)));
}
use of co.cask.cdap.common.conf.CConfiguration in project cdap by caskdata.
the class SystemArtifactsAuthorizationTest method setup.
@BeforeClass
public static void setup() throws Exception {
CConfiguration cConf = CConfiguration.create();
cConf.set(Constants.CFG_LOCAL_DATA_DIR, TMP_FOLDER.newFolder().getAbsolutePath());
cConf.setBoolean(Constants.Security.ENABLED, true);
cConf.setBoolean(Constants.Security.KERBEROS_ENABLED, false);
cConf.setBoolean(Constants.Security.Authorization.ENABLED, true);
cConf.setInt(Constants.Security.Authorization.CACHE_MAX_ENTRIES, 0);
Location deploymentJar = AppJarHelper.createDeploymentJar(new LocalLocationFactory(TMP_FOLDER.newFolder()), InMemoryAuthorizer.class);
cConf.set(Constants.Security.Authorization.EXTENSION_JAR_PATH, deploymentJar.toURI().getPath());
// Add a system artifact
File systemArtifactsDir = TMP_FOLDER.newFolder();
cConf.set(Constants.AppFabric.SYSTEM_ARTIFACTS_DIR, systemArtifactsDir.getAbsolutePath());
createSystemArtifact(systemArtifactsDir);
Injector injector = AppFabricTestHelper.getInjector(cConf);
artifactRepository = injector.getInstance(ArtifactRepository.class);
AuthorizerInstantiator instantiatorService = injector.getInstance(AuthorizerInstantiator.class);
authorizer = instantiatorService.get();
instance = new InstanceId(cConf.get(Constants.INSTANCE_NAME));
namespaceAdmin = injector.getInstance(NamespaceAdmin.class);
}
use of co.cask.cdap.common.conf.CConfiguration in project cdap by caskdata.
the class HBaseMetricsTableTest method setup.
@BeforeClass
public static void setup() throws Exception {
CConfiguration conf = CConfiguration.create();
conf.set(Constants.CFG_HDFS_USER, System.getProperty("user.name"));
Injector injector = Guice.createInjector(new DataFabricModules().getDistributedModules(), new ConfigModule(conf, TEST_HBASE.getConfiguration()), new ZKClientModule(), new DiscoveryRuntimeModule().getDistributedModules(), new TransactionMetricsModule(), new LocationRuntimeModule().getDistributedModules(), new NamespaceClientUnitTestModule().getModule(), new SystemDatasetRuntimeModule().getDistributedModules(), new DataSetsModules().getInMemoryModules(), new AuthorizationTestModule(), new AuthorizationEnforcementModule().getInMemoryModules(), new AuthenticationContextModules().getNoOpModule(), new AbstractModule() {
@Override
protected void configure() {
bind(UGIProvider.class).to(UnsupportedUGIProvider.class);
bind(OwnerAdmin.class).to(DefaultOwnerAdmin.class);
}
});
dsFramework = injector.getInstance(DatasetFramework.class);
tableUtil = injector.getInstance(HBaseTableUtil.class);
ddlExecutor = new HBaseDDLExecutorFactory(conf, TEST_HBASE.getHBaseAdmin().getConfiguration()).get();
ddlExecutor.createNamespaceIfNotExists(tableUtil.getHBaseNamespace(NamespaceId.SYSTEM));
}
Aggregations