From af771506b97cf996dd7c25053c07e1cc8f9eba99 Mon Sep 17 00:00:00 2001 From: gjoranv Date: Sat, 5 Oct 2019 00:06:55 +0200 Subject: Allow duplicate bsn+version for a given set of bundles. - Set 'org.osgi.framework.bsnversion' to 'managed' - Add bundle collision/event hook to handle duplicates and their lifecycle. - Add unit tests for duplicate bundles. o Add bundle 'l1-dup' which is a duplicate of the existing 'l1', but returns a different value from its implemented class. o Add bundle 'ml-dup' that is exactly the same as 'ml' --- .../test_bundles/cert-l1-dup/.gitignore | 2 ++ jdisc_core_test/test_bundles/cert-l1-dup/pom.xml | 36 ++++++++++++++++++++++ .../com/yahoo/jdisc/bundle/l/CertificateL.java | 15 +++++++++ 3 files changed, 53 insertions(+) create mode 100644 jdisc_core_test/test_bundles/cert-l1-dup/.gitignore create mode 100644 jdisc_core_test/test_bundles/cert-l1-dup/pom.xml create mode 100644 jdisc_core_test/test_bundles/cert-l1-dup/src/main/java/com/yahoo/jdisc/bundle/l/CertificateL.java (limited to 'jdisc_core_test/test_bundles/cert-l1-dup') diff --git a/jdisc_core_test/test_bundles/cert-l1-dup/.gitignore b/jdisc_core_test/test_bundles/cert-l1-dup/.gitignore new file mode 100644 index 00000000000..3cc25b51fc4 --- /dev/null +++ b/jdisc_core_test/test_bundles/cert-l1-dup/.gitignore @@ -0,0 +1,2 @@ +/pom.xml.build +/target diff --git a/jdisc_core_test/test_bundles/cert-l1-dup/pom.xml b/jdisc_core_test/test_bundles/cert-l1-dup/pom.xml new file mode 100644 index 00000000000..b1a61bc4145 --- /dev/null +++ b/jdisc_core_test/test_bundles/cert-l1-dup/pom.xml @@ -0,0 +1,36 @@ + + + + 4.0.0 + + com.yahoo.vespa.jdisc_core + test_bundles + 7-SNAPSHOT + + cert-l1-dup + 7-SNAPSHOT + bundle + ${project.artifactId} + + + + org.apache.felix + maven-bundle-plugin + true + + + + ${project.groupId}.cert-l1 + + + com.yahoo.jdisc.bundle.l + + + + + + + diff --git a/jdisc_core_test/test_bundles/cert-l1-dup/src/main/java/com/yahoo/jdisc/bundle/l/CertificateL.java b/jdisc_core_test/test_bundles/cert-l1-dup/src/main/java/com/yahoo/jdisc/bundle/l/CertificateL.java new file mode 100644 index 00000000000..2060686ee4f --- /dev/null +++ b/jdisc_core_test/test_bundles/cert-l1-dup/src/main/java/com/yahoo/jdisc/bundle/l/CertificateL.java @@ -0,0 +1,15 @@ +// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +package com.yahoo.jdisc.bundle.l; + +import java.util.concurrent.Callable; + +/** + * @author Simon Thoresen Hult + */ +public class CertificateL implements Callable { + + @Override + public Integer call() throws Exception { + return 11; + } +} -- cgit v1.2.3