use of org.apache.sling.caconfig.example.SimpleConfig in project sling by apache.
the class ConfigurationResolverCustomPersistence2Test method testNonExistingContentResource_Simple.
@Test
public void testNonExistingContentResource_Simple() {
SimpleConfig cfg = underTest.get(null).as(SimpleConfig.class);
assertNull(cfg.stringParam());
assertEquals(5, cfg.intParam());
assertEquals(false, cfg.boolParam());
}
use of org.apache.sling.caconfig.example.SimpleConfig in project sling by apache.
the class ConfigurationResolverCustomPersistence2Test method testConfig_Simple.
@Test
public void testConfig_Simple() {
context.build().resource("/conf/content/site1/settings/org.apache.sling.caconfig.example.SimpleConfig/jcr:content", "stringParam", "configValue1", "intParam", 111, "boolParam", true);
SimpleConfig cfg = underTest.get(site1Page1).as(SimpleConfig.class);
assertEquals("configValue1", cfg.stringParam());
assertEquals(111, cfg.intParam());
assertEquals(true, cfg.boolParam());
}
use of org.apache.sling.caconfig.example.SimpleConfig in project sling by apache.
the class ConfigurationResolverCustomPersistence2Test method testConfig_SimpleWithName.
@Test
public void testConfig_SimpleWithName() {
context.build().resource("/conf/content/site1/settings/sampleName/jcr:content", "stringParam", "configValue1.1", "intParam", 1111, "boolParam", true);
SimpleConfig cfg = underTest.get(site1Page1).name("sampleName").as(SimpleConfig.class);
assertEquals("configValue1.1", cfg.stringParam());
assertEquals(1111, cfg.intParam());
assertEquals(true, cfg.boolParam());
}
use of org.apache.sling.caconfig.example.SimpleConfig in project sling by apache.
the class ConfigurationResolverCustomPersistence2Test method testNonExistingConfig_Simple.
@Test
public void testNonExistingConfig_Simple() {
SimpleConfig cfg = underTest.get(site1Page1).as(SimpleConfig.class);
assertNull(cfg.stringParam());
assertEquals(5, cfg.intParam());
assertEquals(false, cfg.boolParam());
}
use of org.apache.sling.caconfig.example.SimpleConfig in project sling by apache.
the class ConfigurationResolverCustomPersistenceTest method testNonExistingContentResource_Simple.
@Test
public void testNonExistingContentResource_Simple() {
SimpleConfig cfg = underTest.get(null).as(SimpleConfig.class);
assertNull(cfg.stringParam());
assertEquals(5, cfg.intParam());
assertEquals(false, cfg.boolParam());
}
Aggregations