cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cschnei...@apache.org
Subject cxf-dosgi git commit: Fix warnings
Date Wed, 09 Mar 2016 13:56:21 GMT
Repository: cxf-dosgi
Updated Branches:
  refs/heads/master 4aa108f02 -> ba591efab


Fix warnings


Project: http://git-wip-us.apache.org/repos/asf/cxf-dosgi/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf-dosgi/commit/ba591efa
Tree: http://git-wip-us.apache.org/repos/asf/cxf-dosgi/tree/ba591efa
Diff: http://git-wip-us.apache.org/repos/asf/cxf-dosgi/diff/ba591efa

Branch: refs/heads/master
Commit: ba591efab73eefd6d7138aad3a6d19c0ceb7c9c1
Parents: 4aa108f
Author: Christian Schneider <chris@die-schneider.net>
Authored: Wed Mar 9 14:50:41 2016 +0100
Committer: Christian Schneider <chris@die-schneider.net>
Committed: Wed Mar 9 14:50:41 2016 +0100

----------------------------------------------------------------------
 .../exporter/EndpointListenerNotifier.java      | 11 +++++----
 .../exporter/EndpointRepository.java            |  1 +
 .../exporter/TopologyManagerExport.java         | 16 ++++++-------
 .../importer/EndpointListenerManager.java       |  4 ++--
 .../importer/ListenerHookImpl.java              | 12 ++++------
 .../importer/TopologyManagerImport.java         |  4 ++--
 .../exporter/EndpointListenerNotifierTest.java  |  5 +++-
 .../exporter/ExportServiceTest.java             |  7 ++++--
 .../importer/EndpointListenerImplTest.java      | 25 ++++++++++----------
 .../importer/ListenerHookImplTest.java          |  2 +-
 .../importer/TopologyManagerImportTest.java     |  8 ++++---
 .../util/SimpleServiceTrackerTest.java          |  8 +++----
 12 files changed, 54 insertions(+), 49 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/ba591efa/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/exporter/EndpointListenerNotifier.java
----------------------------------------------------------------------
diff --git a/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/exporter/EndpointListenerNotifier.java
b/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/exporter/EndpointListenerNotifier.java
index 17e9649..e01f5dd 100644
--- a/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/exporter/EndpointListenerNotifier.java
+++ b/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/exporter/EndpointListenerNotifier.java
@@ -57,7 +57,7 @@ public class EndpointListenerNotifier {
         } catch (InvalidSyntaxException e) {
             throw new RuntimeException("Unexpected exception creating filter", e);
         }
-        this.endpointListenerTracker = new SimpleServiceTracker(bctx, filter);
+        this.endpointListenerTracker = new SimpleServiceTracker<EndpointListener>(bctx,
filter);
         this.endpointListenerTracker.addListener(new SimpleServiceTrackerListener<EndpointListener>()
{
             @Override
             public void added(ServiceReference<EndpointListener> reference, EndpointListener
service) {
@@ -95,7 +95,7 @@ public class EndpointListenerNotifier {
         if (endpoints.isEmpty()) { // a little optimization to prevent unnecessary processing
             return;
         }
-        for (ServiceReference eplReference : endpointListenerTracker.getAllServiceReferences())
{
+        for (ServiceReference<EndpointListener> eplReference : endpointListenerTracker.getAllServiceReferences())
{
             notifyListener(added, eplReference, endpoints);
         }
     }
@@ -107,10 +107,10 @@ public class EndpointListenerNotifier {
      * @param endpointListenerRef the ServiceReference of an EndpointListener to notify
      * @param endpoints the endpoints the listener should be notified about
      */
-    void notifyListener(boolean added, ServiceReference endpointListenerRef,
+    void notifyListener(boolean added, ServiceReference<EndpointListener> endpointListenerRef,
                                 Collection<EndpointDescription> endpoints) {
         List<Filter> filters = getFiltersFromEndpointListenerScope(endpointListenerRef,
bctx);
-        EndpointListener endpointListener = (EndpointListener)bctx.getService(endpointListenerRef);
+        EndpointListener endpointListener = bctx.getService(endpointListenerRef);
         try {
             LOG.debug("notifyListener (added={})", added);
             for (EndpointDescription endpoint : endpoints) {
@@ -144,7 +144,8 @@ public class EndpointListenerNotifier {
         }
     }
 
-    static List<Filter> getFiltersFromEndpointListenerScope(ServiceReference sref,
BundleContext bctx) {
+    static List<Filter> getFiltersFromEndpointListenerScope(ServiceReference<EndpointListener>
sref, 
+                                                            BundleContext bctx) {
         List<Filter> filters = new ArrayList<Filter>();
         String[] scopes = Utils.getStringPlusProperty(sref.getProperty(EndpointListener.ENDPOINT_LISTENER_SCOPE));
         for (String scope : scopes) {

http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/ba591efa/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/exporter/EndpointRepository.java
----------------------------------------------------------------------
diff --git a/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/exporter/EndpointRepository.java
b/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/exporter/EndpointRepository.java
index 489b051..bdcdda5 100644
--- a/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/exporter/EndpointRepository.java
+++ b/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/exporter/EndpointRepository.java
@@ -38,6 +38,7 @@ import org.slf4j.LoggerFactory;
  * map is maintained which contains information on the endpoints for each RemoteAdminService
that created the
  * endpoints.
  */
+@SuppressWarnings("rawtypes")
 class EndpointRepository {
 
     private static final Logger LOG = LoggerFactory.getLogger(EndpointRepository.class);

http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/ba591efa/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/exporter/TopologyManagerExport.java
----------------------------------------------------------------------
diff --git a/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/exporter/TopologyManagerExport.java
b/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/exporter/TopologyManagerExport.java
index bb5b800..446ab07 100644
--- a/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/exporter/TopologyManagerExport.java
+++ b/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/exporter/TopologyManagerExport.java
@@ -84,7 +84,7 @@ public class TopologyManagerExport {
             public void added(ServiceReference<RemoteServiceAdmin> reference, RemoteServiceAdmin
rsa) {
                 LOG.debug("RemoteServiceAdmin added: {}, total {}",
                         rsa, remoteServiceAdminTracker.getAllServices().size());
-                for (ServiceReference serviceRef : endpointRepo.getServicesToBeExportedFor(rsa))
{
+                for (ServiceReference<?> serviceRef : endpointRepo.getServicesToBeExportedFor(rsa))
{
                     triggerExport(serviceRef);
                 }
             }
@@ -105,7 +105,7 @@ public class TopologyManagerExport {
         serviceListener = new ServiceListener() {
 
             public void serviceChanged(ServiceEvent event) {
-                ServiceReference sref = event.getServiceReference();
+                ServiceReference<?> sref = event.getServiceReference();
                 if (event.getType() == ServiceEvent.REGISTERED) {
                     LOG.debug("Received REGISTERED ServiceEvent: {}", event);
                     if (shouldExportService(sref)) {
@@ -123,7 +123,7 @@ public class TopologyManagerExport {
     /**
      * checks if a Service is intended to be exported
      */
-    private boolean shouldExportService(ServiceReference sref) {
+    private boolean shouldExportService(ServiceReference<?> sref) {
         return sref.getProperty(RemoteConstants.SERVICE_EXPORTED_INTERFACES) != null;
     }
 
@@ -139,7 +139,7 @@ public class TopologyManagerExport {
         epListenerNotifier.stop();
     }
 
-    protected void triggerExport(final ServiceReference sref) {
+    protected void triggerExport(final ServiceReference<?> sref) {
         execService.execute(new Runnable() {
             public void run() {
                 try {
@@ -151,7 +151,7 @@ public class TopologyManagerExport {
         });
     }
 
-    protected void doExportService(final ServiceReference sref) {
+    protected void doExportService(final ServiceReference<?> sref) {
         LOG.debug("Exporting service {}", sref);
         endpointRepo.addService(sref); // mark for future export even if there are currently
no RSAs
         List<RemoteServiceAdmin> rsaList = remoteServiceAdminTracker.getAllServices();
@@ -173,7 +173,7 @@ public class TopologyManagerExport {
         }
     }
 
-    private void exportServiceUsingRemoteServiceAdmin(final ServiceReference sref,
+    private void exportServiceUsingRemoteServiceAdmin(final ServiceReference<?> sref,
                                                       final RemoteServiceAdmin remoteServiceAdmin)
{
         // abort if the service was unregistered by the time we got here
         // (we check again at the end, but this optimization saves unnecessary heavy processing)
@@ -235,9 +235,9 @@ public class TopologyManagerExport {
     private void exportExistingServices() {
         try {
             // cast to String is necessary for compiling against OSGi core version >=
4.3
-            ServiceReference[] references = bctx.getServiceReferences((String)null, DOSGI_SERVICES);
+            ServiceReference<?>[] references = bctx.getServiceReferences((String)null,
DOSGI_SERVICES);
             if (references != null) {
-                for (ServiceReference sref : references) {
+                for (ServiceReference<?> sref : references) {
                     triggerExport(sref);
                 }
             }

http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/ba591efa/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/importer/EndpointListenerManager.java
----------------------------------------------------------------------
diff --git a/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/importer/EndpointListenerManager.java
b/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/importer/EndpointListenerManager.java
index 42a8bc4..f222606 100644
--- a/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/importer/EndpointListenerManager.java
+++ b/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/importer/EndpointListenerManager.java
@@ -37,7 +37,7 @@ public class EndpointListenerManager {
     private static final Logger LOG = LoggerFactory.getLogger(EndpointListenerManager.class);
 
     private final BundleContext bctx;
-    private volatile ServiceRegistration serviceRegistration;
+    private volatile ServiceRegistration<EndpointListener> serviceRegistration;
     private final List<String> filters = new ArrayList<String>();
     private final EndpointListener endpointListener;
 
@@ -47,7 +47,7 @@ public class EndpointListenerManager {
     }
 
     protected void start() {
-        serviceRegistration = bctx.registerService(EndpointListener.class.getName(), endpointListener,
+        serviceRegistration = bctx.registerService(EndpointListener.class, endpointListener,
                                                    getRegistrationProperties());
     }
 

http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/ba591efa/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/importer/ListenerHookImpl.java
----------------------------------------------------------------------
diff --git a/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/importer/ListenerHookImpl.java
b/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/importer/ListenerHookImpl.java
index 8b1b4bb..f01754d 100644
--- a/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/importer/ListenerHookImpl.java
+++ b/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/importer/ListenerHookImpl.java
@@ -59,11 +59,9 @@ public class ListenerHookImpl implements ListenerHook {
         this.serviceInterestListener = serviceInterestListener;
     }
 
-    @SuppressWarnings("rawtypes")
-    public void added(Collection/* <ListenerInfo> */ listeners) {
+    public void added(Collection<ListenerInfo> listeners) {
         LOG.debug("added listeners {}", listeners);
-        for (Object li : listeners) {
-            ListenerInfo listenerInfo = (ListenerInfo)li;
+        for (ListenerInfo listenerInfo : listeners) {
             LOG.debug("Filter {}", listenerInfo.getFilter());
 
             String className = Utils.getObjectClass(listenerInfo.getFilter());
@@ -87,12 +85,10 @@ public class ListenerHookImpl implements ListenerHook {
         }
     }
 
-    @SuppressWarnings("rawtypes")
-    public void removed(Collection/* <ListenerInfo> */ listeners) {
+    public void removed(Collection<ListenerInfo> listeners) {
         LOG.debug("removed listeners {}", listeners);
 
-        for (Object li : listeners) {
-            ListenerInfo listenerInfo = (ListenerInfo)li;
+        for (ListenerInfo listenerInfo : listeners) {
             LOG.debug("Filter {}", listenerInfo.getFilter());
 
             // TODO: determine if service was handled?

http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/ba591efa/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/importer/TopologyManagerImport.java
----------------------------------------------------------------------
diff --git a/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/importer/TopologyManagerImport.java
b/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/importer/TopologyManagerImport.java
index faadade..366d391 100644
--- a/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/importer/TopologyManagerImport.java
+++ b/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/importer/TopologyManagerImport.java
@@ -111,8 +111,8 @@ public class TopologyManagerImport implements EndpointListener, RemoteServiceAdm
     }
 
     public void start() {
-        bctx.registerService(RemoteServiceAdminListener.class.getName(), this, null);
-        bctx.registerService(ListenerHook.class.getName(), listenerHook, null);
+        bctx.registerService(RemoteServiceAdminListener.class, this, null);
+        bctx.registerService(ListenerHook.class, listenerHook, null);
         endpointListenerManager.start();
     }
 

http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/ba591efa/dsw/cxf-topology-manager/src/test/java/org/apache/cxf/dosgi/topologymanager/exporter/EndpointListenerNotifierTest.java
----------------------------------------------------------------------
diff --git a/dsw/cxf-topology-manager/src/test/java/org/apache/cxf/dosgi/topologymanager/exporter/EndpointListenerNotifierTest.java
b/dsw/cxf-topology-manager/src/test/java/org/apache/cxf/dosgi/topologymanager/exporter/EndpointListenerNotifierTest.java
index b6fab7f..b5bd5d1 100644
--- a/dsw/cxf-topology-manager/src/test/java/org/apache/cxf/dosgi/topologymanager/exporter/EndpointListenerNotifierTest.java
+++ b/dsw/cxf-topology-manager/src/test/java/org/apache/cxf/dosgi/topologymanager/exporter/EndpointListenerNotifierTest.java
@@ -24,9 +24,9 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
+import org.easymock.EasyMock;
 import org.easymock.IAnswer;
 import org.easymock.IMocksControl;
-import org.easymock.classextension.EasyMock;
 import org.junit.Test;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.Filter;
@@ -38,6 +38,9 @@ import org.osgi.service.remoteserviceadmin.EndpointListener;
 
 import static org.junit.Assert.assertEquals;
 
+@SuppressWarnings({
+    "rawtypes", "unchecked"
+   })
 public class EndpointListenerNotifierTest {
 
     @Test

http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/ba591efa/dsw/cxf-topology-manager/src/test/java/org/apache/cxf/dosgi/topologymanager/exporter/ExportServiceTest.java
----------------------------------------------------------------------
diff --git a/dsw/cxf-topology-manager/src/test/java/org/apache/cxf/dosgi/topologymanager/exporter/ExportServiceTest.java
b/dsw/cxf-topology-manager/src/test/java/org/apache/cxf/dosgi/topologymanager/exporter/ExportServiceTest.java
index 6d0140c..cb4c407 100644
--- a/dsw/cxf-topology-manager/src/test/java/org/apache/cxf/dosgi/topologymanager/exporter/ExportServiceTest.java
+++ b/dsw/cxf-topology-manager/src/test/java/org/apache/cxf/dosgi/topologymanager/exporter/ExportServiceTest.java
@@ -24,9 +24,9 @@ import java.util.Map;
 
 import org.apache.cxf.dosgi.topologymanager.util.SimpleServiceTracker;
 import org.apache.cxf.dosgi.topologymanager.util.SimpleServiceTrackerListener;
+import org.easymock.EasyMock;
 import org.easymock.IAnswer;
-import org.easymock.classextension.EasyMock;
-import org.easymock.classextension.IMocksControl;
+import org.easymock.IMocksControl;
 import org.junit.Test;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleContext;
@@ -40,6 +40,9 @@ import org.osgi.service.remoteserviceadmin.ExportRegistration;
 import org.osgi.service.remoteserviceadmin.RemoteConstants;
 import org.osgi.service.remoteserviceadmin.RemoteServiceAdmin;
 
+@SuppressWarnings({
+    "rawtypes", "unchecked"
+   })
 public class ExportServiceTest {
 
     /**

http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/ba591efa/dsw/cxf-topology-manager/src/test/java/org/apache/cxf/dosgi/topologymanager/importer/EndpointListenerImplTest.java
----------------------------------------------------------------------
diff --git a/dsw/cxf-topology-manager/src/test/java/org/apache/cxf/dosgi/topologymanager/importer/EndpointListenerImplTest.java
b/dsw/cxf-topology-manager/src/test/java/org/apache/cxf/dosgi/topologymanager/importer/EndpointListenerImplTest.java
index 0e905ab..c736197 100644
--- a/dsw/cxf-topology-manager/src/test/java/org/apache/cxf/dosgi/topologymanager/importer/EndpointListenerImplTest.java
+++ b/dsw/cxf-topology-manager/src/test/java/org/apache/cxf/dosgi/topologymanager/importer/EndpointListenerImplTest.java
@@ -21,8 +21,9 @@ package org.apache.cxf.dosgi.topologymanager.importer;
 import java.util.Dictionary;
 import java.util.List;
 
+import org.easymock.EasyMock;
 import org.easymock.IAnswer;
-import org.easymock.classextension.EasyMock;
+import org.easymock.IMocksControl;
 import org.junit.Assert;
 import org.junit.Test;
 import org.osgi.framework.BundleContext;
@@ -33,15 +34,18 @@ public class EndpointListenerImplTest extends Assert {
 
     int testCase;
 
-    @SuppressWarnings("rawtypes")
+    @SuppressWarnings({
+     "rawtypes", "unchecked"
+    })
     @Test
     public void testScopeChange() {
-        BundleContext bc = EasyMock.createNiceMock(BundleContext.class);
-        TopologyManagerImport tm = EasyMock.createNiceMock(TopologyManagerImport.class);
-        ServiceRegistration sr = EasyMock.createNiceMock(ServiceRegistration.class);
+        IMocksControl c = EasyMock.createNiceControl();
+        BundleContext bc = c.createMock(BundleContext.class);
+        TopologyManagerImport tm = c.createMock(TopologyManagerImport.class);
+        ServiceRegistration sr = c.createMock(ServiceRegistration.class);
 
         // expect Listener registration
-        EasyMock.expect(bc.registerService((String)EasyMock.anyObject(),
+        EasyMock.expect(bc.registerService(EasyMock.anyObject(Class.class),
                                            EasyMock.anyObject(),
                                            (Dictionary)EasyMock.anyObject())).andReturn(sr).atLeastOnce();
 
@@ -53,7 +57,6 @@ public class EndpointListenerImplTest extends Assert {
             public Object answer() throws Throwable {
                 Object[] args = EasyMock.getCurrentArguments();
                 Dictionary props = (Dictionary)args[0];
-                @SuppressWarnings("unchecked")
                 List<String> scope = (List<String>)props.get(EndpointListener.ENDPOINT_LISTENER_SCOPE);
                 switch (testCase) {
                 case 1:
@@ -83,9 +86,7 @@ public class EndpointListenerImplTest extends Assert {
             }
         }).atLeastOnce();
 
-        EasyMock.replay(bc);
-        EasyMock.replay(tm);
-        EasyMock.replay(sr);
+        c.replay();
 
         EndpointListenerManager endpointListener = new EndpointListenerManager(bc, tm);
 
@@ -105,8 +106,6 @@ public class EndpointListenerImplTest extends Assert {
 
         endpointListener.stop();
 
-        EasyMock.verify(bc);
-        EasyMock.verify(tm);
-        EasyMock.verify(sr);
+        c.verify();
     }
 }

http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/ba591efa/dsw/cxf-topology-manager/src/test/java/org/apache/cxf/dosgi/topologymanager/importer/ListenerHookImplTest.java
----------------------------------------------------------------------
diff --git a/dsw/cxf-topology-manager/src/test/java/org/apache/cxf/dosgi/topologymanager/importer/ListenerHookImplTest.java
b/dsw/cxf-topology-manager/src/test/java/org/apache/cxf/dosgi/topologymanager/importer/ListenerHookImplTest.java
index f2ff694..e61b453 100644
--- a/dsw/cxf-topology-manager/src/test/java/org/apache/cxf/dosgi/topologymanager/importer/ListenerHookImplTest.java
+++ b/dsw/cxf-topology-manager/src/test/java/org/apache/cxf/dosgi/topologymanager/importer/ListenerHookImplTest.java
@@ -21,7 +21,7 @@ package org.apache.cxf.dosgi.topologymanager.importer;
 import java.util.Dictionary;
 import java.util.Hashtable;
 
-import org.easymock.classextension.EasyMock;
+import org.easymock.EasyMock;
 import org.junit.Test;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.Filter;

http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/ba591efa/dsw/cxf-topology-manager/src/test/java/org/apache/cxf/dosgi/topologymanager/importer/TopologyManagerImportTest.java
----------------------------------------------------------------------
diff --git a/dsw/cxf-topology-manager/src/test/java/org/apache/cxf/dosgi/topologymanager/importer/TopologyManagerImportTest.java
b/dsw/cxf-topology-manager/src/test/java/org/apache/cxf/dosgi/topologymanager/importer/TopologyManagerImportTest.java
index a43120a..e01c068 100644
--- a/dsw/cxf-topology-manager/src/test/java/org/apache/cxf/dosgi/topologymanager/importer/TopologyManagerImportTest.java
+++ b/dsw/cxf-topology-manager/src/test/java/org/apache/cxf/dosgi/topologymanager/importer/TopologyManagerImportTest.java
@@ -25,9 +25,9 @@ import java.util.concurrent.TimeUnit;
 
 import org.apache.cxf.dosgi.topologymanager.util.SimpleServiceTracker;
 import org.apache.cxf.dosgi.topologymanager.util.SimpleServiceTrackerListener;
+import org.easymock.EasyMock;
 import org.easymock.IAnswer;
 import org.easymock.IMocksControl;
-import org.easymock.classextension.EasyMock;
 import org.junit.Test;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.ServiceRegistration;
@@ -40,7 +40,9 @@ import static org.junit.Assert.assertTrue;
 
 public class TopologyManagerImportTest {
 
-    @SuppressWarnings("rawtypes")
+    @SuppressWarnings({
+     "rawtypes", "unchecked"
+    })
     @Test
     public void testImportForNewlyAddedRSA() throws InterruptedException {
         IMocksControl c = EasyMock.createControl();
@@ -54,7 +56,7 @@ public class TopologyManagerImportTest {
         ServiceRegistration sreg = c.createMock(ServiceRegistration.class);
         sreg.unregister();
         EasyMock.expectLastCall().once();
-        EasyMock.expect(bc.registerService((String)EasyMock.anyObject(),
+        EasyMock.expect(bc.registerService(EasyMock.anyObject(Class.class),
                                            EasyMock.anyObject(),
                                            (Dictionary)EasyMock.anyObject())).andReturn(sreg).anyTimes();
 

http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/ba591efa/dsw/cxf-topology-manager/src/test/java/org/apache/cxf/dosgi/topologymanager/util/SimpleServiceTrackerTest.java
----------------------------------------------------------------------
diff --git a/dsw/cxf-topology-manager/src/test/java/org/apache/cxf/dosgi/topologymanager/util/SimpleServiceTrackerTest.java
b/dsw/cxf-topology-manager/src/test/java/org/apache/cxf/dosgi/topologymanager/util/SimpleServiceTrackerTest.java
index 0785e28..dd3aa0b 100644
--- a/dsw/cxf-topology-manager/src/test/java/org/apache/cxf/dosgi/topologymanager/util/SimpleServiceTrackerTest.java
+++ b/dsw/cxf-topology-manager/src/test/java/org/apache/cxf/dosgi/topologymanager/util/SimpleServiceTrackerTest.java
@@ -25,9 +25,9 @@ import java.util.HashSet;
 import java.util.List;
 
 import org.easymock.Capture;
+import org.easymock.EasyMock;
 import org.easymock.IAnswer;
-import org.easymock.classextension.EasyMock;
-import org.easymock.classextension.IMocksControl;
+import org.easymock.IMocksControl;
 import org.junit.Test;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleContext;
@@ -65,11 +65,11 @@ public class SimpleServiceTrackerTest {
     
     @Test
     public void testTracker() throws InvalidSyntaxException {
-        IMocksControl c = org.easymock.classextension.EasyMock.createControl();
+        IMocksControl c = EasyMock.createControl();
         // create context mock
         BundleContext context = c.createMock(BundleContext.class);
         // capture service listener so we can invoke it
-        Capture<ServiceListener> capturedListener = new Capture<ServiceListener>();
+        Capture<ServiceListener> capturedListener = EasyMock.newCapture();
         context.addServiceListener(EasyMock.<ServiceListener>capture(capturedListener),
(String)anyObject());
         expectLastCall().once();
         context.removeServiceListener((ServiceListener)anyObject());


Mime
View raw message