You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by dr...@apache.org on 2017/01/09 15:53:56 UTC
[1/2] brooklyn-dist git commit: Allow a user to add or override
deserialize configuration in karaf
Repository: brooklyn-dist
Updated Branches:
refs/heads/master c181d595a -> 97fa7dc04
Allow a user to add or override deserialize configuration in karaf
Project: http://git-wip-us.apache.org/repos/asf/brooklyn-dist/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-dist/commit/ba5c22ce
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-dist/tree/ba5c22ce
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-dist/diff/ba5c22ce
Branch: refs/heads/master
Commit: ba5c22ce599a4975cdda9ed8edcfacd58160184c
Parents: c181d59
Author: Thomas Bouron <th...@cloudsoftcorp.com>
Authored: Tue Dec 20 18:03:32 2016 +0000
Committer: Thomas Bouron <th...@cloudsoftcorp.com>
Committed: Mon Jan 9 10:01:42 2017 +0000
----------------------------------------------------------------------
.../etc/org.apache.brooklyn.classrename.cfg | 21 ++++++++++++++++++++
.../launcher/osgi/OsgiLauncherTest.java | 18 ++++++++++++++++-
2 files changed, 38 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/brooklyn-dist/blob/ba5c22ce/karaf/apache-brooklyn/src/main/resources/etc/org.apache.brooklyn.classrename.cfg
----------------------------------------------------------------------
diff --git a/karaf/apache-brooklyn/src/main/resources/etc/org.apache.brooklyn.classrename.cfg b/karaf/apache-brooklyn/src/main/resources/etc/org.apache.brooklyn.classrename.cfg
new file mode 100644
index 0000000..839eead
--- /dev/null
+++ b/karaf/apache-brooklyn/src/main/resources/etc/org.apache.brooklyn.classrename.cfg
@@ -0,0 +1,21 @@
+################################################################################
+#
+# 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.
+#
+################################################################################
+
+# This file can contains custom deserialization class mappings for the persistence state
+# Syntax should be <old-class>=<new-class>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/brooklyn-dist/blob/ba5c22ce/karaf/itest/src/test/java/org/apache/brooklyn/launcher/osgi/OsgiLauncherTest.java
----------------------------------------------------------------------
diff --git a/karaf/itest/src/test/java/org/apache/brooklyn/launcher/osgi/OsgiLauncherTest.java b/karaf/itest/src/test/java/org/apache/brooklyn/launcher/osgi/OsgiLauncherTest.java
index b825112..17035e4 100644
--- a/karaf/itest/src/test/java/org/apache/brooklyn/launcher/osgi/OsgiLauncherTest.java
+++ b/karaf/itest/src/test/java/org/apache/brooklyn/launcher/osgi/OsgiLauncherTest.java
@@ -25,14 +25,17 @@ import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.editConfi
import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.features;
import java.io.IOException;
+import java.util.Map;
import javax.inject.Inject;
import org.apache.brooklyn.KarafTestUtils;
import org.apache.brooklyn.api.mgmt.ManagementContext;
+import org.apache.brooklyn.core.mgmt.persist.DeserializingClassRenamesProvider;
import org.apache.brooklyn.test.Asserts;
import org.apache.brooklyn.test.IntegrationTest;
import org.apache.karaf.features.BootFinished;
+import org.junit.Before;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.junit.runner.RunWith;
@@ -53,7 +56,8 @@ public class OsgiLauncherTest {
private static final String TEST_KEY_RUNTIME = "test.key";
private static final String TEST_VALUE_IN_CFG = "test.cfg";
private static final String TEST_KEY_IN_CFG = "test.key.in.cfg";
-
+ private static final String TEST_CLASS_IN_CFG = "com.acme";
+ private static final String TEST_CLASS_RENAME_IN_CFG = "org.apache.brooklyn";
@Inject
@Filter(timeout = 120000)
protected ManagementContext mgmt;
@@ -70,12 +74,18 @@ public class OsgiLauncherTest {
@Filter(timeout = 120000)
BootFinished bootFinished;
+ @Before
+ public void setup() {
+ DeserializingClassRenamesProvider.reset();
+ }
+
@Configuration
public static Option[] configuration() throws Exception {
return defaultOptionsWith(
editConfigurationFilePut("etc/org.apache.brooklyn.osgilauncher.cfg", "globalBrooklynPropertiesFile", ""),
editConfigurationFilePut("etc/org.apache.brooklyn.osgilauncher.cfg", "localBrooklynPropertiesFile", ""),
editConfigurationFilePut("etc/brooklyn.cfg", TEST_KEY_IN_CFG, TEST_VALUE_IN_CFG),
+ editConfigurationFilePut("etc/org.apache.brooklyn.class-rename.cfg", TEST_CLASS_IN_CFG, TEST_CLASS_RENAME_IN_CFG),
features(KarafTestUtils.brooklynFeaturesRepository(), "brooklyn-osgi-launcher")
// Uncomment this for remote debugging the tests on port 5005
// ,KarafDistributionOption.debugConfiguration()
@@ -96,4 +106,10 @@ public class OsgiLauncherTest {
}
});
}
+
+ @Test
+ public void testClassRenameConfig() throws IOException {
+ final Map<String, String> map = DeserializingClassRenamesProvider.loadDeserializingClassRenames();
+ assertEquals(TEST_CLASS_RENAME_IN_CFG, map.get(TEST_CLASS_IN_CFG));
+ }
}
[2/2] brooklyn-dist git commit: This closes #72
Posted by dr...@apache.org.
This closes #72
Project: http://git-wip-us.apache.org/repos/asf/brooklyn-dist/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-dist/commit/97fa7dc0
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-dist/tree/97fa7dc0
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-dist/diff/97fa7dc0
Branch: refs/heads/master
Commit: 97fa7dc0438e01c6572eaef4e7e883a8b04eb995
Parents: c181d59 ba5c22c
Author: Duncan Godwin <dr...@googlemail.com>
Authored: Mon Jan 9 15:53:20 2017 +0000
Committer: Duncan Godwin <dr...@googlemail.com>
Committed: Mon Jan 9 15:53:20 2017 +0000
----------------------------------------------------------------------
.../etc/org.apache.brooklyn.classrename.cfg | 21 ++++++++++++++++++++
.../launcher/osgi/OsgiLauncherTest.java | 18 ++++++++++++++++-
2 files changed, 38 insertions(+), 1 deletion(-)
----------------------------------------------------------------------