Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Powell2010-12-06 12:04:01 -0500
committerSteve Powell2010-12-06 12:04:01 -0500
commit827ab8125e7ce3db16d4aea8cfef5239b9e4dc30 (patch)
treefe0e4d11a77fffe226266e44e1361b905272f871
parent3dae7790ef66f8f950f5b2e070d5ad4f80eb6639 (diff)
downloadorg.eclipse.virgo.medic-827ab8125e7ce3db16d4aea8cfef5239b9e4dc30.tar.gz
org.eclipse.virgo.medic-827ab8125e7ce3db16d4aea8cfef5239b9e4dc30.tar.xz
org.eclipse.virgo.medic-827ab8125e7ce3db16d4aea8cfef5239b9e4dc30.zip
Remove warnings by using generics properly and suppressing deprecation warnings.
-rw-r--r--build.versions1
-rw-r--r--org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/dump/impl/thread/StandardThreadInfoWriter.java10
-rw-r--r--org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/impl/MedicActivator.java26
-rw-r--r--org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/impl/config/ConfigurationAdminConfigurationProvider.java32
-rw-r--r--org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/impl/config/ConfigurationProvider.java3
-rw-r--r--org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/impl/config/DictionaryUtils.java10
-rw-r--r--org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/log/impl/LoggingPrintStreamWrapper.java1
-rw-r--r--org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/log/impl/StandardDelegatingPrintStream.java36
-rw-r--r--org.eclipse.virgo.medic.core/src/test/java/org/eclipse/virgo/medic/dump/impl/StandardDumpGeneratorTests.java6
-rw-r--r--org.eclipse.virgo.medic.core/src/test/java/org/eclipse/virgo/medic/dump/impl/logback/LogDumpContributorTests.java5
-rw-r--r--org.eclipse.virgo.medic.core/src/test/java/org/eclipse/virgo/medic/impl/MedicActivatorTests.java1
-rw-r--r--org.eclipse.virgo.medic.core/src/test/java/org/eclipse/virgo/medic/log/impl/LoggingPrintStreamWrapperTests.java4
-rw-r--r--org.eclipse.virgo.medic.core/src/test/java/org/eclipse/virgo/medic/log/impl/StandardDelegatingPrintStreamTests.java1
-rw-r--r--org.eclipse.virgo.medic.core/src/test/java/org/eclipse/virgo/medic/log/impl/config/ServiceRegistryConfigurationLocatorTests.java7
-rw-r--r--org.eclipse.virgo.medic.integrationtest/.classpath4
-rw-r--r--org.eclipse.virgo.medic.integrationtest/ivy.xml4
-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.MF17
18 files changed, 105 insertions, 78 deletions
diff --git a/build.versions b/build.versions
index 14df0e3..f843682 100644
--- a/build.versions
+++ b/build.versions
@@ -12,3 +12,4 @@ org.easymock=2.3.0
org.eclipse.virgo.test=2.2.0.D-20101126161613
org.eclipse.virgo.teststubs=2.2.0.D-20101126160526
org.eclipse.virgo.util=2.2.0.D-20101126161058
+org.eclipse.virgo.osgi=2.2.0.D-20101126160810
diff --git a/org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/dump/impl/thread/StandardThreadInfoWriter.java b/org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/dump/impl/thread/StandardThreadInfoWriter.java
index 2adab11..a6a1475 100644
--- a/org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/dump/impl/thread/StandardThreadInfoWriter.java
+++ b/org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/dump/impl/thread/StandardThreadInfoWriter.java
@@ -12,7 +12,6 @@
package org.eclipse.virgo.medic.dump.impl.thread;
import java.io.PrintWriter;
-import java.lang.management.MonitorInfo;
import java.lang.management.ThreadInfo;
class StandardThreadInfoWriter implements ThreadInfoWriter {
@@ -20,13 +19,4 @@ class StandardThreadInfoWriter implements ThreadInfoWriter {
public void write(ThreadInfo threadInfo, PrintWriter writer) {
writer.print(threadInfo.toString().replaceAll("\n", System.getProperty("line.separator")));
}
-
- private static MonitorInfo findLockedMonitor(StackTraceElement stackTraceElement, MonitorInfo[] lockedMonitors) {
- for (MonitorInfo monitorInfo : lockedMonitors) {
- if (stackTraceElement.equals(monitorInfo.getLockedStackFrame())) {
- return monitorInfo;
- }
- }
- return null;
- }
}
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 4671fcd..81ae897 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
@@ -21,10 +21,7 @@ import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.osgi.framework.BundleListener;
import org.osgi.framework.ServiceFactory;
-import org.osgi.framework.ServiceReference;
import org.osgi.service.cm.ConfigurationListener;
-import org.osgi.service.packageadmin.PackageAdmin;
-
import org.eclipse.virgo.medic.dump.DumpGenerator;
import org.eclipse.virgo.medic.dump.impl.DumpContributorPublisher;
@@ -61,6 +58,7 @@ import org.eclipse.virgo.medic.log.impl.logback.LoggerContextConfigurer;
import org.eclipse.virgo.medic.log.impl.logback.StandardContextSelectorDelegate;
import org.eclipse.virgo.util.osgi.ServiceRegistrationTracker;
+@SuppressWarnings("deprecation")
public final class MedicActivator implements BundleActivator {
private static final String LOGGER_NAME_SYSERR = "System.err";
@@ -85,8 +83,6 @@ public final class MedicActivator implements BundleActivator {
private volatile DumpContributorPublisher dumpContributorPublisher;
- private volatile ServiceReference<PackageAdmin> packageAdminReference;
-
private volatile PrintStream sysOut;
private volatile PrintStream sysErr;
@@ -137,12 +133,9 @@ public final class MedicActivator implements BundleActivator {
}
}
- @SuppressWarnings("unchecked")
private void logStart(BundleContext context, ConfigurationProvider configurationProvider) throws ConfigurationPublicationFailedException {
- this.packageAdminReference = (ServiceReference<PackageAdmin>) context.getServiceReference(PackageAdmin.class.getName());
- PackageAdmin packageAdmin = (PackageAdmin) context.getService(this.packageAdminReference);
- StandardContextSelectorDelegate delegate = createContextSelectorDelegate(context, packageAdmin);
+ StandardContextSelectorDelegate delegate = createContextSelectorDelegate(context);
this.registrationTracker.track(context.registerService(BundleListener.class.getName(), delegate, null));
DelegatingContextSelector.setDelegate(delegate);
@@ -155,7 +148,7 @@ public final class MedicActivator implements BundleActivator {
ExecutionStackAccessor stackAccessor = new SecurityManagerExecutionStackAccessor();
- Dictionary configuration = configurationProvider.getConfiguration();
+ Dictionary<String, String> configuration = configurationProvider.getConfiguration();
PrintStream delegatingSysOut = new StandardDelegatingPrintStream(System.out);
PrintStream delegatingSysErr = new StandardDelegatingPrintStream(System.err);
@@ -166,14 +159,14 @@ public final class MedicActivator implements BundleActivator {
System.setOut(delegatingSysOut);
System.setErr(delegatingSysErr);
- if (Boolean.valueOf((String)configuration.get(ConfigurationProvider.KEY_LOG_WRAP_SYSOUT))) {
+ if (Boolean.valueOf(configuration.get(ConfigurationProvider.KEY_LOG_WRAP_SYSOUT))) {
publishDelegatingPrintStream(delegatingSysOut, LOGGER_NAME_SYSOUT_DELEGATE, context);
publishPrintStream(this.sysOut, LOGGER_NAME_SYSOUT, context);
System.setOut(wrapPrintStream(System.out, LOGGER_NAME_SYSOUT, LoggingLevel.INFO, stackAccessor, configurationProvider, ConfigurationProvider.KEY_LOG_WRAP_SYSOUT));
}
- if (Boolean.valueOf((String)configuration.get(ConfigurationProvider.KEY_LOG_WRAP_SYSERR))) {
+ if (Boolean.valueOf(configuration.get(ConfigurationProvider.KEY_LOG_WRAP_SYSERR))) {
publishDelegatingPrintStream(delegatingSysErr, LOGGER_NAME_SYSERR_DELEGATE, context);
publishPrintStream(this.sysErr, LOGGER_NAME_SYSERR, context);
@@ -211,7 +204,7 @@ public final class MedicActivator implements BundleActivator {
}
}
- private static StandardContextSelectorDelegate createContextSelectorDelegate(BundleContext bundleContext, PackageAdmin packageAdmin) {
+ private static StandardContextSelectorDelegate createContextSelectorDelegate(BundleContext bundleContext) {
ConfigurationLocator configurationLocator = createConfigurationLocator(bundleContext);
CallingBundleResolver loggingCallerLocator = createLoggingCallerLocator();
LoggerContextConfigurer loggerContextConfigurer = new JoranLoggerContextConfigurer();
@@ -244,15 +237,10 @@ public final class MedicActivator implements BundleActivator {
return new SecurityManagerExecutionStackAccessor();
}
- private void logStop(BundleContext context) {
+ private void logStop(@SuppressWarnings("unused") BundleContext context) {
System.setProperty(PROPERTY_LOGBACK_CONTEXT_SELECTOR, DEFAULT_CONTEXT_SELECTOR);
- if (this.packageAdminReference != null) {
- context.ungetService(this.packageAdminReference);
- this.packageAdminReference = null;
- }
-
DelegatingContextSelector.setDelegate(null);
if (this.sysOut != 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 1a6551b..301df17 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
@@ -28,19 +28,18 @@ public final class ConfigurationAdminConfigurationProvider implements Configurat
private static final String CONFIG_ADMIN_SERVICE_NAME = "org.osgi.service.cm.ConfigurationAdmin";
- private static final Dictionary<Object, Object> DEFAULT_CONFIG = createDefaultConfiguration();
+ private static final Dictionary<String, String> DEFAULT_CONFIG = createDefaultConfiguration();
private final BundleContext bundleContext;
- @SuppressWarnings("unchecked")
- private volatile Dictionary configuration = DEFAULT_CONFIG;
+ private volatile Dictionary<String,String> configuration = DEFAULT_CONFIG;
public ConfigurationAdminConfigurationProvider(BundleContext context) {
this.bundleContext = context;
initialisePropertiesFromConfigurationAdmin();
}
- public Dictionary<?, ?> getConfiguration() {
+ public Dictionary<String, String> getConfiguration() {
return this.configuration;
}
@@ -55,20 +54,20 @@ public final class ConfigurationAdminConfigurationProvider implements Configurat
}
}
- @SuppressWarnings("unchecked")
- private void setPropertiesFromConfigurationAdmin(ServiceReference configAdminReference) {
- ConfigurationAdmin configurationAdmin = (ConfigurationAdmin)this.bundleContext.getService(configAdminReference);
+ private void setPropertiesFromConfigurationAdmin(ServiceReference<ConfigurationAdmin> configAdminReference) {
+ ConfigurationAdmin configurationAdmin = this.bundleContext.getService(configAdminReference);
if (configurationAdmin != null) {
try {
Configuration configuration = configurationAdmin.getConfiguration(CONFIG_ADMIN_PID, null);
- Dictionary properties = configuration.getProperties();
+ @SuppressWarnings("unchecked")
+ Dictionary<String,String> properties = configuration.getProperties();
if (properties == null) {
properties = DEFAULT_CONFIG;
} else {
- DictionaryUtils.merge(properties, DEFAULT_CONFIG);
+ DictionaryUtils.mergeGeneral(properties, DEFAULT_CONFIG);
}
this.configuration = properties;
@@ -79,8 +78,8 @@ public final class ConfigurationAdminConfigurationProvider implements Configurat
}
}
- private static Dictionary<Object, Object> createDefaultConfiguration() {
- Dictionary<Object, Object> configuration = new Hashtable<Object, Object>();
+ private static Dictionary<String, String> createDefaultConfiguration() {
+ Dictionary<String, String> configuration = new Hashtable<String, String>();
configuration.put(KEY_DUMP_ROOT_DIRECTORY, ".");
configuration.put(KEY_LOG_WRAP_SYSOUT, Boolean.toString(Boolean.TRUE));
configuration.put(KEY_LOG_WRAP_SYSERR, Boolean.toString(Boolean.TRUE));
@@ -88,17 +87,18 @@ public final class ConfigurationAdminConfigurationProvider implements Configurat
}
private final class MedicConfigurationListener implements ConfigurationListener {
-
- public void configurationEvent(ConfigurationEvent configEvent) {
+ @SuppressWarnings("unchecked")
+ public void configurationEvent(ConfigurationEvent configEvent) {
if (CONFIG_ADMIN_PID.equals(configEvent.getPid()) && configEvent.getType() == ConfigurationEvent.CM_UPDATED) {
- setPropertiesFromConfigurationAdmin(configEvent.getReference());
+ setPropertiesFromConfigurationAdmin((ServiceReference<ConfigurationAdmin>)configEvent.getReference());
}
}
}
- public void configurationEvent(ConfigurationEvent event) {
+ @SuppressWarnings("unchecked")
+ public void configurationEvent(ConfigurationEvent event) {
if (event.getType() == ConfigurationEvent.CM_UPDATED && CONFIG_ADMIN_PID.equals(event.getPid())) {
- setPropertiesFromConfigurationAdmin(event.getReference());
+ setPropertiesFromConfigurationAdmin((ServiceReference<ConfigurationAdmin>)event.getReference());
}
}
}
diff --git a/org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/impl/config/ConfigurationProvider.java b/org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/impl/config/ConfigurationProvider.java
index 01b6470..5768de5 100644
--- a/org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/impl/config/ConfigurationProvider.java
+++ b/org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/impl/config/ConfigurationProvider.java
@@ -27,6 +27,5 @@ public interface ConfigurationProvider {
public static final String KEY_LOG_DUMP_PATTERN = "log.dump.pattern";
- @SuppressWarnings("unchecked")
- Dictionary getConfiguration();
+ Dictionary<String, String> getConfiguration();
}
diff --git a/org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/impl/config/DictionaryUtils.java b/org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/impl/config/DictionaryUtils.java
index 285d84d..0431fd7 100644
--- a/org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/impl/config/DictionaryUtils.java
+++ b/org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/impl/config/DictionaryUtils.java
@@ -25,4 +25,14 @@ final class DictionaryUtils {
}
}
}
+
+ static <S, T> void mergeGeneral(Dictionary<S, T> primary, Dictionary<S, T> secondary) {
+ Enumeration<S> keys = secondary.keys();
+ while (keys.hasMoreElements()) {
+ S key = keys.nextElement();
+ if (primary.get(key) == null) {
+ primary.put(key, secondary.get(key));
+ }
+ }
+ }
}
diff --git a/org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/log/impl/LoggingPrintStreamWrapper.java b/org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/log/impl/LoggingPrintStreamWrapper.java
index ee50845..fd4b144 100644
--- a/org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/log/impl/LoggingPrintStreamWrapper.java
+++ b/org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/log/impl/LoggingPrintStreamWrapper.java
@@ -69,6 +69,7 @@ public final class LoggingPrintStreamWrapper extends PrintStream {
this.executionStackAccessor = executionStackAccessor;
this.entryBuilders = new ThreadLocal<StringBuilder>() {
+ @Override
public StringBuilder initialValue() {
return new StringBuilder();
}
diff --git a/org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/log/impl/StandardDelegatingPrintStream.java b/org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/log/impl/StandardDelegatingPrintStream.java
index 908a939..299c3c8 100644
--- a/org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/log/impl/StandardDelegatingPrintStream.java
+++ b/org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/log/impl/StandardDelegatingPrintStream.java
@@ -53,148 +53,184 @@ public final class StandardDelegatingPrintStream extends PrintStream implements
}
}
+ @Override
public PrintStream append(char c) {
return delegate.append(c);
}
+ @Override
public PrintStream append(CharSequence csq, int start, int end) {
return delegate.append(csq, start, end);
}
+ @Override
public PrintStream append(CharSequence csq) {
return delegate.append(csq);
}
+ @Override
public boolean checkError() {
return delegate.checkError();
}
+ @Override
public void close() {
delegate.close();
}
+ @Override
public boolean equals(Object obj) {
return delegate.equals(obj);
}
+ @Override
public void flush() {
delegate.flush();
}
+ @Override
public PrintStream format(Locale l, String format, Object... args) {
return delegate.format(l, format, args);
}
+ @Override
public PrintStream format(String format, Object... args) {
return delegate.format(format, args);
}
+ @Override
public int hashCode() {
return delegate.hashCode();
}
+ @Override
public void print(boolean b) {
delegate.print(b);
}
+ @Override
public void print(char c) {
delegate.print(c);
}
+ @Override
public void print(char[] s) {
delegate.print(s);
}
+ @Override
public void print(double d) {
delegate.print(d);
}
+ @Override
public void print(float f) {
delegate.print(f);
}
+ @Override
public void print(int i) {
delegate.print(i);
}
+ @Override
public void print(long l) {
delegate.print(l);
}
+ @Override
public void print(Object obj) {
delegate.print(obj);
}
+ @Override
public void print(String s) {
delegate.print(s);
}
+ @Override
public PrintStream printf(Locale l, String format, Object... args) {
return delegate.printf(l, format, args);
}
+ @Override
public PrintStream printf(String format, Object... args) {
return delegate.printf(format, args);
}
+ @Override
public void println() {
delegate.println();
}
+ @Override
public void println(boolean x) {
delegate.println(x);
}
+ @Override
public void println(char x) {
delegate.println(x);
}
+ @Override
public void println(char[] x) {
delegate.println(x);
}
+ @Override
public void println(double x) {
delegate.println(x);
}
+ @Override
public void println(float x) {
delegate.println(x);
}
+ @Override
public void println(int x) {
delegate.println(x);
}
+ @Override
public void println(long x) {
delegate.println(x);
}
+ @Override
public void println(Object x) {
delegate.println(x);
}
+ @Override
public void println(String x) {
delegate.println(x);
}
+ @Override
public String toString() {
return delegate.toString();
}
+ @Override
public void write(byte[] buf, int off, int len) {
delegate.write(buf, off, len);
}
+ @Override
public void write(byte[] b) throws IOException {
delegate.write(b);
}
+ @Override
public void write(int b) {
delegate.write(b);
}
private static final class NoOpOutputStream extends OutputStream {
+ @Override
public void write(int b) throws IOException {
}
}
diff --git a/org.eclipse.virgo.medic.core/src/test/java/org/eclipse/virgo/medic/dump/impl/StandardDumpGeneratorTests.java b/org.eclipse.virgo.medic.core/src/test/java/org/eclipse/virgo/medic/dump/impl/StandardDumpGeneratorTests.java
index be37e8b..8f6a421 100644
--- a/org.eclipse.virgo.medic.core/src/test/java/org/eclipse/virgo/medic/dump/impl/StandardDumpGeneratorTests.java
+++ b/org.eclipse.virgo.medic.core/src/test/java/org/eclipse/virgo/medic/dump/impl/StandardDumpGeneratorTests.java
@@ -64,7 +64,7 @@ public class StandardDumpGeneratorTests {
expect(accessor.getDumpContributors()).andReturn(Arrays.asList(dumpContributor1, dumpContributor2));
ConfigurationProvider configurationProvider = createMock(ConfigurationProvider.class);
- Dictionary<Object, Object> configuration = new Hashtable<Object, Object>();
+ Dictionary<String, String> configuration = new Hashtable<String, String>();
configuration.put(ConfigurationProvider.KEY_DUMP_ROOT_DIRECTORY, "target");
expect(configurationProvider.getConfiguration()).andReturn(configuration).anyTimes();
@@ -88,7 +88,7 @@ public class StandardDumpGeneratorTests {
expect(dumpContributor1.getName()).andReturn("dc1").times(2);
ConfigurationProvider configurationProvider = createMock(ConfigurationProvider.class);
- Dictionary<Object, Object> configuration = new Hashtable<Object, Object>();
+ Dictionary<String, String> configuration = new Hashtable<String, String>();
configuration.put("dump.root.directory", "target");
configuration.put("dump.exclusions.foo", "dc1");
expect(configurationProvider.getConfiguration()).andReturn(configuration).anyTimes();
@@ -116,7 +116,7 @@ public class StandardDumpGeneratorTests {
expect(dumpContributor2.getName()).andReturn("dc2").times(2);
ConfigurationProvider configurationProvider = createMock(ConfigurationProvider.class);
- Dictionary<Object, Object> configuration = new Hashtable<Object, Object>();
+ Dictionary<String, String> configuration = new Hashtable<String, String>();
configuration.put("dump.root.directory", "target");
configuration.put("dump.exclusions.foo", "dc1, dc2");
expect(configurationProvider.getConfiguration()).andReturn(configuration).anyTimes();
diff --git a/org.eclipse.virgo.medic.core/src/test/java/org/eclipse/virgo/medic/dump/impl/logback/LogDumpContributorTests.java b/org.eclipse.virgo.medic.core/src/test/java/org/eclipse/virgo/medic/dump/impl/logback/LogDumpContributorTests.java
index 8a5e369..cbdb19b 100644
--- a/org.eclipse.virgo.medic.core/src/test/java/org/eclipse/virgo/medic/dump/impl/logback/LogDumpContributorTests.java
+++ b/org.eclipse.virgo.medic.core/src/test/java/org/eclipse/virgo/medic/dump/impl/logback/LogDumpContributorTests.java
@@ -111,9 +111,8 @@ public class LogDumpContributorTests {
}
private static final class StaticConfigurationProvider implements ConfigurationProvider {
- @SuppressWarnings("unchecked")
- public Dictionary getConfiguration() {
- Hashtable configuration = new Hashtable();
+ public Dictionary<String,String> getConfiguration() {
+ Hashtable<String,String> configuration = new Hashtable<String,String>();
configuration.put(ConfigurationProvider.KEY_LOG_DUMP_LEVEL, "debug");
configuration.put(ConfigurationProvider.KEY_LOG_DUMP_BUFFERSIZE, "2");
return configuration;
diff --git a/org.eclipse.virgo.medic.core/src/test/java/org/eclipse/virgo/medic/impl/MedicActivatorTests.java b/org.eclipse.virgo.medic.core/src/test/java/org/eclipse/virgo/medic/impl/MedicActivatorTests.java
index 0ecec87..0ce052b 100644
--- a/org.eclipse.virgo.medic.core/src/test/java/org/eclipse/virgo/medic/impl/MedicActivatorTests.java
+++ b/org.eclipse.virgo.medic.core/src/test/java/org/eclipse/virgo/medic/impl/MedicActivatorTests.java
@@ -38,6 +38,7 @@ import org.eclipse.virgo.teststubs.osgi.framework.StubBundle;
import org.eclipse.virgo.teststubs.osgi.framework.StubBundleContext;
import org.eclipse.virgo.teststubs.osgi.support.ObjectClassFilter;
+@SuppressWarnings("deprecation")
public class MedicActivatorTests {
@Test
diff --git a/org.eclipse.virgo.medic.core/src/test/java/org/eclipse/virgo/medic/log/impl/LoggingPrintStreamWrapperTests.java b/org.eclipse.virgo.medic.core/src/test/java/org/eclipse/virgo/medic/log/impl/LoggingPrintStreamWrapperTests.java
index a5f153b..eb13b49 100644
--- a/org.eclipse.virgo.medic.core/src/test/java/org/eclipse/virgo/medic/log/impl/LoggingPrintStreamWrapperTests.java
+++ b/org.eclipse.virgo.medic.core/src/test/java/org/eclipse/virgo/medic/log/impl/LoggingPrintStreamWrapperTests.java
@@ -97,7 +97,7 @@ public class LoggingPrintStreamWrapperTests {
printStream.print(456f);
printStream.print(7);
printStream.print(8910l);
- printStream.print(new Object() {public String toString() { return "toString";}});
+ printStream.print(new Object() {@Override public String toString() { return "toString";}});
printStream.append('\n');
printStream.print("abcd");
printStream.printf("%s %s%n%s%n", "Three", "strings", "last one on a new line.");
@@ -110,7 +110,7 @@ public class LoggingPrintStreamWrapperTests {
printStream.println(456f);
printStream.println(789);
printStream.println(101112l);
- printStream.println(new Object() {public String toString() { return "toString";}});
+ printStream.println(new Object() {@Override public String toString() { return "toString";}});
printStream.println("A string with a\nnew line in it.");
}
diff --git a/org.eclipse.virgo.medic.core/src/test/java/org/eclipse/virgo/medic/log/impl/StandardDelegatingPrintStreamTests.java b/org.eclipse.virgo.medic.core/src/test/java/org/eclipse/virgo/medic/log/impl/StandardDelegatingPrintStreamTests.java
index f23caed..d71e4cf 100644
--- a/org.eclipse.virgo.medic.core/src/test/java/org/eclipse/virgo/medic/log/impl/StandardDelegatingPrintStreamTests.java
+++ b/org.eclipse.virgo.medic.core/src/test/java/org/eclipse/virgo/medic/log/impl/StandardDelegatingPrintStreamTests.java
@@ -229,6 +229,7 @@ public class StandardDelegatingPrintStreamTests {
private static final class WriterOutputStream extends OutputStream {
private final StringWriter writer = new StringWriter();
+ @Override
public void write(int b) throws IOException {
writer.write(b);
}
diff --git a/org.eclipse.virgo.medic.core/src/test/java/org/eclipse/virgo/medic/log/impl/config/ServiceRegistryConfigurationLocatorTests.java b/org.eclipse.virgo.medic.core/src/test/java/org/eclipse/virgo/medic/log/impl/config/ServiceRegistryConfigurationLocatorTests.java
index aa40348..0cedca1 100644
--- a/org.eclipse.virgo.medic.core/src/test/java/org/eclipse/virgo/medic/log/impl/config/ServiceRegistryConfigurationLocatorTests.java
+++ b/org.eclipse.virgo.medic.core/src/test/java/org/eclipse/virgo/medic/log/impl/config/ServiceRegistryConfigurationLocatorTests.java
@@ -50,7 +50,7 @@ public class ServiceRegistryConfigurationLocatorTests {
this.bundle.addHeader("Medic-LoggingConfiguration", "foo");
LoggingConfiguration loggingConfiguration = createMock(LoggingConfiguration.class);
this.bundleContext.addFilter(new PropertiesFilter(getDefaultMap()));
- this.bundleContext.registerService(LoggingConfiguration.class.getName(), loggingConfiguration, getDefaultDictionary());
+ this.bundleContext.registerService(LoggingConfiguration.class, loggingConfiguration, getDefaultDictionary());
LoggingConfiguration configuration = this.locator.locateConfiguration(this.bundle);
assertEquals(loggingConfiguration, configuration);
}
@@ -72,9 +72,8 @@ public class ServiceRegistryConfigurationLocatorTests {
this.locator.locateConfiguration(this.bundle);
}
- @SuppressWarnings("unchecked")
- private Dictionary getDefaultDictionary() {
- Dictionary properties = new Hashtable();
+ private Dictionary<String,String> getDefaultDictionary() {
+ Dictionary<String,String> properties = new Hashtable<String,String>();
properties.put("org.eclipse.virgo.medic.log.configuration.id", "foo");
return properties;
}
diff --git a/org.eclipse.virgo.medic.integrationtest/.classpath b/org.eclipse.virgo.medic.integrationtest/.classpath
index 94dedca..373d6a8 100644
--- a/org.eclipse.virgo.medic.integrationtest/.classpath
+++ b/org.eclipse.virgo.medic.integrationtest/.classpath
@@ -33,10 +33,10 @@
<attribute name="org.eclipse.ajdt.aspectpath" value="org.eclipse.ajdt.aspectpath"/>
</attributes>
</classpathentry>
+ <classpathentry kind="var" path="MEDIC_IVY_CACHE/org.eclipse.virgo.osgi/org.eclipse.virgo.osgi.extensions.equinox/2.2.0.D-20101126160810/org.eclipse.virgo.osgi.extensions.equinox-2.2.0.D-20101126160810.jar" sourcepath="/MEDIC_IVY_CACHE/org.eclipse.virgo.osgi/org.eclipse.virgo.osgi.extensions.equinox/2.2.0.D-20101126160810/org.eclipse.virgo.osgi.extensions.equinox-sources-2.2.0.D-20101126160810.jar"/>
+ <classpathentry kind="var" path="MEDIC_IVY_CACHE/org.eclipse.virgo.osgi/org.eclipse.virgo.osgi.launcher/2.2.0.D-20101126160810/org.eclipse.virgo.osgi.launcher-2.2.0.D-20101126160810.jar" sourcepath="/MEDIC_IVY_CACHE/org.eclipse.virgo.osgi/org.eclipse.virgo.osgi.launcher/2.2.0.D-20101126160810/org.eclipse.virgo.osgi.launcher-sources-2.2.0.D-20101126160810.jar"/>
<classpathentry kind="var" path="MEDIC_IVY_CACHE/org.eclipse.virgo.util/org.eclipse.virgo.util.common/2.2.0.D-20101126161058/org.eclipse.virgo.util.common-2.2.0.D-20101126161058.jar" sourcepath="/MEDIC_IVY_CACHE/org.eclipse.virgo.util/org.eclipse.virgo.util.common/2.2.0.D-20101126161058/org.eclipse.virgo.util.common-sources-2.2.0.D-20101126161058.jar"/>
<classpathentry kind="var" path="MEDIC_IVY_CACHE/org.eclipse.equinox/org.eclipse.equinox.cm/1.0.200.v20100520/org.eclipse.equinox.cm-1.0.200.v20100520.jar"/>
<classpathentry kind="var" path="MEDIC_IVY_CACHE/org.eclipse.osgi/org.eclipse.osgi.services/3.3.0.v20101018/org.eclipse.osgi.services-3.3.0.v20101018.jar"/>
- <classpathentry kind="var" path="MEDIC_IVY_CACHE/org.eclipse.virgo.osgi/org.eclipse.virgo.osgi.launcher/2.2.0.M01/org.eclipse.virgo.osgi.launcher-2.2.0.M01.jar"/>
- <classpathentry kind="var" path="MEDIC_IVY_CACHE/org.eclipse.virgo.osgi/org.eclipse.virgo.osgi.extensions.equinox/2.2.0.M01/org.eclipse.virgo.osgi.extensions.equinox-2.2.0.M01.jar"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
diff --git a/org.eclipse.virgo.medic.integrationtest/ivy.xml b/org.eclipse.virgo.medic.integrationtest/ivy.xml
index a9b0a16..ef2b4f0 100644
--- a/org.eclipse.virgo.medic.integrationtest/ivy.xml
+++ b/org.eclipse.virgo.medic.integrationtest/ivy.xml
@@ -24,6 +24,10 @@
<dependency org="org.aspectj" name="com.springsource.org.aspectj.runtime" rev="${org.aspectj}" conf="aspects->runtime"/>
<dependency org="org.eclipse.virgo.util" name="org.eclipse.virgo.util.common" rev="${org.eclipse.virgo.util}" conf="test->runtime"/>
+ <dependency org="org.eclipse.virgo.osgi" name="org.eclipse.virgo.osgi.launcher" rev="${org.eclipse.virgo.osgi}" conf="test->runtime"/>
+ <dependency org="org.eclipse.virgo.osgi" name="org.eclipse.virgo.osgi.extensions.equinox" rev="${org.eclipse.virgo.osgi}" conf="test->runtime"/>
+
+
<dependency org="org.junit" name="com.springsource.org.junit" rev="${org.junit}" conf="test->runtime"/>
<dependency org="org.eclipse.virgo.test" name="org.eclipse.virgo.test.framework" rev="${org.eclipse.virgo.test}" conf="test->runtime"/>
<dependency org="ch.qos.logback" name="com.springsource.ch.qos.logback.classic" rev="${ch.qos.logback}" conf="test->runtime"/>
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 011fd33..9985a66 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,24 +52,21 @@ public class EventLogIntegrationTests {
this.bundleContext.installBundle("file:src/test/resources/message-fragment");
}
- @SuppressWarnings("unchecked")
@Test
public void availabilityOfEventLoggerFactory() {
- ServiceReference<EventLoggerFactory> serviceReference = (ServiceReference<EventLoggerFactory>)this.bundleContext.getServiceReference(EventLoggerFactory.class.getName());
+ ServiceReference<EventLoggerFactory> serviceReference = this.bundleContext.getServiceReference(EventLoggerFactory.class);
assertNotNull(serviceReference);
}
- @SuppressWarnings("unchecked")
@Test
public void availabilityOfEventLogger() {
- ServiceReference<EventLogger> serviceReference = (ServiceReference<EventLogger>)this.bundleContext.getServiceReference(EventLogger.class.getName());
+ ServiceReference<EventLogger> serviceReference = this.bundleContext.getServiceReference(EventLogger.class);
assertNotNull(serviceReference);
}
- @SuppressWarnings("unchecked")
@Test
public void eventLoggingWithMessageFromCurrentBundle() {
- ServiceReference<EventLogger> serviceReference = (ServiceReference<EventLogger>)this.bundleContext.getServiceReference(EventLogger.class.getName());
+ ServiceReference<EventLogger> serviceReference = this.bundleContext.getServiceReference(EventLogger.class);
assertNotNull(serviceReference);
EventLogger eventLogger = (EventLogger)this.bundleContext.getService(serviceReference);
eventLogger.log("1234", Level.WARNING, "orange", "lemon");
@@ -84,10 +81,9 @@ public class EventLogIntegrationTests {
}
- @SuppressWarnings("unchecked")
@Test
public void eventLoggingWithMessageFromFragment() throws Exception {
- ServiceReference<EventLoggerFactory> serviceReference = (ServiceReference<EventLoggerFactory>)this.bundleContext.getServiceReference(EventLoggerFactory.class.getName());
+ ServiceReference<EventLoggerFactory> serviceReference = this.bundleContext.getServiceReference(EventLoggerFactory.class);
assertNotNull(serviceReference);
EventLoggerFactory eventLoggerFactory = (EventLoggerFactory)this.bundleContext.getService(serviceReference);
EventLogger eventLogger = eventLoggerFactory.createEventLogger(this.messageBundle);
@@ -102,10 +98,9 @@ public class EventLogIntegrationTests {
assertEquals("Shared oak and sycamore", loggingEvent.get(0).getMessage());
}
- @SuppressWarnings("unchecked")
@Test
public void eventLoggingWithMessageFromSpecificBundle() throws Exception {
- ServiceReference<EventLoggerFactory> serviceReference = (ServiceReference<EventLoggerFactory>)this.bundleContext.getServiceReference(EventLoggerFactory.class.getName());
+ ServiceReference<EventLoggerFactory> serviceReference = this.bundleContext.getServiceReference(EventLoggerFactory.class);
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 73c910b..950f1b6 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
@@ -4,14 +4,17 @@ 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)",
+ org.aspectj.lang.reflect;version="[1.6.6,2)",
+ org.aspectj.runtime.reflect;version="[1.6.6,2)",
+ org.eclipse.virgo.medic.dump;version="[2.2.0,2.3)",
+ org.eclipse.virgo.medic.eventlog;version="[2.2.0,2.3)",
org.eclipse.virgo.medic.log;version="[2.2.0,2.3)",
- org.eclipse.virgo.medic.log.appender,
- org.osgi.service.cm,
+ org.eclipse.virgo.test.framework;version=0,
+ org.junit;version=0,
+ org.junit.runner,
org.osgi.framework;version=0,
- org.slf4j,
- org.junit,
- org.eclipse.virgo.test.framework,
- org.eclipse.virgo.medic.dump,
- org.eclipse.virgo.medic.eventlog
+ org.osgi.service.cm;version=0,
+ org.slf4j
Bundle-Version: 1.0.0
Bundle-ManifestVersion: 2

Back to the top