cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r693863 - in /cxf/sandbox/dosgi: dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/OsgiUtils.java dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/OsgiUtilsTest.java felix/profiles/src/main/resources/dosgi_bundles.txt
Date Wed, 10 Sep 2008 14:54:29 GMT
Author: sergeyb
Date: Wed Sep 10 07:54:28 2008
New Revision: 693863

URL: http://svn.apache.org/viewvc?rev=693863&view=rev
Log:
DOSGI : Applying a patch on behalf of David Bosschaert

Added:
    cxf/sandbox/dosgi/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/OsgiUtilsTest.java
  (with props)
    cxf/sandbox/dosgi/felix/profiles/src/main/resources/dosgi_bundles.txt   (with props)
Modified:
    cxf/sandbox/dosgi/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/OsgiUtils.java

Modified: cxf/sandbox/dosgi/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/OsgiUtils.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/dosgi/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/OsgiUtils.java?rev=693863&r1=693862&r2=693863&view=diff
==============================================================================
--- cxf/sandbox/dosgi/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/OsgiUtils.java (original)
+++ cxf/sandbox/dosgi/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/OsgiUtils.java Wed
Sep 10 07:54:28 2008
@@ -72,12 +72,12 @@
         if (names == null || names.length == 0) {
             return null;
         }
+        
         Map<String, Object> userProperties = new HashMap<String, Object>();
         for (String key : sref.getPropertyKeys()) {
             // we're after remote properties only
-            Object property = sref.getProperty(key);
-            if (property.toString().startsWith(Constants.REMOTE_PROPERTY_PREFIX)) {
-                userProperties.put(key, property);
+            if (key.startsWith(Constants.REMOTE_PROPERTY_PREFIX)) {
+                userProperties.put(key, sref.getProperty(key));
             }
         }
         List<ServiceDescription> srefs = getRemoteReferences(sref.getBundle(), 

Added: cxf/sandbox/dosgi/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/OsgiUtilsTest.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/dosgi/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/OsgiUtilsTest.java?rev=693863&view=auto
==============================================================================
--- cxf/sandbox/dosgi/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/OsgiUtilsTest.java
(added)
+++ cxf/sandbox/dosgi/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/OsgiUtilsTest.java
Wed Sep 10 07:54:28 2008
@@ -0,0 +1,42 @@
+package org.apache.cxf.dosgi.dsw;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import junit.framework.TestCase;
+
+import org.easymock.EasyMock;
+import org.easymock.IAnswer;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.ServiceReference;
+import org.osgi.service.discovery.ServiceDescription;
+
+public class OsgiUtilsTest extends TestCase {
+    public void testGetRemoteReferencesFromRegistrationProperties() {
+        final Map<String, Object> props = new HashMap<String, Object>();
+        props.put(org.osgi.framework.Constants.OBJECTCLASS, new String [] {"myClass"});
+        props.put(Constants.PUBLISH_PROPERTY, "*");
+        
+        Bundle b = EasyMock.createNiceMock(Bundle.class);        
+        EasyMock.replay(b);
+        
+        ServiceReference sr = EasyMock.createMock(ServiceReference.class);
+        // set behaviour for getPropertyKeys() and getProperty() based on the map above.
+        EasyMock.expect(sr.getPropertyKeys()).
+            andReturn(props.keySet().toArray(new String [] {})).anyTimes();
+        EasyMock.expect(sr.getProperty((String) EasyMock.anyObject())).
+            andAnswer(new IAnswer<Object>() {
+                public Object answer() throws Throwable {
+                    return props.get(EasyMock.getCurrentArguments()[0]);
+                }                
+            }).anyTimes();
+        EasyMock.expect(sr.getBundle()).andReturn(b).anyTimes();
+        EasyMock.replay(sr);
+        
+        // Actual test starts here
+        ServiceDescription sd = OsgiUtils.getRemoteReference(sr, true);
+        assertEquals("*", sd.getProperties().get(Constants.PUBLISH_PROPERTY));
+        
+        EasyMock.verify(sr);
+    }
+}

Propchange: cxf/sandbox/dosgi/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/OsgiUtilsTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/sandbox/dosgi/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/OsgiUtilsTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: cxf/sandbox/dosgi/felix/profiles/src/main/resources/dosgi_bundles.txt
URL: http://svn.apache.org/viewvc/cxf/sandbox/dosgi/felix/profiles/src/main/resources/dosgi_bundles.txt?rev=693863&view=auto
==============================================================================
--- cxf/sandbox/dosgi/felix/profiles/src/main/resources/dosgi_bundles.txt (added)
+++ cxf/sandbox/dosgi/felix/profiles/src/main/resources/dosgi_bundles.txt Wed Sep 10 07:54:28
2008
@@ -0,0 +1,64 @@
+start file:${maven.repo.local}/org/apache/geronimo/specs/geronimo-annotation_1.0_spec/1.1.1/geronimo-annotation_1.0_spec-1.1.1.jar
+
+start file:${maven.repo.local}/org/apache/geronimo/specs/geronimo-activation_1.1_spec/1.0.2/geronimo-activation_1.1_spec-1.0.2.jar
+
+start file:${maven.repo.local}/org/apache/geronimo/specs/geronimo-javamail_1.4_spec/1.2/geronimo-javamail_1.4_spec-1.2.jar
+
+start file:${maven.repo.local}/org/apache/geronimo/specs/geronimo-ws-metadata_2.0_spec/1.1.2/geronimo-ws-metadata_2.0_spec-1.1.2.jar
+
+start file:${maven.repo.local}/org/apache/geronimo/specs/geronimo-servlet_2.5_spec/1.1.2/geronimo-servlet_2.5_spec-1.1.2.jar
+
+start file:${maven.repo.local}/org/apache/commons/com.springsource.org.apache.commons.logging/1.1.1/com.springsource.org.apache.commons.logging-1.1.1.jar
+
+start file:${maven.repo.local}/org/jdom/com.springsource.org.jdom/1.0.0/com.springsource.org.jdom-1.0.0.jar
+
+start file:${maven.repo.local}/org/springframework/spring-core/${spring.version}/spring-core-${spring.version}.jar
+
+start file:${maven.repo.local}/org/springframework/spring-beans/${spring.version}/spring-beans-${spring.version}.jar
+
+start file:${maven.repo.local}/org/springframework/spring-context/${spring.version}/spring-context-${spring.version}.jar
+
+start file:${maven.repo.local}/org/aopalliance/com.springsource.org.aopalliance/1.0.0/com.springsource.org.aopalliance-1.0.0.jar
+
+start file:${maven.repo.local}/org/springframework/spring-aop/${spring.version}/spring-aop-${spring.version}.jar
+
+start file:${maven.repo.local}/org/springframework/osgi/spring-osgi-io/${spring.osgi.version}/spring-osgi-io-${spring.osgi.version}.jar
+
+start file:${maven.repo.local}/org/springframework/osgi/spring-osgi-core/${spring.osgi.version}/spring-osgi-core-${spring.osgi.version}.jar
+
+start file:${maven.repo.local}/org/springframework/osgi/spring-osgi-extender/${spring.osgi.version}/spring-osgi-extender-${spring.osgi.version}.jar
+
+start file:${maven.repo.local}/org/mortbay/jetty/jetty-util/${jetty.version}/jetty-util-${jetty.version}.jar
+
+start file:${maven.repo.local}/org/mortbay/jetty/jetty/${jetty.version}/jetty-${jetty.version}.jar
+
+start file:${maven.repo.local}/org/apache/servicemix/specs/org.apache.servicemix.specs.locator/${servicemix.specs.version}/org.apache.servicemix.specs.locator-${servicemix.specs.version}.jar
+
+start file:${maven.repo.local}/org/apache/servicemix/specs/org.apache.servicemix.specs.saaj-api-1.3/${servicemix.specs.version}/org.apache.servicemix.specs.saaj-api-1.3-${servicemix.specs.version}.jar
+
+start file:${maven.repo.local}/org/apache/servicemix/specs/org.apache.servicemix.specs.stax-api-1.0/${servicemix.specs.version}/org.apache.servicemix.specs.stax-api-1.0-${servicemix.specs.version}.jar
+
+start file:${maven.repo.local}/org/apache/servicemix/specs/org.apache.servicemix.specs.jaxb-api-2.0/${servicemix.specs.version}/org.apache.servicemix.specs.jaxb-api-2.0-${servicemix.specs.version}.jar
+
+start file:${maven.repo.local}/org/apache/servicemix/specs/org.apache.servicemix.specs.jaxws-api-2.0/${servicemix.specs.version}/org.apache.servicemix.specs.jaxws-api-2.0-${servicemix.specs.version}.jar
+
+start file:${maven.repo.local}/org/apache/servicemix/bundles/org.apache.servicemix.bundles.jaxb-impl-2.0.3/${servicemix.feature.version}/org.apache.servicemix.bundles.jaxb-impl-2.0.3-${servicemix.feature.version}.jar
+
+start file:${maven.repo.local}/org/apache/servicemix/bundles/org.apache.servicemix.bundles.wsdl4j-1.6.1/${servicemix.feature.version}/org.apache.servicemix.bundles.wsdl4j-1.6.1-${servicemix.feature.version}.jar
+
+start file:${maven.repo.local}/org/apache/servicemix/bundles/org.apache.servicemix.bundles.xmlschema-1.3.2/${servicemix.feature.version}/org.apache.servicemix.bundles.xmlschema-1.3.2-${servicemix.feature.version}.jar
+
+start file:${maven.repo.local}/org/apache/servicemix/bundles/org.apache.servicemix.bundles.asm-2.2.3/${servicemix.kernel.version}/org.apache.servicemix.bundles.asm-2.2.3-${servicemix.kernel.version}.jar
+
+start file:${maven.repo.local}/org/apache/servicemix/bundles/org.apache.servicemix.bundles.xmlresolver-1.2/${servicemix.feature.version}/org.apache.servicemix.bundles.xmlresolver-1.2-${servicemix.feature.version}.jar
+
+start file:${maven.repo.local}/org/apache/servicemix/bundles/org.apache.servicemix.bundles.neethi-2.0.2/${servicemix.feature.version}/org.apache.servicemix.bundles.neethi-2.0.2-${servicemix.feature.version}.jar
+
+start file:${maven.repo.local}/org/apache/servicemix/bundles/org.apache.servicemix.bundles.woodstox/${woodstox.bundle.version}/org.apache.servicemix.bundles.woodstox-${woodstox.bundle.version}.jar
+
+start file:${maven.repo.local}/org/apache/cxf/cxf-bundle-minimal/${cxf.version}/cxf-bundle-minimal-${cxf.version}.jar
+
+start file:${maven.repo.local}/org/apache/cxf/cxf-dosgi-ri-discovery-local/${project.version}/cxf-dosgi-ri-discovery-local-${project.version}.jar
+
+start file:${maven.repo.local}/org/apache/cxf/cxf-dosgi-ri-dsw-cxf/${project.version}/cxf-dosgi-ri-dsw-cxf-${project.version}.jar
+

Propchange: cxf/sandbox/dosgi/felix/profiles/src/main/resources/dosgi_bundles.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/sandbox/dosgi/felix/profiles/src/main/resources/dosgi_bundles.txt
------------------------------------------------------------------------------
    svn:mime-type = text/plain



Mime
View raw message