cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1420347 [2/2] - in /cxf/dosgi/trunk/dsw/cxf-dsw/src: main/java/org/apache/cxf/dosgi/dsw/decorator/ main/java/org/apache/cxf/dosgi/dsw/handlers/ main/java/org/apache/cxf/dosgi/dsw/qos/ main/java/org/apache/cxf/dosgi/dsw/service/ main/java/o...
Date Tue, 11 Dec 2012 19:28:00 GMT
Modified: cxf/dosgi/trunk/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/service/UtilsTest.java
URL: http://svn.apache.org/viewvc/cxf/dosgi/trunk/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/service/UtilsTest.java?rev=1420347&r1=1420346&r2=1420347&view=diff
==============================================================================
--- cxf/dosgi/trunk/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/service/UtilsTest.java
(original)
+++ cxf/dosgi/trunk/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/service/UtilsTest.java
Tue Dec 11 19:27:53 2012
@@ -18,10 +18,6 @@
  */
 package org.apache.cxf.dosgi.dsw.service;
 
-import static org.junit.Assert.assertArrayEquals;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
@@ -32,6 +28,11 @@ import org.apache.cxf.dosgi.dsw.util.Uti
 import org.junit.Test;
 import org.osgi.framework.Constants;
 
+import static org.junit.Assert.assertArrayEquals;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+
 public class UtilsTest {
 
     @Test
@@ -81,7 +82,7 @@ public class UtilsTest {
 
         { // nothing should change here
             Properties overload = new Properties();
-            OsgiUtils.overlayProperties(copy,overload);
+            OsgiUtils.overlayProperties(copy, overload);
 
             assertEquals(original.size(), copy.size());
             for (Object key : Collections.list(original.keys())) {
@@ -96,14 +97,14 @@ public class UtilsTest {
             Properties overload = new Properties();
             overload.put("new", "prop");
             
-            OsgiUtils.overlayProperties(copy,overload);
+            OsgiUtils.overlayProperties(copy, overload);
 
-            assertEquals(original.size()+1, copy.size());
+            assertEquals(original.size() + 1, copy.size());
             for (Object key : Collections.list(original.keys())) {
                 assertEquals(original.get(key), copy.get(key));
             }
             assertNotNull(overload.get("new"));
-            assertEquals("prop",overload.get("new"));
+            assertEquals("prop", overload.get("new"));
         }
         
         copy.clear();
@@ -114,14 +115,14 @@ public class UtilsTest {
             overload.put("new", "prop");
             overload.put("NEW", "prop");
             
-            OsgiUtils.overlayProperties(copy,overload);
+            OsgiUtils.overlayProperties(copy, overload);
 
-            assertEquals(original.size()+1, copy.size());
+            assertEquals(original.size() + 1, copy.size());
             for (Object key : Collections.list(original.keys())) {
                 assertEquals(original.get(key), copy.get(key));
             }
             assertNotNull(overload.get("new"));
-            assertEquals("prop",overload.get("new"));
+            assertEquals("prop", overload.get("new"));
         }
         
         copy.clear();
@@ -131,7 +132,7 @@ public class UtilsTest {
             Properties overload = new Properties();
             overload.put(Constants.OBJECTCLASS, "assd");
             overload.put(Constants.SERVICE_ID, "asasdasd");
-            OsgiUtils.overlayProperties(copy,overload);
+            OsgiUtils.overlayProperties(copy, overload);
 
             assertEquals(original.size(), copy.size());
             for (Object key : Collections.list(original.keys())) {
@@ -145,14 +146,15 @@ public class UtilsTest {
         { // overwrite own prop
             Properties overload = new Properties();
             overload.put("MyProp", "newValue");
-            OsgiUtils.overlayProperties(copy,overload);
+            OsgiUtils.overlayProperties(copy, overload);
 
             assertEquals(original.size(), copy.size());
             for (Object key : Collections.list(original.keys())) {
-                if(!"MyProp".equals(key))
+                if (!"MyProp".equals(key)) {
                     assertEquals(original.get(key), copy.get(key));
+                }
             }
-            assertEquals("newValue",copy.get("MyProp"));
+            assertEquals("newValue", copy.get("MyProp"));
         }
         
         copy.clear();
@@ -161,14 +163,15 @@ public class UtilsTest {
         { // overwrite own prop in different case
             Properties overload = new Properties();
             overload.put("MYPROP", "newValue");
-            OsgiUtils.overlayProperties(copy,overload);
+            OsgiUtils.overlayProperties(copy, overload);
 
             assertEquals(original.size(), copy.size());
             for (Object key : Collections.list(original.keys())) {
-                if(!"MyProp".equals(key))
+                if (!"MyProp".equals(key)) {
                     assertEquals(original.get(key), copy.get(key));
+                }
             }
-            assertEquals("newValue",copy.get("MyProp"));
+            assertEquals("newValue", copy.get("MyProp"));
         }
 
     }

Modified: cxf/dosgi/trunk/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/util/OsgiUtilsTest.java
URL: http://svn.apache.org/viewvc/cxf/dosgi/trunk/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/util/OsgiUtilsTest.java?rev=1420347&r1=1420346&r2=1420347&view=diff
==============================================================================
--- cxf/dosgi/trunk/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/util/OsgiUtilsTest.java
(original)
+++ cxf/dosgi/trunk/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/util/OsgiUtilsTest.java
Tue Dec 11 19:27:53 2012
@@ -63,21 +63,21 @@ public class OsgiUtilsTest extends TestC
     }
     
     
-    public void testGetUUID(){
+    public void testGetUUID() {
         BundleContext bc = EasyMock.createNiceMock(BundleContext.class);
         EasyMock.expect(bc.getProperty(EasyMock.eq("org.osgi.framework.uuid"))).andReturn(null).atLeastOnce();
         EasyMock.replay(bc);
         String uuid = OsgiUtils.getUUID(bc);
         assertNotNull(uuid);
         
-        assertEquals(System.getProperty("org.osgi.framework.uuid"),uuid );
+        assertEquals(System.getProperty("org.osgi.framework.uuid"), uuid);
         
         EasyMock.verify(bc);
     }
     
     
     
-    public void testGetVersion(){
+    public void testGetVersion() {
         IMocksControl c = EasyMock.createNiceControl();
         BundleContext bc = c.createMock(BundleContext.class);
         ServiceReference sref = c.createMock(ServiceReference.class);
@@ -102,7 +102,8 @@ public class OsgiUtilsTest extends TestC
         EasyMock.expect(bc.getService(EasyMock.eq(sref))).andReturn(pa);
         EasyMock.expect(pa.getBundle(EasyMock.eq(iClass))).andReturn(b);
         
-        ExportedPackage[] exP = new ExportedPackage[] { new MyExportedPackage(iClass.getPackage(),"1.2.3"),
new MyExportedPackage(String.class.getPackage(),"4.5.6") }; 
+        ExportedPackage[] exP = new ExportedPackage[] {new MyExportedPackage(iClass.getPackage(),
"1.2.3"),
+                                                       new MyExportedPackage(String.class.getPackage(),
"4.5.6") }; 
         
         EasyMock.expect(pa.getExportedPackages(EasyMock.eq(b))).andReturn(exP).atLeastOnce();
         
@@ -112,7 +113,7 @@ public class OsgiUtilsTest extends TestC
     }
     
     
-    private static class MyExportedPackage implements ExportedPackage{
+    private static class MyExportedPackage implements ExportedPackage {
 
         Package package1;
         String version;
@@ -149,18 +150,18 @@ public class OsgiUtilsTest extends TestC
     }
     
     
-    public void testGetProperty(){
+    public void testGetProperty() {
         
         Map<String, Object> p = new HashMap<String, Object>();
         p.put(RemoteConstants.ENDPOINT_ID, "http://google.de");
-        p.put("notAString",new Object());
+        p.put("notAString", new Object());
         p.put(org.osgi.framework.Constants.OBJECTCLASS, new String[]{"my.class"});
         p.put(RemoteConstants.SERVICE_IMPORTED_CONFIGS, new String[]{"my.config"});
         
         EndpointDescription ep = new EndpointDescription(p);
         
         assertNull(OsgiUtils.getProperty(ep, "unkownProp"));
-        assertEquals(p.get(RemoteConstants.ENDPOINT_ID),OsgiUtils.getProperty(ep, RemoteConstants.ENDPOINT_ID));
+        assertEquals(p.get(RemoteConstants.ENDPOINT_ID), OsgiUtils.getProperty(ep, RemoteConstants.ENDPOINT_ID));
         assertEquals(null, OsgiUtils.getProperty(ep, "notAString"));
     }
 }



Mime
View raw message