This is an automated email from the ASF dual-hosted git repository.
davidb pushed a commit to branch master
in repository
https://gitbox.apache.org/repos/asf/sling-org-apache-sling-feature-apiregions.git
The following commit(s) were added to refs/heads/master by this push:
new 6d3b2c0 Rename the sling.feature.apiregions.toglobal property to
sling.feature.apiregions.joinglobal
6d3b2c0 is described below
commit 6d3b2c01edcee4e1c4ff8377781a2e3c020b7294
Author: David Bosschaert <[email protected]>
AuthorDate: Tue Feb 12 16:43:38 2019 +0000
Rename the sling.feature.apiregions.toglobal property to
sling.feature.apiregions.joinglobal
---
.../apache/sling/feature/apiregions/impl/RegionEnforcer.java | 10 +++++-----
.../sling/feature/apiregions/impl/RegionEnforcerTest.java | 6 +++---
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git
a/src/main/java/org/apache/sling/feature/apiregions/impl/RegionEnforcer.java
b/src/main/java/org/apache/sling/feature/apiregions/impl/RegionEnforcer.java
index 456f7f4..a2dd9f8 100644
--- a/src/main/java/org/apache/sling/feature/apiregions/impl/RegionEnforcer.java
+++ b/src/main/java/org/apache/sling/feature/apiregions/impl/RegionEnforcer.java
@@ -49,7 +49,7 @@ class RegionEnforcer implements ResolverHookFactory {
public static final String GLOBAL_REGION = "global";
static final String CLASSLOADER_PSEUDO_PROTOCOL = "classloader://";
- static final String APIREGIONS_TOGLOBAL =
"sling.feature.apiregions.toglobal";
+ static final String APIREGIONS_JOINGLOBAL =
"sling.feature.apiregions.joinglobal";
static final String PROPERTIES_RESOURCE_PREFIX =
"sling.feature.apiregions.resource.";
static final String PROPERTIES_FILE_LOCATION =
"sling.feature.apiregions.location";
@@ -88,10 +88,10 @@ class RegionEnforcer implements ResolverHookFactory {
regProps.put(REGION_PACKAGE_FILENAME, regionsFile.toString());
Map<String, Set<String>> rpm = populateRegionPackageMap(regionsFile);
- String toglobal = context.getProperty(APIREGIONS_TOGLOBAL);
+ String toglobal = context.getProperty(APIREGIONS_JOINGLOBAL);
if (toglobal != null) {
- moveRegionsToGlobal(toglobal, rpm);
- regProps.put(APIREGIONS_TOGLOBAL, toglobal);
+ joinRegionsWithGlobal(toglobal, rpm);
+ regProps.put(APIREGIONS_JOINGLOBAL, toglobal);
}
enabledRegions = Collections.unmodifiableSet(new
HashSet<>(Arrays.asList(regionsProp.split(","))));
@@ -117,7 +117,7 @@ class RegionEnforcer implements ResolverHookFactory {
return Collections.unmodifiableMap(m);
}
- private void moveRegionsToGlobal(String toglobal, Map<String, Set<String>>
rpm) {
+ private void joinRegionsWithGlobal(String toglobal, Map<String,
Set<String>> rpm) {
for (String region : toglobal.split(",")) {
Set<String> packages = rpm.get(region);
if (packages == null)
diff --git
a/src/test/java/org/apache/sling/feature/apiregions/impl/RegionEnforcerTest.java
b/src/test/java/org/apache/sling/feature/apiregions/impl/RegionEnforcerTest.java
index 7cc7c8b..938f3a6 100644
---
a/src/test/java/org/apache/sling/feature/apiregions/impl/RegionEnforcerTest.java
+++
b/src/test/java/org/apache/sling/feature/apiregions/impl/RegionEnforcerTest.java
@@ -34,7 +34,7 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
-import static
org.apache.sling.feature.apiregions.impl.RegionEnforcer.APIREGIONS_TOGLOBAL;
+import static
org.apache.sling.feature.apiregions.impl.RegionEnforcer.APIREGIONS_JOINGLOBAL;
import static
org.apache.sling.feature.apiregions.impl.RegionEnforcer.BUNDLE_FEATURE_FILENAME;
import static
org.apache.sling.feature.apiregions.impl.RegionEnforcer.FEATURE_REGION_FILENAME;
import static
org.apache.sling.feature.apiregions.impl.RegionEnforcer.IDBSNVER_FILENAME;
@@ -141,11 +141,11 @@ public class RegionEnforcerTest {
}
@Test
- public void testMoveRegionsToGlobal() throws Exception {
+ public void testJoinRegionsToGlobal() throws Exception {
String e = getClass().getResource("/empty.properties").getFile();
String f = getClass().getResource("/regions2.properties").getFile();
BundleContext ctx = Mockito.mock(BundleContext.class);
-
Mockito.when(ctx.getProperty(APIREGIONS_TOGLOBAL)).thenReturn("obsolete,deprecated");
+
Mockito.when(ctx.getProperty(APIREGIONS_JOINGLOBAL)).thenReturn("obsolete,deprecated");
Mockito.when(ctx.getProperty(PROPERTIES_RESOURCE_PREFIX +
IDBSNVER_FILENAME)).thenReturn(e);
Mockito.when(ctx.getProperty(PROPERTIES_RESOURCE_PREFIX +
BUNDLE_FEATURE_FILENAME)).thenReturn(e);
Mockito.when(ctx.getProperty(PROPERTIES_RESOURCE_PREFIX +
FEATURE_REGION_FILENAME)).thenReturn(e);