use of io.aklivity.zilla.runtime.engine.Configuration.PropertyDef in project zilla by aklivity.
the class ConfigurationTest method shouldSupplyDefaultFloatProperty.
@Test
public void shouldSupplyDefaultFloatProperty() {
ConfigurationDef configDef = new ConfigurationDef("scope");
FloatPropertyDef propertyDef = configDef.property("float.property.name", (ToFloatFunction<Configuration>) c -> 0.1234f);
Configuration config = new Configuration();
assertEquals(0.1234f, propertyDef.getAsFloat(config), 0.0f);
}
use of io.aklivity.zilla.runtime.engine.Configuration.PropertyDef in project zilla by aklivity.
the class ConfigurationTest method shouldSupplyDefaultIntegerProperty.
@Test
public void shouldSupplyDefaultIntegerProperty() {
ConfigurationDef configDef = new ConfigurationDef("scope");
IntPropertyDef propertyDef = configDef.property("integer.property.name", (ToIntFunction<Configuration>) c -> 1234);
Configuration config = new Configuration();
assertEquals(1234, propertyDef.getAsInt(config));
}
use of io.aklivity.zilla.runtime.engine.Configuration.PropertyDef in project zilla by aklivity.
the class ConfigurationTest method shouldSupplyDefaultBooleanProperty.
@Test
public void shouldSupplyDefaultBooleanProperty() {
ConfigurationDef configDef = new ConfigurationDef("scope");
BooleanPropertyDef propertyDef = configDef.property("boolean.property.name", (Predicate<Configuration>) c -> true);
Configuration config = new Configuration();
assertTrue(propertyDef.getAsBoolean(config));
}
use of io.aklivity.zilla.runtime.engine.Configuration.PropertyDef in project zilla by aklivity.
the class ConfigurationTest method shouldSupplyDefaultLongProperty.
@Test
public void shouldSupplyDefaultLongProperty() {
ConfigurationDef configDef = new ConfigurationDef("scope");
LongPropertyDef propertyDef = configDef.property("long.property.name", (ToLongFunction<Configuration>) c -> 1234L);
Configuration config = new Configuration();
assertEquals(1234L, propertyDef.getAsLong(config));
}
use of io.aklivity.zilla.runtime.engine.Configuration.PropertyDef in project zilla by aklivity.
the class ConfigurationTest method shouldSupplyDefaultByteProperty.
@Test
public void shouldSupplyDefaultByteProperty() {
ConfigurationDef configDef = new ConfigurationDef("scope");
BytePropertyDef propertyDef = configDef.property("byte.property.name", (ToByteFunction<Configuration>) c -> Byte.decode("0x7f"));
Configuration config = new Configuration();
assertEquals(Byte.MAX_VALUE, propertyDef.getAsByte(config));
}
Aggregations