cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1420344 - in /cxf/dosgi/trunk/dsw/cxf-topology-manager/src: main/java/org/apache/cxf/dosgi/topologymanager/ main/java/org/apache/cxf/dosgi/topologymanager/exporter/ main/java/org/apache/cxf/dosgi/topologymanager/importer/ main/java/org/apa...
Date Tue, 11 Dec 2012 19:26:55 GMT
Author: dkulp
Date: Tue Dec 11 19:26:52 2012
New Revision: 1420344

URL: http://svn.apache.org/viewvc?rev=1420344&view=rev
Log:
Fix the topology-managers code style to have proper license headers, whitespaces, etc...

Modified:
    cxf/dosgi/trunk/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/Activator.java
    cxf/dosgi/trunk/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/exporter/EndpointListenerNotifier.java
    cxf/dosgi/trunk/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/exporter/ExportRepository.java
    cxf/dosgi/trunk/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/exporter/TopologyManagerExport.java
    cxf/dosgi/trunk/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/importer/EndpointListenerManager.java
    cxf/dosgi/trunk/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/importer/ListenerHookImpl.java
    cxf/dosgi/trunk/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/importer/RefManager.java
    cxf/dosgi/trunk/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/importer/ServiceInterestListener.java
    cxf/dosgi/trunk/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/importer/TopologyManagerImport.java
    cxf/dosgi/trunk/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/rsatracker/RemoteServiceAdminLifeCycleListener.java
    cxf/dosgi/trunk/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/rsatracker/RemoteServiceAdminTracker.java
    cxf/dosgi/trunk/dsw/cxf-topology-manager/src/test/java/org/apache/cxf/dosgi/topologymanager/ExportServiceTest.java
    cxf/dosgi/trunk/dsw/cxf-topology-manager/src/test/java/org/apache/cxf/dosgi/topologymanager/exporter/EndpointListenerNotifierTest.java
    cxf/dosgi/trunk/dsw/cxf-topology-manager/src/test/java/org/apache/cxf/dosgi/topologymanager/importer/EndpointListenerImplTest.java
    cxf/dosgi/trunk/dsw/cxf-topology-manager/src/test/java/org/apache/cxf/dosgi/topologymanager/importer/ListenerHookImplTest.java
    cxf/dosgi/trunk/dsw/cxf-topology-manager/src/test/java/org/apache/cxf/dosgi/topologymanager/importer/TopologyManagerImportTest.java

Modified: cxf/dosgi/trunk/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/Activator.java
URL: http://svn.apache.org/viewvc/cxf/dosgi/trunk/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/Activator.java?rev=1420344&r1=1420343&r2=1420344&view=diff
==============================================================================
--- cxf/dosgi/trunk/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/Activator.java (original)
+++ cxf/dosgi/trunk/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/Activator.java Tue Dec 11 19:26:52 2012
@@ -1,21 +1,21 @@
-/** 
-  * Licensed to the Apache Software Foundation (ASF) under one 
-  * or more contributor license agreements. See the NOTICE file 
-  * distributed with this work for additional information 
-  * regarding copyright ownership. The ASF licenses this file 
-  * to you under the Apache License, Version 2.0 (the 
-  * "License"); you may not use this file except in compliance 
-  * with the License. You may obtain a copy of the License at 
-  * 
-  * http://www.apache.org/licenses/LICENSE-2.0 
-  * 
-  * Unless required by applicable law or agreed to in writing, 
-  * software distributed under the License is distributed on an 
-  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
-  * KIND, either express or implied. See the License for the 
-  * specific language governing permissions and limitations 
-  * under the License. 
-  */
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
 package org.apache.cxf.dosgi.topologymanager;
 
 import org.apache.cxf.dosgi.topologymanager.exporter.TopologyManagerExport;

Modified: cxf/dosgi/trunk/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/exporter/EndpointListenerNotifier.java
URL: http://svn.apache.org/viewvc/cxf/dosgi/trunk/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/exporter/EndpointListenerNotifier.java?rev=1420344&r1=1420343&r2=1420344&view=diff
==============================================================================
--- cxf/dosgi/trunk/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/exporter/EndpointListenerNotifier.java (original)
+++ cxf/dosgi/trunk/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/exporter/EndpointListenerNotifier.java Tue Dec 11 19:26:52 2012
@@ -1,21 +1,21 @@
-/** 
-  * Licensed to the Apache Software Foundation (ASF) under one 
-  * or more contributor license agreements. See the NOTICE file 
-  * distributed with this work for additional information 
-  * regarding copyright ownership. The ASF licenses this file 
-  * to you under the Apache License, Version 2.0 (the 
-  * "License"); you may not use this file except in compliance 
-  * with the License. You may obtain a copy of the License at 
-  * 
-  * http://www.apache.org/licenses/LICENSE-2.0 
-  * 
-  * Unless required by applicable law or agreed to in writing, 
-  * software distributed under the License is distributed on an 
-  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
-  * KIND, either express or implied. See the License for the 
-  * specific language governing permissions and limitations 
-  * under the License. 
-  */
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
 package org.apache.cxf.dosgi.topologymanager.exporter;
 
 import java.util.ArrayList;
@@ -40,7 +40,7 @@ import org.slf4j.LoggerFactory;
  * Tracks EndpointListeners and allows to notify them of endpoints
  */
 public class EndpointListenerNotifier {
-    private final static Logger LOG = LoggerFactory.getLogger(EndpointListenerNotifier.class);
+    private static final Logger LOG = LoggerFactory.getLogger(EndpointListenerNotifier.class);
     private BundleContext bctx;
     private ServiceTracker stEndpointListeners;
     private ExportRepository exportRepository;
@@ -78,7 +78,7 @@ public class EndpointListenerNotifier {
     private void notifyListenerOfAllExistingExports(
             ServiceReference reference) {
         Collection<ExportRegistration> registrations = exportRepository.getAllExportRegistrations();
-        notifyListenerOfAdding(reference, registrations );
+        notifyListenerOfAdding(reference, registrations);
     }
     
     void nofifyEndpointListenersOfAdding(Collection<ExportRegistration> exportRegistrations) {
@@ -136,7 +136,7 @@ public class EndpointListenerNotifier {
         }
     }
     
-    static List<Filter> getFiltersFromEndpointListenerScope(ServiceReference sref,BundleContext bctx) {
+    static List<Filter> getFiltersFromEndpointListenerScope(ServiceReference sref, BundleContext bctx) {
         List<Filter> filters = new ArrayList<Filter>();
         try {
             Object fo = sref.getProperty(EndpointListener.ENDPOINT_LISTENER_SCOPE);
@@ -193,38 +193,38 @@ public class EndpointListenerNotifier {
      * @return
      * @throws InvalidSyntaxException
      */
-   private static ServiceReference[] getEndpointListeners(BundleContext bctx) {
-       ServiceReference[] result = null;
-       try {
-           String filter = "(" + EndpointListener.ENDPOINT_LISTENER_SCOPE + "=*)";
-           result = bctx.getServiceReferences(EndpointListener.class.getName(), filter);
-       } catch (InvalidSyntaxException e) {
-           LOG.error(e.getMessage(), e);
-       }
-       return (result == null) ? new ServiceReference[]{} : result;
-   }
+    private static ServiceReference[] getEndpointListeners(BundleContext bctx) {
+        ServiceReference[] result = null;
+        try {
+            String filter = "(" + EndpointListener.ENDPOINT_LISTENER_SCOPE + "=*)";
+            result = bctx.getServiceReferences(EndpointListener.class.getName(), filter);
+        } catch (InvalidSyntaxException e) {
+            LOG.error(e.getMessage(), e);
+        }
+        return (result == null) ? new ServiceReference[]{} : result;
+    }
    
-   /**
-    * Retrieve exported Endpoint while handling null
-    * @param exReg
-    * @return exported Endpoint or null if not present
-    */
-   private EndpointDescription getExportedEndpoint(ExportRegistration exReg) {
-       ExportReference ref = (exReg == null) ? null : exReg.getExportReference();
-       return (ref == null) ? null : ref.getExportedEndpoint(); 
-   }
+    /**
+     * Retrieve exported Endpoint while handling null
+     * @param exReg
+     * @return exported Endpoint or null if not present
+     */
+    private EndpointDescription getExportedEndpoint(ExportRegistration exReg) {
+        ExportReference ref = (exReg == null) ? null : exReg.getExportReference();
+        return (ref == null) ? null : ref.getExportedEndpoint(); 
+    }
    
-   /**
-    * Retrieve endpoint properties as Dictionary
-    * 
-    * @param ep
-    * @return endpoint properties (will never return null) 
-    */
-   private Dictionary<String, Object> getEndpointProperties(EndpointDescription ep) {
-       if (ep == null || ep.getProperties() == null) {
-           return new Hashtable<String, Object>();
-       } else {
-           return new Hashtable<String, Object>(ep.getProperties());
-       }
-   }
+    /**
+     * Retrieve endpoint properties as Dictionary
+     * 
+     * @param ep
+     * @return endpoint properties (will never return null) 
+     */
+    private Dictionary<String, Object> getEndpointProperties(EndpointDescription ep) {
+        if (ep == null || ep.getProperties() == null) {
+            return new Hashtable<String, Object>();
+        } else {
+            return new Hashtable<String, Object>(ep.getProperties());
+        }
+    }
 }

Modified: cxf/dosgi/trunk/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/exporter/ExportRepository.java
URL: http://svn.apache.org/viewvc/cxf/dosgi/trunk/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/exporter/ExportRepository.java?rev=1420344&r1=1420343&r2=1420344&view=diff
==============================================================================
--- cxf/dosgi/trunk/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/exporter/ExportRepository.java (original)
+++ cxf/dosgi/trunk/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/exporter/ExportRepository.java Tue Dec 11 19:26:52 2012
@@ -1,21 +1,21 @@
-/** 
-  * Licensed to the Apache Software Foundation (ASF) under one 
-  * or more contributor license agreements. See the NOTICE file 
-  * distributed with this work for additional information 
-  * regarding copyright ownership. The ASF licenses this file 
-  * to you under the Apache License, Version 2.0 (the 
-  * "License"); you may not use this file except in compliance 
-  * with the License. You may obtain a copy of the License at 
-  * 
-  * http://www.apache.org/licenses/LICENSE-2.0 
-  * 
-  * Unless required by applicable law or agreed to in writing, 
-  * software distributed under the License is distributed on an 
-  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
-  * KIND, either express or implied. See the License for the 
-  * specific language governing permissions and limitations 
-  * under the License. 
-  */
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
 package org.apache.cxf.dosgi.topologymanager.exporter;
 
 import java.util.Collection;

Modified: cxf/dosgi/trunk/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/exporter/TopologyManagerExport.java
URL: http://svn.apache.org/viewvc/cxf/dosgi/trunk/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/exporter/TopologyManagerExport.java?rev=1420344&r1=1420343&r2=1420344&view=diff
==============================================================================
--- cxf/dosgi/trunk/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/exporter/TopologyManagerExport.java (original)
+++ cxf/dosgi/trunk/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/exporter/TopologyManagerExport.java Tue Dec 11 19:26:52 2012
@@ -1,20 +1,20 @@
-/** 
- * Licensed to the Apache Software Foundation (ASF) under one 
- * or more contributor license agreements. See the NOTICE file 
- * distributed with this work for additional information 
- * regarding copyright ownership. The ASF licenses this file 
- * to you under the Apache License, Version 2.0 (the 
- * "License"); you may not use this file except in compliance 
- * with the License. You may obtain a copy of the License at 
- * 
- * http://www.apache.org/licenses/LICENSE-2.0 
- * 
- * Unless required by applicable law or agreed to in writing, 
- * software distributed under the License is distributed on an 
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
- * KIND, either express or implied. See the License for the 
- * specific language governing permissions and limitations 
- * under the License. 
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package org.apache.cxf.dosgi.topologymanager.exporter;
 
@@ -50,7 +50,7 @@ import org.slf4j.LoggerFactory;
  */
 public class TopologyManagerExport implements ExportRepository {
 
-    private final static Logger LOG = LoggerFactory.getLogger(TopologyManagerExport.class);
+    private static final Logger LOG = LoggerFactory.getLogger(TopologyManagerExport.class);
 
     private final BundleContext bctx;
     private final EndpointListenerNotifier epListenerNotifier;
@@ -182,11 +182,11 @@ public class TopologyManagerExport imple
                 Map<RemoteServiceAdmin, Collection<ExportRegistration>> rsas = exportedServices.get(sref);
                 for (Map.Entry<RemoteServiceAdmin, Collection<ExportRegistration>> entry : rsas.entrySet()) {
                     if (entry.getValue() != null) {
-                    	Collection<ExportRegistration> registrations = entry.getValue();
-                    	this.epListenerNotifier.notifyListenersOfRemoval(registrations);
+                        Collection<ExportRegistration> registrations = entry.getValue();
+                        this.epListenerNotifier.notifyListenersOfRemoval(registrations);
                         for (ExportRegistration exReg : registrations) {
                             if (exReg != null) {
-                                 exReg.close();
+                                exReg.close();
                             }
                         }
                     }

Modified: cxf/dosgi/trunk/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/importer/EndpointListenerManager.java
URL: http://svn.apache.org/viewvc/cxf/dosgi/trunk/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/importer/EndpointListenerManager.java?rev=1420344&r1=1420343&r2=1420344&view=diff
==============================================================================
--- cxf/dosgi/trunk/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/importer/EndpointListenerManager.java (original)
+++ cxf/dosgi/trunk/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/importer/EndpointListenerManager.java Tue Dec 11 19:26:52 2012
@@ -1,21 +1,21 @@
-/** 
-  * Licensed to the Apache Software Foundation (ASF) under one 
-  * or more contributor license agreements. See the NOTICE file 
-  * distributed with this work for additional information 
-  * regarding copyright ownership. The ASF licenses this file 
-  * to you under the Apache License, Version 2.0 (the 
-  * "License"); you may not use this file except in compliance 
-  * with the License. You may obtain a copy of the License at 
-  * 
-  * http://www.apache.org/licenses/LICENSE-2.0 
-  * 
-  * Unless required by applicable law or agreed to in writing, 
-  * software distributed under the License is distributed on an 
-  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
-  * KIND, either express or implied. See the License for the 
-  * specific language governing permissions and limitations 
-  * under the License. 
-  */
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
 package org.apache.cxf.dosgi.topologymanager.importer;
 
 import java.util.ArrayList;

Modified: cxf/dosgi/trunk/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/importer/ListenerHookImpl.java
URL: http://svn.apache.org/viewvc/cxf/dosgi/trunk/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/importer/ListenerHookImpl.java?rev=1420344&r1=1420343&r2=1420344&view=diff
==============================================================================
--- cxf/dosgi/trunk/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/importer/ListenerHookImpl.java (original)
+++ cxf/dosgi/trunk/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/importer/ListenerHookImpl.java Tue Dec 11 19:26:52 2012
@@ -1,21 +1,21 @@
-/** 
-  * Licensed to the Apache Software Foundation (ASF) under one 
-  * or more contributor license agreements. See the NOTICE file 
-  * distributed with this work for additional information 
-  * regarding copyright ownership. The ASF licenses this file 
-  * to you under the Apache License, Version 2.0 (the 
-  * "License"); you may not use this file except in compliance 
-  * with the License. You may obtain a copy of the License at 
-  * 
-  * http://www.apache.org/licenses/LICENSE-2.0 
-  * 
-  * Unless required by applicable law or agreed to in writing, 
-  * software distributed under the License is distributed on an 
-  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
-  * KIND, either express or implied. See the License for the 
-  * specific language governing permissions and limitations 
-  * under the License. 
-  */
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
 package org.apache.cxf.dosgi.topologymanager.importer;
 
 import java.util.Collection;
@@ -38,12 +38,10 @@ import org.slf4j.LoggerFactory;
  */
 public class ListenerHookImpl implements ListenerHook {
     private static final Logger LOG = LoggerFactory.getLogger(ListenerHookImpl.class);
-    private BundleContext bctx;
-    private ServiceInterestListener serviceInterestListener;
 
-    private final static String CLASS_NAME_EXPRESSION = ".*\\(" + Constants.OBJECTCLASS
+    private static final String CLASS_NAME_EXPRESSION = ".*\\(" + Constants.OBJECTCLASS
                                                         + "=([a-zA-Z_0-9.]+)\\).*";
-    private final static Pattern CLASS_NAME_PATTERN = Pattern.compile(CLASS_NAME_EXPRESSION);
+    private static final Pattern CLASS_NAME_PATTERN = Pattern.compile(CLASS_NAME_EXPRESSION);
 
     // From the old impl.
     private static final Set<String> SYSTEM_PACKAGES;
@@ -58,6 +56,9 @@ public class ListenerHookImpl implements
         SYSTEM_PACKAGES.add("java.net.ContentHandler");
     }
 
+    private BundleContext bctx;
+    private ServiceInterestListener serviceInterestListener;
+
     public ListenerHookImpl(BundleContext bc, ServiceInterestListener serviceInterestListener) {
         bctx = bc;
         this.serviceInterestListener = serviceInterestListener;
@@ -139,7 +140,7 @@ public class ListenerHookImpl implements
     static String getUUID(BundleContext bctx) {
         synchronized ("org.osgi.framework.uuid") {
             String uuid = bctx.getProperty("org.osgi.framework.uuid");
-            if(uuid==null){
+            if (uuid == null) {
                 uuid = UUID.randomUUID().toString();
                 System.setProperty("org.osgi.framework.uuid", uuid);
             }

Modified: cxf/dosgi/trunk/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/importer/RefManager.java
URL: http://svn.apache.org/viewvc/cxf/dosgi/trunk/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/importer/RefManager.java?rev=1420344&r1=1420343&r2=1420344&view=diff
==============================================================================
--- cxf/dosgi/trunk/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/importer/RefManager.java (original)
+++ cxf/dosgi/trunk/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/importer/RefManager.java Tue Dec 11 19:26:52 2012
@@ -1,21 +1,21 @@
-/** 
-  * Licensed to the Apache Software Foundation (ASF) under one 
-  * or more contributor license agreements. See the NOTICE file 
-  * distributed with this work for additional information 
-  * regarding copyright ownership. The ASF licenses this file 
-  * to you under the Apache License, Version 2.0 (the 
-  * "License"); you may not use this file except in compliance 
-  * with the License. You may obtain a copy of the License at 
-  * 
-  * http://www.apache.org/licenses/LICENSE-2.0 
-  * 
-  * Unless required by applicable law or agreed to in writing, 
-  * software distributed under the License is distributed on an 
-  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
-  * KIND, either express or implied. See the License for the 
-  * specific language governing permissions and limitations 
-  * under the License. 
-  */
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
 package org.apache.cxf.dosgi.topologymanager.importer;
 
 import java.util.HashMap;

Modified: cxf/dosgi/trunk/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/importer/ServiceInterestListener.java
URL: http://svn.apache.org/viewvc/cxf/dosgi/trunk/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/importer/ServiceInterestListener.java?rev=1420344&r1=1420343&r2=1420344&view=diff
==============================================================================
--- cxf/dosgi/trunk/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/importer/ServiceInterestListener.java (original)
+++ cxf/dosgi/trunk/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/importer/ServiceInterestListener.java Tue Dec 11 19:26:52 2012
@@ -1,27 +1,27 @@
-/** 
-  * Licensed to the Apache Software Foundation (ASF) under one 
-  * or more contributor license agreements. See the NOTICE file 
-  * distributed with this work for additional information 
-  * regarding copyright ownership. The ASF licenses this file 
-  * to you under the Apache License, Version 2.0 (the 
-  * "License"); you may not use this file except in compliance 
-  * with the License. You may obtain a copy of the License at 
-  * 
-  * http://www.apache.org/licenses/LICENSE-2.0 
-  * 
-  * Unless required by applicable law or agreed to in writing, 
-  * software distributed under the License is distributed on an 
-  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
-  * KIND, either express or implied. See the License for the 
-  * specific language governing permissions and limitations 
-  * under the License. 
-  */
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
 package org.apache.cxf.dosgi.topologymanager.importer;
 
 public interface ServiceInterestListener {
 
-    public abstract void addServiceInterest(String filter);
+    void addServiceInterest(String filter);
 
-    public abstract void removeServiceInterest(String filter);
+    void removeServiceInterest(String filter);
 
 }
\ No newline at end of file

Modified: cxf/dosgi/trunk/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/importer/TopologyManagerImport.java
URL: http://svn.apache.org/viewvc/cxf/dosgi/trunk/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/importer/TopologyManagerImport.java?rev=1420344&r1=1420343&r2=1420344&view=diff
==============================================================================
--- cxf/dosgi/trunk/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/importer/TopologyManagerImport.java (original)
+++ cxf/dosgi/trunk/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/importer/TopologyManagerImport.java Tue Dec 11 19:26:52 2012
@@ -1,20 +1,20 @@
-/** 
- * Licensed to the Apache Software Foundation (ASF) under one 
- * or more contributor license agreements. See the NOTICE file 
- * distributed with this work for additional information 
- * regarding copyright ownership. The ASF licenses this file 
- * to you under the Apache License, Version 2.0 (the 
- * "License"); you may not use this file except in compliance 
- * with the License. You may obtain a copy of the License at 
- * 
- * http://www.apache.org/licenses/LICENSE-2.0 
- * 
- * Unless required by applicable law or agreed to in writing, 
- * software distributed under the License is distributed on an 
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
- * KIND, either express or implied. See the License for the 
- * specific language governing permissions and limitations 
- * under the License. 
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package org.apache.cxf.dosgi.topologymanager.importer;
 
@@ -52,7 +52,7 @@ import org.slf4j.LoggerFactory;
  */
 public class TopologyManagerImport implements EndpointListener, RemoteServiceAdminListener, ServiceInterestListener {
 
-    private final static Logger LOG = LoggerFactory.getLogger(TopologyManagerImport.class);
+    private static final Logger LOG = LoggerFactory.getLogger(TopologyManagerImport.class);
     private ExecutorService execService;
 
     private final EndpointListenerManager endpointListenerManager;
@@ -79,12 +79,14 @@ public class TopologyManagerImport imple
     /**
      * List of Endpoints by matched filter that were reported by the EndpointListener and can be imported
      */
-    private final Map<String /* filter */, List<EndpointDescription>> importPossibilities = new HashMap<String, List<EndpointDescription>>();
+    private final Map<String /* filter */, List<EndpointDescription>> importPossibilities 
+        = new HashMap<String, List<EndpointDescription>>();
     
     /**
      * List of already imported Endpoints by their matched filter
      */
-    private final Map<String /* filter */, List<ImportRegistration>> importedServices = new HashMap<String, List<ImportRegistration>>();
+    private final Map<String /* filter */, List<ImportRegistration>> importedServices 
+        = new HashMap<String, List<ImportRegistration>>();
 
     public TopologyManagerImport(BundleContext bc, RemoteServiceAdminTracker rsaTracker) {
         bctx = bc;
@@ -140,7 +142,7 @@ public class TopologyManagerImport imple
     }
 
     public void endpointAdded(EndpointDescription epd, String filter) {
-        if (filter==null) {
+        if (filter == null) {
             LOG.error("Endpoint is not handled because no matching filter was provided!");
             return;
         }

Modified: cxf/dosgi/trunk/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/rsatracker/RemoteServiceAdminLifeCycleListener.java
URL: http://svn.apache.org/viewvc/cxf/dosgi/trunk/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/rsatracker/RemoteServiceAdminLifeCycleListener.java?rev=1420344&r1=1420343&r2=1420344&view=diff
==============================================================================
--- cxf/dosgi/trunk/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/rsatracker/RemoteServiceAdminLifeCycleListener.java (original)
+++ cxf/dosgi/trunk/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/rsatracker/RemoteServiceAdminLifeCycleListener.java Tue Dec 11 19:26:52 2012
@@ -1,21 +1,21 @@
-/** 
-  * Licensed to the Apache Software Foundation (ASF) under one 
-  * or more contributor license agreements. See the NOTICE file 
-  * distributed with this work for additional information 
-  * regarding copyright ownership. The ASF licenses this file 
-  * to you under the Apache License, Version 2.0 (the 
-  * "License"); you may not use this file except in compliance 
-  * with the License. You may obtain a copy of the License at 
-  * 
-  * http://www.apache.org/licenses/LICENSE-2.0 
-  * 
-  * Unless required by applicable law or agreed to in writing, 
-  * software distributed under the License is distributed on an 
-  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
-  * KIND, either express or implied. See the License for the 
-  * specific language governing permissions and limitations 
-  * under the License. 
-  */
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
 package org.apache.cxf.dosgi.topologymanager.rsatracker;
 
 import org.osgi.service.remoteserviceadmin.RemoteServiceAdmin;

Modified: cxf/dosgi/trunk/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/rsatracker/RemoteServiceAdminTracker.java
URL: http://svn.apache.org/viewvc/cxf/dosgi/trunk/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/rsatracker/RemoteServiceAdminTracker.java?rev=1420344&r1=1420343&r2=1420344&view=diff
==============================================================================
--- cxf/dosgi/trunk/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/rsatracker/RemoteServiceAdminTracker.java (original)
+++ cxf/dosgi/trunk/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/rsatracker/RemoteServiceAdminTracker.java Tue Dec 11 19:26:52 2012
@@ -1,20 +1,20 @@
-/** 
- * Licensed to the Apache Software Foundation (ASF) under one 
- * or more contributor license agreements. See the NOTICE file 
- * distributed with this work for additional information 
- * regarding copyright ownership. The ASF licenses this file 
- * to you under the Apache License, Version 2.0 (the 
- * "License"); you may not use this file except in compliance 
- * with the License. You may obtain a copy of the License at 
- * 
- * http://www.apache.org/licenses/LICENSE-2.0 
- * 
- * Unless required by applicable law or agreed to in writing, 
- * software distributed under the License is distributed on an 
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
- * KIND, either express or implied. See the License for the 
- * specific language governing permissions and limitations 
- * under the License. 
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package org.apache.cxf.dosgi.topologymanager.rsatracker;
 
@@ -59,7 +59,7 @@ public class RemoteServiceAdminTracker e
     }
 
     public List<RemoteServiceAdmin> getList() {
-        ArrayList<RemoteServiceAdmin> list = new ArrayList<RemoteServiceAdmin>();
+        List<RemoteServiceAdmin> list = new ArrayList<RemoteServiceAdmin>();
         ServiceReference[] refs = getServiceReferences();
         if (refs != null) {
             for (ServiceReference ref : refs) {

Modified: cxf/dosgi/trunk/dsw/cxf-topology-manager/src/test/java/org/apache/cxf/dosgi/topologymanager/ExportServiceTest.java
URL: http://svn.apache.org/viewvc/cxf/dosgi/trunk/dsw/cxf-topology-manager/src/test/java/org/apache/cxf/dosgi/topologymanager/ExportServiceTest.java?rev=1420344&r1=1420343&r2=1420344&view=diff
==============================================================================
--- cxf/dosgi/trunk/dsw/cxf-topology-manager/src/test/java/org/apache/cxf/dosgi/topologymanager/ExportServiceTest.java (original)
+++ cxf/dosgi/trunk/dsw/cxf-topology-manager/src/test/java/org/apache/cxf/dosgi/topologymanager/ExportServiceTest.java Tue Dec 11 19:26:52 2012
@@ -1,21 +1,21 @@
-/** 
-  * Licensed to the Apache Software Foundation (ASF) under one 
-  * or more contributor license agreements. See the NOTICE file 
-  * distributed with this work for additional information 
-  * regarding copyright ownership. The ASF licenses this file 
-  * to you under the Apache License, Version 2.0 (the 
-  * "License"); you may not use this file except in compliance 
-  * with the License. You may obtain a copy of the License at 
-  * 
-  * http://www.apache.org/licenses/LICENSE-2.0 
-  * 
-  * Unless required by applicable law or agreed to in writing, 
-  * software distributed under the License is distributed on an 
-  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
-  * KIND, either express or implied. See the License for the 
-  * specific language governing permissions and limitations 
-  * under the License. 
-  */
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
 package org.apache.cxf.dosgi.topologymanager;
 
 import java.util.ArrayList;
@@ -26,8 +26,9 @@ import java.util.concurrent.Semaphore;
 import java.util.concurrent.TimeUnit;
 
 import org.easymock.IAnswer;
-import org.easymock.classextension.IMocksControl;
 import org.easymock.classextension.EasyMock;
+import org.easymock.classextension.IMocksControl;
+import org.junit.Test;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.FrameworkUtil;
@@ -41,7 +42,6 @@ import org.osgi.service.remoteserviceadm
 import org.osgi.service.remoteserviceadmin.RemoteConstants;
 import org.osgi.service.remoteserviceadmin.RemoteServiceAdmin;
 
-import org.junit.Test;
 
 public class ExportServiceTest {
 
@@ -83,25 +83,24 @@ public class ExportServiceTest {
         
         
         EndpointDescription endpoint = c.createMock(EndpointDescription.class);
-        {
-            Map props = new HashMap();
-            String[] objs = new String[1];
-            objs[0] = "abc";
-            props.put("objectClass", objs);
-            EasyMock.expect(endpoint.getProperties()).andReturn(props).anyTimes();
-        }
+
+        Map<String, Object> props = new HashMap<String, Object>();
+        String[] objs = new String[1];
+        objs[0] = "abc";
+        props.put("objectClass", objs);
+        EasyMock.expect(endpoint.getProperties()).andReturn(props).anyTimes();
 
         ExportRegistration exportRegistration = c.createMock(ExportRegistration.class);
         ExportReference exportReference = c.createMock(ExportReference.class);
 
         EasyMock.expect(exportRegistration.getExportReference()).andReturn(exportReference).anyTimes();
         EasyMock.expect(exportReference.getExportedEndpoint()).andReturn(endpoint).anyTimes();
-        {
-            List ret = new ArrayList();
-            ret.add(exportRegistration);
-            EasyMock.expect(rsa.exportService(EasyMock.same(sref), (Map)EasyMock.anyObject())).andReturn(ret)
-                .once();
-        }
+
+        List<ExportRegistration> ret = new ArrayList<ExportRegistration>();
+        ret.add(exportRegistration);
+        EasyMock.expect(rsa.exportService(EasyMock.same(sref),
+                                          (Map<String, Object>)EasyMock.anyObject())).andReturn(ret)
+            .once();
 
         epl.endpointAdded((EndpointDescription)EasyMock.anyObject(), (String)EasyMock.anyObject());
         EasyMock.expectLastCall().andAnswer(new IAnswer<Object>() {
@@ -114,67 +113,63 @@ public class ExportServiceTest {
             
         }).once();
 
-        {/* BCTX */
-
-            bctx.addServiceListener((ServiceListener)EasyMock.anyObject(), (String)EasyMock.anyObject());
-            EasyMock.expectLastCall().andAnswer(new IAnswer<Object>() {
-
-                public Object answer() throws Throwable {
-                    System.out.println("->   addServiceListener: "
-                                       + EasyMock.getCurrentArguments()[1]);
-                    ServiceListener sl = (ServiceListener)EasyMock.getCurrentArguments()[0];
-
-                    if ("(objectClass=org.osgi.service.remoteserviceadmin.RemoteServiceAdmin)"
-                        .equals(EasyMock.getCurrentArguments()[1])) {
-                        ServiceEvent se = new ServiceEvent(ServiceEvent.REGISTERED, rsaSref);
-                        sl.serviceChanged(se);
-                    } else if ("(objectClass=org.osgi.service.remoteserviceadmin.EndpointListener)"
-                        .equals(EasyMock.getCurrentArguments()[1])) {
-                        ServiceEvent se = new ServiceEvent(ServiceEvent.REGISTERED, eplSref);
-                        sl.serviceChanged(se);
-                    }
+        //BCTX
+        bctx.addServiceListener((ServiceListener)EasyMock.anyObject(), (String)EasyMock.anyObject());
+        EasyMock.expectLastCall().andAnswer(new IAnswer<Object>() {
 
-                    return null;
+            public Object answer() throws Throwable {
+                System.out.println("->   addServiceListener: "
+                                   + EasyMock.getCurrentArguments()[1]);
+                ServiceListener sl = (ServiceListener)EasyMock.getCurrentArguments()[0];
+
+                if ("(objectClass=org.osgi.service.remoteserviceadmin.RemoteServiceAdmin)"
+                    .equals(EasyMock.getCurrentArguments()[1])) {
+                    ServiceEvent se = new ServiceEvent(ServiceEvent.REGISTERED, rsaSref);
+                    sl.serviceChanged(se);
+                } else if ("(objectClass=org.osgi.service.remoteserviceadmin.EndpointListener)"
+                    .equals(EasyMock.getCurrentArguments()[1])) {
+                    ServiceEvent se = new ServiceEvent(ServiceEvent.REGISTERED, eplSref);
+                    sl.serviceChanged(se);
                 }
-            }).anyTimes();
-
-            bctx.addServiceListener((ServiceListener)EasyMock.anyObject());
-            EasyMock.expectLastCall().andAnswer(new IAnswer<Object>() {
 
-                public Object answer() throws Throwable {
-                    System.out.println("->   addServiceListener ");
+                return null;
+            }
+        }).anyTimes();
 
-                    ServiceListener sl = (ServiceListener)EasyMock.getCurrentArguments()[0];
+        bctx.addServiceListener((ServiceListener)EasyMock.anyObject());
+        EasyMock.expectLastCall().andAnswer(new IAnswer<Object>() {
 
-                    ServiceEvent se = new ServiceEvent(ServiceEvent.REGISTERED, sref);
-                    sl.serviceChanged(se);
-                    se = new ServiceEvent(ServiceEvent.REGISTERED, eplSref);
-                    sl.serviceChanged(se);
-                    se = new ServiceEvent(ServiceEvent.REGISTERED, rsaSref);
-                    sl.serviceChanged(se);
+            public Object answer() throws Throwable {
+                System.out.println("->   addServiceListener ");
 
-                    return null;
-                }
-            }).anyTimes();
+                ServiceListener sl = (ServiceListener)EasyMock.getCurrentArguments()[0];
 
-            EasyMock.expect(bctx.getService(EasyMock.same(rsaSref))).andReturn(rsa).anyTimes();
-            EasyMock.expect(bctx.getService(EasyMock.same(eplSref))).andReturn(epl).atLeastOnce();
+                ServiceEvent se = new ServiceEvent(ServiceEvent.REGISTERED, sref);
+                sl.serviceChanged(se);
+                se = new ServiceEvent(ServiceEvent.REGISTERED, eplSref);
+                sl.serviceChanged(se);
+                se = new ServiceEvent(ServiceEvent.REGISTERED, rsaSref);
+                sl.serviceChanged(se);
 
-            {
-                ServiceReference[] refs = new ServiceReference[1];
-                refs[0] = eplSref;
-                EasyMock
-                    .expect(
-                            bctx.getServiceReferences(EasyMock.same(EndpointListener.class.getName()),
-                                                      EasyMock
-                                                          .same("("
-                                                                + EndpointListener.ENDPOINT_LISTENER_SCOPE
-                                                                + "=*)"))).andReturn(refs).anyTimes();
+                return null;
             }
-            
-            EasyMock.expect(bctx.createFilter(EasyMock.same(scope))).andReturn(FrameworkUtil.createFilter(scope)).anyTimes();
+        }).anyTimes();
+
+        EasyMock.expect(bctx.getService(EasyMock.same(rsaSref))).andReturn(rsa).anyTimes();
+        EasyMock.expect(bctx.getService(EasyMock.same(eplSref))).andReturn(epl).atLeastOnce();
 
-        }
+        ServiceReference[] refs = new ServiceReference[1];
+        refs[0] = eplSref;
+        EasyMock
+            .expect(
+                    bctx.getServiceReferences(EasyMock.same(EndpointListener.class.getName()),
+                                              EasyMock
+                                                  .same("("
+                                                        + EndpointListener.ENDPOINT_LISTENER_SCOPE
+                                                        + "=*)"))).andReturn(refs).anyTimes();
+        
+        EasyMock.expect(bctx.createFilter(EasyMock.same(scope)))
+            .andReturn(FrameworkUtil.createFilter(scope)).anyTimes();
 
         
         c.replay();

Modified: cxf/dosgi/trunk/dsw/cxf-topology-manager/src/test/java/org/apache/cxf/dosgi/topologymanager/exporter/EndpointListenerNotifierTest.java
URL: http://svn.apache.org/viewvc/cxf/dosgi/trunk/dsw/cxf-topology-manager/src/test/java/org/apache/cxf/dosgi/topologymanager/exporter/EndpointListenerNotifierTest.java?rev=1420344&r1=1420343&r2=1420344&view=diff
==============================================================================
--- cxf/dosgi/trunk/dsw/cxf-topology-manager/src/test/java/org/apache/cxf/dosgi/topologymanager/exporter/EndpointListenerNotifierTest.java (original)
+++ cxf/dosgi/trunk/dsw/cxf-topology-manager/src/test/java/org/apache/cxf/dosgi/topologymanager/exporter/EndpointListenerNotifierTest.java Tue Dec 11 19:26:52 2012
@@ -1,24 +1,23 @@
-/** 
-  * Licensed to the Apache Software Foundation (ASF) under one 
-  * or more contributor license agreements. See the NOTICE file 
-  * distributed with this work for additional information 
-  * regarding copyright ownership. The ASF licenses this file 
-  * to you under the Apache License, Version 2.0 (the 
-  * "License"); you may not use this file except in compliance 
-  * with the License. You may obtain a copy of the License at 
-  * 
-  * http://www.apache.org/licenses/LICENSE-2.0 
-  * 
-  * Unless required by applicable law or agreed to in writing, 
-  * software distributed under the License is distributed on an 
-  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
-  * KIND, either express or implied. See the License for the 
-  * specific language governing permissions and limitations 
-  * under the License. 
-  */
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
 package org.apache.cxf.dosgi.topologymanager.exporter;
 
-import static org.junit.Assert.assertEquals;
 
 import java.util.ArrayList;
 import java.util.Collection;
@@ -26,11 +25,10 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
-import org.apache.cxf.dosgi.topologymanager.exporter.EndpointListenerNotifier;
-import org.apache.cxf.dosgi.topologymanager.exporter.ExportRepository;
 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;
 import org.osgi.framework.FrameworkUtil;
@@ -41,7 +39,7 @@ import org.osgi.service.remoteserviceadm
 import org.osgi.service.remoteserviceadmin.ExportReference;
 import org.osgi.service.remoteserviceadmin.ExportRegistration;
 
-import org.junit.Test;
+import static org.junit.Assert.assertEquals;
 
 public class EndpointListenerNotifierTest {
 
@@ -148,7 +146,7 @@ public class EndpointListenerNotifierTes
 
         try {
             
-            String[] filterStrings = {"f1","f2","f3"};
+            String[] filterStrings = {"f1", "f2", "f3"};
             
             ServiceReference sr = EasyMock.createMock(ServiceReference.class);
             EasyMock.expect(sr.getProperty(EndpointListener.ENDPOINT_LISTENER_SCOPE))

Modified: cxf/dosgi/trunk/dsw/cxf-topology-manager/src/test/java/org/apache/cxf/dosgi/topologymanager/importer/EndpointListenerImplTest.java
URL: http://svn.apache.org/viewvc/cxf/dosgi/trunk/dsw/cxf-topology-manager/src/test/java/org/apache/cxf/dosgi/topologymanager/importer/EndpointListenerImplTest.java?rev=1420344&r1=1420343&r2=1420344&view=diff
==============================================================================
--- cxf/dosgi/trunk/dsw/cxf-topology-manager/src/test/java/org/apache/cxf/dosgi/topologymanager/importer/EndpointListenerImplTest.java (original)
+++ cxf/dosgi/trunk/dsw/cxf-topology-manager/src/test/java/org/apache/cxf/dosgi/topologymanager/importer/EndpointListenerImplTest.java Tue Dec 11 19:26:52 2012
@@ -1,44 +1,43 @@
-/** 
-  * Licensed to the Apache Software Foundation (ASF) under one 
-  * or more contributor license agreements. See the NOTICE file 
-  * distributed with this work for additional information 
-  * regarding copyright ownership. The ASF licenses this file 
-  * to you under the Apache License, Version 2.0 (the 
-  * "License"); you may not use this file except in compliance 
-  * with the License. You may obtain a copy of the License at 
-  * 
-  * http://www.apache.org/licenses/LICENSE-2.0 
-  * 
-  * Unless required by applicable law or agreed to in writing, 
-  * software distributed under the License is distributed on an 
-  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
-  * KIND, either express or implied. See the License for the 
-  * specific language governing permissions and limitations 
-  * under the License. 
-  */
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
 package org.apache.cxf.dosgi.topologymanager.importer;
 
 import java.util.Dictionary;
 import java.util.List;
 
-import org.apache.cxf.dosgi.topologymanager.importer.EndpointListenerManager;
-import org.apache.cxf.dosgi.topologymanager.importer.TopologyManagerImport;
 import org.easymock.IAnswer;
 import org.easymock.classextension.EasyMock;
+import org.junit.Assert;
+import org.junit.Test;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.ServiceRegistration;
 import org.osgi.service.remoteserviceadmin.EndpointListener;
 
-import org.junit.Test;
 
-import static org.junit.Assert.*;
 
-public class EndpointListenerImplTest {
+public class EndpointListenerImplTest extends Assert {
    
-    int testCase = 0;
+    int testCase;
 
+    @SuppressWarnings("rawtypes")
     @Test
-    public void testScopeChange(){
+    public void testScopeChange() {
         
         
         BundleContext bc = EasyMock.createNiceMock(BundleContext.class);
@@ -46,7 +45,9 @@ public class EndpointListenerImplTest {
         ServiceRegistration sr = EasyMock.createNiceMock(ServiceRegistration.class);
         
         // expect Listener registration
-        EasyMock.expect(bc.registerService((String)EasyMock.anyObject(),EasyMock.anyObject() , (Dictionary)EasyMock.anyObject())).andReturn(sr).atLeastOnce();
+        EasyMock.expect(bc.registerService((String)EasyMock.anyObject(),
+                                           EasyMock.anyObject(), 
+                                           (Dictionary)EasyMock.anyObject())).andReturn(sr).atLeastOnce();
         
         
         sr.setProperties((Dictionary)EasyMock.anyObject());
@@ -58,45 +59,32 @@ public class EndpointListenerImplTest {
             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);
-                
-                //System.out.println("Test: change scope -> case: "+testCase);
-                //System.out.println(scope);
-                
                 switch (testCase) {
                 case 1:
-                    assertEquals(1,scope.size());
-                    assertEquals("(a=b)",scope.get(0));
+                    assertEquals(1, scope.size());
+                    assertEquals("(a=b)", scope.get(0));
                     break;
-                    
                 case 2:
-                    assertEquals(0,scope.size());
+                    assertEquals(0, scope.size());
                     break;
-                    
-                    
                 case 3:
-                    assertEquals("adding entry to empty list failed",1,scope.size());
-                    assertEquals("(a=b)",scope.get(0));
+                    assertEquals("adding entry to empty list failed", 1, scope.size());
+                    assertEquals("(a=b)", scope.get(0));
                     break;
-                    
                 case 4:
-                    assertEquals("adding second entry failed",2,scope.size());
+                    assertEquals("adding second entry failed", 2, scope.size());
                     assertNotNull(scope.contains("(a=b)"));
                     assertNotNull(scope.contains("(c=d)"));
                     break;
-                    
                 case 5:
-                    assertEquals("remove failed",1,scope.size());
-                    assertEquals("(c=d)",scope.get(0));
+                    assertEquals("remove failed", 1, scope.size());
+                    assertEquals("(c=d)", scope.get(0));
                     break;
-                    
                 default:
                     assertTrue("This should not happen !", false);
                 }
-                
-                
-                
-                
                 return null;
             }
         }).atLeastOnce();

Modified: cxf/dosgi/trunk/dsw/cxf-topology-manager/src/test/java/org/apache/cxf/dosgi/topologymanager/importer/ListenerHookImplTest.java
URL: http://svn.apache.org/viewvc/cxf/dosgi/trunk/dsw/cxf-topology-manager/src/test/java/org/apache/cxf/dosgi/topologymanager/importer/ListenerHookImplTest.java?rev=1420344&r1=1420343&r2=1420344&view=diff
==============================================================================
--- cxf/dosgi/trunk/dsw/cxf-topology-manager/src/test/java/org/apache/cxf/dosgi/topologymanager/importer/ListenerHookImplTest.java (original)
+++ cxf/dosgi/trunk/dsw/cxf-topology-manager/src/test/java/org/apache/cxf/dosgi/topologymanager/importer/ListenerHookImplTest.java Tue Dec 11 19:26:52 2012
@@ -1,32 +1,26 @@
-/** 
-  * Licensed to the Apache Software Foundation (ASF) under one 
-  * or more contributor license agreements. See the NOTICE file 
-  * distributed with this work for additional information 
-  * regarding copyright ownership. The ASF licenses this file 
-  * to you under the Apache License, Version 2.0 (the 
-  * "License"); you may not use this file except in compliance 
-  * with the License. You may obtain a copy of the License at 
-  * 
-  * http://www.apache.org/licenses/LICENSE-2.0 
-  * 
-  * Unless required by applicable law or agreed to in writing, 
-  * software distributed under the License is distributed on an 
-  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
-  * KIND, either express or implied. See the License for the 
-  * specific language governing permissions and limitations 
-  * under the License. 
-  */
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
 package org.apache.cxf.dosgi.topologymanager.importer;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
 import java.util.Dictionary;
 import java.util.Hashtable;
 
-import org.apache.cxf.dosgi.topologymanager.importer.ListenerHookImpl;
 import org.easymock.classextension.EasyMock;
 import org.junit.Test;
 import org.osgi.framework.BundleContext;
@@ -35,35 +29,41 @@ import org.osgi.framework.FrameworkUtil;
 import org.osgi.framework.InvalidSyntaxException;
 import org.osgi.service.remoteserviceadmin.RemoteConstants;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+
 public class ListenerHookImplTest {
     
     @Test
-    public void testGetNewUUID(){
+    public void testGetNewUUID() {
         BundleContext bc = EasyMock.createNiceMock(BundleContext.class);
         EasyMock.expect(bc.getProperty(EasyMock.eq("org.osgi.framework.uuid"))).andReturn(null).atLeastOnce();
         EasyMock.replay(bc);
         String uuid = ListenerHookImpl.getUUID(bc);
         assertNotNull(uuid);
         
-        assertEquals(System.getProperty("org.osgi.framework.uuid"),uuid );
+        assertEquals(System.getProperty("org.osgi.framework.uuid"), uuid);
         
         EasyMock.verify(bc);
     }
 
     @Test
-    public void testGetExistingUUID(){
+    public void testGetExistingUUID() {
         BundleContext bc = EasyMock.createNiceMock(BundleContext.class);
         EasyMock.expect(bc.getProperty(EasyMock.eq("org.osgi.framework.uuid"))).andReturn("MyUUID").atLeastOnce();
         EasyMock.replay(bc);
         String uuid = ListenerHookImpl.getUUID(bc);
         
-        assertEquals("MyUUID",uuid );
+        assertEquals("MyUUID", uuid);
         
         EasyMock.verify(bc);
     }
 
     @Test
-    public void testUUIDFilterExtension() throws InvalidSyntaxException{
+    public void testUUIDFilterExtension() throws InvalidSyntaxException {
         String filter = "(a=b)";
         
         
@@ -78,8 +78,8 @@ public class ListenerHookImplTest {
         Dictionary<String, String> m = new Hashtable<String, String>();
         m.put("a", "b");
         
-        assertTrue(filter+" filter must match as uuid is missing",f.match(m));      
+        assertTrue(filter + " filter must match as uuid is missing", f.match(m));      
         m.put(RemoteConstants.ENDPOINT_FRAMEWORK_UUID , "MyUUID");
-        assertFalse(filter+" filter must NOT match as uuid is the local one",f.match(m));
+        assertFalse(filter + " filter must NOT match as uuid is the local one", f.match(m));
     }
 }

Modified: cxf/dosgi/trunk/dsw/cxf-topology-manager/src/test/java/org/apache/cxf/dosgi/topologymanager/importer/TopologyManagerImportTest.java
URL: http://svn.apache.org/viewvc/cxf/dosgi/trunk/dsw/cxf-topology-manager/src/test/java/org/apache/cxf/dosgi/topologymanager/importer/TopologyManagerImportTest.java?rev=1420344&r1=1420343&r2=1420344&view=diff
==============================================================================
--- cxf/dosgi/trunk/dsw/cxf-topology-manager/src/test/java/org/apache/cxf/dosgi/topologymanager/importer/TopologyManagerImportTest.java (original)
+++ cxf/dosgi/trunk/dsw/cxf-topology-manager/src/test/java/org/apache/cxf/dosgi/topologymanager/importer/TopologyManagerImportTest.java Tue Dec 11 19:26:52 2012
@@ -1,13 +1,29 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
 package org.apache.cxf.dosgi.topologymanager.importer;
 
-import static org.junit.Assert.assertTrue;
 
 import java.util.Arrays;
 import java.util.Dictionary;
 import java.util.concurrent.Semaphore;
 import java.util.concurrent.TimeUnit;
 
-import org.apache.cxf.dosgi.topologymanager.importer.TopologyManagerImport;
 import org.apache.cxf.dosgi.topologymanager.rsatracker.RemoteServiceAdminLifeCycleListener;
 import org.apache.cxf.dosgi.topologymanager.rsatracker.RemoteServiceAdminTracker;
 import org.easymock.IAnswer;
@@ -21,12 +37,14 @@ import org.osgi.service.remoteserviceadm
 import org.osgi.service.remoteserviceadmin.ImportRegistration;
 import org.osgi.service.remoteserviceadmin.RemoteServiceAdmin;
 
+import static org.junit.Assert.assertTrue;
+
 public class TopologyManagerImportTest {
 
     
     @SuppressWarnings("rawtypes")
     @Test
-    public void testImportForNewlyAddedRSA() throws InterruptedException{
+    public void testImportForNewlyAddedRSA() throws InterruptedException {
         
         IMocksControl c = EasyMock.createControl();
 
@@ -37,7 +55,9 @@ public class TopologyManagerImportTest {
         BundleContext bc = c.createMock(BundleContext.class);
         RemoteServiceAdminTracker rsaTracker = c.createMock(RemoteServiceAdminTracker.class);
         ServiceRegistration sreg = c.createMock(ServiceRegistration.class);
-        EasyMock.expect(bc.registerService((String)EasyMock.anyObject(), EasyMock.anyObject(), (Dictionary)EasyMock.anyObject())).andReturn(sreg).anyTimes();
+        EasyMock.expect(bc.registerService((String)EasyMock.anyObject(), 
+                                           EasyMock.anyObject(), 
+                                           (Dictionary)EasyMock.anyObject())).andReturn(sreg).anyTimes();
         
         EndpointDescription epd = c.createMock(EndpointDescription.class);
         RemoteServiceAdmin rsa  = c.createMock(RemoteServiceAdmin.class);
@@ -48,8 +68,7 @@ public class TopologyManagerImportTest {
         rsaTracker.addListener(EasyMock.<RemoteServiceAdminLifeCycleListener>anyObject());
         EasyMock.expect(rsaTracker.getList()).andReturn(Arrays.asList(rsa)).anyTimes();
         
-        EasyMock.expect(rsa.importService(EasyMock.eq(epd))).andAnswer(new IAnswer<ImportRegistration>( ) {
-
+        EasyMock.expect(rsa.importService(EasyMock.eq(epd))).andAnswer(new IAnswer<ImportRegistration>() {
             public ImportRegistration answer() throws Throwable {
                 sema.release();
                 return ireg;
@@ -65,7 +84,8 @@ public class TopologyManagerImportTest {
         // no RSa available yet so no import ...  
         tm.endpointAdded(epd, "myFilter");
         tm.triggerImportsForRemoteServiceAdmin(rsa);
-        assertTrue("importService should have been called on RemoteServiceAdmin", sema.tryAcquire(100, TimeUnit.SECONDS));
+        assertTrue("importService should have been called on RemoteServiceAdmin",
+                   sema.tryAcquire(100, TimeUnit.SECONDS));
         tm.stop();
         c.verify();
         



Mime
View raw message