use of io.aklivity.zilla.runtime.engine.Configuration.PropertyDef in project zilla by aklivity.
the class ConfigurationTest method shouldSupplyDefaultShortProperty.
@Test
public void shouldSupplyDefaultShortProperty() {
ConfigurationDef configDef = new ConfigurationDef("scope");
ShortPropertyDef propertyDef = configDef.property("short.property.name", (ToShortFunction<Configuration>) c -> Short.decode("0x7fff"));
Configuration config = new Configuration();
assertEquals(Short.MAX_VALUE, propertyDef.getAsShort(config));
}
use of io.aklivity.zilla.runtime.engine.Configuration.PropertyDef in project zilla by aklivity.
the class ConfigurationTest method shouldSupplyDefaultCharProperty.
@Test
public void shouldSupplyDefaultCharProperty() {
ConfigurationDef configDef = new ConfigurationDef("scope");
CharPropertyDef propertyDef = configDef.property("char.property.name", (ToCharFunction<Configuration>) c -> 'a');
Configuration config = new Configuration();
assertEquals('a', propertyDef.getAsChar(config));
}
use of io.aklivity.zilla.runtime.engine.Configuration.PropertyDef in project zilla by aklivity.
the class ConfigurationTest method shouldSupplyDefaultDoubleProperty.
@Test
public void shouldSupplyDefaultDoubleProperty() {
ConfigurationDef configDef = new ConfigurationDef("scope");
DoublePropertyDef propertyDef = configDef.property("double.property.name", (ToDoubleFunction<Configuration>) c -> 0.1234);
Configuration config = new Configuration();
assertEquals(0.1234, propertyDef.getAsDouble(config), 0.0);
}
Aggregations