Search in sources :

Example 16 with SimpleKey

use of org.wildfly.swarm.spi.api.config.SimpleKey in project wildfly-swarm by wildfly-swarm.

the class CompositeKeyTest method testHead.

@Test
public void testHead() {
    CompositeKey key = new CompositeKey("foo", "bar", "baz");
    assertThat(key.head()).isEqualTo(new SimpleKey("foo"));
}
Also used : CompositeKey(org.wildfly.swarm.spi.api.config.CompositeKey) SimpleKey(org.wildfly.swarm.spi.api.config.SimpleKey) Test(org.junit.Test)

Example 17 with SimpleKey

use of org.wildfly.swarm.spi.api.config.SimpleKey in project wildfly-swarm by wildfly-swarm.

the class ConfigNodeTest method testValueOf_flat.

@Test
public void testValueOf_flat() {
    ConfigNode config = new ConfigNode();
    config.child("cheese", "cheddar");
    config.child("amount", "42");
    assertThat(config.valueOf(new SimpleKey("cheese"))).isEqualTo("cheddar");
    assertThat(config.valueOf(new SimpleKey("amount"))).isEqualTo("42");
}
Also used : SimpleKey(org.wildfly.swarm.spi.api.config.SimpleKey) Test(org.junit.Test)

Example 18 with SimpleKey

use of org.wildfly.swarm.spi.api.config.SimpleKey in project wildfly-swarm by wildfly-swarm.

the class SimpleKeyTest method testSubkey.

@Test
public void testSubkey() {
    SimpleKey key = new SimpleKey("hi");
    assertThat(key.subkey(0)).isEqualTo(key);
    assertThat(key.subkey(1)).isEqualTo(ConfigKey.EMPTY);
}
Also used : SimpleKey(org.wildfly.swarm.spi.api.config.SimpleKey) Test(org.junit.Test)

Aggregations

SimpleKey (org.wildfly.swarm.spi.api.config.SimpleKey)18 ConfigKey (org.wildfly.swarm.spi.api.config.ConfigKey)10 List (java.util.List)6 Test (org.junit.Test)6 ConfigView (org.wildfly.swarm.spi.api.config.ConfigView)5 ApplicationScoped (javax.enterprise.context.ApplicationScoped)4 AfterBeanDiscovery (javax.enterprise.inject.spi.AfterBeanDiscovery)3 BeanManager (javax.enterprise.inject.spi.BeanManager)3 Interface (org.wildfly.swarm.container.Interface)3 SocketBindingGroup (org.wildfly.swarm.spi.api.SocketBindingGroup)3 CommonBean (org.wildfly.swarm.spi.api.cdi.CommonBean)3 Field (java.lang.reflect.Field)2 Method (java.lang.reflect.Method)2 ArrayList (java.util.ArrayList)2 Set (java.util.Set)2 Consumer (java.util.function.Consumer)2 Observes (javax.enterprise.event.Observes)2 Any (javax.enterprise.inject.Any)2 Instance (javax.enterprise.inject.Instance)2 Bean (javax.enterprise.inject.spi.Bean)2