Search in sources :

Example 11 with SlingSettingsService

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");
}
Also used : SlingSettingsService(org.apache.sling.settings.SlingSettingsService)

Example 12 with SlingSettingsService

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");
}
Also used : SlingSettingsService(org.apache.sling.settings.SlingSettingsService)

Example 13 with SlingSettingsService

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));
}
Also used : SlingSettingsService(org.apache.sling.settings.SlingSettingsService) HashSet(java.util.HashSet)

Example 14 with SlingSettingsService

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");
}
Also used : SlingSettingsService(org.apache.sling.settings.SlingSettingsService)

Example 15 with SlingSettingsService

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", "");
}
Also used : SlingSettingsService(org.apache.sling.settings.SlingSettingsService)

Aggregations

SlingSettingsService (org.apache.sling.settings.SlingSettingsService)24 Test (org.junit.Test)7 URL (java.net.URL)3 HashSet (java.util.HashSet)3 Attributes (java.util.jar.Attributes)2 JarFile (java.util.jar.JarFile)2 Manifest (java.util.jar.Manifest)2 ZipEntry (java.util.zip.ZipEntry)2 ZipInputStream (java.util.zip.ZipInputStream)2 OsgiInstaller (org.apache.sling.installer.api.OsgiInstaller)2 RegisteredResource (org.apache.sling.installer.api.tasks.RegisteredResource)2 TransformationResult (org.apache.sling.installer.api.tasks.TransformationResult)2 DeleteOnCloseFileInputStream (org.apache.sling.installer.factories.subsystems.base.impl.SubsystemBaseTransformer.DeleteOnCloseFileInputStream)2 Dictionary (java.util.Dictionary)1 Hashtable (java.util.Hashtable)1 Set (java.util.Set)1 ResourceResolverFactory (org.apache.sling.api.resource.ResourceResolverFactory)1 ResourceChange (org.apache.sling.api.resource.observation.ResourceChange)1 DiscoveryService (org.apache.sling.discovery.DiscoveryService)1 LaunchpadContentProvider (org.apache.sling.launchpad.api.LaunchpadContentProvider)1