use of com.netflix.config.PolledConfigurationSource in project ff4j by ff4j.
the class PropertyStoreArchaiusPolledSourceTest method testPollInvalid.
@Test(expected = IllegalStateException.class)
public void testPollInvalid() throws Exception {
PolledConfigurationSource ff4jSource = new FF4jPolledConfigurationSource();
ff4jSource.poll(true, null);
}
use of com.netflix.config.PolledConfigurationSource in project ff4j by ff4j.
the class PropertyStoreAsArchaiusInputTest method initArchauisWithFF4j.
@BeforeClass
public static void initArchauisWithFF4j() throws InterruptedException {
// Sample FF4J Store
PropertyStore ff4jStore = new InMemoryPropertyStore("ff4j-properties.xml");
// FF4Store as polling Source for Archiaus
PolledConfigurationSource ff4jSource = new FF4jPolledConfigurationSource(ff4jStore);
// Working Thread (polling from ff4j => Archaius)
AbstractPollingScheduler scheduler = new FixedDelayPollingScheduler(0, 100, true);
// Define configuration with polling and source
DynamicConfiguration configuration = new DynamicConfiguration(ff4jSource, scheduler);
// Init configuration
ConfigurationManager.install(configuration);
// Other initialization mechanism
FF4jPolledConfigurationSource conf2 = new FF4jPolledConfigurationSource();
conf2.setFf4jStore(ff4jStore);
// Must invoke poll
Thread.sleep(100);
}
use of com.netflix.config.PolledConfigurationSource in project ff4j by ff4j.
the class PropertyStoreArchaiusPolledSourceTest method initArchauis.
@BeforeClass
public static void initArchauis() throws InterruptedException {
// Sample FF4J Store
PropertyStore ff4jStore = new InMemoryPropertyStore("ff4j-properties.xml");
// FF4Store as polling Source for Archiaus
PolledConfigurationSource ff4jSource = new FF4jPolledConfigurationSource(ff4jStore);
// Working Thread (polling from ff4j => Archaius)
AbstractPollingScheduler scheduler = new FixedDelayPollingScheduler(0, 1000, true);
// Define configuration with polling and source
configuration = new DynamicConfiguration(ff4jSource, scheduler);
}
Aggregations