Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlyn Normington2010-11-16 11:28:38 -0500
committerGlyn Normington2010-11-18 11:40:28 -0500
commit873d231b1b89b837a497833e1b3e68919e210ef0 (patch)
treebe9354fd83a18dc1754e77a2bfb2d2c70af63014
parent974dcdf3c96ecb1c2eb82721f094e1f1c3099bdd (diff)
downloadorg.eclipse.virgo.medic-873d231b1b89b837a497833e1b3e68919e210ef0.tar.gz
org.eclipse.virgo.medic-873d231b1b89b837a497833e1b3e68919e210ef0.tar.xz
org.eclipse.virgo.medic-873d231b1b89b837a497833e1b3e68919e210ef0.zip
Begin upgrade to Equinox 3.7. Need to upgrade to Equinox config admin before continuing.
-rw-r--r--build.versions2
-rw-r--r--org.eclipse.virgo.medic.core/.classpath2
-rw-r--r--org.eclipse.virgo.medic.core/.settings/com.springsource.server.ide.bundlor.core.prefs2
-rw-r--r--org.eclipse.virgo.medic.core/ivy.xml2
-rw-r--r--org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/dump/impl/DumpContributorPublisher.java9
-rw-r--r--org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/dump/impl/DumpContributorTracker.java12
-rw-r--r--org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/dump/impl/StandardDumpContributorResolver.java32
-rw-r--r--org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/eventlog/impl/EventLoggerServiceFactory.java7
-rw-r--r--org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/impl/MedicActivator.java17
-rw-r--r--org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/impl/config/ConfigurationAdminConfigurationProvider.java5
-rw-r--r--org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/log/impl/config/ServiceReferenceUtils.java6
-rw-r--r--org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/log/impl/config/ServiceRegistryConfigurationLocator.java12
-rw-r--r--org.eclipse.virgo.medic.core/src/test/java/org/eclipse/virgo/medic/dump/impl/DumpContributorTrackerTests.java5
-rw-r--r--org.eclipse.virgo.medic.integrationtest/.classpath2
-rw-r--r--org.eclipse.virgo.medic.integrationtest/.settings/com.springsource.server.ide.bundlor.core.prefs2
-rw-r--r--org.eclipse.virgo.medic.integrationtest/src/test/java/org/eclipse/virgo/medic/dump/test/DumpIntegrationTests.java9
-rw-r--r--org.eclipse.virgo.medic.integrationtest/src/test/java/org/eclipse/virgo/medic/eventlog/test/EventLogIntegrationTests.java15
-rw-r--r--org.eclipse.virgo.medic.integrationtest/src/test/resources/META-INF/MANIFEST.MF16
-rw-r--r--org.eclipse.virgo.medic.testfragment/.classpath2
-rw-r--r--org.eclipse.virgo.medic.weaving/.classpath2
-rw-r--r--org.eclipse.virgo.medic/.classpath2
21 files changed, 84 insertions, 79 deletions
diff --git a/build.versions b/build.versions
index 660435c..b9ea007 100644
--- a/build.versions
+++ b/build.versions
@@ -1,7 +1,7 @@
# Compile
ch.qos.logback=0.9.24
org.slf4j=1.6.1
-org.eclipse.osgi=3.6.1.R36x_v20100806
+org.eclipse.osgi=3.7.0.v20101022
org.eclipse.osgi.services=3.1.200.v20071203
org.eclipse.equinox.cm=1.0.200.v20100520
org.aspectj=1.6.6.RELEASE
diff --git a/org.eclipse.virgo.medic.core/.classpath b/org.eclipse.virgo.medic.core/.classpath
index fe82999..f3e4ea6 100644
--- a/org.eclipse.virgo.medic.core/.classpath
+++ b/org.eclipse.virgo.medic.core/.classpath
@@ -21,7 +21,7 @@
</attributes>
</classpathentry>
<classpathentry kind="var" path="MEDIC_IVY_CACHE/org.junit/com.springsource.org.junit/4.7.0/com.springsource.org.junit-4.7.0.jar" sourcepath="/MEDIC_IVY_CACHE/org.junit/com.springsource.org.junit/4.7.0/com.springsource.org.junit-sources-4.7.0.jar"/>
- <classpathentry kind="var" path="MEDIC_IVY_CACHE/org.eclipse.osgi/org.eclipse.osgi/3.6.1.R36x_v20100806/org.eclipse.osgi-3.6.1.R36x_v20100806.jar" sourcepath="/MEDIC_IVY_CACHE/org.eclipse.osgi/org.eclipse.osgi/3.6.1.R36x_v20100806/org.eclipse.osgi-sources-3.6.1.R36x_v20100806.jar"/>
+ <classpathentry kind="var" path="MEDIC_IVY_CACHE/org.eclipse.osgi/org.eclipse.osgi/3.7.0.v20101022/org.eclipse.osgi-3.7.0.v20101022.jar" sourcepath="/MEDIC_IVY_CACHE/org.eclipse.osgi/org.eclipse.osgi/3.7.0.v20101022/org.eclipse.osgi-sources-3.7.0.v20101022.jar"/>
<classpathentry kind="var" path="MEDIC_IVY_CACHE/org.easymock/com.springsource.org.easymock/2.3.0/com.springsource.org.easymock-2.3.0.jar" sourcepath="/MEDIC_IVY_CACHE/org.easymock/com.springsource.org.easymock/2.3.0/com.springsource.org.easymock-sources-2.3.0.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry combineaccessrules="false" kind="src" path="/org.eclipse.virgo.medic"/>
diff --git a/org.eclipse.virgo.medic.core/.settings/com.springsource.server.ide.bundlor.core.prefs b/org.eclipse.virgo.medic.core/.settings/com.springsource.server.ide.bundlor.core.prefs
index 84b9c6a..378c270 100644
--- a/org.eclipse.virgo.medic.core/.settings/com.springsource.server.ide.bundlor.core.prefs
+++ b/org.eclipse.virgo.medic.core/.settings/com.springsource.server.ide.bundlor.core.prefs
@@ -1,5 +1,5 @@
#Thu Nov 12 08:44:12 GMT 2009
com.springsource.server.ide.bundlor.core.bundlor.generated.manifest.autoformatting=true
com.springsource.server.ide.bundlor.core.byte.code.scanning=true
-com.springsource.server.ide.bundlor.core.template.properties.files=../build.versions
+com.springsource.server.ide.bundlor.core.template.properties.files=../build.versions;../build.properties
eclipse.preferences.version=1
diff --git a/org.eclipse.virgo.medic.core/ivy.xml b/org.eclipse.virgo.medic.core/ivy.xml
index 38a5ef1..a19bc3f 100644
--- a/org.eclipse.virgo.medic.core/ivy.xml
+++ b/org.eclipse.virgo.medic.core/ivy.xml
@@ -34,7 +34,7 @@
<dependency org="org.easymock" name="com.springsource.org.easymock" rev="${org.easymock}" conf="test->runtime"/>
<dependency org="org.eclipse.virgo.teststubs" name="org.eclipse.virgo.teststubs.osgi" rev="${org.eclipse.virgo.teststubs}" conf="test->runtime"/>
- <!-- Prevent org.eclipse.osgi.services dragging in old Equinox -->
+ <!-- Allow Equinox to be upgraded point-wise before rippling -->
<override org="org.eclipse.osgi" module="org.eclipse.osgi" rev="${org.eclipse.osgi}"/>
</dependencies>
diff --git a/org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/dump/impl/DumpContributorPublisher.java b/org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/dump/impl/DumpContributorPublisher.java
index b8194ef..230e28f 100644
--- a/org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/dump/impl/DumpContributorPublisher.java
+++ b/org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/dump/impl/DumpContributorPublisher.java
@@ -28,7 +28,7 @@ public final class DumpContributorPublisher {
private static final String SUPPRESS_HEAP_DUMPS = "org.eclipse.virgo.suppress.heap.dumps";
- private final List<ServiceRegistration> contributorRegistrations = new ArrayList<ServiceRegistration>();
+ private final List<ServiceRegistration<DumpContributor>> contributorRegistrations = new ArrayList<ServiceRegistration<DumpContributor>>();
private final BundleContext bundleContext;
@@ -51,13 +51,14 @@ public final class DumpContributorPublisher {
publishDumpContributor(this.logDumpContributor);
}
- private void publishDumpContributor(DumpContributor dumpContributor) {
- ServiceRegistration registration = this.bundleContext.registerService(DumpContributor.class.getName(), dumpContributor, null);
+ @SuppressWarnings("unchecked")
+ private void publishDumpContributor(DumpContributor dumpContributor) {
+ ServiceRegistration<DumpContributor> registration = (ServiceRegistration<DumpContributor>)this.bundleContext.registerService(DumpContributor.class.getName(), dumpContributor, null);
this.contributorRegistrations.add(registration);
}
public void retractDumpContributors() {
- for (ServiceRegistration registration : this.contributorRegistrations) {
+ for (ServiceRegistration<DumpContributor> registration : this.contributorRegistrations) {
registration.unregister();
}
diff --git a/org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/dump/impl/DumpContributorTracker.java b/org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/dump/impl/DumpContributorTracker.java
index a4a4ae5..3b8918d 100644
--- a/org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/dump/impl/DumpContributorTracker.java
+++ b/org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/dump/impl/DumpContributorTracker.java
@@ -20,7 +20,7 @@ import org.osgi.framework.ServiceReference;
import org.osgi.util.tracker.ServiceTrackerCustomizer;
-final class DumpContributorTracker implements ServiceTrackerCustomizer {
+final class DumpContributorTracker implements ServiceTrackerCustomizer<DumpContributor ,DumpContributor> {
private final List<DumpContributor> contributors = new CopyOnWriteArrayList<DumpContributor>();
@@ -30,16 +30,16 @@ final class DumpContributorTracker implements ServiceTrackerCustomizer {
this.bundleContext = bundleContext;
}
- public Object addingService(ServiceReference reference) {
- Object service = bundleContext.getService(reference);
- contributors.add((DumpContributor) service);
+ public DumpContributor addingService(ServiceReference<DumpContributor> reference) {
+ DumpContributor service = bundleContext.getService(reference);
+ contributors.add(service);
return service;
}
- public void modifiedService(ServiceReference reference, Object service) {
+ public void modifiedService(ServiceReference<DumpContributor> reference, DumpContributor service) {
}
- public void removedService(ServiceReference reference, Object service) {
+ public void removedService(ServiceReference<DumpContributor> reference, DumpContributor service) {
this.contributors.remove(service);
this.bundleContext.ungetService(reference);
}
diff --git a/org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/dump/impl/StandardDumpContributorResolver.java b/org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/dump/impl/StandardDumpContributorResolver.java
index 7ac0cdf..ea4c538 100644
--- a/org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/dump/impl/StandardDumpContributorResolver.java
+++ b/org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/dump/impl/StandardDumpContributorResolver.java
@@ -17,25 +17,27 @@ import org.eclipse.virgo.medic.dump.DumpContributor;
import org.osgi.framework.BundleContext;
import org.osgi.util.tracker.ServiceTracker;
+public final class StandardDumpContributorResolver implements
+ DumpContributorResolver {
-public final class StandardDumpContributorResolver implements DumpContributorResolver {
+ private final ServiceTracker<DumpContributor, DumpContributor> serviceTracker;
- private final ServiceTracker serviceTracker;
+ private final DumpContributorTracker dumpContributorTracker;
- private final DumpContributorTracker dumpContributorTracker;
+ public StandardDumpContributorResolver(BundleContext bundleContext) {
+ this.dumpContributorTracker = new DumpContributorTracker(bundleContext);
- public StandardDumpContributorResolver(BundleContext bundleContext) {
- this.dumpContributorTracker = new DumpContributorTracker(bundleContext);
+ this.serviceTracker = new ServiceTracker<DumpContributor, DumpContributor>(
+ bundleContext, DumpContributor.class.getName(),
+ this.dumpContributorTracker);
+ this.serviceTracker.open();
+ }
- this.serviceTracker = new ServiceTracker(bundleContext, DumpContributor.class.getName(), this.dumpContributorTracker);
- this.serviceTracker.open();
- }
+ public List<DumpContributor> getDumpContributors() {
+ return this.dumpContributorTracker.getDumpContributors();
+ }
- public List<DumpContributor> getDumpContributors() {
- return this.dumpContributorTracker.getDumpContributors();
- }
-
- public void close() {
- this.serviceTracker.close();
- }
+ public void close() {
+ this.serviceTracker.close();
+ }
}
diff --git a/org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/eventlog/impl/EventLoggerServiceFactory.java b/org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/eventlog/impl/EventLoggerServiceFactory.java
index 03d7a11..b5fc498 100644
--- a/org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/eventlog/impl/EventLoggerServiceFactory.java
+++ b/org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/eventlog/impl/EventLoggerServiceFactory.java
@@ -11,13 +11,14 @@
package org.eclipse.virgo.medic.eventlog.impl;
+import org.eclipse.virgo.medic.eventlog.EventLogger;
import org.eclipse.virgo.medic.eventlog.EventLoggerFactory;
import org.osgi.framework.Bundle;
import org.osgi.framework.ServiceFactory;
import org.osgi.framework.ServiceRegistration;
-public final class EventLoggerServiceFactory implements ServiceFactory {
+public final class EventLoggerServiceFactory implements ServiceFactory<EventLogger> {
private final EventLoggerFactory eventLoggerFactory;
@@ -25,10 +26,10 @@ public final class EventLoggerServiceFactory implements ServiceFactory {
this.eventLoggerFactory = factory;
}
- public Object getService(Bundle bundle, ServiceRegistration registration) {
+ public EventLogger getService(Bundle bundle, ServiceRegistration<EventLogger> registration) {
return this.eventLoggerFactory.createEventLogger(bundle);
}
- public void ungetService(Bundle bundle, ServiceRegistration registration, Object service) {
+ public void ungetService(Bundle bundle, ServiceRegistration<EventLogger> registration, EventLogger service) {
}
}
diff --git a/org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/impl/MedicActivator.java b/org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/impl/MedicActivator.java
index f1a9159..4671fcd 100644
--- a/org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/impl/MedicActivator.java
+++ b/org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/impl/MedicActivator.java
@@ -15,9 +15,8 @@ import java.io.File;
import java.io.PrintStream;
import java.util.Arrays;
import java.util.Dictionary;
+import java.util.Hashtable;
import java.util.List;
-import java.util.Properties;
-
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.osgi.framework.BundleListener;
@@ -86,7 +85,7 @@ public final class MedicActivator implements BundleActivator {
private volatile DumpContributorPublisher dumpContributorPublisher;
- private volatile ServiceReference packageAdminReference;
+ private volatile ServiceReference<PackageAdmin> packageAdminReference;
private volatile PrintStream sysOut;
@@ -140,7 +139,7 @@ public final class MedicActivator implements BundleActivator {
@SuppressWarnings("unchecked")
private void logStart(BundleContext context, ConfigurationProvider configurationProvider) throws ConfigurationPublicationFailedException {
- this.packageAdminReference = context.getServiceReference(PackageAdmin.class.getName());
+ this.packageAdminReference = (ServiceReference<PackageAdmin>) context.getServiceReference(PackageAdmin.class.getName());
PackageAdmin packageAdmin = (PackageAdmin) context.getService(this.packageAdminReference);
StandardContextSelectorDelegate delegate = createContextSelectorDelegate(context, packageAdmin);
@@ -187,15 +186,15 @@ public final class MedicActivator implements BundleActivator {
return wrapper;
}
- private void publishPrintStream(PrintStream printStream, String name, BundleContext context) {
- Properties properties = new Properties();
+ private void publishPrintStream(PrintStream printStream, String name, BundleContext context) {
+ Hashtable<String, String> properties = new Hashtable<String, String>();
properties.put("org.eclipse.virgo.medic.log.printStream", name);
-
+
this.registrationTracker.track(context.registerService(PrintStream.class.getName(), printStream, properties));
}
private void publishDelegatingPrintStream(PrintStream printStream, String name, BundleContext context) {
- Properties properties = new Properties();
+ Hashtable<String, String> properties = new Hashtable<String, String>();
properties.put("org.eclipse.virgo.medic.log.printStream", name);
String[] classes = new String[] {DelegatingPrintStream.class.getName()};
@@ -267,7 +266,7 @@ public final class MedicActivator implements BundleActivator {
private void eventLogStart(BundleContext context) {
this.eventLoggerFactory = createFactory(context);
- ServiceFactory serviceFactory = new EventLoggerServiceFactory(this.eventLoggerFactory);
+ ServiceFactory<EventLogger> serviceFactory = new EventLoggerServiceFactory(this.eventLoggerFactory);
this.registrationTracker.track(context.registerService(EventLoggerFactory.class.getName(), this.eventLoggerFactory, null));
this.registrationTracker.track(context.registerService(EventLogger.class.getName(), serviceFactory, null));
}
diff --git a/org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/impl/config/ConfigurationAdminConfigurationProvider.java b/org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/impl/config/ConfigurationAdminConfigurationProvider.java
index 7d9c2f7..1a6551b 100644
--- a/org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/impl/config/ConfigurationAdminConfigurationProvider.java
+++ b/org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/impl/config/ConfigurationAdminConfigurationProvider.java
@@ -45,8 +45,9 @@ public final class ConfigurationAdminConfigurationProvider implements Configurat
}
- private void initialisePropertiesFromConfigurationAdmin() {
- ServiceReference configAdminReference = this.bundleContext.getServiceReference(CONFIG_ADMIN_SERVICE_NAME);
+ @SuppressWarnings("unchecked")
+ private void initialisePropertiesFromConfigurationAdmin() {
+ ServiceReference<ConfigurationAdmin> configAdminReference = (ServiceReference<ConfigurationAdmin>)this.bundleContext.getServiceReference(CONFIG_ADMIN_SERVICE_NAME);
if (configAdminReference != null) {
this.bundleContext.registerService(ConfigurationListener.class.getName(), new MedicConfigurationListener(), null);
diff --git a/org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/log/impl/config/ServiceReferenceUtils.java b/org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/log/impl/config/ServiceReferenceUtils.java
index 1bb8d9a..488cf45 100644
--- a/org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/log/impl/config/ServiceReferenceUtils.java
+++ b/org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/log/impl/config/ServiceReferenceUtils.java
@@ -15,10 +15,10 @@ import org.osgi.framework.ServiceReference;
class ServiceReferenceUtils {
- static ServiceReference selectServiceReference(ServiceReference[] serviceReferences) {
- ServiceReference highest = null;
+ static <S> ServiceReference<S> selectServiceReference(ServiceReference<S>[] serviceReferences) {
+ ServiceReference<S> highest = null;
- for (ServiceReference serviceReference : serviceReferences) {
+ for (ServiceReference<S> serviceReference : serviceReferences) {
if (highest == null || serviceReference.compareTo(highest) > 0) {
highest = serviceReference;
}
diff --git a/org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/log/impl/config/ServiceRegistryConfigurationLocator.java b/org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/log/impl/config/ServiceRegistryConfigurationLocator.java
index 01a52e5..3c2d2af 100644
--- a/org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/log/impl/config/ServiceRegistryConfigurationLocator.java
+++ b/org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/log/impl/config/ServiceRegistryConfigurationLocator.java
@@ -30,16 +30,20 @@ public final class ServiceRegistryConfigurationLocator implements ConfigurationL
this.bundleContext = bundleContext;
}
- public LoggingConfiguration locateConfiguration(Bundle bundle) {
+ @SuppressWarnings("unchecked")
+ public LoggingConfiguration locateConfiguration(Bundle bundle) {
if (bundle != null) {
String configurationName = (String) bundle.getHeaders().get(MEDIC_LOGGING_CONFIGURATION_HEADER);
if (configurationName != null) {
try {
- ServiceReference[] serviceReferences = this.bundleContext.getServiceReferences(LoggingConfiguration.class.getName(), "("
- + LOGGING_CONFIGURATION_ID_SERVICE_PROPERTY + "=" + configurationName + ")");
+ ServiceReference<LoggingConfiguration>[] serviceReferences = (ServiceReference<LoggingConfiguration>[]) this.bundleContext
+ .getServiceReferences(LoggingConfiguration.class
+ .getName(), "("
+ + LOGGING_CONFIGURATION_ID_SERVICE_PROPERTY
+ + "=" + configurationName + ")");
if (serviceReferences != null && serviceReferences.length > 0) {
- ServiceReference serviceReference = ServiceReferenceUtils.selectServiceReference(serviceReferences);
+ ServiceReference<LoggingConfiguration> serviceReference = ServiceReferenceUtils.selectServiceReference(serviceReferences);
return (LoggingConfiguration) this.bundleContext.getService(serviceReference);
}
} catch (InvalidSyntaxException ise) {
diff --git a/org.eclipse.virgo.medic.core/src/test/java/org/eclipse/virgo/medic/dump/impl/DumpContributorTrackerTests.java b/org.eclipse.virgo.medic.core/src/test/java/org/eclipse/virgo/medic/dump/impl/DumpContributorTrackerTests.java
index bbf5f7b..c210059 100644
--- a/org.eclipse.virgo.medic.core/src/test/java/org/eclipse/virgo/medic/dump/impl/DumpContributorTrackerTests.java
+++ b/org.eclipse.virgo.medic.core/src/test/java/org/eclipse/virgo/medic/dump/impl/DumpContributorTrackerTests.java
@@ -26,11 +26,12 @@ import org.eclipse.virgo.teststubs.osgi.framework.StubBundleContext;
public class DumpContributorTrackerTests {
- @Test
+ @SuppressWarnings("unchecked")
+ @Test
public void serviceAdditionAndRemoval() {
StubBundleContext bundleContext = new StubBundleContext();
DumpContributor service = createMock(DumpContributor.class);
- ServiceRegistration serviceRegistration = bundleContext.registerService(DumpContributor.class.getName(), service, null);
+ ServiceRegistration<DumpContributor> serviceRegistration = (ServiceRegistration<DumpContributor>)bundleContext.registerService(DumpContributor.class.getName(), service, null);
DumpContributorTracker tracker = new DumpContributorTracker(bundleContext);
diff --git a/org.eclipse.virgo.medic.integrationtest/.classpath b/org.eclipse.virgo.medic.integrationtest/.classpath
index 4aefc64..63fffc5 100644
--- a/org.eclipse.virgo.medic.integrationtest/.classpath
+++ b/org.eclipse.virgo.medic.integrationtest/.classpath
@@ -21,7 +21,7 @@
</attributes>
</classpathentry>
<classpathentry kind="var" path="MEDIC_IVY_CACHE/org.junit/com.springsource.org.junit/4.7.0/com.springsource.org.junit-4.7.0.jar" sourcepath="/MEDIC_IVY_CACHE/org.junit/com.springsource.org.junit/4.7.0/com.springsource.org.junit-sources-4.7.0.jar"/>
- <classpathentry kind="var" path="MEDIC_IVY_CACHE/org.eclipse.osgi/org.eclipse.osgi/3.6.1.R36x_v20100806/org.eclipse.osgi-3.6.1.R36x_v20100806.jar" sourcepath="/MEDIC_IVY_CACHE/org.eclipse.osgi/org.eclipse.osgi/3.6.1.R36x_v20100806/org.eclipse.osgi-sources-3.6.1.R36x_v20100806.jar"/>
+ <classpathentry kind="var" path="MEDIC_IVY_CACHE/org.eclipse.osgi/org.eclipse.osgi/3.7.0.v20101022/org.eclipse.osgi-3.7.0.v20101022.jar" sourcepath="/MEDIC_IVY_CACHE/org.eclipse.osgi/org.eclipse.osgi/3.7.0.v20101022/org.eclipse.osgi-sources-3.7.0.v20101022.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="var" path="MEDIC_IVY_CACHE/org.slf4j/com.springsource.slf4j.api/1.6.1/com.springsource.slf4j.api-1.6.1.jar" sourcepath="/MEDIC_IVY_CACHE/org.slf4j/com.springsource.slf4j.api/1.6.1/com.springsource.slf4j.api-sources-1.6.1.jar"/>
<classpathentry kind="var" path="MEDIC_IVY_CACHE/ch.qos.logback/com.springsource.ch.qos.logback.classic/0.9.24/com.springsource.ch.qos.logback.classic-0.9.24.jar" sourcepath="/MEDIC_IVY_CACHE/ch.qos.logback/com.springsource.ch.qos.logback.classic/0.9.24/com.springsource.ch.qos.logback.classic-sources-0.9.24.jar"/>
diff --git a/org.eclipse.virgo.medic.integrationtest/.settings/com.springsource.server.ide.bundlor.core.prefs b/org.eclipse.virgo.medic.integrationtest/.settings/com.springsource.server.ide.bundlor.core.prefs
index 08c417c..0f959ee 100644
--- a/org.eclipse.virgo.medic.integrationtest/.settings/com.springsource.server.ide.bundlor.core.prefs
+++ b/org.eclipse.virgo.medic.integrationtest/.settings/com.springsource.server.ide.bundlor.core.prefs
@@ -1,5 +1,5 @@
#Thu Nov 12 08:44:20 GMT 2009
com.springsource.server.ide.bundlor.core.bundlor.generated.manifest.autoformatting=true
com.springsource.server.ide.bundlor.core.byte.code.scanning=true
-com.springsource.server.ide.bundlor.core.template.properties.files=../build.versions
+com.springsource.server.ide.bundlor.core.template.properties.files=../build.versions;../build.properties
eclipse.preferences.version=1
diff --git a/org.eclipse.virgo.medic.integrationtest/src/test/java/org/eclipse/virgo/medic/dump/test/DumpIntegrationTests.java b/org.eclipse.virgo.medic.integrationtest/src/test/java/org/eclipse/virgo/medic/dump/test/DumpIntegrationTests.java
index 1917ff0..5b84fd2 100644
--- a/org.eclipse.virgo.medic.integrationtest/src/test/java/org/eclipse/virgo/medic/dump/test/DumpIntegrationTests.java
+++ b/org.eclipse.virgo.medic.integrationtest/src/test/java/org/eclipse/virgo/medic/dump/test/DumpIntegrationTests.java
@@ -62,9 +62,10 @@ public class DumpIntegrationTests {
assertTrue(file.delete());
}
+ @SuppressWarnings("unchecked")
@Test
public void dumpGeneratorAvailableFromServiceRegistry() {
- ServiceReference serviceReference = this.bundleContext.getServiceReference(DumpGenerator.class.getName());
+ ServiceReference<DumpGenerator> serviceReference = (ServiceReference<DumpGenerator>)this.bundleContext.getServiceReference(DumpGenerator.class.getName());
assertNotNull(serviceReference);
}
@@ -141,6 +142,7 @@ public class DumpIntegrationTests {
}
+ @SuppressWarnings("unchecked")
@Test
public void logDumpEnabled() throws IOException, InterruptedException {
Configuration configuration = getConfiguration("org.eclipse.virgo.medic");
@@ -156,7 +158,7 @@ public class DumpIntegrationTests {
LoggerFactory.getLogger(getClass()).info("Test");
- ServiceReference serviceReference = this.bundleContext.getServiceReference(DumpGenerator.class.getName());
+ ServiceReference<DumpGenerator> serviceReference = (ServiceReference<DumpGenerator>)this.bundleContext.getServiceReference(DumpGenerator.class.getName());
DumpGenerator dumpGenerator = (DumpGenerator)this.bundleContext.getService(serviceReference);
dumpGenerator.generateDump("bleurgh");
@@ -177,8 +179,9 @@ public class DumpIntegrationTests {
return configurationAdmin.getConfiguration(pid);
}
+ @SuppressWarnings("unchecked")
private ConfigurationAdmin getConfigurationAdmin() {
- ServiceReference serviceReference = this.bundleContext.getServiceReference(ConfigurationAdmin.class.getName());
+ ServiceReference<ConfigurationAdmin> serviceReference = (ServiceReference<ConfigurationAdmin>)this.bundleContext.getServiceReference(ConfigurationAdmin.class.getName());
assertNotNull(serviceReference);
return (ConfigurationAdmin) this.bundleContext.getService(serviceReference);
diff --git a/org.eclipse.virgo.medic.integrationtest/src/test/java/org/eclipse/virgo/medic/eventlog/test/EventLogIntegrationTests.java b/org.eclipse.virgo.medic.integrationtest/src/test/java/org/eclipse/virgo/medic/eventlog/test/EventLogIntegrationTests.java
index 79f62f9..011fd33 100644
--- a/org.eclipse.virgo.medic.integrationtest/src/test/java/org/eclipse/virgo/medic/eventlog/test/EventLogIntegrationTests.java
+++ b/org.eclipse.virgo.medic.integrationtest/src/test/java/org/eclipse/virgo/medic/eventlog/test/EventLogIntegrationTests.java
@@ -52,21 +52,24 @@ public class EventLogIntegrationTests {
this.bundleContext.installBundle("file:src/test/resources/message-fragment");
}
+ @SuppressWarnings("unchecked")
@Test
public void availabilityOfEventLoggerFactory() {
- ServiceReference serviceReference = this.bundleContext.getServiceReference(EventLoggerFactory.class.getName());
+ ServiceReference<EventLoggerFactory> serviceReference = (ServiceReference<EventLoggerFactory>)this.bundleContext.getServiceReference(EventLoggerFactory.class.getName());
assertNotNull(serviceReference);
}
+ @SuppressWarnings("unchecked")
@Test
public void availabilityOfEventLogger() {
- ServiceReference serviceReference = this.bundleContext.getServiceReference(EventLogger.class.getName());
+ ServiceReference<EventLogger> serviceReference = (ServiceReference<EventLogger>)this.bundleContext.getServiceReference(EventLogger.class.getName());
assertNotNull(serviceReference);
}
+ @SuppressWarnings("unchecked")
@Test
public void eventLoggingWithMessageFromCurrentBundle() {
- ServiceReference serviceReference = this.bundleContext.getServiceReference(EventLogger.class.getName());
+ ServiceReference<EventLogger> serviceReference = (ServiceReference<EventLogger>)this.bundleContext.getServiceReference(EventLogger.class.getName());
assertNotNull(serviceReference);
EventLogger eventLogger = (EventLogger)this.bundleContext.getService(serviceReference);
eventLogger.log("1234", Level.WARNING, "orange", "lemon");
@@ -81,9 +84,10 @@ public class EventLogIntegrationTests {
}
+ @SuppressWarnings("unchecked")
@Test
public void eventLoggingWithMessageFromFragment() throws Exception {
- ServiceReference serviceReference = this.bundleContext.getServiceReference(EventLoggerFactory.class.getName());
+ ServiceReference<EventLoggerFactory> serviceReference = (ServiceReference<EventLoggerFactory>)this.bundleContext.getServiceReference(EventLoggerFactory.class.getName());
assertNotNull(serviceReference);
EventLoggerFactory eventLoggerFactory = (EventLoggerFactory)this.bundleContext.getService(serviceReference);
EventLogger eventLogger = eventLoggerFactory.createEventLogger(this.messageBundle);
@@ -98,9 +102,10 @@ public class EventLogIntegrationTests {
assertEquals("Shared oak and sycamore", loggingEvent.get(0).getMessage());
}
+ @SuppressWarnings("unchecked")
@Test
public void eventLoggingWithMessageFromSpecificBundle() throws Exception {
- ServiceReference serviceReference = this.bundleContext.getServiceReference(EventLoggerFactory.class.getName());
+ ServiceReference<EventLoggerFactory> serviceReference = (ServiceReference<EventLoggerFactory>)this.bundleContext.getServiceReference(EventLoggerFactory.class.getName());
assertNotNull(serviceReference);
EventLoggerFactory eventLoggerFactory = (EventLoggerFactory)this.bundleContext.getService(serviceReference);
EventLogger eventLogger = eventLoggerFactory.createEventLogger(this.messageBundle);
diff --git a/org.eclipse.virgo.medic.integrationtest/src/test/resources/META-INF/MANIFEST.MF b/org.eclipse.virgo.medic.integrationtest/src/test/resources/META-INF/MANIFEST.MF
index 11ab47e..697bbdd 100644
--- a/org.eclipse.virgo.medic.integrationtest/src/test/resources/META-INF/MANIFEST.MF
+++ b/org.eclipse.virgo.medic.integrationtest/src/test/resources/META-INF/MANIFEST.MF
@@ -1,23 +1,11 @@
Manifest-Version: 1.0
-Excluded-Import: ch.qos.logback.classic
-Tool: Bundlor 1.0.0.M6
+Tool: Bundlor 1.0.0.RELEASE
Bundle-Name: Medic Logging Integration Tests
Bundle-SymbolicName: org.eclipse.virgo.medic.log.test
Import-Package: ch.qos.logback.classic.spi,
ch.qos.logback.core,
- org.aspectj.lang;version="[1.6.6,2.0.0)",
- org.aspectj.lang.reflect;version="[1.6.6,2.0.0)",
- org.aspectj.runtime.internal;version="[1.6.6,2.0.0)",
- org.aspectj.runtime.reflect;version="[1.6.6,2.0.0)",
- org.eclipse.virgo.medic.dump;version="0",
- org.eclipse.virgo.medic.eventlog;version="0",
- org.eclipse.virgo.medic.log;version="0",
- org.eclipse.virgo.medic.log.appender;version="0",
- org.eclipse.virgo.test.framework,
- org.junit,
- org.junit.runner,
+ org.eclipse.virgo.medic.log;version="[2.2.0,2.3)",
org.osgi.framework;version=0,
- org.osgi.service.cm,
org.slf4j
Bundle-Version: 1.0.0
Bundle-ManifestVersion: 2
diff --git a/org.eclipse.virgo.medic.testfragment/.classpath b/org.eclipse.virgo.medic.testfragment/.classpath
index 353a6dc..14c9faa 100644
--- a/org.eclipse.virgo.medic.testfragment/.classpath
+++ b/org.eclipse.virgo.medic.testfragment/.classpath
@@ -21,7 +21,7 @@
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="var" path="MEDIC_IVY_CACHE/org.eclipse.osgi/org.eclipse.osgi/3.6.1.R36x_v20100806/org.eclipse.osgi-3.6.1.R36x_v20100806.jar" sourcepath="/MEDIC_IVY_CACHE/org.eclipse.osgi/org.eclipse.osgi/3.6.1.R36x_v20100806/org.eclipse.osgi-sources-3.6.1.R36x_v20100806.jar"/>
+ <classpathentry kind="var" path="MEDIC_IVY_CACHE/org.eclipse.osgi/org.eclipse.osgi/3.7.0.v20101022/org.eclipse.osgi-3.7.0.v20101022.jar" sourcepath="/MEDIC_IVY_CACHE/org.eclipse.osgi/org.eclipse.osgi/3.7.0.v20101022/org.eclipse.osgi-sources-3.7.0.v20101022.jar"/>
<classpathentry kind="con" path="org.eclipse.ajdt.core.ASPECTJRT_CONTAINER"/>
<classpathentry kind="var" path="MEDIC_IVY_CACHE/org.slf4j/com.springsource.slf4j.api/1.6.1/com.springsource.slf4j.api-1.6.1.jar" sourcepath="/MEDIC_IVY_CACHE/org.slf4j/com.springsource.slf4j.api/1.6.1/com.springsource.slf4j.api-sources-1.6.1.jar"/>
<classpathentry kind="output" path="target/classes"/>
diff --git a/org.eclipse.virgo.medic.weaving/.classpath b/org.eclipse.virgo.medic.weaving/.classpath
index d48b09c..3a02ce6 100644
--- a/org.eclipse.virgo.medic.weaving/.classpath
+++ b/org.eclipse.virgo.medic.weaving/.classpath
@@ -25,7 +25,7 @@
<classpathentry kind="con" path="org.eclipse.ajdt.core.ASPECTJRT_CONTAINER"/>
<classpathentry kind="var" path="MEDIC_IVY_CACHE/org.slf4j/com.springsource.slf4j.api/1.6.1/com.springsource.slf4j.api-1.6.1.jar" sourcepath="/MEDIC_IVY_CACHE/org.slf4j/com.springsource.slf4j.api/1.6.1/com.springsource.slf4j.api-sources-1.6.1.jar"/>
<classpathentry kind="var" path="MEDIC_IVY_CACHE/ch.qos.logback/com.springsource.ch.qos.logback.classic/0.9.24/com.springsource.ch.qos.logback.classic-0.9.24.jar" sourcepath="/MEDIC_IVY_CACHE/ch.qos.logback/com.springsource.ch.qos.logback.classic/0.9.24/com.springsource.ch.qos.logback.classic-sources-0.9.24.jar"/>
- <classpathentry kind="var" path="MEDIC_IVY_CACHE/org.eclipse.osgi/org.eclipse.osgi/3.6.1.R36x_v20100806/org.eclipse.osgi-3.6.1.R36x_v20100806.jar" sourcepath="MEDIC_IVY_CACHE/org.eclipse.osgi/org.eclipse.osgi/3.6.1.R36x_v20100806/org.eclipse.osgi-sources-3.6.1.R36x_v20100806.jar"/>
+ <classpathentry kind="var" path="MEDIC_IVY_CACHE/org.eclipse.osgi/org.eclipse.osgi/3.7.0.v20101022/org.eclipse.osgi-3.7.0.v20101022.jar" sourcepath="MEDIC_IVY_CACHE/org.eclipse.osgi/org.eclipse.osgi/3.7.0.v20101022/org.eclipse.osgi-sources-3.7.0.v20101022.jar"/>
<classpathentry combineaccessrules="false" kind="src" path="/org.eclipse.virgo.medic"/>
<classpathentry kind="var" path="MEDIC_IVY_CACHE/org.junit/com.springsource.org.junit/4.7.0/com.springsource.org.junit-4.7.0.jar" sourcepath="/MEDIC_IVY_CACHE/org.junit/com.springsource.org.junit/4.7.0/com.springsource.org.junit-sources-4.7.0.jar"/>
<classpathentry kind="output" path="target/classes"/>
diff --git a/org.eclipse.virgo.medic/.classpath b/org.eclipse.virgo.medic/.classpath
index 353a6dc..14c9faa 100644
--- a/org.eclipse.virgo.medic/.classpath
+++ b/org.eclipse.virgo.medic/.classpath
@@ -21,7 +21,7 @@
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="var" path="MEDIC_IVY_CACHE/org.eclipse.osgi/org.eclipse.osgi/3.6.1.R36x_v20100806/org.eclipse.osgi-3.6.1.R36x_v20100806.jar" sourcepath="/MEDIC_IVY_CACHE/org.eclipse.osgi/org.eclipse.osgi/3.6.1.R36x_v20100806/org.eclipse.osgi-sources-3.6.1.R36x_v20100806.jar"/>
+ <classpathentry kind="var" path="MEDIC_IVY_CACHE/org.eclipse.osgi/org.eclipse.osgi/3.7.0.v20101022/org.eclipse.osgi-3.7.0.v20101022.jar" sourcepath="/MEDIC_IVY_CACHE/org.eclipse.osgi/org.eclipse.osgi/3.7.0.v20101022/org.eclipse.osgi-sources-3.7.0.v20101022.jar"/>
<classpathentry kind="con" path="org.eclipse.ajdt.core.ASPECTJRT_CONTAINER"/>
<classpathentry kind="var" path="MEDIC_IVY_CACHE/org.slf4j/com.springsource.slf4j.api/1.6.1/com.springsource.slf4j.api-1.6.1.jar" sourcepath="/MEDIC_IVY_CACHE/org.slf4j/com.springsource.slf4j.api/1.6.1/com.springsource.slf4j.api-sources-1.6.1.jar"/>
<classpathentry kind="output" path="target/classes"/>

Back to the top