incubator-aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mnutt...@apache.org
Subject svn commit: r998149 - in /incubator/aries/trunk: application/application-obr-resolver/src/main/java/org/apache/aries/application/resolver/obr/impl/ samples/blog/blog-biz/src/main/resources/OSGI-INF/blueprint/ samples/blog/blog-itests/ samples/blog/blog...
Date Fri, 17 Sep 2010 14:25:02 GMT
Author: mnuttall
Date: Fri Sep 17 14:25:01 2010
New Revision: 998149

URL: http://svn.apache.org/viewvc?rev=998149&view=rev
Log:
ARIES-411: Apache Aries blog example currently uses the no-op resolver instead of the obr
resolver to resolve the app: patch by Emily Jiang

Modified:
    incubator/aries/trunk/application/application-obr-resolver/src/main/java/org/apache/aries/application/resolver/obr/impl/ModelledBundleResource.java
    incubator/aries/trunk/samples/blog/blog-biz/src/main/resources/OSGI-INF/blueprint/blueprint.xml
    incubator/aries/trunk/samples/blog/blog-itests/pom.xml
    incubator/aries/trunk/samples/blog/blog-itests/src/test/java/org/apache/aries/samples/blog/itests/JdbcBlogSampleWithEbaTest.java
    incubator/aries/trunk/samples/blog/blog-itests/src/test/java/org/apache/aries/samples/blog/itests/JpaBlogSampleWithEbaTest.java

Modified: incubator/aries/trunk/application/application-obr-resolver/src/main/java/org/apache/aries/application/resolver/obr/impl/ModelledBundleResource.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/application/application-obr-resolver/src/main/java/org/apache/aries/application/resolver/obr/impl/ModelledBundleResource.java?rev=998149&r1=998148&r2=998149&view=diff
==============================================================================
--- incubator/aries/trunk/application/application-obr-resolver/src/main/java/org/apache/aries/application/resolver/obr/impl/ModelledBundleResource.java
(original)
+++ incubator/aries/trunk/application/application-obr-resolver/src/main/java/org/apache/aries/application/resolver/obr/impl/ModelledBundleResource.java
Fri Sep 17 14:25:01 2010
@@ -38,6 +38,7 @@ import org.apache.aries.application.mode
 import org.apache.aries.application.modelling.ImportedPackage;
 import org.apache.aries.application.modelling.ImportedService;
 import org.apache.aries.application.modelling.ModelledResource;
+import org.apache.aries.application.modelling.ModellingConstants;
 import org.apache.aries.application.modelling.ModellingManager;
 import org.apache.aries.application.modelling.ResourceType;
 import org.apache.aries.application.modelling.utils.ModellingHelper;
@@ -181,10 +182,15 @@ public class ModelledBundleResource impl
         if (rankingText != null) ranking = Integer.parseInt(rankingText);
         // objectClass may come out as a String or String[]
         Object rawObjectClass = props.remove (Constants.OBJECTCLASS);
-        if (rawObjectClass.getClass().isArray()) { 
-          ifaces = Arrays.asList((String[])rawObjectClass);
-        } else { 
-          ifaces = Arrays.asList((String)rawObjectClass);
+        if (rawObjectClass == null) {
+        	// get it from service
+        	ifaces = Arrays.asList((String)props.get(ModellingConstants.OBR_SERVICE));
+        } else {
+        	if (rawObjectClass.getClass().isArray()) { 
+        		ifaces = Arrays.asList((String[])rawObjectClass);
+        	} else { 
+        		ifaces = Arrays.asList((String)rawObjectClass);
+        	}
         }
 
         ExportedService svc = modellingManager.getExportedService(name, ranking, ifaces,
props);

Modified: incubator/aries/trunk/samples/blog/blog-biz/src/main/resources/OSGI-INF/blueprint/blueprint.xml
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/samples/blog/blog-biz/src/main/resources/OSGI-INF/blueprint/blueprint.xml?rev=998149&r1=998148&r2=998149&view=diff
==============================================================================
--- incubator/aries/trunk/samples/blog/blog-biz/src/main/resources/OSGI-INF/blueprint/blueprint.xml
(original)
+++ incubator/aries/trunk/samples/blog/blog-biz/src/main/resources/OSGI-INF/blueprint/blueprint.xml
Fri Sep 17 14:25:01 2010
@@ -1,48 +1,50 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-    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.
--->
-<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
-            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
-
-  <bean id="blogAuthorManager" class="org.apache.aries.samples.blog.biz.BlogAuthorManagerImpl">
-    <property name="persistenceService" ref="persistenceManager"/>
-  </bean>
-  
-  <bean id="blogEntryManager" class="org.apache.aries.samples.blog.biz.BlogEntryManagerImpl">
-    <property name="persistenceService" ref="persistenceManager"/>
-  </bean>
-  
-  <bean id="blogCommentManager" class="org.apache.aries.samples.blog.biz.BlogCommentManagerImpl">
-    <property name="commentService" ref="commentPersistenceService"/>
-  </bean>
- 
-  
-  <bean id="bloggingServiceComponent" class="org.apache.aries.samples.blog.biz.BloggingServiceImpl">
-    <property name="blogEntryManager" ref="blogEntryManager"/>
-    <property name="blogAuthorManager" ref="blogAuthorManager"/>
-  <property name="blogCommentManager" ref="blogCommentManager"/>
-  </bean>
-  
-  <service ref="bloggingServiceComponent" interface="org.apache.aries.samples.blog.api.BloggingService"/>
-
-  <reference id="persistenceManager" interface="org.apache.aries.samples.blog.api.persistence.BlogPersistenceService"/>
-
-  <reference id="commentPersistenceService" availability="optional" interface="org.apache.aries.samples.blog.api.comment.persistence.BlogCommentService">
-    <reference-listener ref="blogCommentManager" bind-method="blogServiceBound" unbind-method="blogServiceUnbound"/>
-  </reference>
- 
-</blueprint>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    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.
+-->
+<!--  commented out the optional dependency on comment service temporary in order to bypass
the felix obr jira FELIX-2601 -->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+
+  <bean id="blogAuthorManager" class="org.apache.aries.samples.blog.biz.BlogAuthorManagerImpl">
+    <property name="persistenceService" ref="persistenceManager"/>
+  </bean>
+  
+  <bean id="blogEntryManager" class="org.apache.aries.samples.blog.biz.BlogEntryManagerImpl">
+    <property name="persistenceService" ref="persistenceManager"/>
+  </bean>
+  <!-- 
+  <bean id="blogCommentManager" class="org.apache.aries.samples.blog.biz.BlogCommentManagerImpl">
+    <property name="commentService" ref="commentPersistenceService"/>
+  </bean>
+  -->
+  
+  <bean id="bloggingServiceComponent" class="org.apache.aries.samples.blog.biz.BloggingServiceImpl">
+    <property name="blogEntryManager" ref="blogEntryManager"/>
+    <property name="blogAuthorManager" ref="blogAuthorManager"/>
+    <!-- property name="blogCommentManager" ref="blogCommentManager"/-->
+  </bean>
+  
+  <service ref="bloggingServiceComponent" interface="org.apache.aries.samples.blog.api.BloggingService"/>
+
+  <reference id="persistenceManager" interface="org.apache.aries.samples.blog.api.persistence.BlogPersistenceService"/>
+
+<!-- 
+  <reference id="commentPersistenceService" availability="optional" interface="org.apache.aries.samples.blog.api.comment.persistence.BlogCommentService">
+    <reference-listener ref="blogCommentManager" bind-method="blogServiceBound" unbind-method="blogServiceUnbound"/>
+  </reference>
+ -->
+</blueprint>

Modified: incubator/aries/trunk/samples/blog/blog-itests/pom.xml
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/samples/blog/blog-itests/pom.xml?rev=998149&r1=998148&r2=998149&view=diff
==============================================================================
--- incubator/aries/trunk/samples/blog/blog-itests/pom.xml (original)
+++ incubator/aries/trunk/samples/blog/blog-itests/pom.xml Fri Sep 17 14:25:01 2010
@@ -336,6 +336,11 @@
 		</dependency>
 
 		<dependency>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>org.apache.felix.bundlerepository</artifactId>
+            <scope>test</scope>
+        </dependency>
+		<dependency>
 			<groupId>org.apache.aries.jpa</groupId>
 			<artifactId>org.apache.aries.jpa.api</artifactId>
             <scope>test</scope>
@@ -376,7 +381,11 @@
 			<artifactId>org.apache.aries.transaction.wrappers</artifactId>
             <scope>test</scope>
 		</dependency>
-		
+		<dependency>
+            <groupId>org.apache.aries.application</groupId>
+            <artifactId>org.apache.aries.application.resolver.obr</artifactId>
+            <scope>test</scope>
+        </dependency>
 	</dependencies>
 
     <build>

Modified: incubator/aries/trunk/samples/blog/blog-itests/src/test/java/org/apache/aries/samples/blog/itests/JdbcBlogSampleWithEbaTest.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/samples/blog/blog-itests/src/test/java/org/apache/aries/samples/blog/itests/JdbcBlogSampleWithEbaTest.java?rev=998149&r1=998148&r2=998149&view=diff
==============================================================================
--- incubator/aries/trunk/samples/blog/blog-itests/src/test/java/org/apache/aries/samples/blog/itests/JdbcBlogSampleWithEbaTest.java
(original)
+++ incubator/aries/trunk/samples/blog/blog-itests/src/test/java/org/apache/aries/samples/blog/itests/JdbcBlogSampleWithEbaTest.java
Fri Sep 17 14:25:01 2010
@@ -37,7 +37,6 @@ import org.junit.runner.RunWith;
 import org.ops4j.pax.exam.Option;
 import org.ops4j.pax.exam.junit.JUnit4TestRunner;
 import org.osgi.framework.Bundle;
-
 @RunWith(JUnit4TestRunner.class)
 public class JdbcBlogSampleWithEbaTest extends AbstractIntegrationTest {
 
@@ -72,8 +71,8 @@ public class JdbcBlogSampleWithEbaTest e
         waitForServices(bper, "org.apache.aries.samples.blog.api.persistence.BlogPersistenceService");
 
        /*Check that they haven't timed out trying to register*/
-    	assertTrue("No services reistered for " + bbiz.getSymbolicName(), isServiceRegistered(bbiz));
-    	assertTrue("No services reistered for " + bper.getSymbolicName(), isServiceRegistered(bper));
+    	assertTrue("No services registered for " + bbiz.getSymbolicName(), isServiceRegistered(bbiz));
+    	assertTrue("No services registered for " + bper.getSymbolicName(), isServiceRegistered(bper));
 
 		/*Check what services are registered - uncomment for additional debug */
 		/*
@@ -143,6 +142,8 @@ public class JdbcBlogSampleWithEbaTest e
                 mavenBundle("org.apache.aries.application", "org.apache.aries.application.management"
),
                 mavenBundle("org.apache.aries.application", "org.apache.aries.application.runtime"
),
                 mavenBundle("org.apache.aries.application", "org.apache.aries.application.utils"
),
+                mavenBundle("org.apache.felix", "org.apache.felix.bundlerepository"),
+                mavenBundle("org.apache.aries.application", "org.apache.aries.application.resolver.obr"),
                 mavenBundle("org.apache.aries.application", "org.apache.aries.application.modeller"),
                 mavenBundle("org.apache.aries.application", "org.apache.aries.application.deployment.management"),
                 mavenBundle("org.apache.felix", "org.apache.felix.fileinstall" ),
@@ -154,6 +155,14 @@ public class JdbcBlogSampleWithEbaTest e
                 mavenBundle("org.apache.aries.transaction", "org.apache.aries.transaction.blueprint"
),
                 mavenBundle("org.apache.aries.transaction", "org.apache.aries.transaction.wrappers"
),
                 mavenBundle("asm", "asm-all" ),
+                /* For debugging, uncomment the next two lines  */
+                /*vmOption ("-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=7777"),
+                waitForFrameworkStartup(),  
+*/
+                /* For debugging, add these imports:
+                import static org.ops4j.pax.exam.CoreOptions.waitForFrameworkStartup;
+                import static org.ops4j.pax.exam.container.def.PaxRunnerOptions.vmOption;
+                */
                 equinox().version("3.5.0")
         );
         options = updateOptions(options);

Modified: incubator/aries/trunk/samples/blog/blog-itests/src/test/java/org/apache/aries/samples/blog/itests/JpaBlogSampleWithEbaTest.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/samples/blog/blog-itests/src/test/java/org/apache/aries/samples/blog/itests/JpaBlogSampleWithEbaTest.java?rev=998149&r1=998148&r2=998149&view=diff
==============================================================================
--- incubator/aries/trunk/samples/blog/blog-itests/src/test/java/org/apache/aries/samples/blog/itests/JpaBlogSampleWithEbaTest.java
(original)
+++ incubator/aries/trunk/samples/blog/blog-itests/src/test/java/org/apache/aries/samples/blog/itests/JpaBlogSampleWithEbaTest.java
Fri Sep 17 14:25:01 2010
@@ -83,10 +83,10 @@ public class JpaBlogSampleWithEbaTest ex
 
 
     /*Check that they haven't timed out trying to register*/
-	assertTrue("No services reistered for " + bbiz.getSymbolicName(), isServiceRegistered(bbiz));
-	assertTrue("No services reistered for " + bper.getSymbolicName(), isServiceRegistered(bper));
-	assertTrue("No services reistered for " + bds.getSymbolicName(), isServiceRegistered(bds));
-	assertTrue("No services reistered for " + txs.getSymbolicName(), isServiceRegistered(txs));
+	assertTrue("No services registered for " + bbiz.getSymbolicName(), isServiceRegistered(bbiz));
+	assertTrue("No services registered for " + bper.getSymbolicName(), isServiceRegistered(bper));
+	assertTrue("No services registered for " + bds.getSymbolicName(), isServiceRegistered(bds));
+	assertTrue("No services registered for " + txs.getSymbolicName(), isServiceRegistered(txs));
 
 	/*Check what services are registered - uncomment for additional debug */
 	/*
@@ -155,6 +155,8 @@ bootDelegationPackages("javax.transactio
             mavenBundle("org.apache.aries.blueprint", "org.apache.aries.blueprint" ),
             mavenBundle("org.apache.aries", "org.apache.aries.util" ),
             mavenBundle("org.apache.aries.jndi", "org.apache.aries.jndi" ),
+            mavenBundle("org.apache.felix", "org.apache.felix.bundlerepository"),
+            mavenBundle("org.apache.aries.application", "org.apache.aries.application.resolver.obr"),
             mavenBundle("org.apache.aries.application", "org.apache.aries.application.install"
),
             mavenBundle("org.apache.aries.application", "org.apache.aries.application.api"
),
             mavenBundle("org.apache.aries.application", "org.apache.aries.application.management"
),



Mime
View raw message