strange case
diff --git a/features/core/src/test/java/org/apache/karaf/features/internal/region/SubsystemTest.java b/features/core/src/test/java/org/apache/karaf/features/internal/region/SubsystemTest.java
index 8984aba..b80637b 100644
--- a/features/core/src/test/java/org/apache/karaf/features/internal/region/SubsystemTest.java
+++ b/features/core/src/test/java/org/apache/karaf/features/internal/region/SubsystemTest.java
@@ -226,6 +226,49 @@
}
@Test
+ public void test2Conditionals() throws Exception {
+ RepositoryImpl repo = new RepositoryImpl(getClass().getResource("data4a/features.xml").toURI());
+
+ Map<String, Set<String>> features = new HashMap<>();
+ addToMapSet(features, "root/apps1", "f1");
+ addToMapSet(features, "root/apps1", "f2");
+ addToMapSet(features, "root/apps1", "f3");
+ Map<String, Set<String>> expected = new HashMap<>();
+ addToMapSet(expected, "root/apps1", "a/1.0.0");
+ addToMapSet(expected, "root/apps1", "b/1.0.0");
+
+ SubsystemResolver resolver = new SubsystemResolver(this.resolver, new TestDownloadManager(getClass(), "data4a"));
+ resolver.prepare(partitionByName(repo.getFeatures()),
+ features,
+ Collections.emptyMap());
+ resolver.resolve(FeaturesService.DEFAULT_FEATURE_RESOLUTION_RANGE,
+ null, null, null);
+
+ verify(resolver, expected);
+ }
+
+ @Test
+ public void test2Conditionals2() throws Exception {
+ RepositoryImpl repo = new RepositoryImpl(getClass().getResource("data4a/features.xml").toURI());
+
+ Map<String, Set<String>> features = new HashMap<>();
+ addToMapSet(features, "root/apps1", "f2");
+ addToMapSet(features, "root/apps1", "f3");
+ Map<String, Set<String>> expected = new HashMap<>();
+ // nothing should be installed
+ // addToMapSet(expected, "root/apps1", "a/1.0.0");
+
+ SubsystemResolver resolver = new SubsystemResolver(this.resolver, new TestDownloadManager(getClass(), "data4a"));
+ resolver.prepare(partitionByName(repo.getFeatures()),
+ features,
+ Collections.emptyMap());
+ resolver.resolve(FeaturesService.DEFAULT_FEATURE_RESOLUTION_RANGE,
+ null, null, null);
+
+ verify(resolver, expected);
+ }
+
+ @Test
public void testConditionalSatisfiedWithOptional() throws Exception {
RepositoryImpl repo = new RepositoryImpl(getClass().getResource("data4/features.xml").toURI());
diff --git a/features/core/src/test/resources/org/apache/karaf/features/internal/region/data4a/a.mf b/features/core/src/test/resources/org/apache/karaf/features/internal/region/data4a/a.mf
new file mode 100644
index 0000000..20a7811
--- /dev/null
+++ b/features/core/src/test/resources/org/apache/karaf/features/internal/region/data4a/a.mf
@@ -0,0 +1,5 @@
+Manifest-Version: 1
+Bundle-ManifestVersion: 2
+Bundle-SymbolicName: a
+Bundle-Version: 1.0.0
+
diff --git a/features/core/src/test/resources/org/apache/karaf/features/internal/region/data4a/b.mf b/features/core/src/test/resources/org/apache/karaf/features/internal/region/data4a/b.mf
new file mode 100644
index 0000000..dc96158
--- /dev/null
+++ b/features/core/src/test/resources/org/apache/karaf/features/internal/region/data4a/b.mf
@@ -0,0 +1,5 @@
+Manifest-Version: 1
+Bundle-ManifestVersion: 2
+Bundle-SymbolicName: b
+Bundle-Version: 1.0.0
+
diff --git a/features/core/src/test/resources/org/apache/karaf/features/internal/region/data4a/c.mf b/features/core/src/test/resources/org/apache/karaf/features/internal/region/data4a/c.mf
new file mode 100644
index 0000000..8535efa
--- /dev/null
+++ b/features/core/src/test/resources/org/apache/karaf/features/internal/region/data4a/c.mf
@@ -0,0 +1,5 @@
+Manifest-Version: 1
+Bundle-ManifestVersion: 2
+Bundle-SymbolicName: c
+Bundle-Version: 1.0.0
+
diff --git a/features/core/src/test/resources/org/apache/karaf/features/internal/region/data4a/d.mf b/features/core/src/test/resources/org/apache/karaf/features/internal/region/data4a/d.mf
new file mode 100644
index 0000000..58cf0e1
--- /dev/null
+++ b/features/core/src/test/resources/org/apache/karaf/features/internal/region/data4a/d.mf
@@ -0,0 +1,5 @@
+Manifest-Version: 1
+Bundle-ManifestVersion: 2
+Bundle-SymbolicName: d
+Bundle-Version: 1.0.0
+
diff --git a/features/core/src/test/resources/org/apache/karaf/features/internal/region/data4a/features.xml b/features/core/src/test/resources/org/apache/karaf/features/internal/region/data4a/features.xml
new file mode 100644
index 0000000..80e0363
--- /dev/null
+++ b/features/core/src/test/resources/org/apache/karaf/features/internal/region/data4a/features.xml
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
+<features name="test" xmlns="http://karaf.apache.org/xmlns/features/v1.3.0">
+
+ <feature name="f1">
+ <bundle>a</bundle>
+ <conditional>
+ <condition>f2</condition>
+ <condition>f3</condition>
+ <bundle>b</bundle>
+ </conditional>
+ <conditional>
+ <condition>f2</condition>
+ <condition>f4</condition>
+ <bundle>c</bundle>
+ </conditional>
+ </feature>
+
+ <feature name="f2">
+ <feature dependency="true">f4</feature>
+ <requirement>xns</requirement>
+ </feature>
+ <feature name="f3">
+ <capability>xns; xns:=f3</capability>
+ </feature>
+ <feature name="f4">
+ <capability>xns; xns:=f4</capability>
+ <bundle>d</bundle>
+ </feature>
+
+</features>