@BeforeClass public static void init() throws IOException { cConf = CConfiguration.create(); cConf.set(Constants.CFG_LOCAL_DATA_DIR, TEMP_FOLDER.newFolder().getAbsolutePath()); cConf.setInt(Constants.MessagingSystem.HTTP_SERVER_CONSUME_CHUNK_SIZE, 128); // Set max life time to a high value so that dummy tx ids that we create in the tests still work cConf.setLong(TxConstants.Manager.CFG_TX_MAX_LIFETIME, 10000000000L); Injector injector = Guice.createInjector( new ConfigModule(cConf), new InMemoryDiscoveryModule(), new MessagingServerRuntimeModule().getInMemoryModules(), new AbstractModule() { @Override protected void configure() { bind(MetricsCollectionService.class).toInstance(new NoOpMetricsCollectionService()); } } ); httpService = injector.getInstance(MessagingHttpService.class); httpService.startAndWait(); client = new ClientMessagingService(injector.getInstance(DiscoveryServiceClient.class)); }
@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.setInt(Constants.Zookeeper.CFG_SESSION_TIMEOUT_MILLIS, 2000); cConf.set(Constants.CFG_LOCAL_DATA_DIR, TEMP_FOLDER.newFolder().getAbsolutePath()); cConf.set(Constants.MessagingSystem.HTTP_SERVER_BIND_ADDRESS, InetAddress.getLocalHost().getHostName()); cConf.set(Constants.MessagingSystem.SYSTEM_TOPICS, "topic"); cConf.setLong(Constants.MessagingSystem.HA_FENCING_DELAY_SECONDS, 0L); namespaceQueryAdmin = new InMemoryNamespaceAdmin(); levelDBTableFactory = new LevelDBTableFactory(cConf); }
long txGracePeriod = 6; CConfiguration cConf = CConfiguration.create(); cConf.setLong(CachingMessageTable.PRUNE_GRACE_PERIOD, txGracePeriod);
CConfiguration conf = CConfiguration.create(); conf.setInt("test.property.int", 1); conf.setLong("test.property.long", 1L); conf.set("test.property.longbytes", "1k"); conf.setFloat("test.property.float", 1.1f);