upgrade felix so we can run vs. jdk 7 - 2.x was missing profiles for jdk7
diff --git a/integration-tests/bundles/lifecycle.test.bundle/src/main/java/org/eclipse/gemini/blueprint/iandt/lifecycle/GuineaPig.java b/integration-tests/bundles/lifecycle.test.bundle/src/main/java/org/eclipse/gemini/blueprint/iandt/lifecycle/GuineaPig.java
index 994aed2..dee39d3 100644
--- a/integration-tests/bundles/lifecycle.test.bundle/src/main/java/org/eclipse/gemini/blueprint/iandt/lifecycle/GuineaPig.java
+++ b/integration-tests/bundles/lifecycle.test.bundle/src/main/java/org/eclipse/gemini/blueprint/iandt/lifecycle/GuineaPig.java
@@ -1,20 +1,22 @@
-/******************************************************************************
- * 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.iandt.lifecycle;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.osgi.framework.BundleContext;
import org.osgi.framework.FrameworkEvent;
import org.osgi.framework.FrameworkListener;
@@ -31,6 +33,7 @@
BundleContext bundleContext;
Listener listener;
+ private static final Log log = LogFactory.getLog(GuineaPig.class);
public void setBundleContext(BundleContext bundleContext) {
this.bundleContext = bundleContext;
@@ -52,7 +55,7 @@
static class Listener implements FrameworkListener {
public void frameworkEvent(FrameworkEvent frameworkEvent) {
- System.out.println("Eavesdropping on " + frameworkEvent);
+ log.info("Eavesdropping on " + frameworkEvent);
}
}
}
diff --git a/integration-tests/bundles/lifecycle.test.bundle/src/main/resources/META-INF/MANIFEST.MF b/integration-tests/bundles/lifecycle.test.bundle/src/main/resources/META-INF/MANIFEST.MF
index 10d8631..4207a9e 100644
--- a/integration-tests/bundles/lifecycle.test.bundle/src/main/resources/META-INF/MANIFEST.MF
+++ b/integration-tests/bundles/lifecycle.test.bundle/src/main/resources/META-INF/MANIFEST.MF
@@ -5,5 +5,10 @@
Bundle-ClassPath: .
Import-Package: org.springframework.beans.factory,
org.eclipse.gemini.blueprint.context,
- org.osgi.framework
+ org.osgi.framework,
+ org.apache.commons.logging,
+ org.springframework.context,
+ org.springframework.context.support,
+ org.springframework.core.io,
+ org.springframework.core.io.support
diff --git a/integration-tests/tests/pom.xml b/integration-tests/tests/pom.xml
index 47e507f..4a64ed3 100644
--- a/integration-tests/tests/pom.xml
+++ b/integration-tests/tests/pom.xml
@@ -21,7 +21,7 @@
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.configadmin</artifactId>
- <version>1.2.4</version>
+ <version>1.2.8</version>
<scope>provided</scope>
<exclusions>
<exclusion>
@@ -39,7 +39,7 @@
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.metatype</artifactId>
- <version>1.0.2</version>
+ <version>1.0.8</version>
<scope>provided</scope>
<exclusions>
<exclusion>
@@ -56,7 +56,7 @@
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.eventadmin</artifactId>
- <version>1.0.0</version>
+ <version>1.3.0</version>
<scope>provided</scope>
<exclusions>
<exclusion>
diff --git a/integration-tests/tests/src/test/java/org/eclipse/gemini/blueprint/iandt/BaseIntegrationTest.java b/integration-tests/tests/src/test/java/org/eclipse/gemini/blueprint/iandt/BaseIntegrationTest.java
index aaa8ab2..f691505 100644
--- a/integration-tests/tests/src/test/java/org/eclipse/gemini/blueprint/iandt/BaseIntegrationTest.java
+++ b/integration-tests/tests/src/test/java/org/eclipse/gemini/blueprint/iandt/BaseIntegrationTest.java
@@ -289,6 +289,11 @@
platform.getConfigurationProperties().setProperty("org.osgi.framework.storage.clean", "onFirstInit");
platform.getConfigurationProperties().setProperty("felix.fragment.validation", "warning");
+ platform.getConfigurationProperties().setProperty("felix.log.level", "4");
+
+ // todo: set system property to point to logback file.
+ // todo: figure out a better way to attach logback includes.xml files.
+
// KF 3.1 settings
//platform.getConfigurationProperties().setProperty("org.knopflerfish.framework.all_signed", "false");
diff --git a/integration-tests/tests/src/test/java/org/eclipse/gemini/blueprint/iandt/lifecycle/LifecycleTest.java b/integration-tests/tests/src/test/java/org/eclipse/gemini/blueprint/iandt/lifecycle/LifecycleTest.java
index 62ed801..8109937 100644
--- a/integration-tests/tests/src/test/java/org/eclipse/gemini/blueprint/iandt/lifecycle/LifecycleTest.java
+++ b/integration-tests/tests/src/test/java/org/eclipse/gemini/blueprint/iandt/lifecycle/LifecycleTest.java
@@ -7,7 +7,7 @@
* 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.
@@ -16,12 +16,14 @@
package org.eclipse.gemini.blueprint.iandt.lifecycle;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.List;
import org.eclipse.gemini.blueprint.iandt.BaseIntegrationTest;
import org.osgi.framework.AdminPermission;
import org.osgi.framework.Bundle;
import org.osgi.framework.Constants;
+import org.osgi.framework.ServiceReference;
import org.osgi.util.tracker.ServiceTracker;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.AbstractRefreshableApplicationContext;
@@ -32,64 +34,114 @@
*/
public class LifecycleTest extends BaseIntegrationTest {
- protected String getManifestLocation() {
- return null;
- }
+ protected String getManifestLocation() {
+ return null;
+ }
- protected String[] getTestBundlesNames() {
- return new String[] { "org.eclipse.gemini.blueprint.iandt,lifecycle," + getSpringDMVersion() };
- }
+ protected String[] getTestBundlesNames() {
+ return new String[]{"org.eclipse.gemini.blueprint.iandt,lifecycle," + getSpringDMVersion()};
+ }
- public void testLifecycle() throws Exception {
- assertNotSame("Guinea pig has already been shutdown", "true",
- System.getProperty("org.eclipse.gemini.blueprint.iandt.lifecycle.GuineaPig.close"));
+ public void testLifecycle() throws Exception {
+ assertNotSame("Guinea pig has already been shutdown", "true",
+ System.getProperty("org.eclipse.gemini.blueprint.iandt.lifecycle.GuineaPig.close"));
- assertEquals("Guinea pig didn't startup", "true",
- System.getProperty("org.eclipse.gemini.blueprint.iandt.lifecycle.GuineaPig.startUp"));
- Bundle[] bundles = bundleContext.getBundles();
- Bundle testBundle = null;
- for (int i = 0; i < bundles.length; i++) {
- if ("org.eclipse.gemini.blueprint.iandt.lifecycle".equals(bundles[i].getSymbolicName())) {
- testBundle = bundles[i];
- break;
- }
- }
+ assertEquals("Guinea pig didn't startup", "true",
+ System.getProperty("org.eclipse.gemini.blueprint.iandt.lifecycle.GuineaPig.startUp"));
+ Bundle[] bundles = bundleContext.getBundles();
+ Bundle testBundle = null;
+ for (int i = 0; i < bundles.length; i++) {
+ if ("org.eclipse.gemini.blueprint.iandt.lifecycle".equals(bundles[i].getSymbolicName())) {
+ testBundle = bundles[i];
+ break;
+ }
+ }
- assertNotNull("Could not find the test bundle", testBundle);
- StringBuilder filter = new StringBuilder();
- filter.append("(&");
- filter.append("(").append(Constants.OBJECTCLASS).append("=").append(ApplicationContext.class.getName()).append(
- ")");
- filter.append("(").append(ConfigurableOsgiBundleApplicationContext.APPLICATION_CONTEXT_SERVICE_PROPERTY_NAME);
- filter.append("=").append(testBundle.getSymbolicName()).append(")");
- filter.append(")");
- ServiceTracker tracker = new ServiceTracker(bundleContext, bundleContext.createFilter(filter.toString()), null);
- try {
+ assertNotNull("Could not find the test bundle", testBundle);
+ StringBuilder filter = new StringBuilder();
+ filter.append("(&");
+ filter.append("(").append(Constants.OBJECTCLASS).append("=").append(ApplicationContext.class.getName()).append(")");
+ filter.append("(").append(ConfigurableOsgiBundleApplicationContext.APPLICATION_CONTEXT_SERVICE_PROPERTY_NAME);
+ filter.append("=").append(testBundle.getSymbolicName()).append(")");
+ filter.append(")");
- tracker.open();
+ logger.info("Creating filter = " + filter);
- AbstractRefreshableApplicationContext appContext = (AbstractRefreshableApplicationContext) tracker.waitForService(30000);
- assertNotNull("test application context", appContext);
- assertTrue("application context is active", appContext.isActive());
+ /*
+ [org.springframework.beans.factory.DisposableBean,
+ org.eclipse.gemini.blueprint.context.DelegatedExecutionOsgiBundleApplicationContext,
+ org.eclipse.gemini.blueprint.context.ConfigurableOsgiBundleApplicationContext,
+ org.springframework.context.ConfigurableApplicationContext,
+ org.springframework.context.ApplicationContext,
+ org.springframework.context.Lifecycle,
+ org.springframework.beans.factory.ListableBeanFactory,
+ org.springframework.beans.factory.HierarchicalBeanFactory,
+ org.springframework.context.MessageSource,
+ org.springframework.context.ApplicationEventPublisher,
+ org.springframework.core.io.support.ResourcePatternResolver,
+ org.springframework.beans.factory.BeanFactory,
+ org.springframework.core.io.ResourceLoader]
+ */
- testBundle.stop();
- while (testBundle.getState() == Bundle.STOPPING) {
- Thread.sleep(10);
- }
- assertEquals("Guinea pig didn't shutdown", "true",
- System.getProperty("org.eclipse.gemini.blueprint.iandt.lifecycle.GuineaPig.close"));
+// ServiceTracker tracker = new ServiceTracker(bundleContext, bundleContext.createFilter(filter.toString()), null);
+// ServiceTracker tracker = new ServiceTracker(testBundle.getBundleContext(), testBundle.getBundleContext().createFilter(filter.toString()), null);
+// tracker.open();
- assertFalse("application context is inactive", appContext.isActive());
- }
- finally {
- tracker.close();
- }
- }
+ try {
+// logger.info("All Services");
+// ServiceReference[] refs = bundleContext.getAllServiceReferences(ApplicationContext.class.getName(), null);
+// printServiceRefs(refs);
+// logger.info("Visible Services from local context");
+// refs = bundleContext.getServiceReferences(null, filter.toString());
+// printServiceRefs(refs);
+// logger.info("Visible Services from test client context");
+// refs = testBundle.getBundleContext().getServiceReferences(null, filter.toString());
+// printServiceRefs(refs);
+//
+// logger.info("tracking count = " + tracker.getTrackingCount());
+// AbstractRefreshableApplicationContext appContext = (AbstractRefreshableApplicationContext) tracker.waitForService(50000);
+// logger.info("tracking count = " + tracker.getTrackingCount());
+// AbstractRefreshableApplicationContext appContext = (AbstractRefreshableApplicationContext) tracker.getService();
- protected List getTestPermissions() {
- List perms = super.getTestPermissions();
- // export package
- perms.add(new AdminPermission("*", AdminPermission.EXECUTE));
- return perms;
- }
+ ServiceReference[] refs = bundleContext.getServiceReferences(null, filter.toString());
+ assertEquals("Should have a single service matched", 1, refs.length);
+
+ AbstractRefreshableApplicationContext appContext = (AbstractRefreshableApplicationContext)bundleContext.getService(refs[0]);
+
+ assertNotNull("test application context", appContext);
+ assertTrue("application context is active", appContext.isActive());
+
+ testBundle.stop();
+ while (testBundle.getState() == Bundle.STOPPING) {
+ Thread.sleep(10);
+ }
+ assertEquals("Guinea pig didn't shutdown", "true",
+ System.getProperty("org.eclipse.gemini.blueprint.iandt.lifecycle.GuineaPig.close"));
+
+ assertFalse("application context is inactive", appContext.isActive());
+ } finally {
+// tracker.close();
+ }
+ }
+
+ private void printServiceRefs(ServiceReference[] refs) {
+ for (ServiceReference ref : refs) {
+ String[] keys = ref.getPropertyKeys();
+ logger.info(ref);
+ for (String key : keys) {
+ if (Constants.OBJECTCLASS.equals(key)) {
+ logger.info("\t" + key + " = " + Arrays.toString((String[]) ref.getProperty(key)));
+ } else {
+ logger.info("\t" + key + " = " + ref.getProperty(key));
+ }
+ }
+ }
+ }
+
+ protected List getTestPermissions() {
+ List perms = super.getTestPermissions();
+ // export package
+ perms.add(new AdminPermission("*", AdminPermission.EXECUTE));
+ return perms;
+ }
}
diff --git a/integration-tests/tests/src/test/resources/logback-test.xml b/integration-tests/tests/src/test/resources/logback-test.xml
index 3342076..67fe5f1 100644
--- a/integration-tests/tests/src/test/resources/logback-test.xml
+++ b/integration-tests/tests/src/test/resources/logback-test.xml
@@ -7,24 +7,24 @@
<!-- For professional support please see -->
<!-- http://www.qos.ch/shop/products/professionalSupport -->
<!-- -->
-<configuration>
+<configuration debug="true">
<appender name="stdout" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
- <pattern>%t %p [%c{2}] - %m%n</pattern>
+ <pattern>%-30(%d{HH:mm:ss.SSS} [%thread]) %-5level %logger{32} : %line - %msg %ex%n</pattern>
</encoder>
- <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
- <level>TRACE</level>
- </filter>
+ <!--<filter class="ch.qos.logback.classic.filter.ThresholdFilter">-->
+ <!--<level>TRACE</level>-->
+ <!--</filter>-->
</appender>
<appender name="file" class="ch.qos.logback.core.rolling.RollingFileAppender">
<!--See also http://logback.qos.ch/manual/appenders.html#RollingFileAppender-->
<File>./target/out.log</File>
<encoder>
- <pattern>=%t %p [%c{2}] - %m%n</pattern>
+ <pattern>%-30(%d{HH:mm:ss.SSS} [%thread]) %-5level %logger{32}:%line - %msg %ex%n</pattern>
</encoder>
- <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
- <level>TRACE</level>
- </filter>
+ <!--<filter class="ch.qos.logback.classic.filter.ThresholdFilter">-->
+ <!--<level>TRACE</level>-->
+ <!--</filter>-->
<rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
<maxIndex>2</maxIndex>
<FileNamePattern>./target/out.log.%i</FileNamePattern>
@@ -33,7 +33,9 @@
<MaxFileSize>100KB</MaxFileSize>
</triggeringPolicy>
</appender>
- <logger name="org.springframework" level="INFO"/>
+ <logger name="org.eclipse.gemini.blueprint.test.AbstractOnTheFlyBundleCreatorTests" level="WARN"/>
+ <logger name="org.apache.felix" level="DEBUG"/>
+ <logger name="org.springframework" level="WARN"/>
<logger name="org.eclipse.gemini.blueprint.context.support.DelegatedNamespaceHandlerResolver" level="WARN"/>
<logger name="org.eclipse.gemini.blueprint.service.exporter.support.internal.support" level="WARN"/>
<logger name="org.eclipse.gemini.blueprint.service.dependency.internal" level="WARN"/>
diff --git a/integration-tests/tests/src/test/resources/org/eclipse/gemini/blueprint/iandt/testingFramework/logback.xml b/integration-tests/tests/src/test/resources/org/eclipse/gemini/blueprint/iandt/testingFramework/logback.xml
index 7e1e72a..6962b28 100644
--- a/integration-tests/tests/src/test/resources/org/eclipse/gemini/blueprint/iandt/testingFramework/logback.xml
+++ b/integration-tests/tests/src/test/resources/org/eclipse/gemini/blueprint/iandt/testingFramework/logback.xml
@@ -1,16 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
- <appender name="stdout" class="ch.qos.logback.core.ConsoleAppender">
- <encoder>
- <pattern>%d %p [%c] - %m%n</pattern>
- </encoder>
- <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
- <level>TRACE</level>
- </filter>
- </appender>
- <logger name="org.springframework.osgi" level="INFO"/>
- <logger name="org.springframework.osgi.util" level="TRACE"/>
- <root level="INFO">
- <appender-ref ref="stdout"/>
- </root>
+ <appender name="stdout" class="ch.qos.logback.core.ConsoleAppender">
+ <encoder>
+ <pattern>%-30(%d{HH:mm:ss.SSS} [%thread]) %-5level %logger{32}:%line - %msg %ex%n</pattern>
+ </encoder>
+ <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
+ <level>TRACE</level>
+ </filter>
+ </appender>
+ <logger name="org.springframework.osgi" level="INFO"/>
+ <logger name="org.springframework.osgi.util" level="INFO"/>
+ <root level="INFO">
+ <appender-ref ref="stdout"/>
+ </root>
</configuration>
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index 2d7282b..8085f2d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -40,7 +40,8 @@
<equinox.ver>3.6.2.R36x_v20110210</equinox.ver>
<!-- Knopflerfish 3.5 -->
<kf.ver>5.3.3</kf.ver>
- <felix.ver>2.0.5</felix.ver>
+ <!-- need this version so we can run against jdk 7 -->
+ <felix.ver>3.2.2</felix.ver>
<!-- javadoc configuration -->
<javadoc.loc>${basedir}/docs/src/javadoc</javadoc.loc>
@@ -906,18 +907,18 @@
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.framework</artifactId>
</exclusion>
- <exclusion>
- <groupId>org.apache.felix</groupId>
- <artifactId>org.apache.felix.shell</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.felix</groupId>
- <artifactId>org.apache.felix.shell.tui</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.felix</groupId>
- <artifactId>org.apache.felix.bundlerepository</artifactId>
- </exclusion>
+ <!--<exclusion>-->
+ <!--<groupId>org.apache.felix</groupId>-->
+ <!--<artifactId>org.apache.felix.shell</artifactId>-->
+ <!--</exclusion>-->
+ <!--<exclusion>-->
+ <!--<groupId>org.apache.felix</groupId>-->
+ <!--<artifactId>org.apache.felix.shell.tui</artifactId>-->
+ <!--</exclusion>-->
+ <!--<exclusion>-->
+ <!--<groupId>org.apache.felix</groupId>-->
+ <!--<artifactId>org.apache.felix.bundlerepository</artifactId>-->
+ <!--</exclusion>-->
</exclusions>
</dependency>
<!-- include the OSGi jar to allow PermissionAdmin API to be used -->
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 de30fec..4358fd4 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
@@ -17,17 +17,17 @@
# versioning
ignore.junit.version=4.9.0
-ignore.log4j.version=1.2.16
-
ignore.spring.version=3.1.1.RELEASE
ignore.gemini.blueprint.version=2.0.0.BUILD-SNAPSHOT
-ignore.slf4j.version=1.6.4
+ignore.slf4j.version=1.7.2
ignore.asm.version=2.2.3
+ignore.logback.version=1.0.13
# groupIds
ignore.spring.groupId=org.springframework
ignore.gemini.blueprint.groupId=org.eclipse.gemini.blueprint
ignore.slf4j.groupId=org.slf4j
+ignore.logback.groupId=ch.qos.logback
#
# actual libraries
@@ -35,15 +35,14 @@
# listed in dependency order to ease deployment
# dependencies
-
# junit
org.junit,com.springsource.org.junit,${ignore.junit.version}=
-# log4j
-org.apache.log4j,com.springsource.org.apache.log4j,${ignore.log4j.version}=
# slf4j
${ignore.slf4j.groupId},slf4j-api,${ignore.slf4j.version}=
-${ignore.slf4j.groupId},slf4j-log4j12,${ignore.slf4j.version}=
${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
org.aopalliance,com.springsource.org.aopalliance,1.0.0=
# asm