use of org.apache.sling.settings.SlingSettingsService in project sling by apache.
the class RunModeImplTest method testOptions.
@org.junit.Test
public void testOptions() {
final SlingSettingsService rm = new SlingSettingsServiceImpl(new BundleContextMock("foo,bar", "a,b,c|d,e,f", null));
assertActive(rm, true, "foo", "bar", "a", "d");
assertActive(rm, false, "b", "c", "e", "f");
}
use of org.apache.sling.settings.SlingSettingsService in project sling by apache.
the class RunModeImplTest method testOptionsMultipleSelected.
@org.junit.Test
public void testOptionsMultipleSelected() {
final SlingSettingsService rm = new SlingSettingsServiceImpl(new BundleContextMock("foo,bar,c,e,f,a", "a,b,c|d,e,f", null));
assertActive(rm, true, "foo", "bar", "a", "e");
assertActive(rm, false, "b", "c", "d", "f");
}
use of org.apache.sling.settings.SlingSettingsService in project sling by apache.
the class RunModeImplTest method assertParse.
private void assertParse(String str, String[] expected) {
final SlingSettingsService rm = new SlingSettingsServiceImpl(new BundleContextMock(str, null, null));
final Set<String> modes = rm.getRunModes();
Set<String> expectedSet = new HashSet<String>(expected.length);
for (String expectedEntry : expected) {
expectedSet.add(expectedEntry);
}
assertThat("Parsed runModes match for '" + str + "'", modes, equalTo(expectedSet));
}
use of org.apache.sling.settings.SlingSettingsService in project sling by apache.
the class RunModeImplTest method testOptionsMultipleSelected2.
@org.junit.Test
public void testOptionsMultipleSelected2() {
final SlingSettingsService rm = new SlingSettingsServiceImpl(new BundleContextMock("foo,bar,c,f,a,d", "a,b,c|d,e,f", null));
assertActive(rm, true, "foo", "bar", "a", "d");
assertActive(rm, false, "b", "c", "e", "f");
}
use of org.apache.sling.settings.SlingSettingsService in project sling by apache.
the class RunModeImplTest method testMatchesNotEmpty.
@org.junit.Test
public void testMatchesNotEmpty() {
final SlingSettingsService rm = new SlingSettingsServiceImpl(new BundleContextMock("foo,bar", null, null));
assertActive(rm, true, "foo", "bar");
assertActive(rm, false, "wiz", "bah", "");
}
Aggregations