/** * Returns the {@link CConfiguration} stored inside the job {@link Configuration}. */ CConfiguration getCConf() { String conf = hConf.getRaw(HCONF_ATTR_CCONF); Preconditions.checkArgument(conf != null, "No CConfiguration available"); return CConfiguration.create(new ByteArrayInputStream(conf.getBytes(Charsets.UTF_8))); } }
public HBaseTestFactory(Object... configs) { super(CConfiguration.create()); Preconditions.checkArgument(configs.length % 2 == 0, "Arguments must be in pair form like (k1, v1, k2, v2): %s", Arrays.toString(configs)); for (int i = 0; i < configs.length; i += 2) { // Use the system properties map as a mean to communicate specific configurations to HBaseTestBase#startHBase System.setProperty(PROPERTY_PREFIX + configs[i].toString(), configs[i + 1].toString()); } }
@Override protected void configure() { bind(LaunchOptions.class).toInstance(options); bind(CConfiguration.class).toInstance(CConfiguration.create()); bind(PrintStream.class).toInstance(cliConfig.getOutput()); bind(CLIConfig.class).toInstance(cliConfig); bind(ClientConfig.class).toInstance(cliConfig.getClientConfig()); } }
@Override protected void configure() { bind(CConfiguration.class).toInstance(CConfiguration.create()); bind(LaunchOptions.class).toInstance(LaunchOptions.DEFAULT); bind(PrintStream.class).toInstance(System.out); bind(CLIConfig.class).toInstance(cliConfig); bind(ClientConfig.class).toInstance(cliConfig.getClientConfig()); bind(TableRenderer.class).toInstance(new CsvTableRenderer()); } });
@BeforeClass public static void setupBeforeClass() throws Exception { conf = TEST_HBASE.getConfiguration(); cConf = CConfiguration.create(); }
@BeforeClass public static void setupBeforeClass() throws Exception { conf = TEST_HBASE.getConfiguration(); cConf = CConfiguration.create(); }
@BeforeClass public static void setupBeforeClass() throws Exception { conf = TEST_HBASE.getConfiguration(); cConf = CConfiguration.create(); }
@BeforeClass public static void setupBeforeClass() throws Exception { conf = TEST_HBASE.getConfiguration(); cConf = CConfiguration.create(); }
@Override protected void configure() { CConfiguration conf = CConfiguration.create(); conf.set(Constants.CFG_DATA_LEVELDB_DIR, dataDir); bind(CConfiguration.class).toInstance(conf); bind(LevelDBTableService.class).toInstance(levelDBTableService); } });
@BeforeClass public static void setupBeforeClass() throws Exception { conf = TEST_HBASE.getConfiguration(); cConf = CConfiguration.create(); }
@Test(expected = IllegalArgumentException.class) public void testMaxNotInteger() throws Exception { CConfiguration cConfiguration = CConfiguration.create(); cConfiguration.set(TxConstants.Manager.CFG_TX_MAX_TIMEOUT, "NaN"); run(cConfiguration); }
@Test(expected = IllegalArgumentException.class) public void testDefaultNotInteger() throws Exception { CConfiguration cConfiguration = CConfiguration.create(); cConfiguration.set(TxConstants.Manager.CFG_TX_TIMEOUT, "NaN"); run(cConfiguration); }
@Test(expected = IllegalArgumentException.class) public void testMaxNotConfigured() throws Exception { CConfiguration cConfiguration = CConfiguration.create(); cConfiguration.unset(TxConstants.Manager.CFG_TX_MAX_TIMEOUT); run(cConfiguration); }
private static CConfiguration createCConf() throws IOException { CConfiguration cConf = CConfiguration.create(); cConf.setBoolean(Constants.Security.ENABLED, true); cConf.setBoolean(Constants.Security.Authorization.ENABLED, true); // we only want to test authorization, but we don't specify principal/keytab, so disable kerberos cConf.setBoolean(Constants.Security.KERBEROS_ENABLED, false); cConf.setInt(Constants.Security.Authorization.CACHE_MAX_ENTRIES, 0); LocationFactory locationFactory = new LocalLocationFactory(new File(TEMPORARY_FOLDER.newFolder().toURI())); Location authorizerJar = AppJarHelper.createDeploymentJar(locationFactory, InMemoryAuthorizer.class); cConf.set(Constants.Security.Authorization.EXTENSION_JAR_PATH, authorizerJar.toURI().getPath()); return cConf; }
@Test public void testAuthenticationDisabled() throws Exception { CConfiguration cConf = CConfiguration.create(); cConf.setBoolean(Constants.Security.ENABLED, false); cConf.setBoolean(Constants.Security.Authorization.ENABLED, true); testDisabled(cConf, FeatureDisabledException.Feature.AUTHENTICATION, Constants.Security.ENABLED); }
@BeforeClass public static void setup() throws Exception { CConfiguration cConf = CConfiguration.create(); cConf.set(Constants.CFG_LOCAL_DATA_DIR, TMP_FOLDER.newFolder().getAbsolutePath()); classLoaderFactory = new ArtifactClassLoaderFactory(cConf, new DummyProgramRunnerFactory()); artifactInspector = new ArtifactInspector(cConf, classLoaderFactory); }
@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)); }
@BeforeClass public static void init() throws IOException { zkServer = InMemoryZKServer.builder().setDataDir(TMP_FOLDER.newFolder()).build(); zkServer.startAndWait(); CConfiguration cConf = CConfiguration.create(); cConf.set(Constants.Zookeeper.QUORUM, zkServer.getConnectionStr()); Injector injector = Guice.createInjector(new ConfigModule(cConf), new ZKClientModule()); zkClientService = injector.getInstance(ZKClientService.class); zkClientService.startAndWait(); }
@BeforeClass public static void init() throws IOException { zkServer = InMemoryZKServer.builder().setDataDir(TEMP_FOLDER.newFolder()).build(); zkServer.startAndWait(); cConf = CConfiguration.create(); cConf.set(Constants.Zookeeper.QUORUM, zkServer.getConnectionStr()); cConf.set(Constants.CFG_LOCAL_DATA_DIR, TEMP_FOLDER.newFolder().getAbsolutePath()); }