use of org.apache.ignite.internal.configuration.storage.TestConfigurationStorage in project ignite-3 by apache.
the class ConfigurationRegistryTest method testComplicatedPolymorphicConfig.
@Test
void testComplicatedPolymorphicConfig() throws Exception {
ConfigurationRegistry registry = new ConfigurationRegistry(List.of(SixthRootConfiguration.KEY), Map.of(), new TestConfigurationStorage(LOCAL), List.of(), List.of(Fourth0PolymorphicConfigurationSchema.class));
registry.start();
try {
registry.getConfiguration(SixthRootConfiguration.KEY).change(c -> c.changePoly(toFirst0Polymorphic(0)).changePolyNamed(c0 -> c0.create("1", toFirst0Polymorphic(1))).changeEntity(c0 -> c0.changePoly(toFirst0Polymorphic(2)).changePolyNamed(c1 -> c1.create("3", toFirst0Polymorphic(3)))).changeEntityNamed(c0 -> c0.create("4", c1 -> c1.changePoly(toFirst0Polymorphic(4)).changePolyNamed(c2 -> c2.create("5", toFirst0Polymorphic(5)))))).get(1, SECONDS);
} finally {
registry.stop();
}
}
use of org.apache.ignite.internal.configuration.storage.TestConfigurationStorage in project ignite-3 by apache.
the class ConfigurationRegistryTest method testValidationPolymorphicConfigurationExtensions.
@Test
void testValidationPolymorphicConfigurationExtensions() {
// There is a polymorphic extension that is missing from the schema.
assertThrows(IllegalArgumentException.class, () -> new ConfigurationRegistry(List.of(ThirdRootConfiguration.KEY), Map.of(), new TestConfigurationStorage(LOCAL), List.of(), List.of(Second0PolymorphicConfigurationSchema.class)));
// There are two polymorphic extensions with the same id.
assertThrows(IllegalArgumentException.class, () -> new ConfigurationRegistry(List.of(ThirdRootConfiguration.KEY), Map.of(), new TestConfigurationStorage(LOCAL), List.of(), List.of(First0PolymorphicConfigurationSchema.class, ErrorFirst0PolymorphicConfigurationSchema.class)));
// Check that everything is fine.
ConfigurationRegistry configRegistry = new ConfigurationRegistry(List.of(ThirdRootConfiguration.KEY, FourthRootConfiguration.KEY, FifthRootConfiguration.KEY), Map.of(), new TestConfigurationStorage(LOCAL), List.of(), List.of(First0PolymorphicConfigurationSchema.class, First1PolymorphicConfigurationSchema.class, Second0PolymorphicConfigurationSchema.class, Third0PolymorphicConfigurationSchema.class, Third1PolymorphicConfigurationSchema.class));
configRegistry.stop();
}
use of org.apache.ignite.internal.configuration.storage.TestConfigurationStorage in project ignite-3 by apache.
the class NamedListNodeTest method before.
/**
* Before each.
*/
@BeforeEach
public void before() {
storage = new TestConfigurationStorage(LOCAL);
changer = new TestConfigurationChanger(cgen, List.of(FirstConfiguration.KEY), Map.of(), storage, List.of(), List.of());
changer.start();
}
use of org.apache.ignite.internal.configuration.storage.TestConfigurationStorage in project ignite-3 by apache.
the class ConfigurationUtilTest method testCheckConfigurationTypeNoError.
@Test
void testCheckConfigurationTypeNoError() {
checkConfigurationType(List.of(LocalFirstConfiguration.KEY, LocalSecondConfiguration.KEY), new TestConfigurationStorage(LOCAL));
checkConfigurationType(List.of(DistributedFirstConfiguration.KEY, DistributedSecondConfiguration.KEY), new TestConfigurationStorage(DISTRIBUTED));
}
use of org.apache.ignite.internal.configuration.storage.TestConfigurationStorage in project ignite-3 by apache.
the class HoconConverterTest method beforeAll.
/**
* Before all.
*/
@BeforeAll
public static void beforeAll() {
registry = new ConfigurationRegistry(List.of(HoconRootConfiguration.KEY, HoconInjectedNameRootConfiguration.KEY), Map.of(), new TestConfigurationStorage(LOCAL), List.of(), List.of(HoconFirstPolymorphicInstanceConfigurationSchema.class, HoconSecondPolymorphicInstanceConfigurationSchema.class));
registry.start();
configuration = registry.getConfiguration(HoconRootConfiguration.KEY);
injectedNameRootConfig = registry.getConfiguration(HoconInjectedNameRootConfiguration.KEY);
}
Aggregations