incubator-aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mnutt...@apache.org
Subject svn commit: r899706 - in /incubator/aries/trunk/application: application-management/ application-management/src/main/java/org/apache/aries/application/management/impl/ application-management/src/main/resources/OSGI-INF/blueprint/ application-management...
Date Fri, 15 Jan 2010 16:51:37 GMT
Author: mnuttall
Date: Fri Jan 15 16:51:36 2010
New Revision: 899706

URL: http://svn.apache.org/viewvc?rev=899706&view=rev
Log:
Aries-89: Application itests

Added:
    incubator/aries/trunk/application/application-runtime/src/main/java/org/apache/aries/application/runtime/defaults/
    incubator/aries/trunk/application/application-runtime/src/main/java/org/apache/aries/application/runtime/defaults/DefaultLocalPlatform.java
    incubator/aries/trunk/application/application-runtime/src/main/java/org/apache/aries/application/runtime/defaults/NoOpResolver.java
Modified:
    incubator/aries/trunk/application/application-management/pom.xml
    incubator/aries/trunk/application/application-management/src/main/java/org/apache/aries/application/management/impl/AriesApplicationManagerImpl.java
    incubator/aries/trunk/application/application-management/src/main/java/org/apache/aries/application/management/impl/BundleInfoImpl.java
    incubator/aries/trunk/application/application-management/src/main/resources/OSGI-INF/blueprint/app-management.xml
    incubator/aries/trunk/application/application-management/src/test/java/org/apache/aries/application/management/impl/AriesApplicationManagerImplTest.java
    incubator/aries/trunk/application/application-runtime/pom.xml
    incubator/aries/trunk/application/application-runtime/src/main/resources/OSGI-INF/blueprint/app-context-management.xml

Modified: incubator/aries/trunk/application/application-management/pom.xml
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/application/application-management/pom.xml?rev=899706&r1=899705&r2=899706&view=diff
==============================================================================
--- incubator/aries/trunk/application/application-management/pom.xml (original)
+++ incubator/aries/trunk/application/application-management/pom.xml Fri Jan 15 16:51:36 2010
@@ -77,7 +77,6 @@
                 <configuration>
                     <instructions>
                         <Bundle-SymbolicName>${pom.artifactId}</Bundle-SymbolicName>
-                        <Private-Package>org.apache.aries.application.management.impl</Private-Package>
                         <_versionpolicy>[$(version;==;$(@)),$(version;+;$(@)))</_versionpolicy>
                         <_removeheaders>Ignore-Package,Include-Resource,Private-Package,Bundle-DocURL</_removeheaders>
                     </instructions>

Modified: incubator/aries/trunk/application/application-management/src/main/java/org/apache/aries/application/management/impl/AriesApplicationManagerImpl.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/application/application-management/src/main/java/org/apache/aries/application/management/impl/AriesApplicationManagerImpl.java?rev=899706&r1=899705&r2=899706&view=diff
==============================================================================
--- incubator/aries/trunk/application/application-management/src/main/java/org/apache/aries/application/management/impl/AriesApplicationManagerImpl.java
(original)
+++ incubator/aries/trunk/application/application-management/src/main/java/org/apache/aries/application/management/impl/AriesApplicationManagerImpl.java
Fri Jan 15 16:51:36 2010
@@ -142,7 +142,7 @@
         BundleManifest bm = getBundleManifest (f);
         if (bm != null) {
           if (bm.isValid()) {
-            extraBundlesInfo.add(new BundleInfoImpl(bm, f.toURL().toExternalForm()));
+            extraBundlesInfo.add(new BundleInfoImpl(_applicationMetadataManager, bm, f.toURL().toExternalForm()));
           } else if (deploymentMetadata != null) {
             throw new ManagementException (MessageUtil.getMessage("APPMANAGEMENT0003E", f.getName(),
ebaFile.getName()));
           } else { 
@@ -168,7 +168,7 @@
             if (convertedBinary != null) { 
               modifiedBundles.put (f.getName(), convertedBinary);
               bm = BundleManifest.fromBundle(f);
-              extraBundlesInfo.add(new BundleInfoImpl(bm, f.getName()));
+              extraBundlesInfo.add(new BundleInfoImpl(_applicationMetadataManager, bm, f.getName()));
             }
           }
         } 

Modified: incubator/aries/trunk/application/application-management/src/main/java/org/apache/aries/application/management/impl/BundleInfoImpl.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/application/application-management/src/main/java/org/apache/aries/application/management/impl/BundleInfoImpl.java?rev=899706&r1=899705&r2=899706&view=diff
==============================================================================
--- incubator/aries/trunk/application/application-management/src/main/java/org/apache/aries/application/management/impl/BundleInfoImpl.java
(original)
+++ incubator/aries/trunk/application/application-management/src/main/java/org/apache/aries/application/management/impl/BundleInfoImpl.java
Fri Jan 15 16:51:36 2010
@@ -27,8 +27,8 @@
 import java.util.Map.Entry;
 import java.util.jar.Attributes;
 
+import org.apache.aries.application.ApplicationMetadataManager;
 import org.apache.aries.application.Content;
-import org.apache.aries.application.impl.ContentImpl;
 import org.apache.aries.application.management.BundleInfo;
 import org.apache.aries.application.utils.manifest.BundleManifest;
 import org.apache.aries.application.utils.manifest.ManifestHeaderProcessor;
@@ -42,12 +42,14 @@
   private Set<Content> _exportPackages = null;
   private Set<Content> _importPackages = null;
   private String _location;
+  private ApplicationMetadataManager _applicationMetadataManager;
   
-  public BundleInfoImpl (BundleManifest bm, String location) { 
+  public BundleInfoImpl (ApplicationMetadataManager amm, BundleManifest bm, String location)
{ 
     _symbolicName = bm.getSymbolicName();
     _version = bm.getVersion();
     _attributes = bm.getRawAttributes();
     _location = location;
+    _applicationMetadataManager = amm;
   }
   
   public Set<Content> getExportPackage() {
@@ -92,7 +94,8 @@
     List<String> splitHeader = ManifestHeaderProcessor.split(header, ",");
     HashSet<Content> result = new HashSet<Content>();
     for (String s: splitHeader) { 
-      result.add(new ContentImpl(s));
+      Content c = _applicationMetadataManager.parseContent(s);
+      result.add(c);
     }
     return result;
   }

Modified: incubator/aries/trunk/application/application-management/src/main/resources/OSGI-INF/blueprint/app-management.xml
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/application/application-management/src/main/resources/OSGI-INF/blueprint/app-management.xml?rev=899706&r1=899705&r2=899706&view=diff
==============================================================================
--- incubator/aries/trunk/application/application-management/src/main/resources/OSGI-INF/blueprint/app-management.xml
(original)
+++ incubator/aries/trunk/application/application-management/src/main/resources/OSGI-INF/blueprint/app-management.xml
Fri Jan 15 16:51:36 2010
@@ -37,6 +37,6 @@
   <reference id="localPlatform" interface="org.apache.aries.application.management.LocalPlatform"/>
   <reference id="application-context-manager" interface="org.apache.aries.application.management.ApplicationContextManager"/>
     
-  <service interface="org.apache.aries.application.management.AriesApplicationManager"
ref="manager-service" />
+  <service interface="org.apache.aries.application.management.AriesApplicationManager"
ref="app-manager" />
   
 </blueprint>

Modified: incubator/aries/trunk/application/application-management/src/test/java/org/apache/aries/application/management/impl/AriesApplicationManagerImplTest.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/application/application-management/src/test/java/org/apache/aries/application/management/impl/AriesApplicationManagerImplTest.java?rev=899706&r1=899705&r2=899706&view=diff
==============================================================================
--- incubator/aries/trunk/application/application-management/src/test/java/org/apache/aries/application/management/impl/AriesApplicationManagerImplTest.java
(original)
+++ incubator/aries/trunk/application/application-management/src/test/java/org/apache/aries/application/management/impl/AriesApplicationManagerImplTest.java
Fri Jan 15 16:51:36 2010
@@ -189,7 +189,7 @@
     String persistenceLibraryLocation = "../src/test/resources/bundles/repository/a.handy.persistence.library.jar";
     File persistenceLibrary = new File (persistenceLibraryLocation);
     BundleManifest mf = BundleManifest.fromBundle(persistenceLibrary);
-    BundleInfo resolvedPersistenceLibrary = new BundleInfoImpl(mf, persistenceLibraryLocation);

+    BundleInfo resolvedPersistenceLibrary = new BundleInfoImpl(_appMetaMgr, mf, persistenceLibraryLocation);

     Field v = BundleInfoImpl.class.getDeclaredField("_version");
     v.setAccessible(true);
     v.set(resolvedPersistenceLibrary, new Version("1.1.0"));

Modified: incubator/aries/trunk/application/application-runtime/pom.xml
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/application/application-runtime/pom.xml?rev=899706&r1=899705&r2=899706&view=diff
==============================================================================
--- incubator/aries/trunk/application/application-runtime/pom.xml (original)
+++ incubator/aries/trunk/application/application-runtime/pom.xml Fri Jan 15 16:51:36 2010
@@ -25,7 +25,6 @@
     </parent>
     
     <modelVersion>4.0.0</modelVersion>
-    <groupId>org.apache.aries.application</groupId>
     <artifactId>org.apache.aries.application.runtime</artifactId>
     <packaging>bundle</packaging>
     <name>Apache Aries application runtime</name>
@@ -78,7 +77,6 @@
                 <configuration>
                     <instructions>
                         <Bundle-SymbolicName>${pom.artifactId}</Bundle-SymbolicName>
-                        <Private-Package>org.apache.aries.application.management.impl</Private-Package>
                         <_versionpolicy>[$(version;==;$(@)),$(version;+;$(@)))</_versionpolicy>
                         <_removeheaders>Ignore-Package,Include-Resource,Private-Package,Bundle-DocURL</_removeheaders>
                     </instructions>

Added: incubator/aries/trunk/application/application-runtime/src/main/java/org/apache/aries/application/runtime/defaults/DefaultLocalPlatform.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/application/application-runtime/src/main/java/org/apache/aries/application/runtime/defaults/DefaultLocalPlatform.java?rev=899706&view=auto
==============================================================================
--- incubator/aries/trunk/application/application-runtime/src/main/java/org/apache/aries/application/runtime/defaults/DefaultLocalPlatform.java
(added)
+++ incubator/aries/trunk/application/application-runtime/src/main/java/org/apache/aries/application/runtime/defaults/DefaultLocalPlatform.java
Fri Jan 15 16:51:36 2010
@@ -0,0 +1,37 @@
+/*
+ * 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.aries.application.runtime.defaults;
+
+import java.io.File;
+import java.io.IOException;
+
+import org.apache.aries.application.management.LocalPlatform;
+
+public class DefaultLocalPlatform implements LocalPlatform {
+
+  public File getTemporaryDirectory() throws IOException {
+    File f = File.createTempFile("ebaTmp", null);
+    f.delete();
+    f.mkdir();
+    return f;
+  } 
+  public File getTemporaryFile () throws IOException { 
+    return File.createTempFile("ebaTmp", null);
+  }
+}

Added: incubator/aries/trunk/application/application-runtime/src/main/java/org/apache/aries/application/runtime/defaults/NoOpResolver.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/application/application-runtime/src/main/java/org/apache/aries/application/runtime/defaults/NoOpResolver.java?rev=899706&view=auto
==============================================================================
--- incubator/aries/trunk/application/application-runtime/src/main/java/org/apache/aries/application/runtime/defaults/NoOpResolver.java
(added)
+++ incubator/aries/trunk/application/application-runtime/src/main/java/org/apache/aries/application/runtime/defaults/NoOpResolver.java
Fri Jan 15 16:51:36 2010
@@ -0,0 +1,39 @@
+/*
+ * 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.aries.application.runtime.defaults;
+
+import java.util.Set;
+
+import org.apache.aries.application.management.AriesApplication;
+import org.apache.aries.application.management.AriesApplicationResolver;
+import org.apache.aries.application.management.BundleInfo;
+
+/** AriesApplicationManager requires that there be at least one 
+ * AriesApplicationResolver service present. This class provides a null 
+ * implementation: it simply returns the bundles that it was provided with - 
+ * enough to permit the testing of Aries applications that have no external 
+ * dependencies.   
+ */
+public class NoOpResolver implements AriesApplicationResolver {
+
+  public Set<BundleInfo> resolve(AriesApplication app) {
+    return app.getBundleInfo();
+  }
+
+}

Modified: incubator/aries/trunk/application/application-runtime/src/main/resources/OSGI-INF/blueprint/app-context-management.xml
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/application/application-runtime/src/main/resources/OSGI-INF/blueprint/app-context-management.xml?rev=899706&r1=899705&r2=899706&view=diff
==============================================================================
--- incubator/aries/trunk/application/application-runtime/src/main/resources/OSGI-INF/blueprint/app-context-management.xml
(original)
+++ incubator/aries/trunk/application/application-runtime/src/main/resources/OSGI-INF/blueprint/app-context-management.xml
Fri Jan 15 16:51:36 2010
@@ -22,7 +22,20 @@
   <bean id="app-context-manager" class="org.apache.aries.application.runtime.impl.ApplicationContextManagerImpl"
scope="singleton" activation="lazy">
     <property name="bundleContext" ref="blueprintBundleContext"/>
   </bean>
-   
-  <service interface="org.apache.aries.application.management.pplicationContextManager"
ref="app-context-manager" />
+
+  <service interface="org.apache.aries.application.management.ApplicationContextManager"
ref="app-context-manager" />
+  
+  <!-- Default implementations of services that must be implemented against a 
+       particular application server environment follow -->
+
+  <bean id="default-local-platform" class="org.apache.aries.application.runtime.defaults.DefaultLocalPlatform"/>
+  <bean id="no-op-resolver" class="org.apache.aries.application.runtime.defaults.NoOpResolver"/>
+  
+  <service interface="org.apache.aries.application.management.LocalPlatform" 
+            ref="default-local-platform"
+            ranking="-1"/>
+  <service interface="org.apache.aries.application.management.AriesApplicationResolver"

+            ref="no-op-resolver"
+            ranking="-1"/>
   
 </blueprint>



Mime
View raw message