karaf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anierb...@apache.org
Subject git commit: [KARAF-3212] - karaf.data variable not correctly resolved while installing the pax-http feature
Date Tue, 09 Sep 2014 20:01:50 GMT
Repository: karaf
Updated Branches:
  refs/heads/master 1343e7179 -> 1a40cf90f


[KARAF-3212] - karaf.data variable not correctly resolved while
installing the pax-http feature

Project: http://git-wip-us.apache.org/repos/asf/karaf/repo
Commit: http://git-wip-us.apache.org/repos/asf/karaf/commit/1a40cf90
Tree: http://git-wip-us.apache.org/repos/asf/karaf/tree/1a40cf90
Diff: http://git-wip-us.apache.org/repos/asf/karaf/diff/1a40cf90

Branch: refs/heads/master
Commit: 1a40cf90f5495719e41bada15dab44eecbe26330
Parents: 1343e71
Author: anierbeck <bcanhome@googlemail.com>
Authored: Tue Sep 9 22:01:34 2014 +0200
Committer: anierbeck <bcanhome@googlemail.com>
Committed: Tue Sep 9 22:01:34 2014 +0200

----------------------------------------------------------------------
 .../karaf/features/internal/model/Config.java   |  1 +
 .../org/apache/karaf/features/AppendTest.java   | 48 ++++++++++++++++++++
 .../karaf/features/internal/service/f08.xml     | 28 ++++++++++++
 .../webconsole/features/ExtendedFeature.java    |  1 -
 4 files changed, 77 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/karaf/blob/1a40cf90/features/core/src/main/java/org/apache/karaf/features/internal/model/Config.java
----------------------------------------------------------------------
diff --git a/features/core/src/main/java/org/apache/karaf/features/internal/model/Config.java
b/features/core/src/main/java/org/apache/karaf/features/internal/model/Config.java
index dcd3d59..de5bc6e 100644
--- a/features/core/src/main/java/org/apache/karaf/features/internal/model/Config.java
+++ b/features/core/src/main/java/org/apache/karaf/features/internal/model/Config.java
@@ -124,6 +124,7 @@ public class Config implements ConfigInfo{
 		} catch (IOException e) {
 			// ignore??
 		}
+		interpolation(props);
 		return props;
 	}
 

http://git-wip-us.apache.org/repos/asf/karaf/blob/1a40cf90/features/core/src/test/java/org/apache/karaf/features/AppendTest.java
----------------------------------------------------------------------
diff --git a/features/core/src/test/java/org/apache/karaf/features/AppendTest.java b/features/core/src/test/java/org/apache/karaf/features/AppendTest.java
new file mode 100644
index 0000000..462a4fd
--- /dev/null
+++ b/features/core/src/test/java/org/apache/karaf/features/AppendTest.java
@@ -0,0 +1,48 @@
+/*
+ * 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.
+ */
+package org.apache.karaf.features;
+
+import java.util.Properties;
+
+import junit.framework.TestCase;
+import org.apache.karaf.features.internal.service.RepositoryImpl;
+
+public class AppendTest extends TestCase {
+
+	public void testLoad() throws Exception {
+		System.setProperty("karaf.data", "data");
+
+		RepositoryImpl r = new RepositoryImpl(getClass().getResource("internal/f08.xml").toURI());
+		// Check repo
+		Feature[] features = r.getFeatures();
+		assertNotNull(features);
+		assertEquals(1, features.length);
+		Feature feature = features[0];
+
+		ConfigInfo configInfo = feature.getConfigurations().get(0);
+		assertNotNull(configInfo);
+		assertTrue(configInfo.isAppend());
+
+		Properties properties = configInfo.getProperties();
+		assertNotNull(properties);
+		String property = properties
+				.getProperty("javax.servlet.context.tempdir");
+		assertNotNull(property);
+		assertFalse(property.contains("${"));
+
+	}
+}

http://git-wip-us.apache.org/repos/asf/karaf/blob/1a40cf90/features/core/src/test/resources/org/apache/karaf/features/internal/service/f08.xml
----------------------------------------------------------------------
diff --git a/features/core/src/test/resources/org/apache/karaf/features/internal/service/f08.xml
b/features/core/src/test/resources/org/apache/karaf/features/internal/service/f08.xml
new file mode 100644
index 0000000..802ce1e
--- /dev/null
+++ b/features/core/src/test/resources/org/apache/karaf/features/internal/service/f08.xml
@@ -0,0 +1,28 @@
+<?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="karaf" xmlns="http://karaf.apache.org/xmlns/features/v1.2.1">
+    <feature name="http" version="2.0.0" >
+        <feature version="[${pax.web.version},5)">pax-http</feature>
+        <config name="org.ops4j.pax.web" append="true">
+            javax.servlet.context.tempdir=${karaf.data}/pax-web-jsp
+        </config>
+        <bundle start-level="30">mvn:org.apache.karaf.http/org.apache.karaf.http.core/${project.version}</bundle>
+        <bundle start-level="30">mvn:org.apache.karaf.http/org.apache.karaf.http.command/${project.version}</bundle>
+    </feature>
+</features>
+

http://git-wip-us.apache.org/repos/asf/karaf/blob/1a40cf90/webconsole/features/src/main/java/org/apache/karaf/webconsole/features/ExtendedFeature.java
----------------------------------------------------------------------
diff --git a/webconsole/features/src/main/java/org/apache/karaf/webconsole/features/ExtendedFeature.java
b/webconsole/features/src/main/java/org/apache/karaf/webconsole/features/ExtendedFeature.java
index 5e97cb4..695a10d 100644
--- a/webconsole/features/src/main/java/org/apache/karaf/webconsole/features/ExtendedFeature.java
+++ b/webconsole/features/src/main/java/org/apache/karaf/webconsole/features/ExtendedFeature.java
@@ -59,7 +59,6 @@ public class ExtendedFeature implements Feature {
 
     @Override
     public List<ConfigInfo> getConfigurations() {
-//    public Map<String, Map<String, String>> getConfigurations() {
         return this.feature.getConfigurations();
     }
 


Mime
View raw message