use of io.aklivity.zilla.runtime.engine.Configuration.ConfigurationDef in project zilla by aklivity.
the class ConfigurationTest method shouldDefaultLongProperty.
@Test
public void shouldDefaultLongProperty() {
ConfigurationDef configDef = new ConfigurationDef("scope");
LongPropertyDef propertyDef = configDef.property("long.property.name", 1234L);
Configuration config = new Configuration();
assertEquals(1234L, propertyDef.getAsLong(config));
}
use of io.aklivity.zilla.runtime.engine.Configuration.ConfigurationDef in project zilla by aklivity.
the class ConfigurationTest method shouldGetFloatProperty.
@Test
public void shouldGetFloatProperty() {
System.setProperty("scope.float.property.name", Float.toString(0.1234f));
ConfigurationDef configDef = new ConfigurationDef("scope");
FloatPropertyDef propertyDef = configDef.property("float.property.name", 0.5678f);
Configuration config = new Configuration();
assertEquals(0.1234f, propertyDef.getAsFloat(config), 0.0f);
}
use of io.aklivity.zilla.runtime.engine.Configuration.ConfigurationDef 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.ConfigurationDef in project zilla by aklivity.
the class ConfigurationTest method shouldDefaultByteProperty.
@Test
public void shouldDefaultByteProperty() {
ConfigurationDef configDef = new ConfigurationDef("scope");
BytePropertyDef propertyDef = configDef.property("byte.property.name", Byte.decode("0x7f"));
Configuration config = new Configuration();
assertEquals(Byte.MAX_VALUE, propertyDef.getAsByte(config));
}
use of io.aklivity.zilla.runtime.engine.Configuration.ConfigurationDef 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));
}
Aggregations