[jboss-osgi-commits] JBoss-OSGI SVN: r88200 - in projects/jboss-osgi/trunk: build/hudson/hudson-home/jobs/jbossosgi-embedded and 5 other directories.

jboss-osgi-commits at lists.jboss.org jboss-osgi-commits at lists.jboss.org
Tue May 5 06:12:18 EDT 2009


Author: thomas.diesler at jboss.com
Date: 2009-05-05 06:12:18 -0400 (Tue, 05 May 2009)
New Revision: 88200

Modified:
   projects/jboss-osgi/trunk/build/hudson/hudson-home/jobs/jbossosgi-embedded/config.xml
   projects/jboss-osgi/trunk/bundle/blueprint/pom.xml
   projects/jboss-osgi/trunk/bundle/blueprint/src/test/java/org/jboss/test/osgi/blueprint/bootstrap/BundleTestCase.java
   projects/jboss-osgi/trunk/bundle/blueprint/src/test/resources/basic-felix-framework.properties
   projects/jboss-osgi/trunk/bundle/blueprint/src/test/resources/jboss-osgi-framework.properties
   projects/jboss-osgi/trunk/bundle/blueprint/src/test/resources/jndi.properties
   projects/jboss-osgi/trunk/pom.xml
   projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/framework/PropertiesBootstrapProvider.java
   projects/jboss-osgi/trunk/testsuite/pom.xml
Log:
Remove dependency on localhost

Modified: projects/jboss-osgi/trunk/build/hudson/hudson-home/jobs/jbossosgi-embedded/config.xml
===================================================================
--- projects/jboss-osgi/trunk/build/hudson/hudson-home/jobs/jbossosgi-embedded/config.xml	2009-05-05 09:16:02 UTC (rev 88199)
+++ projects/jboss-osgi/trunk/build/hudson/hudson-home/jobs/jbossosgi-embedded/config.xml	2009-05-05 10:12:18 UTC (rev 88200)
@@ -31,7 +31,7 @@
     <hudson.tasks.Maven>
       <targets>clean install</targets>
       <mavenName>apache-maven</mavenName>
-      <properties>-U</properties>
+      <properties>-U -Djboss.bind.address=@jboss.bind.address@</properties>
     </hudson.tasks.Maven>
     <hudson.tasks.Shell>
       <command>

Modified: projects/jboss-osgi/trunk/bundle/blueprint/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/bundle/blueprint/pom.xml	2009-05-05 09:16:02 UTC (rev 88199)
+++ projects/jboss-osgi/trunk/bundle/blueprint/pom.xml	2009-05-05 10:12:18 UTC (rev 88200)
@@ -113,6 +113,12 @@
   </dependencies>
 
   <build>
+    <testResources>
+      <testResource>
+        <directory>src/test/resources</directory>
+        <filtering>true</filtering>
+      </testResource>
+    </testResources>
     <plugins>
       <plugin>
         <artifactId>maven-assembly-plugin</artifactId>

Modified: projects/jboss-osgi/trunk/bundle/blueprint/src/test/java/org/jboss/test/osgi/blueprint/bootstrap/BundleTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/bundle/blueprint/src/test/java/org/jboss/test/osgi/blueprint/bootstrap/BundleTestCase.java	2009-05-05 09:16:02 UTC (rev 88199)
+++ projects/jboss-osgi/trunk/bundle/blueprint/src/test/java/org/jboss/test/osgi/blueprint/bootstrap/BundleTestCase.java	2009-05-05 10:12:18 UTC (rev 88200)
@@ -24,9 +24,6 @@
 //$Id$
 package org.jboss.test.osgi.blueprint.bootstrap;
 
-import javax.management.MBeanServerConnection;
-import javax.naming.InitialContext;
-
 import org.jboss.osgi.spi.framework.OSGiBootstrap;
 import org.jboss.osgi.spi.framework.OSGiBootstrapProvider;
 import org.jboss.osgi.spi.framework.OSGiFramework;
@@ -163,10 +160,6 @@
          bundle = installBundle(context, "bundles/jboss-osgi-jmx.jar", true);
          
          assertEquals("Test bundle ACTIVE", Bundle.ACTIVE, bundle.getState());
-         
-         InitialContext iniCtx = new InitialContext();
-         MBeanServerConnection lookup = (MBeanServerConnection)iniCtx.lookup("jmx/invoker/RMIAdaptor");
-         assertEquals("DefaultDomain", lookup.getDefaultDomain());
       }
       finally
       {

Modified: projects/jboss-osgi/trunk/bundle/blueprint/src/test/resources/basic-felix-framework.properties
===================================================================
--- projects/jboss-osgi/trunk/bundle/blueprint/src/test/resources/basic-felix-framework.properties	2009-05-05 09:16:02 UTC (rev 88199)
+++ projects/jboss-osgi/trunk/bundle/blueprint/src/test/resources/basic-felix-framework.properties	2009-05-05 10:12:18 UTC (rev 88200)
@@ -5,20 +5,19 @@
 #
 
 # The OSGiFramework implementation 
-framework.impl=org.jboss.osgi.felix.framework.FelixIntegration
+org.jboss.osgi.spi.framework.impl=org.jboss.osgi.felix.framework.FelixIntegration
 
 # Properties to configure the Framework
-# All props start with 'framework.prop' 
-framework.prop.org.osgi.framework.storage.clean=onFirstInit
-framework.prop.org.osgi.framework.system.packages.extra=\
+org.osgi.framework.storage.clean=onFirstInit
+org.osgi.framework.system.packages.extra=\
 	org.jboss.logging
 
 # Bundles that need to be installed with the Framework automatically 
-framework.autoInstall=\
+org.jboss.osgi.spi.framework.autoInstall=\
 	file://${test.archive.directory}/bundles/org.osgi.compendium.jar
 
 # Bundles that need to be started automatically 
-framework.autoStart=\
+org.jboss.osgi.spi.framework.autoStart=\
 	file://${test.archive.directory}/bundles/org.apache.felix.log.jar \
 	file://${test.archive.directory}/bundles/jboss-osgi-common.jar \
 	file://${test.archive.directory}/bundles/jboss-osgi-logging.jar

Modified: projects/jboss-osgi/trunk/bundle/blueprint/src/test/resources/jboss-osgi-framework.properties
===================================================================
--- projects/jboss-osgi/trunk/bundle/blueprint/src/test/resources/jboss-osgi-framework.properties	2009-05-05 09:16:02 UTC (rev 88199)
+++ projects/jboss-osgi/trunk/bundle/blueprint/src/test/resources/jboss-osgi-framework.properties	2009-05-05 10:12:18 UTC (rev 88200)
@@ -5,12 +5,11 @@
 #
 
 # The OSGiFramework implementation 
-framework.impl=org.jboss.osgi.felix.framework.FelixIntegration
+org.jboss.osgi.spi.framework.impl=org.jboss.osgi.felix.framework.FelixIntegration
 
 # Properties to configure the Framework
-# All props start with 'framework.prop' 
-framework.prop.org.osgi.framework.storage.clean=onFirstInit
-framework.prop.org.osgi.framework.system.packages.extra=\
+org.osgi.framework.storage.clean=onFirstInit
+org.osgi.framework.system.packages.extra=\
 	org.jboss.logging, \
   	org.jboss.osgi.spi, \
   	org.jboss.osgi.spi.management, \
@@ -20,13 +19,15 @@
   	org.jboss.virtual.plugins.vfs.helpers, \
   	org.jboss.net.protocol, \
   	org.jboss.virtual.protocol
+org.jboss.osgi.jmx.host=@jboss.bind.address@
+org.jboss.osgi.jndi.host=@jboss.bind.address@
 
 # Bundles that need to be installed with the Framework automatically 
-framework.autoInstall=\
+org.jboss.osgi.spi.framework.autoInstall=\
 	file://${test.archive.directory}/bundles/org.osgi.compendium.jar
 
 # Bundles that need to be started automatically 
-framework.autoStart=\
+org.jboss.osgi.spi.framework.autoStart=\
 	file://${test.archive.directory}/bundles/org.apache.felix.log.jar \
 	file://${test.archive.directory}/bundles/apache-xerces-bundle.jar \
 	file://${test.archive.directory}/bundles/jboss-common-core-bundle.jar \

Modified: projects/jboss-osgi/trunk/bundle/blueprint/src/test/resources/jndi.properties
===================================================================
--- projects/jboss-osgi/trunk/bundle/blueprint/src/test/resources/jndi.properties	2009-05-05 09:16:02 UTC (rev 88199)
+++ projects/jboss-osgi/trunk/bundle/blueprint/src/test/resources/jndi.properties	2009-05-05 10:12:18 UTC (rev 88200)
@@ -1,3 +1,3 @@
 java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
 java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
-java.naming.provider.url=jnp://localhost:1099
+java.naming.provider.url=jnp://@jboss.bind.address@:1099

Modified: projects/jboss-osgi/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/pom.xml	2009-05-05 09:16:02 UTC (rev 88199)
+++ projects/jboss-osgi/trunk/pom.xml	2009-05-05 10:12:18 UTC (rev 88200)
@@ -477,6 +477,23 @@
         </plugins>
       </build>
     </profile>
+    
+    <!--
+      Name: no-jboss-bind-address
+      Desc: Set the default jboss.bind.address
+    -->
+    <profile>
+      <id>no-jboss-bind-address</id>
+      <activation>
+        <property>
+          <name>!jboss.bind.address</name>
+        </property>
+      </activation>
+      <properties>
+        <jboss.bind.address>localhost</jboss.bind.address>
+      </properties>
+    </profile>
+    
   </profiles>
 
 </project>

Modified: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/framework/PropertiesBootstrapProvider.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/framework/PropertiesBootstrapProvider.java	2009-05-05 09:16:02 UTC (rev 88199)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/framework/PropertiesBootstrapProvider.java	2009-05-05 10:12:18 UTC (rev 88200)
@@ -30,9 +30,11 @@
 import java.util.ArrayList;
 import java.util.Enumeration;
 import java.util.HashMap;
+import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
 import java.util.Properties;
+import java.util.Set;
 
 import org.jboss.osgi.spi.NotImplementedException;
 import org.jboss.util.StringPropertyReplacer;
@@ -43,30 +45,30 @@
  * The PropertiesBootstrapProvider supports the following properties
  * 
  * <ul>
- * <li><b>framework.impl</b> - The OSGiFramework implementation</li>
- * <li><b>framework.prop.*</b> - Properties to configure the Framework</li>
- * <li><b>framework.autoInstall</b> - Bundles that need to be installed with the Framework automatically</li>
- * <li><b>framework.autoStart</b> - Bundles that need to be started automatically</li>
+ * <li><b>org.jboss.osgi.spi.framework.impl</b> - The OSGiFramework implementation</li>
+ * <li><b>org.jboss.osgi.spi.framework.autoInstall</b> - Bundles that need to be installed with the Framework automatically</li>
+ * <li><b>org.jboss.osgi.spi.framework.autoStart</b> - Bundles that need to be started automatically</li>
  * </ul>
  * 
+ * All other properties are passed on to configure the framework.
+ * 
  * <pre>
  *    # The OSGiFramework implementation 
- *    framework.impl=org.jboss.osgi.felix.framework.FelixIntegration
+ *    org.jboss.osgi.spi.framework.impl=org.jboss.osgi.felix.framework.FelixIntegration
  *    
  *    # Properties to configure the Framework
- *    # All props start with 'framework.prop' 
- *    framework.prop.org.osgi.framework.storage.clean=onFirstInit
- *    framework.prop.org.osgi.framework.system.packages=\
+ *    org.osgi.framework.storage.clean=onFirstInit
+ *    org.osgi.framework.system.packages=\
  *       org.jboss.logging, \
  *       org.osgi.framework; version=1.4, \
  *       javax.management
  *    
  *    # Bundles that need to be installed with the Framework automatically 
- *    framework.autoInstall=\
+ *    org.jboss.osgi.spi.framework.autoInstall=\
  *       file://${test.archive.directory}/bundles/org.osgi.compendium.jar
  *    
  *    # Bundles that need to be started automatically 
- *    framework.autoStart=\
+ *    org.jboss.osgi.spi.framework.autoStart=\
  *       file://${test.archive.directory}/bundles/org.apache.felix.log.jar \
  *       file://${test.archive.directory}/bundles/jboss-osgi-logging.jar \
  *       file://${test.archive.directory}/bundles/jboss-osgi-common.jar \
@@ -79,9 +81,21 @@
  */
 public class PropertiesBootstrapProvider implements OSGiBootstrapProvider 
 {
-   /** The OSGi framework integration class: osgi.framework.impl */
-   public static final String PROP_OSGI_FRAMEWORK_IMPL = "framework.impl";
+   /** The OSGi framework integration class: org.jboss.osgi.spi.framework.impl */
+   public static final String PROP_OSGI_FRAMEWORK_IMPL = "org.jboss.osgi.spi.framework.impl";
+   /** The OSGi framework integration class: org.jboss.osgi.spi.framework.autoInstall */
+   public static final String PROP_OSGI_FRAMEWORK_AUTO_INSTALL = "org.jboss.osgi.spi.framework.autoInstall";
+   /** The OSGi framework integration class: org.jboss.osgi.spi.framework.autoStart */
+   public static final String PROP_OSGI_FRAMEWORK_AUTO_START = "org.jboss.osgi.spi.framework.autoStart";
    
+   private static Set<String> internalProps = new HashSet<String>();
+   static
+   {
+      internalProps.add(PROP_OSGI_FRAMEWORK_IMPL);
+      internalProps.add(PROP_OSGI_FRAMEWORK_AUTO_INSTALL);
+      internalProps.add(PROP_OSGI_FRAMEWORK_AUTO_START);
+   }
+   
    /** The default framework beans property: jboss.osgi.bootstrap.config */
    public static final String OSGI_BOOTSTRAP_CONFIG = "jboss.osgi.bootstrap.config";
    /** The default framework beans: jboss-osgi-bootstrap-beans.xml */
@@ -111,11 +125,11 @@
       initFrameworkProperties(props);
 
       // Init the the autoInstall URLs
-      List<URL> installURLs = getBundleURLs(props, "framework.autoInstall");
+      List<URL> installURLs = getBundleURLs(props, PROP_OSGI_FRAMEWORK_AUTO_INSTALL);
       framework.setAutoInstall(installURLs);
       
       // Init the the autoStart URLs
-      List<URL> startURLs = getBundleURLs(props, "framework.autoStart");
+      List<URL> startURLs = getBundleURLs(props, PROP_OSGI_FRAMEWORK_AUTO_START);
       framework.setAutoStart(startURLs);
       
       configured = true;
@@ -194,16 +208,14 @@
 
    private void initFrameworkProperties(Properties props)
    {
-      String prefix = "framework.prop.";
       Map<String,Object> frameworkProps = new HashMap<String,Object>();
       Enumeration<?> keys = props.propertyNames();
       while(keys.hasMoreElements())
       {
          String key = (String)keys.nextElement();
-         if (key.startsWith(prefix))
+         if (internalProps.contains(key) == false)
          {
             String value = props.getProperty(key);
-            key = key.substring(prefix.length());
             frameworkProps.put(key, value);
          }
       }

Modified: projects/jboss-osgi/trunk/testsuite/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/pom.xml	2009-05-05 09:16:02 UTC (rev 88199)
+++ projects/jboss-osgi/trunk/testsuite/pom.xml	2009-05-05 10:12:18 UTC (rev 88200)
@@ -73,7 +73,7 @@
       <id>framework-felix</id>
       <activation>
         <property>
-          <name>!framework</name>
+          <name>framework</name>
           <value>felix</value>
         </property>
       </activation>
@@ -117,7 +117,7 @@
       <id>framework-equinox</id>
       <activation>
         <property>
-          <name>!framework</name>
+          <name>framework</name>
           <value>equinox</value>
         </property>
       </activation>
@@ -162,7 +162,7 @@
       <id>framework-knopflerfish</id>
       <activation>
         <property>
-          <name>!framework</name>
+          <name>framework</name>
           <value>knopflerfish</value>
         </property>
       </activation>
@@ -207,7 +207,7 @@
       <id>embedded-tesing</id>
       <activation>
         <property>
-          <name>!jboss.bind.address</name>
+          <name>!target.container</name>
         </property>
       </activation>
       <build>
@@ -234,7 +234,7 @@
       <id>remote-tesing</id>
       <activation>
         <property>
-          <name>jboss.bind.address</name>
+          <name>target.container</name>
         </property>
       </activation>
       <dependencies>




More information about the jboss-osgi-commits mailing list