You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by da...@apache.org on 2018/04/27 09:53:23 UTC
[sling-org-apache-sling-feature-analyser] 07/28: [Feature Model]
Support separate phases for reading variables
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-analyser.git
commit b8784388e897b1325711187031d74409890657f0
Author: David Bosschaert <da...@gmail.com>
AuthorDate: Fri Mar 16 12:01:14 2018 +0000
[Feature Model] Support separate phases for reading variables
Variables in the feature model must be substituted at different points in
time, depending on where they reside. Variables in the includes, bundle,
requirements and capabilities section must be substituted before the
resolver runs, as they influence the resolver result. They should not be
substituted at launch time. Other variables, such as configuration and
framework properties variables must be substituted at launch time.
---
src/test/java/org/apache/sling/feature/analyser/AnalyserTest.java | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/test/java/org/apache/sling/feature/analyser/AnalyserTest.java b/src/test/java/org/apache/sling/feature/analyser/AnalyserTest.java
index bff0af9..f2b4b95 100644
--- a/src/test/java/org/apache/sling/feature/analyser/AnalyserTest.java
+++ b/src/test/java/org/apache/sling/feature/analyser/AnalyserTest.java
@@ -28,6 +28,7 @@ import org.apache.sling.feature.support.ArtifactManager;
import org.apache.sling.feature.support.ArtifactManagerConfig;
import org.apache.sling.feature.support.FeatureUtil;
import org.apache.sling.feature.support.json.FeatureJSONReader;
+import org.apache.sling.feature.support.json.FeatureJSONReader.Phase;
import org.junit.Test;
import java.io.File;
@@ -46,7 +47,7 @@ public class AnalyserTest {
final Analyser analyser = new Analyser(scanner);
try ( final Reader reader = new InputStreamReader(AnalyserTest.class.getResourceAsStream("/feature_complete.json"),
"UTF-8") ) {
- Feature feature = FeatureJSONReader.read(reader, "feature");
+ Feature feature = FeatureJSONReader.read(reader, "feature", Phase.RESOLVE);
Application app = FeatureUtil.assembleApplication(null, ArtifactManager.getArtifactManager(new ArtifactManagerConfig()),
getTestResolver(), feature);
@@ -61,7 +62,7 @@ public class AnalyserTest {
final Analyser analyser = new Analyser(scanner);
try ( final Reader reader = new InputStreamReader(AnalyserTest.class.getResourceAsStream("/feature_incomplete.json"),
"UTF-8") ) {
- Feature feature = FeatureJSONReader.read(reader, "feature");
+ Feature feature = FeatureJSONReader.read(reader, "feature", Phase.RESOLVE);
Application app = FeatureUtil.assembleApplication(null, ArtifactManager.getArtifactManager(new ArtifactManagerConfig()),
getTestResolver(), feature);
--
To stop receiving notification emails like this one, please contact
davidb@apache.org.