diff --git a/core/pom.xml b/core/pom.xml
index ca514b88..1f2a1f39 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -5,7 +5,7 @@
gemini-blueprint
org.eclipse.gemini.blueprint
- 3.0.0.M01-SNAPSHOT
+ 4.0.0-atlassian-5-SNAPSHOT
../pom.xml
@@ -36,43 +36,38 @@
test
- org.apache.servicemix.bundles
- org.apache.servicemix.bundles.spring-aop
+ org.springframework
+ spring-aop
- org.apache.servicemix.bundles
- org.apache.servicemix.bundles.spring-beans
+ org.springframework
+ spring-beans
- org.apache.servicemix.bundles
- org.apache.servicemix.bundles.spring-context
+ org.springframework
+ spring-context
- org.apache.servicemix.bundles
- org.apache.servicemix.bundles.spring-core
+ org.springframework
+ spring-core
- org.apache.servicemix.bundles
- org.apache.servicemix.bundles.spring-expression
+ org.springframework
+ spring-expression
- org.apache.servicemix.bundles
- org.apache.servicemix.bundles.spring-test
+ org.springframework
+ spring-test
test
-
- org.apache.servicemix.bundles
- org.apache.servicemix.bundles.aopalliance
- provided
-
org.osgi
- org.osgi.core
+ osgi.core
provided
org.osgi
- org.osgi.compendium
+ osgi.cmpn
provided
diff --git a/core/src/main/java/org/eclipse/gemini/blueprint/blueprint/container/SpringBlueprintConverterService.java b/core/src/main/java/org/eclipse/gemini/blueprint/blueprint/container/SpringBlueprintConverterService.java
index abd031ec..637340b6 100644
--- a/core/src/main/java/org/eclipse/gemini/blueprint/blueprint/container/SpringBlueprintConverterService.java
+++ b/core/src/main/java/org/eclipse/gemini/blueprint/blueprint/container/SpringBlueprintConverterService.java
@@ -14,15 +14,11 @@
package org.eclipse.gemini.blueprint.blueprint.container;
-import java.security.AccessControlContext;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import org.eclipse.gemini.blueprint.blueprint.container.support.BlueprintEditorRegistrar;
-import org.eclipse.gemini.blueprint.context.support.internal.security.SecurityUtils;
import org.osgi.service.blueprint.container.Converter;
import org.osgi.service.blueprint.container.ReifiedType;
import org.springframework.beans.SimpleTypeConverter;
@@ -93,19 +89,7 @@ public Object convert(final Object source, TypeDescriptor sourceType, TypeDescri
return source;
final ReifiedType type = TypeFactory.getType(targetType);
- boolean hasSecurity = (System.getSecurityManager() != null);
- AccessControlContext acc = (hasSecurity ? SecurityUtils.getAccFrom(cbf) : null);
- Object result;
-
- if (hasSecurity) {
- result = AccessController.doPrivileged(new PrivilegedAction
- org.apache.servicemix.bundles
- org.apache.servicemix.bundles.spring-beans
+ org.springframework
+ spring-beans
- org.apache.servicemix.bundles
- org.apache.servicemix.bundles.spring-core
+ org.springframework
+ spring-core
- org.apache.servicemix.bundles
- org.apache.servicemix.bundles.spring-context
+ org.springframework
+ spring-context
-
- org.apache.servicemix.bundles
- org.apache.servicemix.bundles.aopalliance
- test
-
org.osgi
- org.osgi.core
+ osgi.core
provided
org.osgi
- org.osgi.compendium
+ osgi.cmpn
provided
diff --git a/extender/src/main/java/org/eclipse/gemini/blueprint/extender/event/BootstrappingDependenciesEvent.java b/extender/src/main/java/org/eclipse/gemini/blueprint/extender/event/BootstrappingDependenciesEvent.java
index 2a4e041b..a4a2bf4e 100644
--- a/extender/src/main/java/org/eclipse/gemini/blueprint/extender/event/BootstrappingDependenciesEvent.java
+++ b/extender/src/main/java/org/eclipse/gemini/blueprint/extender/event/BootstrappingDependenciesEvent.java
@@ -53,7 +53,7 @@ public class BootstrappingDependenciesEvent extends OsgiBundleApplicationContext
public BootstrappingDependenciesEvent(ApplicationContext source, Bundle bundle,
Collection nestedEvents, Filter filter, long timeLeft) {
super(source, bundle);
- Assert.notNull(nestedEvents);
+ Assert.notNull(nestedEvents, "required field");
this.dependencyEvents = nestedEvents;
this.dependenciesFilter = filter;
this.timeLeft = timeLeft;
diff --git a/extender/src/main/java/org/eclipse/gemini/blueprint/extender/event/BootstrappingDependencyEvent.java b/extender/src/main/java/org/eclipse/gemini/blueprint/extender/event/BootstrappingDependencyEvent.java
index f14b2219..ad67c892 100644
--- a/extender/src/main/java/org/eclipse/gemini/blueprint/extender/event/BootstrappingDependencyEvent.java
+++ b/extender/src/main/java/org/eclipse/gemini/blueprint/extender/event/BootstrappingDependencyEvent.java
@@ -43,7 +43,7 @@ public class BootstrappingDependencyEvent extends OsgiBundleApplicationContextEv
*/
public BootstrappingDependencyEvent(ApplicationContext source, Bundle bundle, OsgiServiceDependencyEvent nestedEvent) {
super(source, bundle);
- Assert.notNull(nestedEvent);
+ Assert.notNull(nestedEvent, "required field");
this.dependencyEvent = nestedEvent;
}
diff --git a/extender/src/main/java/org/eclipse/gemini/blueprint/extender/internal/activator/LifecycleManager.java b/extender/src/main/java/org/eclipse/gemini/blueprint/extender/internal/activator/LifecycleManager.java
index 406c298f..9dda37ad 100644
--- a/extender/src/main/java/org/eclipse/gemini/blueprint/extender/internal/activator/LifecycleManager.java
+++ b/extender/src/main/java/org/eclipse/gemini/blueprint/extender/internal/activator/LifecycleManager.java
@@ -26,7 +26,6 @@
import org.eclipse.gemini.blueprint.extender.internal.support.ExtenderConfiguration;
import org.eclipse.gemini.blueprint.extender.internal.support.OsgiBeanFactoryPostProcessorAdapter;
import org.eclipse.gemini.blueprint.extender.internal.util.concurrent.Counter;
-import org.eclipse.gemini.blueprint.extender.internal.util.concurrent.RunnableTimedExecution;
import org.eclipse.gemini.blueprint.extender.support.ApplicationContextConfiguration;
import org.eclipse.gemini.blueprint.util.OsgiBundleUtils;
import org.eclipse.gemini.blueprint.util.OsgiStringUtils;
@@ -135,7 +134,7 @@ protected void maybeCreateApplicationContextFor(Bundle bundle) {
boolean debug = log.isDebugEnabled();
String bundleString = "[" + OsgiStringUtils.nullSafeNameAndSymName(bundle) + "]";
- final Long bundleId = new Long(bundle.getBundleId());
+ final Long bundleId = bundle.getBundleId();
if (managedContexts.containsKey(bundleId)) {
if (debug) {
@@ -418,9 +417,9 @@ public String toString() {
public ConfigurableOsgiBundleApplicationContext getManagedContext(Bundle bundle) {
ConfigurableOsgiBundleApplicationContext context = null;
try {
- Long id = new Long(bundle.getBundleId());
- context = (ConfigurableOsgiBundleApplicationContext) managedContexts.get(id);
- } catch (IllegalStateException _) {
+ Long id = bundle.getBundleId();
+ context = managedContexts.get(id);
+ } catch (IllegalStateException ignored) {
// ignore
}
return context;
diff --git a/extender/src/main/java/org/eclipse/gemini/blueprint/extender/internal/dependencies/startup/DependencyServiceManager.java b/extender/src/main/java/org/eclipse/gemini/blueprint/extender/internal/dependencies/startup/DependencyServiceManager.java
index 676ecda5..5b3ce16b 100644
--- a/extender/src/main/java/org/eclipse/gemini/blueprint/extender/internal/dependencies/startup/DependencyServiceManager.java
+++ b/extender/src/main/java/org/eclipse/gemini/blueprint/extender/internal/dependencies/startup/DependencyServiceManager.java
@@ -1,29 +1,25 @@
-/******************************************************************************
- * Copyright (c) 2006, 2010 VMware Inc., Oracle Inc.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * and Apache License v2.0 which accompanies this distribution.
- * The Eclipse Public License is available at
- * http://www.eclipse.org/legal/epl-v10.html and the Apache License v2.0
- * is available at http://www.opensource.org/licenses/apache2.0.php.
- * You may elect to redistribute this code under either of these licenses.
- *
- * Contributors:
- * VMware Inc.
- * Oracle Inc.
- *****************************************************************************/
-
+/******************************************************************************
+ * Copyright (c) 2006, 2010 VMware Inc., Oracle Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * and Apache License v2.0 which accompanies this distribution.
+ * The Eclipse Public License is available at
+ * http://www.eclipse.org/legal/epl-v10.html and the Apache License v2.0
+ * is available at http://www.opensource.org/licenses/apache2.0.php.
+ * You may elect to redistribute this code under either of these licenses.
+ *
+ * Contributors:
+ * VMware Inc.
+ * Oracle Inc.
+ *****************************************************************************/
+
package org.eclipse.gemini.blueprint.extender.internal.dependencies.startup;
-import java.security.AccessControlContext;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.security.PrivilegedExceptionAction;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
+import java.util.HashMap;
+import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
@@ -38,15 +34,12 @@
import org.osgi.framework.ServiceListener;
import org.osgi.framework.ServiceReference;
import org.springframework.beans.factory.BeanFactoryUtils;
-import org.springframework.beans.factory.config.AutowireCapableBeanFactory;
-import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.eclipse.gemini.blueprint.context.DelegatedExecutionOsgiBundleApplicationContext;
import org.eclipse.gemini.blueprint.context.event.OsgiBundleApplicationContextEvent;
-import org.eclipse.gemini.blueprint.extender.OsgiServiceDependencyFactory;
-import org.eclipse.gemini.blueprint.extender.event.BootstrappingDependenciesEvent;
-import org.eclipse.gemini.blueprint.extender.event.BootstrappingDependencyEvent;
-import org.eclipse.gemini.blueprint.extender.internal.util.PrivilegedUtils;
+import org.eclipse.gemini.blueprint.extender.OsgiServiceDependencyFactory;
+import org.eclipse.gemini.blueprint.extender.event.BootstrappingDependenciesEvent;
+import org.eclipse.gemini.blueprint.extender.event.BootstrappingDependencyEvent;
import org.eclipse.gemini.blueprint.service.importer.OsgiServiceDependency;
import org.eclipse.gemini.blueprint.service.importer.event.OsgiServiceDependencyEvent;
import org.eclipse.gemini.blueprint.service.importer.event.OsgiServiceDependencyWaitEndedEvent;
@@ -65,10 +58,10 @@
*/
public class DependencyServiceManager {
- private static final Map UNMODIFIABLE_DEPENDENCY_MAP = Collections.unmodifiableMap(new HashMap(0));
-
- private static final Log log = LogFactory.getLog(DependencyServiceManager.class);
-
+ private static final Map UNMODIFIABLE_DEPENDENCY_MAP = Collections.unmodifiableMap(new HashMap(0));
+
+ private static final Log log = LogFactory.getLog(DependencyServiceManager.class);
+
private final Object monitor = new Object();
protected final Map dependencies = new LinkedHashMap();
@@ -157,8 +150,8 @@ public void serviceChanged(ServiceEvent serviceEvent) {
log.error("Exception during dependency processing for " + context.getDisplayName(), th);
contextStateAccessor.fail(th);
}
- }
-
+ }
+
private void updateDependencies(ServiceEvent serviceEvent) {
boolean trace = log.isTraceEnabled();
boolean debug = log.isDebugEnabled();
@@ -171,11 +164,11 @@ private void updateDependencies(ServiceEvent serviceEvent) {
contextToString = context.getDisplayName();
}
- Set mandatoryServiceDependencies;
- synchronized (monitor) {
- mandatoryServiceDependencies = new HashSet(dependencies.keySet());
- }
-
+ Set mandatoryServiceDependencies;
+ synchronized (monitor) {
+ mandatoryServiceDependencies = new HashSet(dependencies.keySet());
+ }
+
for (MandatoryServiceDependency dependency : mandatoryServiceDependencies) {
// check all dependencies (there might be multiple imports for the same service)
if (dependency.matches(serviceEvent)) {
@@ -188,13 +181,13 @@ private void updateDependencies(ServiceEvent serviceEvent) {
case ServiceEvent.REGISTERED:
case ServiceEvent.MODIFIED:
dependency.increment();
- String removedDependency;
- synchronized (monitor) {
- removedDependency = unsatisfiedDependencies.remove(dependency);
- }
+ String removedDependency;
+ synchronized (monitor) {
+ removedDependency = unsatisfiedDependencies.remove(dependency);
+ }
if (removedDependency != null) {
Map unsatisfiedDependenciesSnapshot = getUnsatisfiedDependencies();
- if (debug) {
+ if (debug) {
log.debug("Registered dependency for " + contextToString + "; eliminating "
+ dependency + ", remaining [" + unsatisfiedDependenciesSnapshot + "]");
}
@@ -202,7 +195,7 @@ private void updateDependencies(ServiceEvent serviceEvent) {
sendDependencySatisfiedEvent(dependency);
sendBootstrappingDependenciesEvent(unsatisfiedDependenciesSnapshot.keySet());
} else {
- if (debug) {
+ if (debug) {
Map unsatisfiedDependenciesSnapshot = getUnsatisfiedDependencies();
log.debug("Increasing the number of matching services for " + contextToString + "; "
+ dependency + ", remaining [" + unsatisfiedDependenciesSnapshot + "]");
@@ -214,11 +207,11 @@ private void updateDependencies(ServiceEvent serviceEvent) {
case ServiceEvent.UNREGISTERING:
int count = dependency.decrement();
if (count == 0) {
- synchronized (monitor) {
- unsatisfiedDependencies.put(dependency, dependency.getBeanName());
- }
- Map unsatisfiedDependenciesSnapshot = getUnsatisfiedDependencies();
- if (debug) {
+ synchronized (monitor) {
+ unsatisfiedDependencies.put(dependency, dependency.getBeanName());
+ }
+ Map unsatisfiedDependenciesSnapshot = getUnsatisfiedDependencies();
+ if (debug) {
log.debug("Unregistered dependency for " + contextToString + " adding " + dependency
+ "; total unsatisfied [" + unsatisfiedDependenciesSnapshot + "]");
}
@@ -244,8 +237,8 @@ private void updateDependencies(ServiceEvent serviceEvent) {
}
}
}
- }
-
+ }
+
}
/**
@@ -275,39 +268,22 @@ public DependencyServiceManager(ContextExecutorAccessor executor,
protected void findServiceDependencies() throws Exception {
try {
- if (System.getSecurityManager() != null) {
- final AccessControlContext acc = getAcc();
-
- PrivilegedUtils.executeWithCustomTCCL(context.getClassLoader(),
- new PrivilegedUtils.UnprivilegedThrowableExecution() {
- public Object run() throws Throwable {
- AccessController.doPrivileged(new PrivilegedExceptionAction() {
- public Object run() throws Exception {
- doFindDependencies();
- return null;
- }
- }, acc);
- return null;
- }
- });
- } else {
- doFindDependencies();
- }
+ doFindDependencies();
} catch (Throwable th) {
if (th instanceof Exception)
throw ((Exception) th);
throw (Error) th;
}
- Collection unsatisfiedDependencyValues = getUnsatisfiedDependencies().values();
-
+ Collection unsatisfiedDependencyValues = getUnsatisfiedDependencies().values();
+
if (log.isDebugEnabled()) {
- int numDependencies;
- int numUnsatisfiedDependencies;
- synchronized (monitor) {
- numDependencies = dependencies.size();
- numUnsatisfiedDependencies = unsatisfiedDependencies.size();
- }
+ int numDependencies;
+ int numUnsatisfiedDependencies;
+ synchronized (monitor) {
+ numDependencies = dependencies.size();
+ numUnsatisfiedDependencies = unsatisfiedDependencies.size();
+ }
log.debug(numDependencies + " OSGi service dependencies, " + numUnsatisfiedDependencies
+ " unsatisfied (for beans " + unsatisfiedDependencyValues + ") in "
+ context.getDisplayName());
@@ -318,10 +294,10 @@ public Object run() throws Exception {
+ unsatisfiedDependencyValues + "]");
}
if (log.isTraceEnabled()) {
- Collection dependencyValues;
- synchronized (monitor) {
- dependencyValues = new ArrayList(dependencies.values());
- }
+ Collection dependencyValues;
+ synchronized (monitor) {
+ dependencyValues = new ArrayList(dependencies.values());
+ }
log.trace("Total OSGi service dependencies beans " + dependencyValues);
log.trace("Unsatified OSGi service dependencies beans " + unsatisfiedDependencyValues);
}
@@ -363,16 +339,16 @@ private void doFindDependencies() throws Exception {
if (discoveredDependencies != null)
for (OsgiServiceDependency dependency : discoveredDependencies) {
if (dependency.isMandatory()) {
- MandatoryServiceDependency msd = new MandatoryServiceDependency(bundleContext, dependency);
+ MandatoryServiceDependency msd = new MandatoryServiceDependency(bundleContext, dependency);
synchronized (monitor) {
- dependencies.put(msd, dependency.getBeanName());
+ dependencies.put(msd, dependency.getBeanName());
}
if (!msd.isServicePresent()) {
log.info("Adding OSGi service dependency for importer [" + msd.getBeanName()
+ "] matching OSGi filter [" + msd.filterAsString + "]");
- synchronized (monitor) {
- unsatisfiedDependencies.put(msd, dependency.getBeanName());
+ synchronized (monitor) {
+ unsatisfiedDependencies.put(msd, dependency.getBeanName());
}
} else {
if (debug)
@@ -385,18 +361,18 @@ private void doFindDependencies() throws Exception {
}
public boolean isSatisfied() {
- synchronized (monitor) {
- return unsatisfiedDependencies.isEmpty();
+ synchronized (monitor) {
+ return unsatisfiedDependencies.isEmpty();
}
}
- public Map getUnsatisfiedDependencies() {
- if (isSatisfied()) {
- return UNMODIFIABLE_DEPENDENCY_MAP;
+ public Map getUnsatisfiedDependencies() {
+ if (isSatisfied()) {
+ return UNMODIFIABLE_DEPENDENCY_MAP;
} else {
- synchronized (monitor) {
- return Collections.unmodifiableMap(new HashMap(unsatisfiedDependencies));
- }
+ synchronized (monitor) {
+ return Collections.unmodifiableMap(new HashMap(unsatisfiedDependencies));
+ }
}
}
@@ -410,17 +386,7 @@ protected void register() {
// send dependency event before registering the filter
sendInitialBootstrappingEvents(getUnsatisfiedDependencies().keySet());
- if (System.getSecurityManager() != null) {
- AccessControlContext acc = getAcc();
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- OsgiListenerUtils.addServiceListener(bundleContext, listener, filter);
- return null;
- }
- }, acc);
- } else {
- OsgiListenerUtils.addServiceListener(bundleContext, listener, filter);
- }
+ OsgiListenerUtils.addServiceListener(bundleContext, listener, filter);
}
/**
@@ -429,15 +395,15 @@ public Object run() {
*
* @return
*/
- private String createDependencyFilter() {
- synchronized (monitor) {
+ private String createDependencyFilter() {
+ synchronized (monitor) {
return createDependencyFilter(dependencies.keySet());
}
}
String createUnsatisfiedDependencyFilter() {
- synchronized (monitor) {
- return createDependencyFilter(unsatisfiedDependencies.keySet());
+ synchronized (monitor) {
+ return createDependencyFilter(unsatisfiedDependencies.keySet());
}
}
@@ -472,8 +438,8 @@ protected void deregister() {
}
List getUnsatisfiedDependenciesAsEvents() {
- synchronized (monitor) {
- return getUnsatisfiedDependenciesAsEvents(unsatisfiedDependencies.keySet());
+ synchronized (monitor) {
+ return getUnsatisfiedDependenciesAsEvents(unsatisfiedDependencies.keySet());
}
}
@@ -539,19 +505,11 @@ private void sendBootstrappingDependenciesEvent(Set
private void publishEvent(OsgiBundleApplicationContextEvent dependencyEvent) {
this.contextStateAccessor.getEventMulticaster().multicastEvent(dependencyEvent);
}
-
- private AccessControlContext getAcc() {
- AutowireCapableBeanFactory beanFactory = context.getAutowireCapableBeanFactory();
- if (beanFactory instanceof ConfigurableBeanFactory) {
- return ((ConfigurableBeanFactory) beanFactory).getAccessControlContext();
- }
- return null;
- }
-
- public boolean allDependenciesSatisfied() {
- synchronized (monitor) {
- return unsatisfiedDependencies.isEmpty();
- }
- }
+
+ public boolean allDependenciesSatisfied() {
+ synchronized (monitor) {
+ return unsatisfiedDependencies.isEmpty();
+ }
+ }
}
\ No newline at end of file
diff --git a/extender/src/main/java/org/eclipse/gemini/blueprint/extender/internal/support/NamespaceManager.java b/extender/src/main/java/org/eclipse/gemini/blueprint/extender/internal/support/NamespaceManager.java
index 72604fbb..b69b08bc 100644
--- a/extender/src/main/java/org/eclipse/gemini/blueprint/extender/internal/support/NamespaceManager.java
+++ b/extender/src/main/java/org/eclipse/gemini/blueprint/extender/internal/support/NamespaceManager.java
@@ -172,7 +172,7 @@ private boolean hasCompatibleNamespaceType(Bundle bundle) {
* @param bundle handler bundle
*/
public void maybeRemoveNameSpaceHandlerFor(Bundle bundle) {
- Assert.notNull(bundle);
+ Assert.notNull(bundle, "required field");
boolean removed = this.namespacePlugins.removePlugin(bundle);
if (removed && log.isDebugEnabled()) {
log.debug("Removed namespace handler resolver for " + OsgiStringUtils.nullSafeNameAndSymName(bundle));
diff --git a/extender/src/main/java/org/eclipse/gemini/blueprint/extender/internal/util/PrivilegedUtils.java b/extender/src/main/java/org/eclipse/gemini/blueprint/extender/internal/util/PrivilegedUtils.java
deleted file mode 100644
index 5a14b46d..00000000
--- a/extender/src/main/java/org/eclipse/gemini/blueprint/extender/internal/util/PrivilegedUtils.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/******************************************************************************
- * Copyright (c) 2006, 2010 VMware Inc.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * and Apache License v2.0 which accompanies this distribution.
- * The Eclipse Public License is available at
- * http://www.eclipse.org/legal/epl-v10.html and the Apache License v2.0
- * is available at http://www.opensource.org/licenses/apache2.0.php.
- * You may elect to redistribute this code under either of these licenses.
- *
- * Contributors:
- * VMware Inc.
- *****************************************************************************/
-
-package org.eclipse.gemini.blueprint.extender.internal.util;
-
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.security.PrivilegedActionException;
-
-/**
- * Utility class for commons actions used within PrivilegedBlocks.
- *
- * @author Costin Leau
- *
- */
-public abstract class PrivilegedUtils {
-
- private static class GetTCCLAction implements PrivilegedAction {
-
- public ClassLoader run() {
- return Thread.currentThread().getContextClassLoader();
- }
-
- public ClassLoader getTCCL() {
- return AccessController.doPrivileged(this);
- }
- }
-
- public interface UnprivilegedThrowableExecution {
-
- public T run() throws Throwable;
- }
-
- public interface UnprivilegedExecution {
-
- public T run();
- }
-
-
- private static final GetTCCLAction getTCCLAction = new GetTCCLAction();
-
-
- public static ClassLoader getTCCL() {
- return getTCCLAction.getTCCL();
- }
-
- /**
- * Temporarily changes the TCCL to the given one for the duration of the
- * given execution. All actions except the execution are executed with
- * privileged access.
- *
- * Consider checking if there is a security manager in place before calling
- * this method.
- *
- * @param customClassLoader
- * @param execution
- * @return
- */
- public static T executeWithCustomTCCL(final ClassLoader customClassLoader,
- final UnprivilegedExecution execution) {
- final Thread currentThread = Thread.currentThread();
- final ClassLoader oldTCCL = getTCCLAction.getTCCL();
-
- try {
- AccessController.doPrivileged(new PrivilegedAction() {
-
- public Object run() {
- currentThread.setContextClassLoader(customClassLoader);
- return null;
- }
- });
- return execution.run();
- }
- finally {
- AccessController.doPrivileged(new PrivilegedAction() {
-
- public Object run() {
- currentThread.setContextClassLoader(oldTCCL);
- return null;
- }
- });
- }
- }
-
- /**
- * Temporarily changes the TCCL to the given one for the duration of the
- * given execution. All actions except the execution are executed with
- * privileged access.
- *
- * Consider checking if there is a security manager in place before calling
- * this method.
- *
- * @param customClassLoader
- * @param execution
- * @return
- * @throws Throwable
- */
- public static T executeWithCustomTCCL(final ClassLoader customClassLoader,
- final UnprivilegedThrowableExecution execution) throws Throwable {
- final Thread currentThread = Thread.currentThread();
- final ClassLoader oldTCCL = getTCCLAction.getTCCL();
-
- try {
- AccessController.doPrivileged(new PrivilegedAction() {
-
- public Object run() {
- currentThread.setContextClassLoader(customClassLoader);
- return null;
- }
- });
- return execution.run();
- }
- catch (PrivilegedActionException pae) {
- throw pae.getCause();
- }
- finally {
- AccessController.doPrivileged(new PrivilegedAction() {
-
- public Object run() {
- currentThread.setContextClassLoader(oldTCCL);
- return null;
- }
- });
- }
- }
-}
\ No newline at end of file
diff --git a/extender/src/main/java/org/eclipse/gemini/blueprint/extender/internal/util/concurrent/RunnableTimedExecution.java b/extender/src/main/java/org/eclipse/gemini/blueprint/extender/internal/util/concurrent/RunnableTimedExecution.java
index cab08796..f406c549 100644
--- a/extender/src/main/java/org/eclipse/gemini/blueprint/extender/internal/util/concurrent/RunnableTimedExecution.java
+++ b/extender/src/main/java/org/eclipse/gemini/blueprint/extender/internal/util/concurrent/RunnableTimedExecution.java
@@ -81,7 +81,7 @@ public static boolean execute(Runnable task, long waitTime) {
}
public static boolean execute(Runnable task, long waitTime, TaskExecutor taskExecutor) {
- Assert.notNull(task);
+ Assert.notNull(task, "required field");
Counter counter = new Counter("counter for task: " + task);
Runnable wrapper = new MonitoredRunnable(task, counter);
diff --git a/extender/src/main/java/org/eclipse/gemini/blueprint/extender/support/ApplicationContextConfiguration.java b/extender/src/main/java/org/eclipse/gemini/blueprint/extender/support/ApplicationContextConfiguration.java
index 0f0a9cf9..ccd06f7b 100644
--- a/extender/src/main/java/org/eclipse/gemini/blueprint/extender/support/ApplicationContextConfiguration.java
+++ b/extender/src/main/java/org/eclipse/gemini/blueprint/extender/support/ApplicationContextConfiguration.java
@@ -62,8 +62,8 @@ public ApplicationContextConfiguration(Bundle bundle) {
}
public ApplicationContextConfiguration(Bundle bundle, ConfigurationScanner configurationScanner) {
- Assert.notNull(bundle);
- Assert.notNull(configurationScanner);
+ Assert.notNull(bundle, "required field");
+ Assert.notNull(configurationScanner, "required field");
this.bundle = bundle;
this.configurationScanner = configurationScanner;
diff --git a/extender/src/main/java/org/eclipse/gemini/blueprint/extender/support/DefaultOsgiApplicationContextCreator.java b/extender/src/main/java/org/eclipse/gemini/blueprint/extender/support/DefaultOsgiApplicationContextCreator.java
index 5234349d..b2528640 100644
--- a/extender/src/main/java/org/eclipse/gemini/blueprint/extender/support/DefaultOsgiApplicationContextCreator.java
+++ b/extender/src/main/java/org/eclipse/gemini/blueprint/extender/support/DefaultOsgiApplicationContextCreator.java
@@ -79,7 +79,7 @@ public DelegatedExecutionOsgiBundleApplicationContext createApplicationContext(B
* @param configurationScanner The configurationScanner to set.
*/
public void setConfigurationScanner(ConfigurationScanner configurationScanner) {
- Assert.notNull(configurationScanner);
+ Assert.notNull(configurationScanner, "required field");
this.configurationScanner = configurationScanner;
}
}
\ No newline at end of file
diff --git a/extender/src/main/java/org/eclipse/gemini/blueprint/extender/support/internal/ConfigUtils.java b/extender/src/main/java/org/eclipse/gemini/blueprint/extender/support/internal/ConfigUtils.java
index 8214cc8c..fbf7bc25 100644
--- a/extender/src/main/java/org/eclipse/gemini/blueprint/extender/support/internal/ConfigUtils.java
+++ b/extender/src/main/java/org/eclipse/gemini/blueprint/extender/support/internal/ConfigUtils.java
@@ -105,7 +105,7 @@ public abstract class ConfigUtils {
public static boolean matchExtenderVersionRange(Bundle bundle, String header, Version versionToMatch) {
- Assert.notNull(bundle);
+ Assert.notNull(bundle, "required field");
// get version range
String range = (String) bundle.getHeaders().get(header);
diff --git a/extender/src/test/java/org/eclipse/gemini/blueprint/extender/internal/activator/LifecycleManagerTest.java b/extender/src/test/java/org/eclipse/gemini/blueprint/extender/internal/activator/LifecycleManagerTest.java
index 9ee88a65..0b45fe92 100644
--- a/extender/src/test/java/org/eclipse/gemini/blueprint/extender/internal/activator/LifecycleManagerTest.java
+++ b/extender/src/test/java/org/eclipse/gemini/blueprint/extender/internal/activator/LifecycleManagerTest.java
@@ -28,7 +28,6 @@
import org.osgi.framework.BundleContext;
import org.osgi.framework.Version;
-import static java.lang.Thread.yield;
import static java.util.concurrent.TimeUnit.SECONDS;
import static org.mockito.Matchers.eq;
import static org.mockito.Matchers.isA;
@@ -96,7 +95,7 @@ public void testFailingAsynchronousShutdown() throws Exception {
withFailingApplicationContextClose();
shutdownContext();
- yield();
+ Thread.yield();
verifyContextIsClosed();
verifyOsgiContextProcessorInteractions();
@@ -130,7 +129,7 @@ public void testSuccessfulAsynchronousDestruction() throws Exception {
addContextToLifecycleManager();
destroy();
- yield();
+ Thread.yield();
verifyContextIsClosed();
verifyOsgiContextProcessorInteractions();
diff --git a/extender/src/test/java/org/eclipse/gemini/blueprint/extender/internal/support/DummyApplicationEventMulticaster.java b/extender/src/test/java/org/eclipse/gemini/blueprint/extender/internal/support/DummyApplicationEventMulticaster.java
index bede3dc1..3ffaa38d 100644
--- a/extender/src/test/java/org/eclipse/gemini/blueprint/extender/internal/support/DummyApplicationEventMulticaster.java
+++ b/extender/src/test/java/org/eclipse/gemini/blueprint/extender/internal/support/DummyApplicationEventMulticaster.java
@@ -19,6 +19,8 @@
import org.springframework.context.event.ApplicationEventMulticaster;
import org.springframework.core.ResolvableType;
+import java.util.function.Predicate;
+
/**
* @author Costin Leau
*/
@@ -44,6 +46,14 @@ public void removeApplicationListener(ApplicationListener arg0) {
public void removeApplicationListenerBean(String arg0) {
}
+ @Override
+ public void removeApplicationListeners(Predicate> predicate) {
+ }
+
+ @Override
+ public void removeApplicationListenerBeans(Predicate predicate) {
+ }
+
public void addApplicationListenerBean(String listenerBeanName) {
}
diff --git a/extensions/pom.xml b/extensions/pom.xml
index 9a5c3c6e..dcc4c6a3 100644
--- a/extensions/pom.xml
+++ b/extensions/pom.xml
@@ -5,7 +5,7 @@
gemini-blueprint
org.eclipse.gemini.blueprint
- 3.0.0.M01-SNAPSHOT
+ 4.0.0-atlassian-5-SNAPSHOT
../pom.xml
@@ -25,18 +25,18 @@
- org.apache.servicemix.bundles
- org.apache.servicemix.bundles.spring-core
+ org.springframework
+ spring-core
provided
org.osgi
- org.osgi.compendium
+ osgi.cmpn
provided
org.osgi
- org.osgi.core
+ osgi.core
provided
diff --git a/extensions/src/main/java/org/eclipse/gemini/blueprint/extensions/annotation/ServiceReferenceInjectionBeanPostProcessor.java b/extensions/src/main/java/org/eclipse/gemini/blueprint/extensions/annotation/ServiceReferenceInjectionBeanPostProcessor.java
index 8f742333..360421ba 100644
--- a/extensions/src/main/java/org/eclipse/gemini/blueprint/extensions/annotation/ServiceReferenceInjectionBeanPostProcessor.java
+++ b/extensions/src/main/java/org/eclipse/gemini/blueprint/extensions/annotation/ServiceReferenceInjectionBeanPostProcessor.java
@@ -26,7 +26,7 @@
import org.springframework.beans.PropertyValues;
import org.springframework.beans.factory.*;
import org.springframework.beans.factory.config.BeanPostProcessor;
-import org.springframework.beans.factory.config.InstantiationAwareBeanPostProcessorAdapter;
+import org.springframework.beans.factory.config.SmartInstantiationAwareBeanPostProcessor;
import org.springframework.core.annotation.AnnotationUtils;
import org.springframework.util.ReflectionUtils;
@@ -45,8 +45,8 @@
*
* @author Andy Piper
*/
-public class ServiceReferenceInjectionBeanPostProcessor extends InstantiationAwareBeanPostProcessorAdapter implements
- BundleContextAware, BeanFactoryAware, BeanClassLoaderAware {
+public class ServiceReferenceInjectionBeanPostProcessor implements
+ BundleContextAware, BeanFactoryAware, BeanClassLoaderAware, SmartInstantiationAwareBeanPostProcessor {
private BundleContext bundleContext;
diff --git a/integration-tests/bundles/blueprint/config.bundle/pom.xml b/integration-tests/bundles/blueprint/config.bundle/pom.xml
index d76d593e..251df74f 100644
--- a/integration-tests/bundles/blueprint/config.bundle/pom.xml
+++ b/integration-tests/bundles/blueprint/config.bundle/pom.xml
@@ -5,7 +5,7 @@
org.eclipse.gemini.blueprint.iandt.blueprint
bundles
- 3.0.0.M01-SNAPSHOT
+ 4.0.0-atlassian-5-SNAPSHOT
../pom.xml
diff --git a/integration-tests/bundles/blueprint/error.bundle/pom.xml b/integration-tests/bundles/blueprint/error.bundle/pom.xml
index 6b4fd131..0eb1aa3c 100644
--- a/integration-tests/bundles/blueprint/error.bundle/pom.xml
+++ b/integration-tests/bundles/blueprint/error.bundle/pom.xml
@@ -5,7 +5,7 @@
org.eclipse.gemini.blueprint.iandt.blueprint
bundles
- 3.0.0.M01-SNAPSHOT
+ 4.0.0-atlassian-5-SNAPSHOT
../pom.xml
diff --git a/integration-tests/bundles/blueprint/pom.xml b/integration-tests/bundles/blueprint/pom.xml
index 49313737..8cbcb2e2 100644
--- a/integration-tests/bundles/blueprint/pom.xml
+++ b/integration-tests/bundles/blueprint/pom.xml
@@ -5,7 +5,7 @@
gemini-blueprint-integration-test-bundles
org.eclipse.gemini.blueprint.iandt
- 3.0.0.M01-SNAPSHOT
+ 4.0.0-atlassian-5-SNAPSHOT
../pom.xml
diff --git a/integration-tests/bundles/blueprint/simple.bundle/pom.xml b/integration-tests/bundles/blueprint/simple.bundle/pom.xml
index 1b2a52d5..f2f511c0 100644
--- a/integration-tests/bundles/blueprint/simple.bundle/pom.xml
+++ b/integration-tests/bundles/blueprint/simple.bundle/pom.xml
@@ -5,7 +5,7 @@
org.eclipse.gemini.blueprint.iandt.blueprint
bundles
- 3.0.0.M01-SNAPSHOT
+ 4.0.0-atlassian-5-SNAPSHOT
../pom.xml
diff --git a/integration-tests/bundles/blueprint/waiting.bundle/pom.xml b/integration-tests/bundles/blueprint/waiting.bundle/pom.xml
index c626f906..1eb61aae 100644
--- a/integration-tests/bundles/blueprint/waiting.bundle/pom.xml
+++ b/integration-tests/bundles/blueprint/waiting.bundle/pom.xml
@@ -5,7 +5,7 @@
org.eclipse.gemini.blueprint.iandt.blueprint
bundles
- 3.0.0.M01-SNAPSHOT
+ 4.0.0-atlassian-5-SNAPSHOT
../pom.xml
diff --git a/integration-tests/bundles/cardinality.0to1.bundle/pom.xml b/integration-tests/bundles/cardinality.0to1.bundle/pom.xml
index 0504f2d7..154a2eb4 100644
--- a/integration-tests/bundles/cardinality.0to1.bundle/pom.xml
+++ b/integration-tests/bundles/cardinality.0to1.bundle/pom.xml
@@ -5,7 +5,7 @@
org.eclipse.gemini.blueprint.iandt
gemini-blueprint-integration-test-bundles
- 3.0.0.M01-SNAPSHOT
+ 4.0.0-atlassian-5-SNAPSHOT
../pom.xml
diff --git a/integration-tests/bundles/config.bundle/async.nowait.bundle/pom.xml b/integration-tests/bundles/config.bundle/async.nowait.bundle/pom.xml
index 0ae861b7..9614e232 100644
--- a/integration-tests/bundles/config.bundle/async.nowait.bundle/pom.xml
+++ b/integration-tests/bundles/config.bundle/async.nowait.bundle/pom.xml
@@ -5,7 +5,7 @@
org.eclipse.gemini.blueprint.iandt
config.bundle
- 3.0.0.M01-SNAPSHOT
+ 4.0.0-atlassian-5-SNAPSHOT
../pom.xml
diff --git a/integration-tests/bundles/config.bundle/async.wait.bundle/pom.xml b/integration-tests/bundles/config.bundle/async.wait.bundle/pom.xml
index eb3efa6f..9541bee8 100644
--- a/integration-tests/bundles/config.bundle/async.wait.bundle/pom.xml
+++ b/integration-tests/bundles/config.bundle/async.wait.bundle/pom.xml
@@ -5,7 +5,7 @@
org.eclipse.gemini.blueprint.iandt
config.bundle
- 3.0.0.M01-SNAPSHOT
+ 4.0.0-atlassian-5-SNAPSHOT
../pom.xml
diff --git a/integration-tests/bundles/config.bundle/no.publish.bundle/pom.xml b/integration-tests/bundles/config.bundle/no.publish.bundle/pom.xml
index 5b3cb852..7bcfe27b 100644
--- a/integration-tests/bundles/config.bundle/no.publish.bundle/pom.xml
+++ b/integration-tests/bundles/config.bundle/no.publish.bundle/pom.xml
@@ -5,7 +5,7 @@
org.eclipse.gemini.blueprint.iandt
config.bundle
- 3.0.0.M01-SNAPSHOT
+ 4.0.0-atlassian-5-SNAPSHOT
../pom.xml
diff --git a/integration-tests/bundles/config.bundle/pom.xml b/integration-tests/bundles/config.bundle/pom.xml
index c064dbc6..b468f173 100644
--- a/integration-tests/bundles/config.bundle/pom.xml
+++ b/integration-tests/bundles/config.bundle/pom.xml
@@ -5,7 +5,7 @@
org.eclipse.gemini.blueprint.iandt
gemini-blueprint-integration-test-bundles
- 3.0.0.M01-SNAPSHOT
+ 4.0.0-atlassian-5-SNAPSHOT
../pom.xml
diff --git a/integration-tests/bundles/config.bundle/sync.nowait.bundle/pom.xml b/integration-tests/bundles/config.bundle/sync.nowait.bundle/pom.xml
index b30f8f8b..2e118c39 100644
--- a/integration-tests/bundles/config.bundle/sync.nowait.bundle/pom.xml
+++ b/integration-tests/bundles/config.bundle/sync.nowait.bundle/pom.xml
@@ -5,7 +5,7 @@
org.eclipse.gemini.blueprint.iandt
config.bundle
- 3.0.0.M01-SNAPSHOT
+ 4.0.0-atlassian-5-SNAPSHOT
../pom.xml
diff --git a/integration-tests/bundles/config.bundle/sync.tail.bundle/pom.xml b/integration-tests/bundles/config.bundle/sync.tail.bundle/pom.xml
index d746c309..06029567 100644
--- a/integration-tests/bundles/config.bundle/sync.tail.bundle/pom.xml
+++ b/integration-tests/bundles/config.bundle/sync.tail.bundle/pom.xml
@@ -5,7 +5,7 @@
org.eclipse.gemini.blueprint.iandt
config.bundle
- 3.0.0.M01-SNAPSHOT
+ 4.0.0-atlassian-5-SNAPSHOT
../pom.xml
diff --git a/integration-tests/bundles/config.bundle/sync.wait.bundle/pom.xml b/integration-tests/bundles/config.bundle/sync.wait.bundle/pom.xml
index c1394440..ac495ffe 100644
--- a/integration-tests/bundles/config.bundle/sync.wait.bundle/pom.xml
+++ b/integration-tests/bundles/config.bundle/sync.wait.bundle/pom.xml
@@ -5,7 +5,7 @@
org.eclipse.gemini.blueprint.iandt
config.bundle
- 3.0.0.M01-SNAPSHOT
+ 4.0.0-atlassian-5-SNAPSHOT
../pom.xml
diff --git a/integration-tests/bundles/config.file.with.dots.bundle/pom.xml b/integration-tests/bundles/config.file.with.dots.bundle/pom.xml
index 97ab3b39..e34489f8 100644
--- a/integration-tests/bundles/config.file.with.dots.bundle/pom.xml
+++ b/integration-tests/bundles/config.file.with.dots.bundle/pom.xml
@@ -5,7 +5,7 @@
org.eclipse.gemini.blueprint.iandt
gemini-blueprint-integration-test-bundles
- 3.0.0.M01-SNAPSHOT
+ 4.0.0-atlassian-5-SNAPSHOT
../pom.xml
diff --git a/integration-tests/bundles/configuration.test.bundle/pom.xml b/integration-tests/bundles/configuration.test.bundle/pom.xml
index b8baab57..6c7b32ca 100644
--- a/integration-tests/bundles/configuration.test.bundle/pom.xml
+++ b/integration-tests/bundles/configuration.test.bundle/pom.xml
@@ -5,7 +5,7 @@
org.eclipse.gemini.blueprint.iandt
gemini-blueprint-integration-test-bundles
- 3.0.0.M01-SNAPSHOT
+ 4.0.0-atlassian-5-SNAPSHOT
../pom.xml
diff --git a/integration-tests/bundles/deadlock.bundle/pom.xml b/integration-tests/bundles/deadlock.bundle/pom.xml
index 5b9e3252..c9516cec 100644
--- a/integration-tests/bundles/deadlock.bundle/pom.xml
+++ b/integration-tests/bundles/deadlock.bundle/pom.xml
@@ -5,7 +5,7 @@
org.eclipse.gemini.blueprint.iandt
gemini-blueprint-integration-test-bundles
- 3.0.0.M01-SNAPSHOT
+ 4.0.0-atlassian-5-SNAPSHOT
../pom.xml
diff --git a/integration-tests/bundles/dependency.factory.bundle/pom.xml b/integration-tests/bundles/dependency.factory.bundle/pom.xml
index ea0abe89..f61cad0d 100644
--- a/integration-tests/bundles/dependency.factory.bundle/pom.xml
+++ b/integration-tests/bundles/dependency.factory.bundle/pom.xml
@@ -5,7 +5,7 @@
org.eclipse.gemini.blueprint.iandt
gemini-blueprint-integration-test-bundles
- 3.0.0.M01-SNAPSHOT
+ 4.0.0-atlassian-5-SNAPSHOT
../pom.xml
diff --git a/integration-tests/bundles/dependency.test.bundle/pom.xml b/integration-tests/bundles/dependency.test.bundle/pom.xml
index 5d68e08f..4b427195 100644
--- a/integration-tests/bundles/dependency.test.bundle/pom.xml
+++ b/integration-tests/bundles/dependency.test.bundle/pom.xml
@@ -5,7 +5,7 @@
org.eclipse.gemini.blueprint.iandt
gemini-blueprint-integration-test-bundles
- 3.0.0.M01-SNAPSHOT
+ 4.0.0-atlassian-5-SNAPSHOT
../pom.xml
diff --git a/integration-tests/bundles/error.bundle/pom.xml b/integration-tests/bundles/error.bundle/pom.xml
index 6ee1b583..a56e6c07 100644
--- a/integration-tests/bundles/error.bundle/pom.xml
+++ b/integration-tests/bundles/error.bundle/pom.xml
@@ -5,7 +5,7 @@
org.eclipse.gemini.blueprint.iandt
gemini-blueprint-integration-test-bundles
- 3.0.0.M01-SNAPSHOT
+ 4.0.0-atlassian-5-SNAPSHOT
../pom.xml
diff --git a/integration-tests/bundles/export.import.dependency.bundle/pom.xml b/integration-tests/bundles/export.import.dependency.bundle/pom.xml
index c7d0319f..619c5b44 100644
--- a/integration-tests/bundles/export.import.dependency.bundle/pom.xml
+++ b/integration-tests/bundles/export.import.dependency.bundle/pom.xml
@@ -5,7 +5,7 @@
org.eclipse.gemini.blueprint.iandt
gemini-blueprint-integration-test-bundles
- 3.0.0.M01-SNAPSHOT
+ 4.0.0-atlassian-5-SNAPSHOT
../pom.xml
diff --git a/integration-tests/bundles/extender.fragment.bundle/pom.xml b/integration-tests/bundles/extender.fragment.bundle/pom.xml
index 34612237..d538791b 100644
--- a/integration-tests/bundles/extender.fragment.bundle/pom.xml
+++ b/integration-tests/bundles/extender.fragment.bundle/pom.xml
@@ -5,7 +5,7 @@
org.eclipse.gemini.blueprint.iandt
gemini-blueprint-integration-test-bundles
- 3.0.0.M01-SNAPSHOT
+ 4.0.0-atlassian-5-SNAPSHOT
../pom.xml
diff --git a/integration-tests/bundles/extender.listener.bundle/pom.xml b/integration-tests/bundles/extender.listener.bundle/pom.xml
index 7f9b7b7f..a126e7e4 100644
--- a/integration-tests/bundles/extender.listener.bundle/pom.xml
+++ b/integration-tests/bundles/extender.listener.bundle/pom.xml
@@ -5,7 +5,7 @@
org.eclipse.gemini.blueprint.iandt
gemini-blueprint-integration-test-bundles
- 3.0.0.M01-SNAPSHOT
+ 4.0.0-atlassian-5-SNAPSHOT
../pom.xml
diff --git a/integration-tests/bundles/extender.version.bundle/pom.xml b/integration-tests/bundles/extender.version.bundle/pom.xml
index ddddc4d2..77d65118 100644
--- a/integration-tests/bundles/extender.version.bundle/pom.xml
+++ b/integration-tests/bundles/extender.version.bundle/pom.xml
@@ -5,7 +5,7 @@
org.eclipse.gemini.blueprint.iandt
gemini-blueprint-integration-test-bundles
- 3.0.0.M01-SNAPSHOT
+ 4.0.0-atlassian-5-SNAPSHOT
../pom.xml
diff --git a/integration-tests/bundles/io.fragment.1.bundle/pom.xml b/integration-tests/bundles/io.fragment.1.bundle/pom.xml
index e477a253..d7fb23b7 100644
--- a/integration-tests/bundles/io.fragment.1.bundle/pom.xml
+++ b/integration-tests/bundles/io.fragment.1.bundle/pom.xml
@@ -5,7 +5,7 @@
org.eclipse.gemini.blueprint.iandt
gemini-blueprint-integration-test-bundles
- 3.0.0.M01-SNAPSHOT
+ 4.0.0-atlassian-5-SNAPSHOT
../pom.xml
diff --git a/integration-tests/bundles/io.fragment.2.bundle/pom.xml b/integration-tests/bundles/io.fragment.2.bundle/pom.xml
index a2fbaf43..dda0aebf 100644
--- a/integration-tests/bundles/io.fragment.2.bundle/pom.xml
+++ b/integration-tests/bundles/io.fragment.2.bundle/pom.xml
@@ -5,7 +5,7 @@
org.eclipse.gemini.blueprint.iandt
gemini-blueprint-integration-test-bundles
- 3.0.0.M01-SNAPSHOT
+ 4.0.0-atlassian-5-SNAPSHOT
../pom.xml
diff --git a/integration-tests/bundles/jdk.proxy.bundle/pom.xml b/integration-tests/bundles/jdk.proxy.bundle/pom.xml
index b5503da6..4f286bf7 100644
--- a/integration-tests/bundles/jdk.proxy.bundle/pom.xml
+++ b/integration-tests/bundles/jdk.proxy.bundle/pom.xml
@@ -5,7 +5,7 @@
org.eclipse.gemini.blueprint.iandt
gemini-blueprint-integration-test-bundles
- 3.0.0.M01-SNAPSHOT
+ 4.0.0-atlassian-5-SNAPSHOT
../pom.xml
diff --git a/integration-tests/bundles/jdk5/component.scan.bundle/pom.xml b/integration-tests/bundles/jdk5/component.scan.bundle/pom.xml
index f7658c8c..e5c0a3d7 100644
--- a/integration-tests/bundles/jdk5/component.scan.bundle/pom.xml
+++ b/integration-tests/bundles/jdk5/component.scan.bundle/pom.xml
@@ -5,7 +5,7 @@
org.eclipse.gemini.blueprint.iandt
spring-osgi-jdk5-integration-test-bundles
- 3.0.0.M01-SNAPSHOT
+ 4.0.0-atlassian-5-SNAPSHOT
../pom.xml
diff --git a/integration-tests/bundles/jdk5/pom.xml b/integration-tests/bundles/jdk5/pom.xml
index 49cf26da..fa5ed6ae 100644
--- a/integration-tests/bundles/jdk5/pom.xml
+++ b/integration-tests/bundles/jdk5/pom.xml
@@ -5,7 +5,7 @@
org.eclipse.gemini.blueprint.iandt
gemini-blueprint-integration-test-bundles
- 3.0.0.M01-SNAPSHOT
+ 4.0.0-atlassian-5-SNAPSHOT
../pom.xml
diff --git a/integration-tests/bundles/lifecycle.test.bundle/pom.xml b/integration-tests/bundles/lifecycle.test.bundle/pom.xml
index ab76ee5c..7a316863 100644
--- a/integration-tests/bundles/lifecycle.test.bundle/pom.xml
+++ b/integration-tests/bundles/lifecycle.test.bundle/pom.xml
@@ -5,7 +5,7 @@
org.eclipse.gemini.blueprint.iandt
gemini-blueprint-integration-test-bundles
- 3.0.0.M01-SNAPSHOT
+ 4.0.0-atlassian-5-SNAPSHOT
../pom.xml
diff --git a/integration-tests/bundles/namespace.own.consumer.bundle/pom.xml b/integration-tests/bundles/namespace.own.consumer.bundle/pom.xml
index dee677f9..e276e20a 100644
--- a/integration-tests/bundles/namespace.own.consumer.bundle/pom.xml
+++ b/integration-tests/bundles/namespace.own.consumer.bundle/pom.xml
@@ -5,7 +5,7 @@
org.eclipse.gemini.blueprint.iandt
gemini-blueprint-integration-test-bundles
- 3.0.0.M01-SNAPSHOT
+ 4.0.0-atlassian-5-SNAPSHOT
../pom.xml
diff --git a/integration-tests/bundles/pom.xml b/integration-tests/bundles/pom.xml
index fddad055..66217798 100644
--- a/integration-tests/bundles/pom.xml
+++ b/integration-tests/bundles/pom.xml
@@ -5,7 +5,7 @@
org.eclipse.gemini.blueprint.iandt
gemini-blueprint-integration-tests-parent
- 3.0.0.M01-SNAPSHOT
+ 4.0.0-atlassian-5-SNAPSHOT
../pom.xml
@@ -31,7 +31,7 @@
org.osgi
- org.osgi.core
+ osgi.core
provided
diff --git a/integration-tests/bundles/proxy.creator.bundle/pom.xml b/integration-tests/bundles/proxy.creator.bundle/pom.xml
index 7aa28099..7bff01ff 100644
--- a/integration-tests/bundles/proxy.creator.bundle/pom.xml
+++ b/integration-tests/bundles/proxy.creator.bundle/pom.xml
@@ -5,7 +5,7 @@
org.eclipse.gemini.blueprint.iandt
gemini-blueprint-integration-test-bundles
- 3.0.0.M01-SNAPSHOT
+ 4.0.0-atlassian-5-SNAPSHOT
../pom.xml
diff --git a/integration-tests/bundles/proxy.destruction.test.bundle/pom.xml b/integration-tests/bundles/proxy.destruction.test.bundle/pom.xml
index 47cb8341..6b99e485 100644
--- a/integration-tests/bundles/proxy.destruction.test.bundle/pom.xml
+++ b/integration-tests/bundles/proxy.destruction.test.bundle/pom.xml
@@ -5,7 +5,7 @@
org.eclipse.gemini.blueprint.iandt
gemini-blueprint-integration-test-bundles
- 3.0.0.M01-SNAPSHOT
+ 4.0.0-atlassian-5-SNAPSHOT
../pom.xml
diff --git a/integration-tests/bundles/proxy.listener/pom.xml b/integration-tests/bundles/proxy.listener/pom.xml
index 60fed384..4335f951 100644
--- a/integration-tests/bundles/proxy.listener/pom.xml
+++ b/integration-tests/bundles/proxy.listener/pom.xml
@@ -5,7 +5,7 @@
org.eclipse.gemini.blueprint.iandt
gemini-blueprint-integration-test-bundles
- 3.0.0.M01-SNAPSHOT
+ 4.0.0-atlassian-5-SNAPSHOT
../pom.xml
diff --git a/integration-tests/bundles/recursive.type.bundle/pom.xml b/integration-tests/bundles/recursive.type.bundle/pom.xml
index 535fee91..bfeb8431 100644
--- a/integration-tests/bundles/recursive.type.bundle/pom.xml
+++ b/integration-tests/bundles/recursive.type.bundle/pom.xml
@@ -5,7 +5,7 @@
org.eclipse.gemini.blueprint.iandt
gemini-blueprint-integration-test-bundles
- 3.0.0.M01-SNAPSHOT
+ 4.0.0-atlassian-5-SNAPSHOT
../pom.xml
diff --git a/integration-tests/bundles/reference.test.bundle/pom.xml b/integration-tests/bundles/reference.test.bundle/pom.xml
index 7610f8c0..68175e34 100644
--- a/integration-tests/bundles/reference.test.bundle/pom.xml
+++ b/integration-tests/bundles/reference.test.bundle/pom.xml
@@ -5,7 +5,7 @@
org.eclipse.gemini.blueprint.iandt
gemini-blueprint-integration-test-bundles
- 3.0.0.M01-SNAPSHOT
+ 4.0.0-atlassian-5-SNAPSHOT
../pom.xml
diff --git a/integration-tests/bundles/scoped.a.bundle/pom.xml b/integration-tests/bundles/scoped.a.bundle/pom.xml
index 36896ca0..b37d944e 100644
--- a/integration-tests/bundles/scoped.a.bundle/pom.xml
+++ b/integration-tests/bundles/scoped.a.bundle/pom.xml
@@ -5,7 +5,7 @@
org.eclipse.gemini.blueprint.iandt
gemini-blueprint-integration-test-bundles
- 3.0.0.M01-SNAPSHOT
+ 4.0.0-atlassian-5-SNAPSHOT
../pom.xml
diff --git a/integration-tests/bundles/scoped.b.bundle/pom.xml b/integration-tests/bundles/scoped.b.bundle/pom.xml
index b77ed20d..e6a9f57c 100644
--- a/integration-tests/bundles/scoped.b.bundle/pom.xml
+++ b/integration-tests/bundles/scoped.b.bundle/pom.xml
@@ -5,7 +5,7 @@
org.eclipse.gemini.blueprint.iandt
gemini-blueprint-integration-test-bundles
- 3.0.0.M01-SNAPSHOT
+ 4.0.0-atlassian-5-SNAPSHOT
../pom.xml
diff --git a/integration-tests/bundles/scoped.common.bundle/pom.xml b/integration-tests/bundles/scoped.common.bundle/pom.xml
index 7b04887f..7f82cdae 100644
--- a/integration-tests/bundles/scoped.common.bundle/pom.xml
+++ b/integration-tests/bundles/scoped.common.bundle/pom.xml
@@ -5,7 +5,7 @@
org.eclipse.gemini.blueprint.iandt
gemini-blueprint-integration-test-bundles
- 3.0.0.M01-SNAPSHOT
+ 4.0.0-atlassian-5-SNAPSHOT
../pom.xml
diff --git a/integration-tests/bundles/service.listener.bundle/pom.xml b/integration-tests/bundles/service.listener.bundle/pom.xml
index 6437914c..8408bf24 100644
--- a/integration-tests/bundles/service.listener.bundle/pom.xml
+++ b/integration-tests/bundles/service.listener.bundle/pom.xml
@@ -5,7 +5,7 @@
org.eclipse.gemini.blueprint.iandt
gemini-blueprint-integration-test-bundles
- 3.0.0.M01-SNAPSHOT
+ 4.0.0-atlassian-5-SNAPSHOT
../pom.xml
diff --git a/integration-tests/bundles/simple.service.2.bundle/pom.xml b/integration-tests/bundles/simple.service.2.bundle/pom.xml
index e494d4d9..d89d702a 100644
--- a/integration-tests/bundles/simple.service.2.bundle/pom.xml
+++ b/integration-tests/bundles/simple.service.2.bundle/pom.xml
@@ -5,7 +5,7 @@
org.eclipse.gemini.blueprint.iandt
gemini-blueprint-integration-test-bundles
- 3.0.0.M01-SNAPSHOT
+ 4.0.0-atlassian-5-SNAPSHOT
../pom.xml
diff --git a/integration-tests/bundles/simple.service.3.bundle/pom.xml b/integration-tests/bundles/simple.service.3.bundle/pom.xml
index 06b1e8e6..d6851e8e 100644
--- a/integration-tests/bundles/simple.service.3.bundle/pom.xml
+++ b/integration-tests/bundles/simple.service.3.bundle/pom.xml
@@ -5,7 +5,7 @@
org.eclipse.gemini.blueprint.iandt
gemini-blueprint-integration-test-bundles
- 3.0.0.M01-SNAPSHOT
+ 4.0.0-atlassian-5-SNAPSHOT
../pom.xml
diff --git a/integration-tests/bundles/simple.service.bundle.2.identical/pom.xml b/integration-tests/bundles/simple.service.bundle.2.identical/pom.xml
index 6335767a..746d40cc 100644
--- a/integration-tests/bundles/simple.service.bundle.2.identical/pom.xml
+++ b/integration-tests/bundles/simple.service.bundle.2.identical/pom.xml
@@ -5,7 +5,7 @@
org.eclipse.gemini.blueprint.iandt
gemini-blueprint-integration-test-bundles
- 3.0.0.M01-SNAPSHOT
+ 4.0.0-atlassian-5-SNAPSHOT
../pom.xml
diff --git a/integration-tests/bundles/simple.service.bundle.identical/pom.xml b/integration-tests/bundles/simple.service.bundle.identical/pom.xml
index 20407473..ea9afdb0 100644
--- a/integration-tests/bundles/simple.service.bundle.identical/pom.xml
+++ b/integration-tests/bundles/simple.service.bundle.identical/pom.xml
@@ -5,7 +5,7 @@
org.eclipse.gemini.blueprint.iandt
gemini-blueprint-integration-test-bundles
- 3.0.0.M01-SNAPSHOT
+ 4.0.0-atlassian-5-SNAPSHOT
../pom.xml
diff --git a/integration-tests/bundles/simple.service.bundle/pom.xml b/integration-tests/bundles/simple.service.bundle/pom.xml
index 5cb595cb..4e6805bb 100644
--- a/integration-tests/bundles/simple.service.bundle/pom.xml
+++ b/integration-tests/bundles/simple.service.bundle/pom.xml
@@ -5,7 +5,7 @@
org.eclipse.gemini.blueprint.iandt
gemini-blueprint-integration-test-bundles
- 3.0.0.M01-SNAPSHOT
+ 4.0.0-atlassian-5-SNAPSHOT
../pom.xml
diff --git a/integration-tests/bundles/tccl.bundle/pom.xml b/integration-tests/bundles/tccl.bundle/pom.xml
index 4c75f731..69b83183 100644
--- a/integration-tests/bundles/tccl.bundle/pom.xml
+++ b/integration-tests/bundles/tccl.bundle/pom.xml
@@ -5,7 +5,7 @@
org.eclipse.gemini.blueprint.iandt
gemini-blueprint-integration-test-bundles
- 3.0.0.M01-SNAPSHOT
+ 4.0.0-atlassian-5-SNAPSHOT
../pom.xml
diff --git a/integration-tests/bundles/tccl.intf.bundle/pom.xml b/integration-tests/bundles/tccl.intf.bundle/pom.xml
index 20f20c3d..92937203 100644
--- a/integration-tests/bundles/tccl.intf.bundle/pom.xml
+++ b/integration-tests/bundles/tccl.intf.bundle/pom.xml
@@ -5,7 +5,7 @@
org.eclipse.gemini.blueprint.iandt
gemini-blueprint-integration-test-bundles
- 3.0.0.M01-SNAPSHOT
+ 4.0.0-atlassian-5-SNAPSHOT
../pom.xml
diff --git a/integration-tests/bundles/trivial.bundle/pom.xml b/integration-tests/bundles/trivial.bundle/pom.xml
index 0766dd7c..da7cd0c8 100644
--- a/integration-tests/bundles/trivial.bundle/pom.xml
+++ b/integration-tests/bundles/trivial.bundle/pom.xml
@@ -5,7 +5,7 @@
org.eclipse.gemini.blueprint.iandt
gemini-blueprint-integration-test-bundles
- 3.0.0.M01-SNAPSHOT
+ 4.0.0-atlassian-5-SNAPSHOT
../pom.xml
diff --git a/integration-tests/bundles/trivial.test.bundle/pom.xml b/integration-tests/bundles/trivial.test.bundle/pom.xml
index be47e091..fea442bc 100644
--- a/integration-tests/bundles/trivial.test.bundle/pom.xml
+++ b/integration-tests/bundles/trivial.test.bundle/pom.xml
@@ -5,7 +5,7 @@
org.eclipse.gemini.blueprint.iandt
gemini-blueprint-integration-test-bundles
- 3.0.0.M01-SNAPSHOT
+ 4.0.0-atlassian-5-SNAPSHOT
../pom.xml
diff --git a/integration-tests/pom.xml b/integration-tests/pom.xml
index f351bc27..ac2bfe40 100644
--- a/integration-tests/pom.xml
+++ b/integration-tests/pom.xml
@@ -5,7 +5,7 @@
org.eclipse.gemini.blueprint
gemini-blueprint
- 3.0.0.M01-SNAPSHOT
+ 4.0.0-atlassian-5-SNAPSHOT
../pom.xml
@@ -24,24 +24,6 @@
tests
-
-
- release
-
-
-
-
- maven-surefire-plugin
-
- true
-
-
-
-
-
-
-
-
diff --git a/integration-tests/tests/pom.xml b/integration-tests/tests/pom.xml
index bae666f3..df6c65cf 100644
--- a/integration-tests/tests/pom.xml
+++ b/integration-tests/tests/pom.xml
@@ -5,7 +5,7 @@
org.eclipse.gemini.blueprint.iandt
gemini-blueprint-integration-tests-parent
- 3.0.0.M01-SNAPSHOT
+ 4.0.0-atlassian-5-SNAPSHOT
../pom.xml
@@ -197,7 +197,7 @@
${project.build.testOutputDirectory}/logback-test.xml
- ${clover.argLine} ${security.argLine} -XX:+UnlockDiagnosticVMOptions -XX:+UnsyncloadClass
+ ${clover.argLine} ${security.argLine} -XX:+UnlockDiagnosticVMOptions --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.security=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED
diff --git a/integration-tests/tests/src/test/java/org/eclipse/gemini/blueprint/iandt/compliance/io/CallingResourceOnDifferentBundlesTest.java b/integration-tests/tests/src/test/java/org/eclipse/gemini/blueprint/iandt/compliance/io/CallingResourceOnDifferentBundlesTest.java
index 131a2380..3c96ea05 100644
--- a/integration-tests/tests/src/test/java/org/eclipse/gemini/blueprint/iandt/compliance/io/CallingResourceOnDifferentBundlesTest.java
+++ b/integration-tests/tests/src/test/java/org/eclipse/gemini/blueprint/iandt/compliance/io/CallingResourceOnDifferentBundlesTest.java
@@ -70,7 +70,8 @@ public void testCallGetResourcesOnADifferentBundle() throws Exception {
}
public void testCallGetResourceOnADifferentBundleRetrievedThroughBundleEvent() throws Exception {
- String EXTRA_BUNDLE = "org.apache.servicemix.bundles.spring-core";
+ // those tests are using Atlassian Spring bundle now instead of servicemix repackages
+ String EXTRA_BUNDLE = "platform-spring-bundle";
Bundle[] bundles = bundleContext.getBundles();
Bundle bundle = null;
diff --git a/integration-tests/tests/src/test/java/org/eclipse/gemini/blueprint/iandt/configopt/BehaviorBaseTest.java b/integration-tests/tests/src/test/java/org/eclipse/gemini/blueprint/iandt/configopt/BehaviorBaseTest.java
index 458915ae..b1346f16 100644
--- a/integration-tests/tests/src/test/java/org/eclipse/gemini/blueprint/iandt/configopt/BehaviorBaseTest.java
+++ b/integration-tests/tests/src/test/java/org/eclipse/gemini/blueprint/iandt/configopt/BehaviorBaseTest.java
@@ -38,7 +38,7 @@ public abstract class BehaviorBaseTest extends BaseIntegrationTest {
* @param alive
*/
protected void assertContextServiceIs(Bundle bundle, boolean alive, long maxWait) {
- Assert.notNull(bundle);
+ Assert.notNull(bundle, "required field");
try {
waitOnContextCreation(bundle.getSymbolicName(), maxWait / 1000 + 1);
diff --git a/integration-tests/tests/src/test/java/org/eclipse/gemini/blueprint/iandt/io/ClassSpaceWildcardTest.java b/integration-tests/tests/src/test/java/org/eclipse/gemini/blueprint/iandt/io/ClassSpaceWildcardTest.java
index fc77f318..7f5aaa6b 100644
--- a/integration-tests/tests/src/test/java/org/eclipse/gemini/blueprint/iandt/io/ClassSpaceWildcardTest.java
+++ b/integration-tests/tests/src/test/java/org/eclipse/gemini/blueprint/iandt/io/ClassSpaceWildcardTest.java
@@ -45,7 +45,10 @@ public void testWildcardAtRootFileLevel() throws Exception {
// similar as the root test but inside META-INF
public void testWildcardAtFolderLevel() throws Exception {
Resource res[] = patternLoader.getResources("classpath:/META-INF/*");
- assertEquals("not enough packages found", 1, res.length);
+ // after updating configuration to include license file `META-INF/*` contains 2 resources:
+ // - `MANIFEST.MF`
+ // - `license-apache.txt`
+ assertEquals("not enough packages found", 2, res.length);
printPathWithinContext(res);
}
diff --git a/integration-tests/tests/src/test/java/org/eclipse/gemini/blueprint/iandt/io/OSGI799Test.java b/integration-tests/tests/src/test/java/org/eclipse/gemini/blueprint/iandt/io/OSGI799Test.java
index ef8ac0cc..dd08a806 100644
--- a/integration-tests/tests/src/test/java/org/eclipse/gemini/blueprint/iandt/io/OSGI799Test.java
+++ b/integration-tests/tests/src/test/java/org/eclipse/gemini/blueprint/iandt/io/OSGI799Test.java
@@ -34,7 +34,14 @@
*
* The test will install two bundle, one with a custom classpath exporting a package and the other importing that
* particular package.
- *
+ *
+ * ATLASSIAN notes:
+ * Apparently Gemini implementation treats every "Bundle-ClassPath" entry as a separate root.
+ * `osgi-799-exp.jar` defines 3 entries there:
+ * - `.` - typical simple root of the jar
+ * - `cp` - a directory inside the jar
+ * - `nested.jar` - a nested jar that is loaded by the bundle classloader (we are using similar pattern to register embedded libraries in plugins)
+ *
* @author Costin Leau
*/
public class OSGI799Test extends BaseIoTest {
@@ -94,6 +101,10 @@ protected ResourcePatternResolver getImporterPatternLoader() {
public void testExportedCustomCP() throws Exception {
ResourcePatternResolver resolver = getExporterPatternLoader();
+ // It detects:
+ // - `/some/path/root/root.res` from the default classpath root (`.`)
+ // - `some/path/cp/cp.res` from the `cp` directory (defined as classpath root)
+ // - `some/path/nested/nested.res` from the `nested.jar` (defined as classpath root)
Resource[] resources = resolver.getResources("classpath:/some/**/*.res");
System.out.println(Arrays.toString(resources));
assertEquals(3, resources.length);
@@ -101,6 +112,8 @@ public void testExportedCustomCP() throws Exception {
public void testImportedCustomCP() throws Exception {
ResourcePatternResolver resolver = getImporterPatternLoader();
+ // Importer bundle imports all the paths (they are not only packages!)
+ // so it has access to exactly the same resources as the exporter defined in test above
Resource[] resources = resolver.getResources("classpath:some/**/*.res");
System.out.println(Arrays.toString(resources));
assertEquals(3, resources.length);
@@ -108,29 +121,58 @@ public void testImportedCustomCP() throws Exception {
public void testExportedCustomFoldersCP() throws Exception {
ResourcePatternResolver resolver = getExporterPatternLoader();
+ // It detects:
+ // - `/cp/some/path/cp/cp.res` from the default classpath root (`.`)
+ // - `/some/path/root/root.res` from the default classpath root (`.`)
+ // - `some/path/cp/cp.res` from the `cp` directory (defined as classpath root)
+ // - `some/path/nested/nested.res` from the `nested.jar` (defined as classpath root)
Resource[] resources = resolver.getResources("classpath:/**/path/**/*");
System.out.println(Arrays.toString(resources));
- assertEquals(8, resources.length);
+ // Original value - 8
+ // Actual expected value should be 4, as shown above
+ // The tests used to execute on Spring 5 that contains a bug:
+ // https://github.com/spring-projects/spring-framework/issues/27506
+ // in this specific scenario, it returned not only files, but also directories - hence the result was 8.
+ assertEquals(4, resources.length);
}
public void testImporterCustomFoldersCP() throws Exception {
ResourcePatternResolver resolver = getImporterPatternLoader();
+ // The pattern is exactly the same as in case above
+ // Importer imports:
+ // - `some.path.root`
+ // - `some.path.cp`
+ // - `some.path.nested`
+ // There is no import for `cp.some.path.cp`, so that resource won't be available for importer
Resource[] resources = resolver.getResources("classpath:/**/path/**/*");
System.out.println(Arrays.toString(resources));
- assertEquals(5, resources.length);
+ // Original value - 5
+ // See explanation in above test case
+ assertEquals(3, resources.length);
}
public void testExportedCustomPatternFoldersCP() throws Exception {
ResourcePatternResolver resolver = getExporterPatternLoader();
+ // The pattern is almost the same as in previous case.
+ // The difference is in `p?th` instead of `path`.
+ // However, bundle doesn't contain any other directories that could match that pattern.
+ // Result resources are exactly the same as in the exporter case above.
Resource[] resources = resolver.getResources("classpath:/**/p?th/**/*");
System.out.println(Arrays.toString(resources));
- assertEquals(8, resources.length);
+ // Original value - 8
+ // For explanation check exporter case above
+ assertEquals(4, resources.length);
}
public void testImporterCustomPatternFoldersCP() throws Exception {
ResourcePatternResolver resolver = getImporterPatternLoader();
+ // Pattern is exactly the same as in case above.
+ // Here we have exactly the same case as in previous importer case.
+ // Importer doesn't import all the packages/directories, so instead of 4 it has access to only 3 resources.
Resource[] resources = resolver.getResources("classpath:/**/p?th/**/*");
System.out.println(Arrays.toString(resources));
- assertEquals(5, resources.length);
+ // Original value - 5
+ // For explanation check cases above
+ assertEquals(3, resources.length);
}
}
\ No newline at end of file
diff --git a/integration-tests/tests/src/test/java/org/eclipse/gemini/blueprint/iandt/jdk5/io/ComponentScanTest.java b/integration-tests/tests/src/test/java/org/eclipse/gemini/blueprint/iandt/jdk5/io/ComponentScanTest.java
index 329fab8c..d566718d 100644
--- a/integration-tests/tests/src/test/java/org/eclipse/gemini/blueprint/iandt/jdk5/io/ComponentScanTest.java
+++ b/integration-tests/tests/src/test/java/org/eclipse/gemini/blueprint/iandt/jdk5/io/ComponentScanTest.java
@@ -16,6 +16,7 @@
import org.eclipse.gemini.blueprint.iandt.BaseIntegrationTest;
import org.eclipse.gemini.blueprint.iandt.io.component.ComponentBean;
+import org.springframework.stereotype.Component;
/**
* Integration test for Spring 2.5 component scan.
@@ -25,6 +26,21 @@
*/
public class ComponentScanTest extends BaseIntegrationTest {
+ static {
+ // Modern Spring versions are trying to load and compare annotation by its runtime type.
+ // Older versions were simply comparing names of the class.
+ // That is an important change in OSGi world,
+ // where some bundles may not have access to specific classes or have different versions of them.
+ //
+ // Those tests create OSGi bundles on the fly. Code below ensures that created bundle will import Spring package.
+ // With that configuration Spring used by Gemini will be able to properly load an XML configuration.
+ //
+ // For Spring change see:
+ // https://github.com/spring-projects/spring-framework/issues/22884
+ // https://github.com/spring-projects/spring-framework/commit/7fbf3f97cdeffd7e60a7dc9b19ca59ce73cd1cea#diff-8edf0405eb9b93018d302aaa928ec58c231a58e34d92bcd7c3241b42c99be99cR99
+ Class componentClass = Component.class;
+ }
+
protected String[] getConfigLocations() {
return new String[] { "/org/eclipse/gemini/blueprint/iandt/jdk5/io/component-scan.xml" };
}
diff --git a/integration-tests/tests/src/test/resources/logback-test.xml b/integration-tests/tests/src/test/resources/logback-test.xml
index c27d7e38..27888067 100644
--- a/integration-tests/tests/src/test/resources/logback-test.xml
+++ b/integration-tests/tests/src/test/resources/logback-test.xml
@@ -5,6 +5,9 @@
%-30(%d{HH:mm:ss.SSS} [%thread]) %-5level %logger{32}:%line - %msg %ex%n
+
+ WARN
+
diff --git a/io/pom.xml b/io/pom.xml
index 371cc2cb..0fe520dd 100644
--- a/io/pom.xml
+++ b/io/pom.xml
@@ -5,7 +5,7 @@
gemini-blueprint
org.eclipse.gemini.blueprint
- 3.0.0.M01-SNAPSHOT
+ 4.0.0-atlassian-5-SNAPSHOT
../pom.xml
@@ -32,13 +32,13 @@
test
- org.apache.servicemix.bundles
- org.apache.servicemix.bundles.spring-core
+ org.springframework
+ spring-core
provided
org.osgi
- org.osgi.core
+ osgi.core
provided
diff --git a/io/src/main/java/org/eclipse/gemini/blueprint/io/OsgiBundleResource.java b/io/src/main/java/org/eclipse/gemini/blueprint/io/OsgiBundleResource.java
index 3d7d11e6..2d155955 100644
--- a/io/src/main/java/org/eclipse/gemini/blueprint/io/OsgiBundleResource.java
+++ b/io/src/main/java/org/eclipse/gemini/blueprint/io/OsgiBundleResource.java
@@ -425,7 +425,7 @@ ContextResource[] getAllUrlsFromBundleSpace(String location) throws IOException
throw new IllegalArgumentException(
"cannot locate items in bundle-space w/o a bundle; specify one when creating this resolver");
- Assert.notNull(location);
+ Assert.notNull(location, "required field");
Set resources = new LinkedHashSet(5);
location = StringUtils.cleanPath(location);
diff --git a/io/src/main/java/org/eclipse/gemini/blueprint/io/internal/OsgiResourceUtils.java b/io/src/main/java/org/eclipse/gemini/blueprint/io/internal/OsgiResourceUtils.java
index 2f79d9b7..bb92f1b7 100644
--- a/io/src/main/java/org/eclipse/gemini/blueprint/io/internal/OsgiResourceUtils.java
+++ b/io/src/main/java/org/eclipse/gemini/blueprint/io/internal/OsgiResourceUtils.java
@@ -84,7 +84,7 @@ public static String getPrefix(String path) {
* @return
*/
public static int getSearchType(String path) {
- Assert.notNull(path);
+ Assert.notNull(path, "required field");
int type = PREFIX_TYPE_NOT_SPECIFIED;
String prefix = getPrefix(path);
diff --git a/io/src/main/java/org/eclipse/gemini/blueprint/io/internal/resolver/PackageAdminResolver.java b/io/src/main/java/org/eclipse/gemini/blueprint/io/internal/resolver/PackageAdminResolver.java
index 267c9ad1..7aa0dc20 100644
--- a/io/src/main/java/org/eclipse/gemini/blueprint/io/internal/resolver/PackageAdminResolver.java
+++ b/io/src/main/java/org/eclipse/gemini/blueprint/io/internal/resolver/PackageAdminResolver.java
@@ -57,7 +57,7 @@ public class PackageAdminResolver implements DependencyResolver {
public PackageAdminResolver(BundleContext bundleContext) {
- Assert.notNull(bundleContext);
+ Assert.notNull(bundleContext, "required field");
this.bundleContext = bundleContext;
}
diff --git a/mock/pom.xml b/mock/pom.xml
index 54be2e3c..f4467418 100644
--- a/mock/pom.xml
+++ b/mock/pom.xml
@@ -5,7 +5,7 @@
gemini-blueprint
org.eclipse.gemini.blueprint
- 3.0.0.M01-SNAPSHOT
+ 4.0.0-atlassian-5-SNAPSHOT
../pom.xml
@@ -24,7 +24,7 @@
org.osgi
- org.osgi.core
+ osgi.core
provided
diff --git a/mock/src/main/java/org/eclipse/gemini/blueprint/mock/MockBundleContext.java b/mock/src/main/java/org/eclipse/gemini/blueprint/mock/MockBundleContext.java
index 427c626c..7427004e 100644
--- a/mock/src/main/java/org/eclipse/gemini/blueprint/mock/MockBundleContext.java
+++ b/mock/src/main/java/org/eclipse/gemini/blueprint/mock/MockBundleContext.java
@@ -38,7 +38,9 @@
import org.osgi.framework.Filter;
import org.osgi.framework.FrameworkListener;
import org.osgi.framework.InvalidSyntaxException;
+import org.osgi.framework.ServiceFactory;
import org.osgi.framework.ServiceListener;
+import org.osgi.framework.ServiceObjects;
import org.osgi.framework.ServiceReference;
import org.osgi.framework.ServiceRegistration;
@@ -166,7 +168,12 @@ public S getService(ServiceReference reference) {
}
}
- private static Class> getClass(Type type) {
+ @Override
+ public ServiceObjects getServiceObjects(ServiceReference reference) {
+ return null;
+ }
+
+ private static Class> getClass(Type type) {
if (type instanceof Class) {
return (Class) type;
}
@@ -280,7 +287,12 @@ public ServiceRegistration registerService(Class clazz, S service, Dic
return registration;
}
- public void removeServiceListener(ServiceListener listener) {
+ @Override
+ public ServiceRegistration registerService(Class clazz, ServiceFactory factory, Dictionary properties) {
+ return new MockServiceRegistration(properties);
+ }
+
+ public void removeServiceListener(ServiceListener listener) {
serviceListeners.remove(listener);
}
diff --git a/mock/src/main/java/org/eclipse/gemini/blueprint/mock/MockServiceReference.java b/mock/src/main/java/org/eclipse/gemini/blueprint/mock/MockServiceReference.java
index 33bacdf7..3eb9ef3e 100644
--- a/mock/src/main/java/org/eclipse/gemini/blueprint/mock/MockServiceReference.java
+++ b/mock/src/main/java/org/eclipse/gemini/blueprint/mock/MockServiceReference.java
@@ -244,4 +244,9 @@ public int compareTo(Object reference) {
return result;
}
+
+ @Override
+ public Dictionary getProperties() {
+ return properties;
+ }
}
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index e4cc8ad8..7c6c4e55 100644
--- a/pom.xml
+++ b/pom.xml
@@ -5,7 +5,7 @@
org.eclipse.gemini.blueprint
gemini-blueprint
- 3.0.0.M01-SNAPSHOT
+ 4.0.0-atlassian-5-SNAPSHOT
pom
Gemini Blueprint
http://www.eclipse.org/gemini/blueprint/
@@ -23,8 +23,8 @@
UTF-8
- 5.0.4.RELEASE_1
- 5.0.0
+ 6.2.0
+ 6.0.0
org.eclipse.gemini.blueprint
${project.groupId}.${project.artifactId}
@@ -38,14 +38,10 @@
- 5.0.0
+ 7.0.0
-
- 3.9.1.v20130814-1242
-
- 7.1.2
-
- 4.4.0
+
+ 7.0.5
${basedir}/docs/src/javadoc
@@ -54,18 +50,18 @@
false
- false
-
..${file.separator}policy.all
- [${spring.base.version},6)
+ [${spring.base.version},7)
"${spring.version.range.nq}"
[${project.version},${project.version}]
"${gemini.blueprint.version.range.nq}"
"[1.0,2.0)"
+
+ org.eclipse.gemini.blueprint.test.platform.FelixPlatform
@@ -97,10 +93,9 @@
- http://git.eclipse.org/c/gemini.blueprint/org.eclipse.gemini.blueprint.git/
- scm:git:git//git.eclipse.org/gitroot/gemini.blueprint/org.eclipse.gemini.blueprint.git
-
- scm:git:file:///gitroot/gemini.blueprint/org.eclipse.gemini.blueprint.git
+ https://github.com/atlassian-forks/gemini.blueprint
+ scm:git:git@github.com:atlassian-forks/gemini.blueprint.git
+ scm:git:git@github.com:atlassian-forks/gemini.blueprint.git
HEAD
@@ -188,6 +183,7 @@
extender
extensions
test-support
+ integration-tests
@@ -221,38 +217,38 @@
- org.apache.servicemix.bundles
- org.apache.servicemix.bundles.spring-aop
+ org.springframework
+ spring-aop
${spring.maven.artifact.version}
- org.apache.servicemix.bundles
- org.apache.servicemix.bundles.spring-beans
+ org.springframework
+ spring-beans
${spring.maven.artifact.version}
- org.apache.servicemix.bundles
- org.apache.servicemix.bundles.spring-core
+ org.springframework
+ spring-core
${spring.maven.artifact.version}
- org.apache.servicemix.bundles
- org.apache.servicemix.bundles.spring-context
+ org.springframework
+ spring-context
${spring.maven.artifact.version}
- org.apache.servicemix.bundles
- org.apache.servicemix.bundles.spring-expression
+ org.springframework
+ spring-expression
${spring.maven.artifact.version}
- org.apache.servicemix.bundles
- org.apache.servicemix.bundles.spring-test
+ org.springframework
+ spring-test
${spring.maven.artifact.version}
@@ -264,13 +260,13 @@
org.osgi
- org.osgi.core
+ osgi.core
${osgi.ver}
org.osgi
- org.osgi.compendium
+ osgi.cmpn
${osgi.ver}
@@ -280,18 +276,6 @@
4.12_1
-
- org.eclipse.birt.runtime
- org.eclipse.osgi
- ${equinox.ver}
-
-
-
- org.knopflerfish
- framework
- ${kf.ver}
-
-
org.apache.felix
org.apache.felix.main
@@ -306,6 +290,12 @@
+
+ com.atlassian.platform.dependencies
+ platform-spring-bundle
+ 8.0.0-jakarta-001
+
+
@@ -313,9 +303,9 @@
- javax.inject
- javax.inject
- 1
+ jakarta.servlet
+ jakarta.servlet-api
+ 4.0.4
@@ -373,6 +363,24 @@
${logback.version}
provided
+
+
+ org.apache.felix
+ org.apache.felix.main
+ ${felix.ver}
+ provided
+
+
+ org.apache.felix
+ org.apache.felix.framework
+
+
+
+
+ org.osgi
+ osgi.core
+ compile
+
@@ -388,18 +396,6 @@
-
-
- org.apache.maven.plugins
- maven-deploy-plugin
- 2.8.2
-
- true
-
-
org.apache.maven.plugins
maven-release-plugin
@@ -414,7 +410,7 @@
biz.aQute.bnd
bnd-maven-plugin
- 3.3.0
+ 7.0.0
@@ -436,7 +432,7 @@
org.apache.maven.plugins
maven-site-plugin
- 3.6
+ 3.21.0
org.apache.maven.plugins
@@ -467,6 +463,9 @@
org.apache.maven.plugins
maven-surefire-plugin
2.19.1
+
+ --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.security=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED
+
@@ -491,9 +490,10 @@
org.apache.maven.plugins
maven-javadoc-plugin
- 2.10.4
+ 3.4.0
true
+ false
-Xdoclint:none
@@ -510,16 +510,6 @@
maven-jxr-plugin
2.5
-
- org.codehaus.mojo
- jdepend-maven-plugin
- 2.0
-
-
- org.codehaus.mojo
- findbugs-maven-plugin
- 3.0.4
-
org.apache.maven.plugins
maven-antrun-plugin
@@ -543,7 +533,7 @@
org.apache.maven.plugins
maven-project-info-reports-plugin
- 2.9
+ 3.8.0
@@ -554,8 +544,8 @@
maven-compiler-plugin
3.6.1
- 1.8
- 1.8
+ 17
+ 17
@@ -631,68 +621,6 @@
maven-site-plugin
true
-
-
- org.apache.maven.plugins
- maven-jxr-plugin
-
- true
-
-
-
- org.apache.maven.plugins
- maven-surefire-report-plugin
-
- true
-
-
-
-
- org.apache.maven.plugins
- maven-project-info-reports-plugin
-
-
-
-
-
-
- org.codehaus.mojo
- findbugs-maven-plugin
-
-
- Normal
- Default
-
- ${findbugs.skip}
-
-
-
-
-
-
-
-
- org.apache.maven.plugins
- maven-pmd-plugin
-
- 1.7
-
-
-
-
-
-
-
- org.codehaus.mojo
- jdepend-maven-plugin
-
-
@@ -778,83 +706,43 @@
+
+ org.apache.maven.plugins
+ maven-resources-plugin
+
+
+ copy-license
+ process-sources
+
+ copy-resources
+
+
+ ${project.build.outputDirectory}/META-INF
+ true
+
+
+ ${user.dir}
+
+ license-apache.txt
+
+ true
+
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-javadoc-plugin
+
-
-
+
-
- equinox
-
-
- org.eclipse.birt.runtime
- org.eclipse.osgi
- ${equinox.ver}
- provided
-
-
-
- org.eclipse.gemini.blueprint.test.platform.EquinoxPlatform
-
-
-
-
- knopflerfish
-
-
- org.knopflerfish
- framework
- ${kf.ver}
- provided
-
-
-
- org.eclipse.gemini.blueprint.test.platform.KnopflerfishPlatform
- true
-
-
-
-
- felix
-
-
- org.apache.felix
- org.apache.felix.main
- ${felix.ver}
- provided
-
-
- org.apache.felix
- org.apache.felix.framework
-
-
-
-
- org.osgi
- org.osgi.core
- compile
-
-
-
- org.eclipse.gemini.blueprint.test.platform.FelixPlatform
-
-
-
-
-
- it
-
-
- env-test
-
-
-
- integration-tests
-
-
@@ -897,30 +785,6 @@
-->
release
-
- core
- extender
- extensions
- integration-tests
- io
- mock
- test-support
-
-
-
-
-
- org.osgi
- org.osgi.core
- compile
-
-
-
@@ -956,45 +820,6 @@
-
- org.apache.maven.plugins
- maven-gpg-plugin
- 1.6
-
-
- sign-artifacts
- verify
-
- sign
-
-
-
-
-
- org.sonatype.plugins
- nexus-staging-maven-plugin
- 1.6.7
- true
-
-
- default-deploy
- deploy
-
- deploy
-
-
-
-
- ossrh
- https://oss.sonatype.org/
- false
-
- true
-
-
@@ -1006,14 +831,13 @@
- http://www.eclipse.org/gemini/blueprint/download/
- ossrh
- https://oss.sonatype.org/content/repositories/snapshots
+ atlassian-3rdparty-snapshot
+ https://packages.atlassian.com/maven/3rdparty-snapshot
- ossrh
- https://oss.sonatype.org/service/local/staging/deploy/maven2/
+ atlassian-3rdparty
+ https://packages.atlassian.com/maven/3rdparty
@@ -1044,4 +868,40 @@
+
+
+
+ org.apache.maven.plugins
+ maven-jxr-plugin
+
+ true
+
+
+
+ org.apache.maven.plugins
+ maven-surefire-report-plugin
+
+ true
+
+
+
+
+ org.apache.maven.plugins
+ maven-project-info-reports-plugin
+
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-pmd-plugin
+
+ 1.7
+
+
+
+
+
diff --git a/test-support/pom.xml b/test-support/pom.xml
index 7353ced2..c08394ea 100644
--- a/test-support/pom.xml
+++ b/test-support/pom.xml
@@ -5,7 +5,7 @@
gemini-blueprint
org.eclipse.gemini.blueprint
- 3.0.0.M01-SNAPSHOT
+ 4.0.0-atlassian-5-SNAPSHOT
../pom.xml
@@ -39,14 +39,14 @@
- org.apache.servicemix.bundles
- org.apache.servicemix.bundles.spring-test
+ org.springframework
+ spring-test
org.ow2.asm
- asm-all
- 5.2
+ asm
+ 9.6
@@ -64,27 +64,15 @@
- org.osgi
- org.osgi.core
+ org.apache.felix
+ org.apache.felix.main
provided
true
- org.eclipse.birt.runtime
- org.eclipse.osgi
- provided
- true
-
-
- org.knopflerfish
- framework
- provided
- true
-
-
- org.apache.felix
- org.apache.felix.main
+ org.osgi
+ osgi.core
provided
true
@@ -95,6 +83,12 @@
gemini-blueprint-mock
test
+
+
+ com.atlassian.platform.dependencies
+ platform-spring-bundle
+ runtime
+
diff --git a/test-support/src/main/java/org/eclipse/gemini/blueprint/test/AbstractConfigurableOsgiTests.java b/test-support/src/main/java/org/eclipse/gemini/blueprint/test/AbstractConfigurableOsgiTests.java
index 9cea66c1..205c02ad 100644
--- a/test-support/src/main/java/org/eclipse/gemini/blueprint/test/AbstractConfigurableOsgiTests.java
+++ b/test-support/src/main/java/org/eclipse/gemini/blueprint/test/AbstractConfigurableOsgiTests.java
@@ -19,7 +19,7 @@
import java.util.List;
import java.util.Properties;
-import org.eclipse.gemini.blueprint.test.platform.EquinoxPlatform;
+import org.eclipse.gemini.blueprint.test.platform.FelixPlatform;
import org.eclipse.gemini.blueprint.test.platform.OsgiPlatform;
import org.eclipse.gemini.blueprint.test.platform.Platforms;
import org.osgi.framework.Constants;
@@ -103,7 +103,7 @@ protected OsgiPlatform createPlatform() {
// fall back
if (platform == null)
- platform = new EquinoxPlatform();
+ platform = new FelixPlatform();
Properties config = platform.getConfigurationProperties();
// add boot delegation
@@ -128,7 +128,7 @@ protected String getPlatformName() {
logger.trace("System property [" + OSGI_FRAMEWORK_SELECTOR + "] has value=" + systemProperty);
}
- return (!StringUtils.hasText(systemProperty) ? Platforms.EQUINOX : systemProperty);
+ return (!StringUtils.hasText(systemProperty) ? Platforms.FELIX : systemProperty);
}
/**
diff --git a/test-support/src/main/java/org/eclipse/gemini/blueprint/test/AbstractDependencyManagerTests.java b/test-support/src/main/java/org/eclipse/gemini/blueprint/test/AbstractDependencyManagerTests.java
index 03eabe83..5bcf355c 100644
--- a/test-support/src/main/java/org/eclipse/gemini/blueprint/test/AbstractDependencyManagerTests.java
+++ b/test-support/src/main/java/org/eclipse/gemini/blueprint/test/AbstractDependencyManagerTests.java
@@ -77,7 +77,6 @@ public AbstractDependencyManagerTests(String name) {
}
private static final String GEMINI_BLUEPRINT_VERSION_PROP_KEY = "ignore.gemini.blueprint.version";
- private static final String SPRING_VERSION_PROP_KEY = "ignore.spring.version";
/** uninitialised - read from the properties file */
private String springOsgiVersion = null;
@@ -100,19 +99,6 @@ protected String getSpringDMVersion() {
return springOsgiVersion;
}
- /**
- * Returns the version of the Spring bundles installed by the testing
- * framework.
- *
- * @return Spring framework dependency version
- */
- protected String getSpringVersion() {
- if (springBundledVersion == null) {
- springBundledVersion = readProperty(SPRING_VERSION_PROP_KEY);
- }
- return springBundledVersion;
- }
-
private String readProperty(final String name) {
if (System.getSecurityManager() != null) {
return (String) AccessController.doPrivileged(new PrivilegedAction() {
@@ -180,7 +166,6 @@ protected String[] getTestFrameworkBundlesNames() {
// pass properties to test instance running inside OSGi space
System.getProperties().put(GEMINI_BLUEPRINT_VERSION_PROP_KEY, props.get(GEMINI_BLUEPRINT_VERSION_PROP_KEY));
- System.getProperties().put(SPRING_VERSION_PROP_KEY, props.get(SPRING_VERSION_PROP_KEY));
Properties excluded = PropertiesUtil.filterKeysStartingWith(props, IGNORE);
diff --git a/test-support/src/main/java/org/eclipse/gemini/blueprint/test/AbstractOptionalDependencyInjectionTests.java b/test-support/src/main/java/org/eclipse/gemini/blueprint/test/AbstractOptionalDependencyInjectionTests.java
index 46ffda4a..64f98d8e 100644
--- a/test-support/src/main/java/org/eclipse/gemini/blueprint/test/AbstractOptionalDependencyInjectionTests.java
+++ b/test-support/src/main/java/org/eclipse/gemini/blueprint/test/AbstractOptionalDependencyInjectionTests.java
@@ -54,6 +54,11 @@ public abstract class AbstractOptionalDependencyInjectionTests extends AbstractD
// the disposable interface is added just so that byte code detect the org.springframework.beans.factory package
private static class EmptyOsgiApplicationContext extends AbstractDelegatedExecutionApplicationContext implements DisposableBean {
protected void loadBeanDefinitions(DefaultListableBeanFactory beanFactory) throws IOException, BeansException {}
+
+ @Override
+ public void destroy() throws Exception {
+ this.close();
+ }
}
diff --git a/test-support/src/main/java/org/eclipse/gemini/blueprint/test/AbstractOsgiTests.java b/test-support/src/main/java/org/eclipse/gemini/blueprint/test/AbstractOsgiTests.java
index 0c5614fa..3083e5e3 100644
--- a/test-support/src/main/java/org/eclipse/gemini/blueprint/test/AbstractOsgiTests.java
+++ b/test-support/src/main/java/org/eclipse/gemini/blueprint/test/AbstractOsgiTests.java
@@ -398,8 +398,15 @@ private void initializeServiceRunnerInvocationMethods() throws Exception {
BundleContext ctx = getRuntimeBundleContext();
- ServiceReference reference = ctx.getServiceReference(ACTIVATOR_REFERENCE);
- Assert.notNull(reference, "no OSGi service reference found at " + ACTIVATOR_REFERENCE);
+ // analysing the code of Felix 7 it returns only those services that can be assigned by the requester
+ // here we are in the context of "System Bundle" and we are trying to get service from different bundle
+ // "System Bundle" doesn't have access to that class, so Felix returns `null`
+ // By calling all services we are omitting that check
+ ServiceReference>[] allServiceReferences = ctx.getAllServiceReferences(ACTIVATOR_REFERENCE, null);
+ if (allServiceReferences.length == 0) {
+ throw new IllegalArgumentException("no OSGi service reference found at " + ACTIVATOR_REFERENCE);
+ }
+ ServiceReference reference = allServiceReferences[0];
service = ctx.getService(reference);
Assert.notNull(service, "no service found for reference: " + reference);
diff --git a/test-support/src/main/java/org/eclipse/gemini/blueprint/test/AbstractSynchronizedOsgiTests.java b/test-support/src/main/java/org/eclipse/gemini/blueprint/test/AbstractSynchronizedOsgiTests.java
index 8b6236d7..d73c1845 100644
--- a/test-support/src/main/java/org/eclipse/gemini/blueprint/test/AbstractSynchronizedOsgiTests.java
+++ b/test-support/src/main/java/org/eclipse/gemini/blueprint/test/AbstractSynchronizedOsgiTests.java
@@ -22,6 +22,7 @@
import org.eclipse.gemini.blueprint.util.OsgiBundleUtils;
import org.eclipse.gemini.blueprint.util.OsgiListenerUtils;
import org.eclipse.gemini.blueprint.util.OsgiStringUtils;
+import org.osgi.framework.AllServiceListener;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceEvent;
@@ -117,13 +118,10 @@ protected void waitOnContextCreation(BundleContext context, String forBundleWith
String filter = "(org.springframework.context.service.name=" + forBundleWithSymbolicName + ")";
- ServiceListener listener = new ServiceListener() {
-
- public void serviceChanged(ServiceEvent event) {
- if (event.getType() == ServiceEvent.REGISTERED)
- counter.decrement();
- }
- };
+ AllServiceListener listener = event -> {
+ if (event.getType() == ServiceEvent.REGISTERED)
+ counter.decrement();
+ };
OsgiListenerUtils.addServiceListener(context, listener, filter);
diff --git a/test-support/src/main/java/org/eclipse/gemini/blueprint/test/internal/holder/ReflectionOsgiHolder.java b/test-support/src/main/java/org/eclipse/gemini/blueprint/test/internal/holder/ReflectionOsgiHolder.java
index f1f2a86d..eb298cc8 100644
--- a/test-support/src/main/java/org/eclipse/gemini/blueprint/test/internal/holder/ReflectionOsgiHolder.java
+++ b/test-support/src/main/java/org/eclipse/gemini/blueprint/test/internal/holder/ReflectionOsgiHolder.java
@@ -42,7 +42,7 @@ class ReflectionOsgiHolder extends OsgiTestInfoHolder {
* @param twinInstance instance to wrap
*/
ReflectionOsgiHolder(Object twinInstance) {
- Assert.notNull(twinInstance);
+ Assert.notNull(twinInstance, "required field");
this.instance = twinInstance;
Class> clazz = instance.getClass();
GET_TEST_BUNDLE_ID = ReflectionUtils.findMethod(clazz, "getTestBundleId");
diff --git a/test-support/src/main/java/org/eclipse/gemini/blueprint/test/internal/util/DependencyVisitor.java b/test-support/src/main/java/org/eclipse/gemini/blueprint/test/internal/util/DependencyVisitor.java
index 06866044..9184564e 100644
--- a/test-support/src/main/java/org/eclipse/gemini/blueprint/test/internal/util/DependencyVisitor.java
+++ b/test-support/src/main/java/org/eclipse/gemini/blueprint/test/internal/util/DependencyVisitor.java
@@ -65,7 +65,7 @@
*/
public class DependencyVisitor extends ClassVisitor {
- private final AnnotationVisitor av = new AnnotationVisitor(Opcodes.ASM5) {
+ private final AnnotationVisitor av = new AnnotationVisitor(Opcodes.ASM7) {
@Override
public void visit(String name, Object value) {
DependencyVisitor.this.visit(name, value);
@@ -92,7 +92,7 @@ public void visitEnd() {
}
};
- private final SignatureVisitor sv = new SignatureVisitor(Opcodes.ASM5) {
+ private final SignatureVisitor sv = new SignatureVisitor(Opcodes.ASM7) {
@Override
public void visitFormalTypeParameter(String name) {
DependencyVisitor.this.visitFormalTypeParameter(name);
@@ -174,7 +174,7 @@ public void visitEnd() {
}
};
- private final FieldVisitor fv = new FieldVisitor(Opcodes.ASM5) {
+ private final FieldVisitor fv = new FieldVisitor(Opcodes.ASM7) {
@Override
public AnnotationVisitor visitAnnotation(String desc, boolean visible) {
return DependencyVisitor.this.visitAnnotation(desc, visible);
@@ -196,7 +196,7 @@ public void visitEnd() {
}
};
- private final MethodVisitor mv = new MethodVisitor(Opcodes.ASM5) {
+ private final MethodVisitor mv = new MethodVisitor(Opcodes.ASM7) {
@Override
public void visitParameter(String name, int access) {
DependencyVisitor.this.visitParameter(name, access);
@@ -354,7 +354,7 @@ public void visitEnd() {
};
public DependencyVisitor() {
- super(Opcodes.ASM5);
+ super(Opcodes.ASM7);
}
private AnnotationVisitor visitLocalVariableAnnotation(int typeRef, TypePath typePath, Label[] start, Label[] end, int[] index, String desc, boolean visible) {
diff --git a/test-support/src/main/java/org/eclipse/gemini/blueprint/test/internal/util/PropertiesUtil.java b/test-support/src/main/java/org/eclipse/gemini/blueprint/test/internal/util/PropertiesUtil.java
index a991c951..39ed4eb2 100644
--- a/test-support/src/main/java/org/eclipse/gemini/blueprint/test/internal/util/PropertiesUtil.java
+++ b/test-support/src/main/java/org/eclipse/gemini/blueprint/test/internal/util/PropertiesUtil.java
@@ -248,7 +248,7 @@ public static Properties filterKeysStartingWith(Properties properties, String pr
return EMPTY_PROPERTIES;
}
- Assert.notNull(properties);
+ Assert.notNull(properties, "required field");
Properties excluded = (properties instanceof OrderedProperties ? new OrderedProperties() : new Properties());
@@ -278,7 +278,7 @@ public static Properties filterValuesStartingWith(Properties properties, String
return EMPTY_PROPERTIES;
}
- Assert.notNull(properties);
+ Assert.notNull(properties, "required field");
Properties excluded = (properties instanceof OrderedProperties ? new OrderedProperties() : new Properties());
for (Enumeration enm = properties.keys(); enm.hasMoreElements();) {
@@ -305,7 +305,7 @@ public static Properties filterValuesStartingWith(Properties properties, String
* @return
*/
public static Properties expandProperties(Properties props) {
- Assert.notNull(props);
+ Assert.notNull(props, "required field");
Set entrySet = props.entrySet();
diff --git a/test-support/src/main/java/org/eclipse/gemini/blueprint/test/platform/EquinoxPlatform.java b/test-support/src/main/java/org/eclipse/gemini/blueprint/test/platform/EquinoxPlatform.java
deleted file mode 100644
index c3dd650e..00000000
--- a/test-support/src/main/java/org/eclipse/gemini/blueprint/test/platform/EquinoxPlatform.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/******************************************************************************
- * Copyright (c) 2006, 2010 VMware Inc.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * and Apache License v2.0 which accompanies this distribution.
- * The Eclipse Public License is available at
- * http://www.eclipse.org/legal/epl-v10.html and the Apache License v2.0
- * is available at http://www.opensource.org/licenses/apache2.0.php.
- * You may elect to redistribute this code under either of these licenses.
- *
- * Contributors:
- * VMware Inc.
- *****************************************************************************/
-
-package org.eclipse.gemini.blueprint.test.platform;
-
-import java.lang.reflect.Field;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.util.Properties;
-
-import org.eclipse.core.runtime.adaptor.EclipseStarter;
-import org.osgi.framework.BundleContext;
-
-/**
- * Equinox (3.2.x) OSGi platform.
- *
- * @author Costin Leau
- *
- */
-public class EquinoxPlatform extends AbstractOsgiPlatform {
-
- private BundleContext context;
-
-
- public EquinoxPlatform() {
- toString = "Equinox OSGi Platform";
- }
-
- Properties getPlatformProperties() {
- // default properties
- Properties props = new Properties();
- props.setProperty("eclipse.ignoreApp", "true");
- props.setProperty("osgi.clean", "true");
- props.setProperty("osgi.noShutdown", "true");
-
- // local temporary folder for running tests
- // prevents accidental rewrites
- props.setProperty("osgi.configuration.area", "./target/eclipse_config");
- props.setProperty("osgi.instance.area", "./target/eclipse_config");
- props.setProperty("osgi.user.area", "./target/eclipse_config");
-
- // props.setProperty("eclipse.consoleLog", "true");
- // props.setProperty("osgi.debug", "");
-
- return props;
- }
-
- public BundleContext getBundleContext() {
- return context;
- }
-
- public void start() throws Exception {
-
- if (context == null) {
- // copy configuration properties to sys properties
- System.getProperties().putAll(getConfigurationProperties());
-
- // Equinox 3.1.x returns void - use of reflection is required
- // use main since in 3.1.x it sets up some system properties
-// EclipseStarter.main(new String[0]);
-
-// final Field field = EclipseStarter.class.getDeclaredField("context");
-
-// AccessController.doPrivileged(new PrivilegedAction() {
-// public Object run() {
-// field.setAccessible(true);
-// return null;
-// }
-// });
-// context = (BundleContext) field.get(null);
- context = EclipseStarter.startup(new String[0], null);
- }
- }
-
- public void stop() throws Exception {
- if (context != null) {
- context = null;
- EclipseStarter.shutdown();
- }
- }
-}
\ No newline at end of file
diff --git a/test-support/src/main/java/org/eclipse/gemini/blueprint/test/platform/KnopflerfishPlatform.java b/test-support/src/main/java/org/eclipse/gemini/blueprint/test/platform/KnopflerfishPlatform.java
deleted file mode 100644
index f7327670..00000000
--- a/test-support/src/main/java/org/eclipse/gemini/blueprint/test/platform/KnopflerfishPlatform.java
+++ /dev/null
@@ -1,185 +0,0 @@
-/******************************************************************************
- * Copyright (c) 2006, 2010 VMware Inc.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * and Apache License v2.0 which accompanies this distribution.
- * The Eclipse Public License is available at
- * http://www.eclipse.org/legal/epl-v10.html and the Apache License v2.0
- * is available at http://www.opensource.org/licenses/apache2.0.php.
- * You may elect to redistribute this code under either of these licenses.
- *
- * Contributors:
- * VMware Inc.
- *****************************************************************************/
-
-package org.eclipse.gemini.blueprint.test.platform;
-
-import java.io.File;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.Method;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Properties;
-
-import org.apache.commons.logging.Log;
-import org.eclipse.gemini.blueprint.test.internal.util.IOUtils;
-import org.knopflerfish.framework.FrameworkFactoryImpl;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-import org.springframework.beans.BeanUtils;
-import org.springframework.util.ClassUtils;
-import org.springframework.util.CollectionUtils;
-import org.springframework.util.ReflectionUtils;
-
-/**
- * Knopflerfish 2.0.4+/3.x Platform. Automatically detects the available version on the class path and uses the
- * appropriate means to configure and instantiate it.
- *
- * @author Costin Leau
- */
-public class KnopflerfishPlatform extends AbstractOsgiPlatform {
-
- private static class KF2Platform implements Platform {
- private static final Class> BOOT_CLASS;
- private static final Constructor> CONSTRUCTOR;
- private static final Method LAUNCH;
- private static final Method GET_BUNDLE_CONTEXT;
- private static final Method SHUTDOWN;
-
- static {
- BOOT_CLASS = ClassUtils.resolveClassName(KF_2X_BOOT_CLASS, KF2Platform.class.getClassLoader());
-
- try {
- CONSTRUCTOR = BOOT_CLASS.getDeclaredConstructor(Object.class);
- } catch (NoSuchMethodException nsme) {
- throw new IllegalArgumentException("Invalid framework class", nsme);
- }
-
- LAUNCH = BeanUtils.findDeclaredMethod(BOOT_CLASS, "launch", new Class[] { long.class });
- GET_BUNDLE_CONTEXT =
- org.springframework.util.ReflectionUtils.findMethod(BOOT_CLASS, "getSystemBundleContext");
- SHUTDOWN = org.springframework.util.ReflectionUtils.findMethod(BOOT_CLASS, "shutdown");
- }
-
- private final Object monitor;
- private Object framework;
-
- KF2Platform(Object monitor) {
- this.monitor = monitor;
-
- }
-
- public BundleContext start() {
- framework = BeanUtils.instantiateClass(CONSTRUCTOR, monitor);
- ReflectionUtils.invokeMethod(LAUNCH, framework, 0);
- return (BundleContext) ReflectionUtils.invokeMethod(GET_BUNDLE_CONTEXT, framework);
- }
-
- public void stop() {
- if (framework != null) {
- ReflectionUtils.invokeMethod(SHUTDOWN, framework);
- framework = null;
- }
- }
- }
-
- private static class KF3Platform implements Platform {
- private Bundle framework;
- private final Map properties;
- private final Log log;
- private FrameworkTemplate fwkTemplate;
-
- KF3Platform(Map properties, Log log) {
- this.properties = properties;
- this.log = log;
- }
-
- public BundleContext start() {
- framework = new FrameworkFactoryImpl().newFramework(properties);
- fwkTemplate = new DefaultFrameworkTemplate(framework, log);
- fwkTemplate.init();
- fwkTemplate.start();
-
- return framework.getBundleContext();
- }
-
- public void stop() {
- if (fwkTemplate != null) {
- fwkTemplate.stopAndWait(1000);
- fwkTemplate = null;
- }
- }
- }
-
- private static final String KF_2X_BOOT_CLASS = "org.knopflerfish.framework.Framework";
- private static final boolean KF_2X =
- ClassUtils.isPresent(KF_2X_BOOT_CLASS, KnopflerfishPlatform.class.getClassLoader());
-
- private BundleContext context;
- private Platform framework;
- private File kfStorageDir;
-
- public KnopflerfishPlatform() {
- toString = "Knopflerfish OSGi Platform";
- }
-
- Properties getPlatformProperties() {
- if (kfStorageDir == null) {
- kfStorageDir = createTempDir("kf");
- kfStorageDir.deleteOnExit();
- if (log.isDebugEnabled())
- log.debug("KF temporary storage dir is " + kfStorageDir.getAbsolutePath());
-
- }
-
- // default properties
- Properties props = new Properties();
- props.setProperty("org.osgi.framework.dir", kfStorageDir.getAbsolutePath());
- props.setProperty("org.knopflerfish.framework.bundlestorage", "file");
- props.setProperty("org.knopflerfish.framework.bundlestorage.file.reference", "true");
- props.setProperty("org.knopflerfish.framework.bundlestorage.file.unpack", "true");
- props.setProperty("org.knopflerfish.startlevel.use", "true");
- props.setProperty("org.knopflerfish.osgi.setcontextclassloader", "true");
- // embedded mode
- props.setProperty("org.knopflerfish.framework.exitonshutdown", "false");
- // disable patch CL
- props.setProperty("org.knopflerfish.framework.patch", "false");
- // new in KF 2.0.4 - automatically exports system packages based on the JRE version
- props.setProperty("org.knopflerfish.framework.system.export.all", "true");
- // props.setProperty("org.knopflerfish.framework.system.export.all_15", "true");
- // add strict bootpath delegation (introduced in KF 2.3.0)
- // since otherwise classes will be loaded from the booth classpath
- // when generating JDK proxies instead of the OSGi space
- // since KF thinks that a non-OSGi class is making the call.
- props.setProperty("org.knopflerfish.framework.strictbootclassloading", "true");
-
- return props;
- }
-
- public BundleContext getBundleContext() {
- return context;
- }
-
- public void start() throws Exception {
- if (framework == null) {
- // copy configuration properties to sys properties
- System.getProperties().putAll(getConfigurationProperties());
- Map props = new HashMap();
- CollectionUtils.mergePropertiesIntoMap(getPlatformProperties(), props);
- framework = (KF_2X ? new KF2Platform(this) : new KF3Platform(props, log));
- context = framework.start();
- }
- }
-
- public void stop() throws Exception {
- if (framework != null) {
- context = null;
- try {
- framework.stop();
- } finally {
- framework = null;
- IOUtils.delete(kfStorageDir);
- }
- }
- }
-}
\ No newline at end of file
diff --git a/test-support/src/main/java/org/eclipse/gemini/blueprint/test/platform/Platforms.java b/test-support/src/main/java/org/eclipse/gemini/blueprint/test/platform/Platforms.java
index 24c0e3bf..bad27013 100644
--- a/test-support/src/main/java/org/eclipse/gemini/blueprint/test/platform/Platforms.java
+++ b/test-support/src/main/java/org/eclipse/gemini/blueprint/test/platform/Platforms.java
@@ -21,18 +21,6 @@
*/
public abstract class Platforms {
- /**
- * Equinox OSGi platform
- * constant.
- */
- public static final String EQUINOX = EquinoxPlatform.class.getName();
-
- /**
- * Knopflerfish OSGi platform
- * constant.
- */
- public static final String KNOPFLERFISH = KnopflerfishPlatform.class.getName();
-
/**
* Felix OSGi platform constant.
*/
diff --git a/test-support/src/main/resources/org/eclipse/gemini/blueprint/test/internal/boot-bundles.properties b/test-support/src/main/resources/org/eclipse/gemini/blueprint/test/internal/boot-bundles.properties
index 713548b6..64cd176b 100644
--- a/test-support/src/main/resources/org/eclipse/gemini/blueprint/test/internal/boot-bundles.properties
+++ b/test-support/src/main/resources/org/eclipse/gemini/blueprint/test/internal/boot-bundles.properties
@@ -19,13 +19,13 @@
ignore.junit.version=4.12_1
ignore.logback.version=1.0.13
-ignore.spring.version=5.0.4.RELEASE_1
+ignore.atlassian.spring.bundle.version=8.0.0-jakarta-001
ignore.gemini.blueprint.version=${project.version}
ignore.slf4j.version=1.7.5
ignore.assertj.version=3.6.2
# groupIds
-ignore.servicemix.bundles.groupId=org.apache.servicemix.bundles
+ignore.atlassian.spring.bundle.groupId=com.atlassian.platform.dependencies
ignore.gemini.blueprint.groupId=org.eclipse.gemini.blueprint
ignore.slf4j.groupId=org.slf4j
ignore.logback.groupId=ch.qos.logback
@@ -44,19 +44,11 @@ ${ignore.slf4j.groupId},jcl-over-slf4j,${ignore.slf4j.version}=
${ignore.logback.groupId},logback-core,${ignore.logback.version}=
${ignore.logback.groupId},logback-classic,${ignore.logback.version}=
-# aop alliance
-${ignore.servicemix.bundles.groupId},${ignore.servicemix.bundles.groupId}.aopalliance,1.0_6=
-
# AssertJ for using AssertJ-assertions in OSGi test bundles at runtime
org.assertj,assertj-core,${ignore.assertj.version}=
# spring libs
-${ignore.servicemix.bundles.groupId},${ignore.servicemix.bundles.groupId}.spring-beans,${ignore.spring.version}=
-${ignore.servicemix.bundles.groupId},${ignore.servicemix.bundles.groupId}.spring-core,${ignore.spring.version}=
-${ignore.servicemix.bundles.groupId},${ignore.servicemix.bundles.groupId}.spring-context,${ignore.spring.version}=
-${ignore.servicemix.bundles.groupId},${ignore.servicemix.bundles.groupId}.spring-expression,${ignore.spring.version}=
-${ignore.servicemix.bundles.groupId},${ignore.servicemix.bundles.groupId}.spring-aop,${ignore.spring.version}=
-${ignore.servicemix.bundles.groupId},${ignore.servicemix.bundles.groupId}.spring-test,${ignore.spring.version}=
+${ignore.atlassian.spring.bundle.groupId},platform-spring-bundle,${ignore.atlassian.spring.bundle.version}=
# gemini blueprint libs
${ignore.gemini.blueprint.groupId},gemini-blueprint-io,${ignore.gemini.blueprint.version}=
diff --git a/test-support/src/test/java/org/eclipse/gemini/blueprint/test/platform/EquinoxPlatformTest.java b/test-support/src/test/java/org/eclipse/gemini/blueprint/test/platform/EquinoxPlatformTest.java
deleted file mode 100644
index 12d21a02..00000000
--- a/test-support/src/test/java/org/eclipse/gemini/blueprint/test/platform/EquinoxPlatformTest.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/******************************************************************************
- * Copyright (c) 2006, 2010 VMware Inc.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * and Apache License v2.0 which accompanies this distribution.
- * The Eclipse Public License is available at
- * http://www.eclipse.org/legal/epl-v10.html and the Apache License v2.0
- * is available at http://www.opensource.org/licenses/apache2.0.php.
- * You may elect to redistribute this code under either of these licenses.
- *
- * Contributors:
- * VMware Inc.
- *****************************************************************************/
-
-package org.eclipse.gemini.blueprint.test.platform;
-
-
-/**
- * @author Costin Leau
- *
- */
-public class EquinoxPlatformTest extends CommonPlatformTest {
-
- AbstractOsgiPlatform createPlatform() {
- return new EquinoxPlatform();
- }
-}
diff --git a/test-support/src/test/java/org/eclipse/gemini/blueprint/test/platform/KnopflerfishPlatformTest.java b/test-support/src/test/java/org/eclipse/gemini/blueprint/test/platform/KnopflerfishPlatformTest.java
deleted file mode 100644
index aa4953d7..00000000
--- a/test-support/src/test/java/org/eclipse/gemini/blueprint/test/platform/KnopflerfishPlatformTest.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/******************************************************************************
- * Copyright (c) 2006, 2010 VMware Inc.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * and Apache License v2.0 which accompanies this distribution.
- * The Eclipse Public License is available at
- * http://www.eclipse.org/legal/epl-v10.html and the Apache License v2.0
- * is available at http://www.opensource.org/licenses/apache2.0.php.
- * You may elect to redistribute this code under either of these licenses.
- *
- * Contributors:
- * VMware Inc.
- *****************************************************************************/
-
-package org.eclipse.gemini.blueprint.test.platform;
-
-
-/**
- * @author Costin Leau
- *
- */
-public class KnopflerfishPlatformTest extends CommonPlatformTest {
-
- protected void setUp() throws Exception {
- System.setProperty("org.knopflerfish.osgi.registerserviceurlhandler", "false");
- super.setUp();
- }
-
- protected void tearDown() throws Exception {
- System.getProperties().remove("org.knopflerfish.osgi.registerserviceurlhandler");
- super.tearDown();
- }
-
- AbstractOsgiPlatform createPlatform() {
- return new KnopflerfishPlatform();
- }
-}