JBoss-OSGI SVN: r94337 - in projects/jboss-osgi/projects/osgitck/r4v42: hudson and 1 other directory.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-10-05 03:07:47 -0400 (Mon, 05 Oct 2009)
New Revision: 94337
Modified:
projects/jboss-osgi/projects/osgitck/r4v42/build.xml
projects/jboss-osgi/projects/osgitck/r4v42/hudson/
Log:
Fix dependency in 'init'
Modified: projects/jboss-osgi/projects/osgitck/r4v42/build.xml
===================================================================
--- projects/jboss-osgi/projects/osgitck/r4v42/build.xml 2009-10-05 06:59:28 UTC (rev 94336)
+++ projects/jboss-osgi/projects/osgitck/r4v42/build.xml 2009-10-05 07:07:47 UTC (rev 94337)
@@ -80,15 +80,15 @@
<!-- Hudson -->
<!-- ================================================================== -->
- <target name="hudson-setup">
+ <target name="hudson-setup" depends="init">
<ant dir="${basedir}/hudson" target="hudson-setup" />
</target>
- <target name="hudson-start">
+ <target name="hudson-start" depends="init">
<ant dir="${basedir}/hudson" target="hudson-start" />
</target>
- <target name="hudson-stop">
+ <target name="hudson-stop" depends="init">
<ant dir="${basedir}/hudson" target="hudson-stop" />
</target>
@@ -96,7 +96,7 @@
<!-- TCK Tests -->
<!-- ================================================================== -->
- <target name="tck-core-tests">
+ <target name="tck-core-tests" depends="init">
<ant dir="${osgitck.dir}/osgi.ct" target="clean" />
<ant dir="${osgitck.dir}/osgi.ct" target="publish" />
<ant dir="${osgitck.dir}/osgi.ct" target="osgi.core.tests" />
Property changes on: projects/jboss-osgi/projects/osgitck/r4v42/hudson
___________________________________________________________________
Name: svn:ignore
+ target
16 years, 9 months
JBoss-OSGI SVN: r94336 - in projects/jboss-osgi/projects/osgitck/r4v42: hudson and 1 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-10-05 02:59:28 -0400 (Mon, 05 Oct 2009)
New Revision: 94336
Removed:
projects/jboss-osgi/projects/osgitck/r4v42/hudson/ant.properties.example
Modified:
projects/jboss-osgi/projects/osgitck/r4v42/
projects/jboss-osgi/projects/osgitck/r4v42/ant.properties.example
projects/jboss-osgi/projects/osgitck/r4v42/build.xml
projects/jboss-osgi/projects/osgitck/r4v42/hudson/build.xml
projects/jboss-osgi/projects/osgitck/r4v42/hudson/hudson-home/jobs/osgi.core.tests/config.xml
Log:
Setup hudson - wip
Property changes on: projects/jboss-osgi/projects/osgitck/r4v42
___________________________________________________________________
Name: svn:ignore
+ target
ant.properties
Modified: projects/jboss-osgi/projects/osgitck/r4v42/ant.properties.example
===================================================================
--- projects/jboss-osgi/projects/osgitck/r4v42/ant.properties.example 2009-10-05 06:41:21 UTC (rev 94335)
+++ projects/jboss-osgi/projects/osgitck/r4v42/ant.properties.example 2009-10-05 06:59:28 UTC (rev 94336)
@@ -6,8 +6,31 @@
# The location of the OSGi TCK
osgitck.zip=/home/tdiesler/svn/r4v42-core-cmpn-final.zip
-# The location of the aQute Bnd
-aQute.bnd.jar=/home/tdiesler/.m2/repository/biz/aQute/aQute.bnd/0.0.366-SNAPSHOT/aQute.bnd-0.0.366-SNAPSHOT.jar
+# The location od the local maven repository
+maven.local.repository=/home/tdiesler/.m2/repository
-# The location of the framework
-jboss.osgi.framework.jar=/home/tdiesler/.m2/repository/org/jboss/osgi/runtime/jboss-osgi-framework/1.0.0-SNAPSHOT/jboss-osgi-framework-1.0.0-SNAPSHOT-all.jar
+# The aQute Bnd version
+aQute.bnd.version=0.0.366-SNAPSHOT
+
+# The JBoss OSGi framework version
+jboss.osgi.framework.version=1.0.0-SNAPSHOT
+
+# Hudson Setup ----------------------------------------------------------------
+
+# JDK settings
+java.home.jdk15=/usr/java/jdk1.5.0_19
+java.home.jdk16=/usr/java/jdk1.6.0_14
+
+# Hudson QA Environment
+hudson.username=changeme
+hudson.password=changeme
+
+hudson.root=/home/tdiesler/workspace/hudson/osgitck
+
+hudson.host=localhost
+hudson.admin.port=8150
+hudson.http.port=8180
+
+# Hudson (1.290)
+apache-tomcat=5.5.27
+sun-hudson=2402/128862
Modified: projects/jboss-osgi/projects/osgitck/r4v42/build.xml
===================================================================
--- projects/jboss-osgi/projects/osgitck/r4v42/build.xml 2009-10-05 06:41:21 UTC (rev 94335)
+++ projects/jboss-osgi/projects/osgitck/r4v42/build.xml 2009-10-05 06:59:28 UTC (rev 94336)
@@ -32,10 +32,12 @@
<fail message="Cannot find: ${osgitck.zip}" unless="osgitck.zip.available" />
<!-- Check if the aQute.bnd jar is available -->
+ <property name="aQute.bnd.jar" value="${maven.local.repository}/biz/aQute/aQute.bnd/${aQute.bnd.version}/aQute.bnd-${aQute.bnd.version}.jar" />
<available property="aQute.bnd.available" file="${aQute.bnd.jar}" />
<fail message="Cannot find: ${aQute.bnd.jar}" unless="aQute.bnd.available" />
<!-- Check if the jboss.osgi.framework jar is available -->
+ <property name="jboss.osgi.framework.jar" value="${maven.local.repository}/org/jboss/osgi/runtime/jboss-osgi-framework/${jboss.osgi.framework.version}/jboss-osgi-framework-${jboss.osgi.framework.version}-all.jar" />
<available property="jboss.osgi.framework.available" file="${jboss.osgi.framework.jar}" />
<fail message="Cannot find: ${jboss.osgi.framework.jar}" unless="jboss.osgi.framework.available" />
@@ -53,6 +55,7 @@
<!-- Unzip the OSGi TCK-->
<target name="unzip-osgitck" depends="init" unless="osgitck.dir.available">
<unzip src="${osgitck.zip}" dest="${target.dir}" />
+ <available property="osgitck.dir.available" file="${osgitck.dir}" />
</target>
<target name="setup" depends="init,unzip-osgitck">
@@ -74,6 +77,32 @@
</target>
<!-- ================================================================== -->
+ <!-- Hudson -->
+ <!-- ================================================================== -->
+
+ <target name="hudson-setup">
+ <ant dir="${basedir}/hudson" target="hudson-setup" />
+ </target>
+
+ <target name="hudson-start">
+ <ant dir="${basedir}/hudson" target="hudson-start" />
+ </target>
+
+ <target name="hudson-stop">
+ <ant dir="${basedir}/hudson" target="hudson-stop" />
+ </target>
+
+ <!-- ================================================================== -->
+ <!-- TCK Tests -->
+ <!-- ================================================================== -->
+
+ <target name="tck-core-tests">
+ <ant dir="${osgitck.dir}/osgi.ct" target="clean" />
+ <ant dir="${osgitck.dir}/osgi.ct" target="publish" />
+ <ant dir="${osgitck.dir}/osgi.ct" target="osgi.core.tests" />
+ </target>
+
+ <!-- ================================================================== -->
<!-- Clean -->
<!-- ================================================================== -->
Deleted: projects/jboss-osgi/projects/osgitck/r4v42/hudson/ant.properties.example
===================================================================
--- projects/jboss-osgi/projects/osgitck/r4v42/hudson/ant.properties.example 2009-10-05 06:41:21 UTC (rev 94335)
+++ projects/jboss-osgi/projects/osgitck/r4v42/hudson/ant.properties.example 2009-10-05 06:59:28 UTC (rev 94336)
@@ -1,29 +0,0 @@
-#
-# A sample ant properties file
-#
-# $Id: $
-
-# JDK settings
-java.home.jdk15=/usr/java/jdk1.5.0_19
-java.home.jdk16=/usr/java/jdk1.6.0_14
-
-# Hudson QA Environment
-hudson.username=changeme
-hudson.password=changeme
-
-hudson.root=/home/hudson/workspace/hudson/org.osgi
-
-hudson.host=localhost
-hudson.admin.port=8250
-hudson.http.port=8280
-
-hudson.mail.recipients=
-hudson.smtp.host=localhost
-
-# Hudson (1.290)
-apache-tomcat=5.5.27
-sun-hudson=2402/128862
-
-# authentication cancelled error
-# https://hudson.dev.java.net/issues/show_bug.cgi?id=3936
-
Modified: projects/jboss-osgi/projects/osgitck/r4v42/hudson/build.xml
===================================================================
--- projects/jboss-osgi/projects/osgitck/r4v42/hudson/build.xml 2009-10-05 06:41:21 UTC (rev 94335)
+++ projects/jboss-osgi/projects/osgitck/r4v42/hudson/build.xml 2009-10-05 06:59:28 UTC (rev 94336)
@@ -20,6 +20,7 @@
<!-- ================================================================== -->
<!-- Hudson Jobs -->
<!-- ================================================================== -->
+
<macrodef name="copyjobs">
<sequential>
<copy todir="${hudson.home}/jobs" overwrite="true">
@@ -28,7 +29,7 @@
</fileset>
<filterset>
<filter token="hudson.osgi.url" value="${hudson.osgi.url}"/>
- <filtersfile file="${hudson.dir}/ant.properties"/>
+ <filtersfile file="${project.root.dir}/ant.properties"/>
</filterset>
</copy>
</sequential>
@@ -40,10 +41,10 @@
<target name="init">
<!-- Check if ant.properties is available -->
- <available property="ant.properties.available" file="${basedir}/ant.properties"/>
+ <available property="ant.properties.available" file="${project.root.dir}/ant.properties"/>
<fail message="Cannot find ant.properties. Did you copy/edit ant.properties.example?" unless="ant.properties.available"/>
- <property file="${basedir}/ant.properties"/>
+ <property file="${project.root.dir}/ant.properties"/>
</target>
<target name="init-hudson" depends="init">
@@ -131,7 +132,7 @@
<include name="**/*.xml"/>
</fileset>
<filterset>
- <filtersfile file="${hudson.dir}/ant.properties"/>
+ <filtersfile file="${project.root.dir}/ant.properties"/>
<filter token="hudson.home" value="${hudson.home}"/>
</filterset>
</copy>
@@ -142,7 +143,7 @@
<include name="*.xml"/>
</fileset>
<filterset>
- <filtersfile file="${hudson.dir}/ant.properties"/>
+ <filtersfile file="${project.root.dir}/ant.properties"/>
</filterset>
</copy>
Modified: projects/jboss-osgi/projects/osgitck/r4v42/hudson/hudson-home/jobs/osgi.core.tests/config.xml
===================================================================
--- projects/jboss-osgi/projects/osgitck/r4v42/hudson/hudson-home/jobs/osgi.core.tests/config.xml 2009-10-05 06:41:21 UTC (rev 94335)
+++ projects/jboss-osgi/projects/osgitck/r4v42/hudson/hudson-home/jobs/osgi.core.tests/config.xml 2009-10-05 06:59:28 UTC (rev 94336)
@@ -8,7 +8,7 @@
<locations>
<hudson.scm.SubversionSCM_-ModuleLocation>
<remote>@hudson.osgi.url@</remote>
- <local>org.osgi</local>
+ <local>osgitck</local>
</hudson.scm.SubversionSCM_-ModuleLocation>
</locations>
<useUpdate>true</useUpdate>
@@ -21,28 +21,23 @@
<builders>
<hudson.tasks.Shell>
<command>
-OSGIDIR=$WORKSPACE/org.osgi
-TCKDIR=$OSGIDIR/osgi.ct
+OSGITCKDIR=$WORKSPACE/osgitck
-# Build the TCK
-cd $TCKDIR
-ant clean publish
+# Setup the TCK
+cd $OSGITCKDIR
+cp ant.properties.example ant.properties
-# Run the core framework tests
-ant osgi.core.tests
+# Setup the TCK
+ant clean setup
-# Copy the test reports
-REPORTSDIR=$WORKSPACE/test-reports
-rm -rf $REPORTSDIR; mkdir $REPORTSDIR
-for file in `find $TCKDIR/generated -name TEST-*.xml`; do
- cp $file $REPORTSDIR
-done
+# Run the core tests
+ant tck-core-tests
</command>
</hudson.tasks.Shell>
</builders>
<publishers>
<hudson.tasks.junit.JUnitResultArchiver>
- <testResults>test-reports/TEST-*.xml</testResults>
+ <testResults>osgitck/osgi.ct/generated/**/test-reports/TEST-*.xml</testResults>
</hudson.tasks.junit.JUnitResultArchiver>
</publishers>
<buildWrappers/>
16 years, 9 months
JBoss-OSGI SVN: r94322 - in projects/jboss-osgi/projects: osgitck and 9 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-10-04 18:07:49 -0400 (Sun, 04 Oct 2009)
New Revision: 94322
Added:
projects/jboss-osgi/projects/osgitck/
projects/jboss-osgi/projects/osgitck/r4v42/
projects/jboss-osgi/projects/osgitck/r4v42/.classpath
projects/jboss-osgi/projects/osgitck/r4v42/.project
projects/jboss-osgi/projects/osgitck/r4v42/ant.properties.example
projects/jboss-osgi/projects/osgitck/r4v42/build.xml
projects/jboss-osgi/projects/osgitck/r4v42/hudson/
projects/jboss-osgi/projects/osgitck/r4v42/hudson/.project
projects/jboss-osgi/projects/osgitck/r4v42/hudson/ant.properties.example
projects/jboss-osgi/projects/osgitck/r4v42/hudson/apache-tomcat/
projects/jboss-osgi/projects/osgitck/r4v42/hudson/apache-tomcat/conf/
projects/jboss-osgi/projects/osgitck/r4v42/hudson/apache-tomcat/conf/server.xml
projects/jboss-osgi/projects/osgitck/r4v42/hudson/apache-tomcat/conf/tomcat-users.xml
projects/jboss-osgi/projects/osgitck/r4v42/hudson/build.xml
projects/jboss-osgi/projects/osgitck/r4v42/hudson/hudson-home/
projects/jboss-osgi/projects/osgitck/r4v42/hudson/hudson-home/config.xml
projects/jboss-osgi/projects/osgitck/r4v42/hudson/hudson-home/hudson.tasks.Maven.xml
projects/jboss-osgi/projects/osgitck/r4v42/hudson/hudson-home/jobs/
projects/jboss-osgi/projects/osgitck/r4v42/hudson/hudson-home/jobs/osgi.core.tests/
projects/jboss-osgi/projects/osgitck/r4v42/hudson/hudson-home/jobs/osgi.core.tests/config.xml
projects/jboss-osgi/projects/osgitck/r4v42/overlay/
projects/jboss-osgi/projects/osgitck/r4v42/overlay/cnf/
projects/jboss-osgi/projects/osgitck/r4v42/overlay/cnf/build.bnd
Log:
Add initial osgitck setup
Added: projects/jboss-osgi/projects/osgitck/r4v42/.classpath
===================================================================
--- projects/jboss-osgi/projects/osgitck/r4v42/.classpath (rev 0)
+++ projects/jboss-osgi/projects/osgitck/r4v42/.classpath 2009-10-04 22:07:49 UTC (rev 94322)
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
Added: projects/jboss-osgi/projects/osgitck/r4v42/.project
===================================================================
--- projects/jboss-osgi/projects/osgitck/r4v42/.project (rev 0)
+++ projects/jboss-osgi/projects/osgitck/r4v42/.project 2009-10-04 22:07:49 UTC (rev 94322)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>osgitck-r4v42</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Added: projects/jboss-osgi/projects/osgitck/r4v42/ant.properties.example
===================================================================
--- projects/jboss-osgi/projects/osgitck/r4v42/ant.properties.example (rev 0)
+++ projects/jboss-osgi/projects/osgitck/r4v42/ant.properties.example 2009-10-04 22:07:49 UTC (rev 94322)
@@ -0,0 +1,13 @@
+#
+# A sample ant properties file
+#
+# $Id: ant.properties.example 3995 2007-07-26 08:52:45Z thomas.diesler(a)jboss.com $
+
+# The location of the OSGi TCK
+osgitck.zip=/home/tdiesler/svn/r4v42-core-cmpn-final.zip
+
+# The location of the aQute Bnd
+aQute.bnd.jar=/home/tdiesler/.m2/repository/biz/aQute/aQute.bnd/0.0.366-SNAPSHOT/aQute.bnd-0.0.366-SNAPSHOT.jar
+
+# The location of the framework
+jboss.osgi.framework.jar=/home/tdiesler/.m2/repository/org/jboss/osgi/runtime/jboss-osgi-framework/1.0.0-SNAPSHOT/jboss-osgi-framework-1.0.0-SNAPSHOT-all.jar
Added: projects/jboss-osgi/projects/osgitck/r4v42/build.xml
===================================================================
--- projects/jboss-osgi/projects/osgitck/r4v42/build.xml (rev 0)
+++ projects/jboss-osgi/projects/osgitck/r4v42/build.xml 2009-10-04 22:07:49 UTC (rev 94322)
@@ -0,0 +1,84 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- ====================================================================== -->
+<!-- -->
+<!-- JBoss, the OpenSource J2EE webOS -->
+<!-- -->
+<!-- Distributable under LGPL license. -->
+<!-- See terms of license at http://www.gnu.org. -->
+<!-- -->
+<!-- ====================================================================== -->
+
+<!-- $Id: build.xml 93515 2009-09-15 07:18:21Z thomas.diesler(a)jboss.com $ -->
+
+<project default="setup">
+
+ <property name="target.dir" value="${basedir}/target" />
+
+ <!-- ================================================================== -->
+ <!-- Initialization -->
+ <!-- ================================================================== -->
+
+ <target name="init">
+
+ <!-- Check if ant.properties is available -->
+ <available property="ant.properties.available" file="${basedir}/ant.properties" />
+ <fail message="Cannot find ant.properties. Did you copy/edit ant.properties.example?" unless="ant.properties.available" />
+
+ <property file="${basedir}/ant.properties" />
+
+ <!-- Check if the osgitck zip is available -->
+ <available property="osgitck.zip.available" file="${osgitck.zip}" />
+ <fail message="Cannot find: ${osgitck.zip}" unless="osgitck.zip.available" />
+
+ <!-- Check if the aQute.bnd jar is available -->
+ <available property="aQute.bnd.available" file="${aQute.bnd.jar}" />
+ <fail message="Cannot find: ${aQute.bnd.jar}" unless="aQute.bnd.available" />
+
+ <!-- Check if the jboss.osgi.framework jar is available -->
+ <available property="jboss.osgi.framework.available" file="${jboss.osgi.framework.jar}" />
+ <fail message="Cannot find: ${jboss.osgi.framework.jar}" unless="jboss.osgi.framework.available" />
+
+ <!-- Check if the osgitck dir is available -->
+ <property name="osgitck.dir" value="${target.dir}/r4v42-core-cmpn-final" />
+ <available property="osgitck.dir.available" file="${osgitck.dir}" />
+ <property name="jboss.framework.repo.dir" value="${osgitck.dir}/licensed/repo/org.jboss.osgi.framework" />
+
+ </target>
+
+ <!-- ================================================================== -->
+ <!-- Setup -->
+ <!-- ================================================================== -->
+
+ <!-- Unzip the OSGi TCK-->
+ <target name="unzip-osgitck" depends="init" unless="osgitck.dir.available">
+ <unzip src="${osgitck.zip}" dest="${target.dir}" />
+ </target>
+
+ <target name="setup" depends="init,unzip-osgitck">
+
+ <!-- Check if the osgitck dir is available -->
+ <fail message="Cannot find: ${osgitck.dir}" unless="osgitck.dir.available" />
+
+ <!-- Overlay the TCK setup -->
+ <copy todir="${osgitck.dir}" overwrite="true">
+ <fileset dir="${basedir}/overlay" />
+ </copy>
+
+ <!-- Copy the OSGi Framework -->
+ <mkdir dir="${jboss.framework.repo.dir}" />
+ <copy file="${jboss.osgi.framework.jar}" tofile="${jboss.framework.repo.dir}/org.jboss.osgi.framework-1.0.0.jar" overwrite="true" />
+
+ <!-- Copy the aQute.bnd -->
+ <copy file="${aQute.bnd.jar}" tofile="${osgitck.dir}/licensed/repo/biz.aQute.bnd/biz.aQute.bnd-latest.jar" overwrite="true" />
+ </target>
+
+ <!-- ================================================================== -->
+ <!-- Clean -->
+ <!-- ================================================================== -->
+
+ <target name="clean">
+ <delete dir="${target.dir}" />
+ </target>
+
+</project>
Added: projects/jboss-osgi/projects/osgitck/r4v42/hudson/.project
===================================================================
--- projects/jboss-osgi/projects/osgitck/r4v42/hudson/.project (rev 0)
+++ projects/jboss-osgi/projects/osgitck/r4v42/hudson/.project 2009-10-04 22:07:49 UTC (rev 94322)
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>hudson</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ </buildSpec>
+ <natures>
+ </natures>
+</projectDescription>
Added: projects/jboss-osgi/projects/osgitck/r4v42/hudson/ant.properties.example
===================================================================
--- projects/jboss-osgi/projects/osgitck/r4v42/hudson/ant.properties.example (rev 0)
+++ projects/jboss-osgi/projects/osgitck/r4v42/hudson/ant.properties.example 2009-10-04 22:07:49 UTC (rev 94322)
@@ -0,0 +1,29 @@
+#
+# A sample ant properties file
+#
+# $Id: $
+
+# JDK settings
+java.home.jdk15=/usr/java/jdk1.5.0_19
+java.home.jdk16=/usr/java/jdk1.6.0_14
+
+# Hudson QA Environment
+hudson.username=changeme
+hudson.password=changeme
+
+hudson.root=/home/hudson/workspace/hudson/org.osgi
+
+hudson.host=localhost
+hudson.admin.port=8250
+hudson.http.port=8280
+
+hudson.mail.recipients=
+hudson.smtp.host=localhost
+
+# Hudson (1.290)
+apache-tomcat=5.5.27
+sun-hudson=2402/128862
+
+# authentication cancelled error
+# https://hudson.dev.java.net/issues/show_bug.cgi?id=3936
+
Added: projects/jboss-osgi/projects/osgitck/r4v42/hudson/apache-tomcat/conf/server.xml
===================================================================
--- projects/jboss-osgi/projects/osgitck/r4v42/hudson/apache-tomcat/conf/server.xml (rev 0)
+++ projects/jboss-osgi/projects/osgitck/r4v42/hudson/apache-tomcat/conf/server.xml 2009-10-04 22:07:49 UTC (rev 94322)
@@ -0,0 +1,44 @@
+<?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.
+-->
+<Server port="@hudson.admin.port@" shutdown="SHUTDOWN">
+
+ <GlobalNamingResources>
+ <!-- Used by Manager webapp -->
+ <Resource
+ name="UserDatabase" auth="Container"
+ type="org.apache.catalina.UserDatabase"
+ description="User database that can be updated and saved"
+ factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
+ pathname="conf/tomcat-users.xml" />
+ </GlobalNamingResources>
+
+ <Service name="Catalina">
+
+ <Connector port="@hudson.http.port@" />
+
+ <!-- This is here for compatibility only, not required
+ <Connector port="8009" protocol="AJP/1.3" />
+ -->
+
+ <Engine name="Catalina" defaultHost="localhost">
+ <Realm className="org.apache.catalina.realm.UserDatabaseRealm" resourceName="UserDatabase" />
+ <Host name="localhost" appBase="webapps"/>
+ </Engine>
+
+ </Service>
+</Server>
Added: projects/jboss-osgi/projects/osgitck/r4v42/hudson/apache-tomcat/conf/tomcat-users.xml
===================================================================
--- projects/jboss-osgi/projects/osgitck/r4v42/hudson/apache-tomcat/conf/tomcat-users.xml (rev 0)
+++ projects/jboss-osgi/projects/osgitck/r4v42/hudson/apache-tomcat/conf/tomcat-users.xml 2009-10-04 22:07:49 UTC (rev 94322)
@@ -0,0 +1,5 @@
+<?xml version='1.0' encoding='utf-8'?>
+<tomcat-users>
+ <role rolename="admin"/>
+ <user username="@hudson.username@" password="@hudson.password@" roles="admin"/>
+</tomcat-users>
Added: projects/jboss-osgi/projects/osgitck/r4v42/hudson/build.xml
===================================================================
--- projects/jboss-osgi/projects/osgitck/r4v42/hudson/build.xml (rev 0)
+++ projects/jboss-osgi/projects/osgitck/r4v42/hudson/build.xml 2009-10-04 22:07:49 UTC (rev 94322)
@@ -0,0 +1,192 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- ====================================================================== -->
+<!-- -->
+<!-- JBoss, the OpenSource J2EE webOS -->
+<!-- -->
+<!-- Distributable under LGPL license. -->
+<!-- See terms of license at http://www.gnu.org. -->
+<!-- -->
+<!-- ====================================================================== -->
+
+<!-- $Id: $ -->
+
+<project>
+
+ <property name="hudson.dir" value="${basedir}"/>
+ <property name="hudson.target.dir" value="${hudson.dir}/target"/>
+ <property name="project.root.dir" value="${basedir}/.."/>
+
+ <!-- ================================================================== -->
+ <!-- Hudson Jobs -->
+ <!-- ================================================================== -->
+ <macrodef name="copyjobs">
+ <sequential>
+ <copy todir="${hudson.home}/jobs" overwrite="true">
+ <fileset dir="${hudson.dir}/hudson-home/jobs">
+ <include name="*/config.xml"/>
+ </fileset>
+ <filterset>
+ <filter token="hudson.osgi.url" value="${hudson.osgi.url}"/>
+ <filtersfile file="${hudson.dir}/ant.properties"/>
+ </filterset>
+ </copy>
+ </sequential>
+ </macrodef>
+
+ <!-- ================================================================== -->
+ <!-- Initialization -->
+ <!-- ================================================================== -->
+
+ <target name="init">
+ <!-- Check if ant.properties is available -->
+ <available property="ant.properties.available" file="${basedir}/ant.properties"/>
+ <fail message="Cannot find ant.properties. Did you copy/edit ant.properties.example?" unless="ant.properties.available"/>
+
+ <property file="${basedir}/ant.properties"/>
+ </target>
+
+ <target name="init-hudson" depends="init">
+ <property name="hudson.tomcat" value="${hudson.root}/apache-tomcat"/>
+ <property name="hudson.home" value="${hudson.root}/hudson-home"/>
+
+ <echo/>
+ <echo message="hudson.root = ${hudson.root}"/>
+ <echo message="hudson.home = ${hudson.home}"/>
+ <echo/>
+
+ <available file="${hudson.root}" property="hudson.root.available"/>
+ <available file="${hudson.tomcat}" property="hudson.tomcat.available"/>
+ <fail message="Hudson root not available: ${hudson.root}" unless="hudson.root.available"/>
+
+ <property name="hudson.username.${hudson.username}" value="true"/>
+ <fail message="Cannot use default hudson username: ${hudson.username}" if="hudson.username.changeme"/>
+ <property name="hudson.password.${hudson.password}" value="true"/>
+ <fail message="Cannot use default hudson password: ${hudson.password}" if="hudson.password.changeme"/>
+ </target>
+
+ <target name="init-thirdparty" depends="init-hudson">
+ <property name="thirdparty.dir" value="${hudson.target.dir}/thirdparty"/>
+ <mkdir dir="${thirdparty.dir}"/>
+ <available property="apache.tomcat.available" file="${thirdparty.dir}/apache-tomcat.zip"/>
+ <available property="sun.hudson.available" file="${thirdparty.dir}/hudson.war"/>
+ </target>
+
+ <!--
+ Get thirdparty dependencies
+ -->
+ <target name="thirdparty" depends="init-thirdparty,get-tomcat,get-hudson">
+ </target>
+ <target name="get-tomcat" depends="init-thirdparty" unless="apache.tomcat.available">
+ <get src="http://www.apache.org/dist/tomcat/tomcat-5/v${apache-tomcat}/bin/apache-t..." dest="${thirdparty.dir}/apache-tomcat.zip" usetimestamp="true" verbose="true"/>
+ </target>
+ <target name="get-hudson" depends="init-thirdparty" unless="sun.hudson.available">
+ <get src="https://hudson.dev.java.net/files/documents/${sun-hudson}/hudson.war" dest="${thirdparty.dir}/hudson.war" usetimestamp="true" verbose="true"/>
+ </target>
+
+ <!--
+ Setup the Hudson Tomcat instance
+ -->
+ <target name="hudson-tomcat-setup" depends="thirdparty" unless="hudson.tomcat.available">
+
+ <!-- Install Tomcat -->
+ <unzip src="${thirdparty.dir}/apache-tomcat.zip" dest="${hudson.root}"/>
+ <move file="${hudson.root}/apache-tomcat-${apache-tomcat}" tofile="${hudson.tomcat}"/>
+ <chmod perm="+x">
+ <fileset dir="${hudson.tomcat}/bin">
+ <include name="*.sh"/>
+ </fileset>
+ </chmod>
+
+ <!-- Install Hudson -->
+ <copy todir="${hudson.tomcat}/webapps" file="${thirdparty.dir}/hudson.war"/>
+
+ </target>
+
+ <!--
+ Update the Hudson version
+ -->
+ <target name="hudson-update" depends="init-thirdparty">
+ <get src="https://hudson.dev.java.net/files/documents/${sun-hudson}/hudson.war" dest="${thirdparty.dir}/hudson.war" usetimestamp="false" verbose="true"/>
+ <delete dir="${hudson.tomcat}/webapps/hudson"/>
+ <copy todir="${hudson.tomcat}/webapps" file="${thirdparty.dir}/hudson.war" overwrite="true"/>
+ </target>
+
+ <!--
+ Setup the Hudson QA environment
+ -->
+ <target name="hudson-setup" depends="init-hudson,hudson-tomcat-setup" description="Setup the Hudson QA environment">
+
+ <!-- get the svn url -->
+ <exec dir="${project.root.dir}" executable="svn" failonerror="true" output="${hudson.target.dir}/svn-info.xml">
+ <arg line="info"/>
+ <arg line="--xml"/>
+ </exec>
+ <xmlproperty file="${hudson.target.dir}/svn-info.xml"/>
+ <property name="hudson.osgi.url" value="${info.entry.url}"/>
+
+ <!-- Configure Tomcat -->
+ <copy todir="${hudson.tomcat}" overwrite="true">
+ <fileset dir="${hudson.dir}/apache-tomcat">
+ <include name="**/*.xml"/>
+ </fileset>
+ <filterset>
+ <filtersfile file="${hudson.dir}/ant.properties"/>
+ <filter token="hudson.home" value="${hudson.home}"/>
+ </filterset>
+ </copy>
+
+ <!-- Configure Hudson Home -->
+ <copy todir="${hudson.home}" overwrite="false">
+ <fileset dir="${hudson.dir}/hudson-home">
+ <include name="*.xml"/>
+ </fileset>
+ <filterset>
+ <filtersfile file="${hudson.dir}/ant.properties"/>
+ </filterset>
+ </copy>
+
+ <!-- Configure Hudson Jobs -->
+ <copyjobs/>
+
+ <echo/>
+ <echo message="*************************************"/>
+ <echo message="* Hudson setup successfully *"/>
+ <echo message="* ant hudson-start *"/>
+ <echo message="*************************************"/>
+ <echo/>
+
+ </target>
+
+ <target name="hudson-stop" depends="init-hudson" description="Stops the Hudson QA environment">
+
+ <exec executable="${hudson.tomcat}/bin/catalina.sh" failonerror="true">
+ <arg line="stop"/>
+ </exec>
+
+ <echo/>
+ <echo message="*************************************"/>
+ <echo message="* Hudson stopped successfully *"/>
+ <echo message="* ant hudson-start *"/>
+ <echo message="*************************************"/>
+ <echo/>
+
+ </target>
+
+ <target name="hudson-start" depends="init-hudson" description="Start the Hudson QA environment">
+
+ <exec executable="${hudson.tomcat}/bin/catalina.sh" failonerror="true" output="${hudson.target.dir}/hudson.log">
+ <env key="CATALINA_OPTS" value="-Xmx512m -DHUDSON_HOME=${hudson.home} -Djava.awt.headless=true"/>
+ <arg line="start"/>
+ </exec>
+
+ <echo/>
+ <echo message="*************************************"/>
+ <echo message="* Hudson started successfully *"/>
+ <echo message="* http://localhost:${hudson.http.port}/hudson *"/>
+ <echo message="*************************************"/>
+ <echo/>
+
+ </target>
+
+</project>
Added: projects/jboss-osgi/projects/osgitck/r4v42/hudson/hudson-home/config.xml
===================================================================
--- projects/jboss-osgi/projects/osgitck/r4v42/hudson/hudson-home/config.xml (rev 0)
+++ projects/jboss-osgi/projects/osgitck/r4v42/hudson/hudson-home/config.xml 2009-10-04 22:07:49 UTC (rev 94322)
@@ -0,0 +1,35 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<hudson>
+ <numExecutors>2</numExecutors>
+ <useSecurity>true</useSecurity>
+ <systemMessage>
+ <![CDATA[
+<h2>OSGi QA Environment</h2>
+]]>
+ </systemMessage>
+ <jdks>
+ <jdk>
+ <name>jdk1.5</name>
+ <javaHome>@java.home.jdk15@</javaHome>
+ </jdk>
+ <jdk>
+ <name>jdk1.6</name>
+ <javaHome>@java.home.jdk16@</javaHome>
+ </jdk>
+ </jdks>
+ <clouds/>
+ <slaves/>
+ <quietPeriod>5</quietPeriod>
+ <views>
+ <hudson.model.AllView>
+ <owner class="hudson" reference="../../.."/>
+ <name>All</name>
+ </hudson.model.AllView>
+ </views>
+ <primaryView>All</primaryView>
+ <slaveAgentPort>0</slaveAgentPort>
+ <label></label>
+ <nodeProperties/>
+ <globalNodeProperties/>
+ <disabledAdministrativeMonitors/>
+</hudson>
\ No newline at end of file
Added: projects/jboss-osgi/projects/osgitck/r4v42/hudson/hudson-home/hudson.tasks.Maven.xml
===================================================================
--- projects/jboss-osgi/projects/osgitck/r4v42/hudson/hudson-home/hudson.tasks.Maven.xml (rev 0)
+++ projects/jboss-osgi/projects/osgitck/r4v42/hudson/hudson-home/hudson.tasks.Maven.xml 2009-10-04 22:07:49 UTC (rev 94322)
@@ -0,0 +1,9 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<hudson.tasks.Maven_-DescriptorImpl>
+ <installations>
+ <hudson.tasks.Maven_-MavenInstallation>
+ <name>@hudson.maven.name@</name>
+ <mavenHome>@hudson.maven.path@</mavenHome>
+ </hudson.tasks.Maven_-MavenInstallation>
+ </installations>
+</hudson.tasks.Maven_-DescriptorImpl>
\ No newline at end of file
Added: projects/jboss-osgi/projects/osgitck/r4v42/hudson/hudson-home/jobs/osgi.core.tests/config.xml
===================================================================
--- projects/jboss-osgi/projects/osgitck/r4v42/hudson/hudson-home/jobs/osgi.core.tests/config.xml (rev 0)
+++ projects/jboss-osgi/projects/osgitck/r4v42/hudson/hudson-home/jobs/osgi.core.tests/config.xml 2009-10-04 22:07:49 UTC (rev 94322)
@@ -0,0 +1,49 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<project>
+ <actions/>
+ <description></description>
+ <keepDependencies>false</keepDependencies>
+ <properties/>
+ <scm class="hudson.scm.SubversionSCM">
+ <locations>
+ <hudson.scm.SubversionSCM_-ModuleLocation>
+ <remote>@hudson.osgi.url@</remote>
+ <local>org.osgi</local>
+ </hudson.scm.SubversionSCM_-ModuleLocation>
+ </locations>
+ <useUpdate>true</useUpdate>
+ </scm>
+ <assignedNode>master</assignedNode>
+ <canRoam>false</canRoam>
+ <disabled>false</disabled>
+ <jdk>jdk1.6</jdk>
+ <triggers class="vector"/>
+ <builders>
+ <hudson.tasks.Shell>
+ <command>
+OSGIDIR=$WORKSPACE/org.osgi
+TCKDIR=$OSGIDIR/osgi.ct
+
+# Build the TCK
+cd $TCKDIR
+ant clean publish
+
+# Run the core framework tests
+ant osgi.core.tests
+
+# Copy the test reports
+REPORTSDIR=$WORKSPACE/test-reports
+rm -rf $REPORTSDIR; mkdir $REPORTSDIR
+for file in `find $TCKDIR/generated -name TEST-*.xml`; do
+ cp $file $REPORTSDIR
+done
+ </command>
+ </hudson.tasks.Shell>
+ </builders>
+ <publishers>
+ <hudson.tasks.junit.JUnitResultArchiver>
+ <testResults>test-reports/TEST-*.xml</testResults>
+ </hudson.tasks.junit.JUnitResultArchiver>
+ </publishers>
+ <buildWrappers/>
+</project>
\ No newline at end of file
Added: projects/jboss-osgi/projects/osgitck/r4v42/overlay/cnf/build.bnd
===================================================================
--- projects/jboss-osgi/projects/osgitck/r4v42/overlay/cnf/build.bnd (rev 0)
+++ projects/jboss-osgi/projects/osgitck/r4v42/overlay/cnf/build.bnd 2009-10-04 22:07:49 UTC (rev 94322)
@@ -0,0 +1,99 @@
+# Very general
+project.dependson = ${p-dependson;:}
+project.bootclasspath = ${p-bootclasspath;:}
+project.buildpath = ${p-buildpath;:}
+project.sourcepath = ${p-sourcepath;:}
+project.allsourcepath = ${p-allsourcepath;:}
+project.output = ${p-output}
+project.testpath = ${p-testpath;:}
+project.workspace = ${workspace}
+project.dir = ${project}
+
+-verbose = true
+src = src
+bin = bin
+target = ${project}/${target-dir}
+release.target = ${if;${def;top};${def;top};${target}}
+build = ${workspace}/cnf
+licensed = ${workspace}/licensed
+repo = ${build}/repo
+licensed-repo = ${licensed}/repo
+target-dir = generated
+p = ${basename;${project}}
+project.name = ${p}
+bin.includes = ${project.name}.jar
+prebuild =
+
+# Java compiler options
+java = java
+javac = javac
+javac.debug = on
+javac.source = 1.3
+javac.target = 1.2
+
+
+#Bnd options
+-sources = true
+-sourcepath = ${project}/src
+
+-plugin = aQute.lib.deployer.FileRepo; \
+ location=${repo}, \
+ aQute.lib.deployer.FileRepo; \
+ location=${licensed-repo}; \
+ readonly=true, \
+ aQute.bnd.signing.JartoolSigner; \
+ keystore=${build}/keystore; \
+ keypass=testtest; \
+ storepass=testtest, \
+ Packaging; \
+ path:=${build}/${bin}; \
+ command:=-pack, \
+ SignatureTest; \
+ path:=${build}/${bin}; \
+ command:="-signaturetest"
+
+
+-make = \
+ (*).(jar); type=bnd; recipe="bnd/$1.bnd", \
+ (*).(ipa); type=bnd; recipe="ipa/$1.bnd"
+
+
+junit = com.springsource.junit;version=3.8;export="junit.framework;version=3.8,junit.extensions;version=3.8"
+
+# Time options
+# base.modified is used by bnd to not make when files are not changed
+base.modified = ${fmodified;${build}/build.xml,${build}/build.bnd,${project}/build.properties,${project}/bnd.bnd,${project}/build.xml}
+base.modified.readable = ${long2date;${base.modified}}
+project.build = ${tstamp;yyyyMMddhhmm}
+
+copyright = Copyright (c) OSGi Alliance (2000, ${tstamp;yyyy}). All Rights Reserved.
+copyright.html = Copyright © OSGi Alliance (2000, ${tstamp;yyyy}). All Rights Reserved.
+
+osgi.release = 4
+osgi.version = 4.2.0
+-versionpolicy = "[${version;==;${@}},${version;+;${@}})"
+
+osgi.release.version = ${osgi.version}.${project.build}
+core.release.version = ${osgi.release.version}
+cmpn.release.version = ${osgi.release.version}
+mobile.release.version = ${osgi.release.version}
+enterprise.release.version = ${osgi.release.version}
+proposed.release.version = ${osgi.release.version}
+
+
+# Documentation
+Bundle-Copyright = ${copyright}
+Bundle-Vendor = OSGi Alliance
+-removeheaders = Include-Resource, Private-Package
+
+# Define the OSGi vendor framework
+osgi.vendor.framework = org.jboss.osgi.framework
+osgi.vendor.version = 1.0.0
+
+-runpath = \
+ ${osgi.vendor.framework}; version=${osgi.vendor.version}, \
+ com.springsource.junit; version=3.8; export="junit.framework;version=3.8"
+
+testcases = ${classes;extending;junit.framework.TestCase|*DefaultTestBundleControl;concrete}
+
+
16 years, 9 months
JBoss-OSGI SVN: r94321 - projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/etc/osgitck.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-10-04 17:59:52 -0400 (Sun, 04 Oct 2009)
New Revision: 94321
Modified:
projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/etc/osgitck/jboss-osgi-bootstrap.xml
Log:
Delegate more osgi packages to the sys cl
Modified: projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/etc/osgitck/jboss-osgi-bootstrap.xml
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/etc/osgitck/jboss-osgi-bootstrap.xml 2009-10-04 21:54:06 UTC (rev 94320)
+++ projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/etc/osgitck/jboss-osgi-bootstrap.xml 2009-10-04 21:59:52 UTC (rev 94321)
@@ -31,8 +31,10 @@
org.osgi.framework,
org.osgi.framework.launch,
+ org.osgi.framework.hooks.service,
org.osgi.service.startlevel,
- org.osgi.service.packageadmin
+ org.osgi.service.packageadmin,
+ org.osgi.util.tracker,
</value></entry>
</map>
</property>
16 years, 9 months
JBoss-OSGI SVN: r94318 - in projects/jboss-osgi/projects/runtime/microcontainer/trunk/src: main/java/org/jboss/osgi/framework/bundle and 1 other directory.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-10-04 17:38:57 -0400 (Sun, 04 Oct 2009)
New Revision: 94318
Removed:
projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/etc/osgitck/cnf/
Modified:
projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/framework/bundle/OSGiBundleManager.java
Log:
Avoid interpreting bundle loaction as URL if inputSource is given
Modified: projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/framework/bundle/OSGiBundleManager.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/framework/bundle/OSGiBundleManager.java 2009-10-04 21:19:12 UTC (rev 94317)
+++ projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/framework/bundle/OSGiBundleManager.java 2009-10-04 21:38:57 UTC (rev 94318)
@@ -400,8 +400,9 @@
if (location == null)
throw new BundleException("Null location");
+ URL locationURL;
+
// Get the location URL
- URL locationURL = getLocationURL(location);
if (input != null)
{
try
@@ -410,7 +411,7 @@
String path = plugin.getStorageDir(getSystemBundle()).getCanonicalPath();
// [TODO] do properly
- File file = new File(path + "/installBundle-" + System.currentTimeMillis() + ".jar");
+ File file = new File(path + "/bundle-" + System.currentTimeMillis() + ".jar");
FileOutputStream fos = new FileOutputStream(file);
VFSUtils.copyStream(input, fos);
fos.close();
@@ -422,6 +423,10 @@
throw new BundleException("Cannot store bundle from input stream", ex);
}
}
+ else
+ {
+ locationURL = getLocationURL(location);
+ }
// Get the root file
VirtualFile root;
16 years, 9 months
JBoss-OSGI SVN: r94316 - in projects/jboss-osgi/projects/runtime/microcontainer/trunk: src/main/java/org/jboss/osgi/framework/bundle and 1 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-10-04 16:32:56 -0400 (Sun, 04 Oct 2009)
New Revision: 94316
Modified:
projects/jboss-osgi/projects/runtime/microcontainer/trunk/.classpath
projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/framework/bundle/OSGiBundleManager.java
projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/test/java/org/jboss/test/osgi/OSGiTestDelegate.java
Log:
Fix missing bundle location with AS integration
Modified: projects/jboss-osgi/projects/runtime/microcontainer/trunk/.classpath
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/trunk/.classpath 2009-10-04 14:45:30 UTC (rev 94315)
+++ projects/jboss-osgi/projects/runtime/microcontainer/trunk/.classpath 2009-10-04 20:32:56 UTC (rev 94316)
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="lib" path="/licensed/repo/com.springsource.junit/com.springsource.junit-3.8.2.jar" sourcepath="/home/tdiesler/Download/java/junit/junit3.8.2/src.jar"/>
<classpathentry kind="src" output="target/classes" path="src/main/java"/>
<classpathentry kind="src" output="target/classes" path="target/generated-sources/javacc"/>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
Modified: projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/framework/bundle/OSGiBundleManager.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/framework/bundle/OSGiBundleManager.java 2009-10-04 14:45:30 UTC (rev 94315)
+++ projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/framework/bundle/OSGiBundleManager.java 2009-10-04 20:32:56 UTC (rev 94316)
@@ -373,7 +373,7 @@
}
/**
- * Install a bundle
+ * Install a bundle from an URL.
*
* @param url the url of the bundle
* @return the bundle state
@@ -384,21 +384,11 @@
if (url == null)
throw new BundleException("Null url");
- VirtualFile root;
- try
- {
- root = VFS.getRoot(url);
- }
- catch (IOException e)
- {
- throw new BundleException("Invalid bundle location=" + url, e);
- }
-
- return install(root, null);
+ return install(url.toExternalForm(), null);
}
/**
- * Install a bundle
+ * Install a bundle from
*
* @param location the bundle's location identifier
* @param input an optional input stream to read the bundle content from
@@ -450,13 +440,21 @@
/**
* Install a bundle
* @param root the virtual file that point to the bundle
- * @param location the optional bundle location
*
* @return the bundle state
* @throws BundleException for any error
*/
- public AbstractBundleState install(VirtualFile root, String location) throws BundleException
+ public AbstractBundleState install(VirtualFile root) throws BundleException
{
+ return install(root, null);
+ }
+
+ /*
+ * Installs a bundle from the given virtual file. If the location is not explicitly
+ * given, it'll be derived from the virtual file.
+ */
+ private AbstractBundleState install(VirtualFile root, String location) throws BundleException
+ {
if (location == null)
location = root.toString();
@@ -570,7 +568,7 @@
String location = (String)unit.getAttachment(PROPERTY_BUNDLE_LOCATION);
if (location == null)
- throw new IllegalStateException("Cannot obtain bundle location");
+ location = unit.getName();
OSGiBundleState bundleState = new OSGiBundleState(location, osgiMetaData, unit);
addBundle(bundleState);
Modified: projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/test/java/org/jboss/test/osgi/OSGiTestDelegate.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/test/java/org/jboss/test/osgi/OSGiTestDelegate.java 2009-10-04 14:45:30 UTC (rev 94315)
+++ projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/test/java/org/jboss/test/osgi/OSGiTestDelegate.java 2009-10-04 20:32:56 UTC (rev 94316)
@@ -202,7 +202,7 @@
*/
public Bundle addBundle(VirtualFile file) throws Exception
{
- AbstractBundleState bundleState = getBundleManager().install(file, null);
+ AbstractBundleState bundleState = getBundleManager().install(file);
return bundleState.getBundleInternal();
}
16 years, 9 months
JBoss-OSGI SVN: r94306 - in projects/jboss-osgi/projects/runtime/microcontainer/trunk: src/etc/osgitck and 1 other directory.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-10-02 19:23:06 -0400 (Fri, 02 Oct 2009)
New Revision: 94306
Added:
projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/etc/osgitck/log4j.xml
Modified:
projects/jboss-osgi/projects/runtime/microcontainer/trunk/scripts/assembly-all.xml
projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/etc/osgitck/jboss-osgi-bootstrap.xml
Log:
Remove dependency on log4j.output.dir
Modified: projects/jboss-osgi/projects/runtime/microcontainer/trunk/scripts/assembly-all.xml
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/trunk/scripts/assembly-all.xml 2009-10-02 22:58:52 UTC (rev 94305)
+++ projects/jboss-osgi/projects/runtime/microcontainer/trunk/scripts/assembly-all.xml 2009-10-02 23:23:06 UTC (rev 94306)
@@ -64,17 +64,11 @@
<outputDirectory>/</outputDirectory>
</fileSet>
<fileSet>
- <directory>target/test-classes</directory>
- <outputDirectory>/</outputDirectory>
- <includes>
- <include>log4j.xml</include>
- </includes>
- </fileSet>
- <fileSet>
<directory>src/etc/osgitck</directory>
<outputDirectory>/</outputDirectory>
<includes>
<include>jboss-osgi-bootstrap.xml</include>
+ <include>log4j.xml</include>
</includes>
</fileSet>
</fileSets>
Modified: projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/etc/osgitck/jboss-osgi-bootstrap.xml
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/etc/osgitck/jboss-osgi-bootstrap.xml 2009-10-02 22:58:52 UTC (rev 94305)
+++ projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/etc/osgitck/jboss-osgi-bootstrap.xml 2009-10-02 23:23:06 UTC (rev 94306)
@@ -15,7 +15,7 @@
</constructor>
<property name="properties">
<map keyClass="java.lang.String" valueClass="java.lang.String">
- <entry><key>org.osgi.framework.storage</key><value>${log4j.output.dir}/osgi-store</value></entry>
+ <entry><key>org.osgi.framework.storage</key><value>./generated/osgi-store</value></entry>
<entry><key>org.osgi.framework.storage.clean</key><value>onFirstInit</value></entry>
<entry><key>org.osgi.framework.system.packages.extra</key><value>
Added: projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/etc/osgitck/log4j.xml
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/etc/osgitck/log4j.xml (rev 0)
+++ projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/etc/osgitck/log4j.xml 2009-10-02 23:23:06 UTC (rev 94306)
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
+
+ <!-- ================================= -->
+ <!-- Preserve messages in a local file -->
+ <!-- ================================= -->
+
+ <appender name="FILE" class="org.apache.log4j.FileAppender">
+ <param name="File" value="./generated/jboss-osgi-framework.log"/>
+ <param name="Append" value="false"/>
+ <layout class="org.apache.log4j.PatternLayout">
+ <!-- The default pattern: Date Priority [Category] Message\n -->
+ <param name="ConversionPattern" value="%d %-5p [%c] %m%n"/>
+ </layout>
+ </appender>
+
+ <!-- ============================== -->
+ <!-- Append messages to the console -->
+ <!-- ============================== -->
+
+ <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
+ <param name="Target" value="System.out" />
+ <param name="Threshold" value="INFO" />
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="%d{HH:mm:ss,SSS} %-5p [%c{1}] %m%n" />
+ </layout>
+ </appender>
+
+ <!-- ================ -->
+ <!-- Limit categories -->
+ <!-- ================ -->
+
+ <!-- Show jboss deployer traces
+ <category name="org.jboss.deployer">
+ <priority value="TRACE" />
+ </category>
+ -->
+
+ <!-- ======================= -->
+ <!-- Setup the Root category -->
+ <!-- ======================= -->
+
+ <root>
+ <!--appender-ref ref="CONSOLE"/-->
+ <appender-ref ref="FILE"/>
+ </root>
+
+</log4j:configuration>
16 years, 9 months
JBoss-OSGI SVN: r94305 - projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/etc/osgitck/cnf.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-10-02 18:58:52 -0400 (Fri, 02 Oct 2009)
New Revision: 94305
Modified:
projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/etc/osgitck/cnf/build.bnd
Log:
Add log4j.output.dir to -runvm
Modified: projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/etc/osgitck/cnf/build.bnd
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/etc/osgitck/cnf/build.bnd 2009-10-02 22:56:20 UTC (rev 94304)
+++ projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/etc/osgitck/cnf/build.bnd 2009-10-02 22:58:52 UTC (rev 94305)
@@ -94,6 +94,8 @@
${osgi.vendor.framework}; version=${osgi.vendor.version}, \
com.springsource.junit; version=3.8; export="junit.framework;version=3.8"
+-runvm = log4j.output.dir=generated
+
testcases = ${classes;extending;junit.framework.TestCase|*DefaultTestBundleControl;concrete}
16 years, 9 months
JBoss-OSGI SVN: r94304 - in projects/jboss-osgi/projects/aQute/trunk: aQute.runtime and 1 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-10-02 18:56:20 -0400 (Fri, 02 Oct 2009)
New Revision: 94304
Modified:
projects/jboss-osgi/projects/aQute/trunk/aQute.bnd/.project
projects/jboss-osgi/projects/aQute/trunk/aQute.runtime/.project
projects/jboss-osgi/projects/aQute/trunk/aQute.runtime/src/main/java/aQute/junit/runtime/GenericFramework.java
projects/jboss-osgi/projects/aQute/trunk/aQute.runtime/src/main/java/aQute/junit/runtime/Target.java
Log:
Better error handling during framework start and initial bundle install/start.
Modified: projects/jboss-osgi/projects/aQute/trunk/aQute.bnd/.project
===================================================================
--- projects/jboss-osgi/projects/aQute/trunk/aQute.bnd/.project 2009-10-02 22:56:07 UTC (rev 94303)
+++ projects/jboss-osgi/projects/aQute/trunk/aQute.bnd/.project 2009-10-02 22:56:20 UTC (rev 94304)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
- <name>bnd</name>
+ <name>aQute.bnd</name>
<comment></comment>
<projects>
</projects>
Modified: projects/jboss-osgi/projects/aQute/trunk/aQute.runtime/.project
===================================================================
--- projects/jboss-osgi/projects/aQute/trunk/aQute.runtime/.project 2009-10-02 22:56:07 UTC (rev 94303)
+++ projects/jboss-osgi/projects/aQute/trunk/aQute.runtime/.project 2009-10-02 22:56:20 UTC (rev 94304)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
- <name>runtime</name>
+ <name>aQute.runtime</name>
<comment></comment>
<projects>
</projects>
Modified: projects/jboss-osgi/projects/aQute/trunk/aQute.runtime/src/main/java/aQute/junit/runtime/GenericFramework.java
===================================================================
--- projects/jboss-osgi/projects/aQute/trunk/aQute.runtime/src/main/java/aQute/junit/runtime/GenericFramework.java 2009-10-02 22:56:07 UTC (rev 94303)
+++ projects/jboss-osgi/projects/aQute/trunk/aQute.runtime/src/main/java/aQute/junit/runtime/GenericFramework.java 2009-10-02 22:56:20 UTC (rev 94304)
@@ -47,6 +47,7 @@
private final Properties properties;
private boolean security;
private SimplePermissionPolicy policy;
+ private List<Throwable> activateErrors = new ArrayList<Throwable>();
public GenericFramework(Properties properties) {
this.properties = properties;
@@ -54,77 +55,81 @@
systemPackages.add("org.osgi.framework.launch");
}
- public boolean activate() throws Exception {
- boolean error = false;
+ public List<Throwable> activate() {
Policy.setPolicy(new AllPolicy());
- systemBundle = createFramework();
- if (systemBundle == null)
- return false;
-
try {
- PermissionInfo allPermissions[] = new PermissionInfo[] { new PermissionInfo(
- AllPermission.class
- .getName(),
- null, null) };
- policy = new SimplePermissionPolicy(systemBundle.getBundleContext());
+ systemBundle = createFramework();
+ if (systemBundle == null)
+ throw new IllegalStateException("No system bundle");
+
+
+ try {
+ PermissionInfo allPermissions[] = new PermissionInfo[] {
+ new PermissionInfo(AllPermission.class.getName(),null, null) };
+ policy = new SimplePermissionPolicy(systemBundle.getBundleContext());
- // All bundles installed from the script are getting AllPermission
- // for now.
- policy.setDefaultPermissions(allPermissions);
- security = true;
- } catch (Throwable t) {
- // This can throw a linkage error when the framework
- // does not carry the PermissionAdmin class
- security = false;
- }
+ // All bundles installed from the script are getting AllPermission
+ // for now.
+ policy.setDefaultPermissions(allPermissions);
+ security = true;
+ } catch (Throwable t) {
+ // This can throw a linkage error when the framework
+ // does not carry the PermissionAdmin class
+ security = false;
+ }
- systemBundle.start();
- // Initialize this framework so it becomes STARTING
- BundleContext systemContext = getFrameworkContext();
+ systemBundle.start();
+ // Initialize this framework so it becomes STARTING
+ BundleContext systemContext = getFrameworkContext();
- // Install the set of bundles
- List/* <Bundle> */installed = new ArrayList/* <Bundle> */();
+ // Install the set of bundles
+ List/* <Bundle> */installed = new ArrayList/* <Bundle> */();
- for (Iterator/* <File> */i = bundles.iterator(); i.hasNext();) {
- File path = ((File) i.next()).getAbsoluteFile();
+ for (Iterator/* <File> */i = bundles.iterator(); i.hasNext();) {
+ File path = ((File) i.next()).getAbsoluteFile();
- InputStream in = new FileInputStream(path);
- try {
- Bundle bundle = systemContext
- .installBundle(path.toString(), in);
- installed.add(bundle);
- } catch (BundleException e) {
- System.out.println("Install: " + path + " ");
- report(e, System.out);
- error = true;
- } finally {
- in.close();
- }
- }
+ InputStream in = new FileInputStream(path);
+ try {
+ Bundle bundle = systemContext
+ .installBundle(path.toString(), in);
+ installed.add(bundle);
+ } catch (BundleException e) {
+ System.out.println("Install error: " + path + " ");
+ report(e, System.out);
+ activateErrors.add(e);
+ } finally {
+ in.close();
+ }
+ }
- // From now on, the bundles are on their own. They have
- // by default AllPermission, but if they install bundles
- // they will not automatically get AllPermission anymore
-
- if (security)
- policy.setDefaultPermissions(null);
+ // From now on, the bundles are on their own. They have
+ // by default AllPermission, but if they install bundles
+ // they will not automatically get AllPermission anymore
+
+ if (security)
+ policy.setDefaultPermissions(null);
- // Now start all the installed bundles in the same order
- // (unless they're a fragment)
-
- for (Iterator/* <Bundle> */i = installed.iterator(); i.hasNext();) {
- Bundle b = (Bundle) i.next();
- try {
- if (!isFragment(b))
- b.start();
- } catch (BundleException e) {
- System.out.println("Start: " + b.getBundleId() + " ");
- report(e, System.out);
- error = true;
- }
- }
- return !error;
+ // Now start all the installed bundles in the same order
+ // (unless they're a fragment)
+
+ for (Iterator/* <Bundle> */i = installed.iterator(); i.hasNext();) {
+ Bundle b = (Bundle) i.next();
+ try {
+ if (!isFragment(b))
+ b.start();
+ } catch (BundleException e) {
+ System.out.println("Start error: " + b + " ");
+ report(e, System.out);
+ activateErrors.add(e);
+ }
+ }
+
+ } catch (Exception ex) {
+ activateErrors.add(ex);
+ }
+
+ return activateErrors;
}
private boolean isFragment(Bundle b) {
@@ -338,12 +343,10 @@
public void report(PrintStream out) {
try {
- System.out
- .println("------------------------------- REPORT --------------------------");
+ out.println("------------------------------- REPORT --------------------------");
out.println();
out.println("Framework " + framework);
- out.println("SystemBundle "
- + (systemBundle == null ? "<>" : systemBundle.getClass().getName()));
+ out.println("SystemBundle " + (systemBundle == null ? "<>" : systemBundle.getClass().getName()));
out.println("Storage " + storage);
out.println("Keep " + keep);
out.println("Security " + security);
@@ -464,7 +467,7 @@
case BundleException.UNSUPPORTED_OPERATION:
case BundleException.UNSPECIFIED:
case BundleException.RESOLVE_ERROR:
- System.out.println(e.getMessage());
+ e.printStackTrace(System.out);
break;
}
}
Modified: projects/jboss-osgi/projects/aQute/trunk/aQute.runtime/src/main/java/aQute/junit/runtime/Target.java
===================================================================
--- projects/jboss-osgi/projects/aQute/trunk/aQute.runtime/src/main/java/aQute/junit/runtime/Target.java 2009-10-02 22:56:07 UTC (rev 94303)
+++ projects/jboss-osgi/projects/aQute/trunk/aQute.runtime/src/main/java/aQute/junit/runtime/Target.java 2009-10-02 22:56:20 UTC (rev 94304)
@@ -2,11 +2,13 @@
import java.io.BufferedReader;
import java.io.File;
+import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.IOException;
import java.io.PrintStream;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Enumeration;
import java.util.Iterator;
import java.util.List;
@@ -130,20 +132,24 @@
/**
* Main test routine.
*
- * @param testSuiteReport
+ * @param testReporter
* @param framework
* @param targetBundle
* @param testNames
* @return
* @throws Throwable
*/
- private int doTesting(TestReporter testSuiteReport) throws Throwable {
+ private int doTesting(TestReporter testReporter) throws Throwable {
Bundle targetBundle;
+ long startTime = System.currentTimeMillis();
try {
- if (framework.activate() == false)
- throw new IllegalStateException("Framework does not activate");
+ List<Throwable> activateErrors = framework.activate();
+ if (activateErrors.size() > 0) {
+ handleSetupErrors(activateErrors, startTime);
+ return activateErrors.size();
+ }
boolean report = properties.containsKey("report");
if (report)
@@ -151,7 +157,7 @@
targetBundle = framework.getBundle(target);
if (targetBundle == null)
- throw new IllegalArgumentException("No target specified");
+ throw new IllegalArgumentException("Cannot obtain target bundle: " + target);
// Verify if we have any test names set
if (testNames.size() == 0)
@@ -164,16 +170,14 @@
return 0;
}
} catch (Throwable th) {
- FileOutputStream fos = new FileOutputStream(reportName);
- th.printStackTrace(new PrintStream(fos));
- fos.close();
+ handleSetupError(th, startTime);
throw th;
}
int allErrors = 0;
TestSuite suite = createSuite(targetBundle, testNames);
- testSuiteReport.begin(framework, targetBundle, null, suite.countTestCases());
+ testReporter.begin(framework, targetBundle, null, suite.countTestCases());
try {
Enumeration tests = suite.tests();
@@ -186,7 +190,7 @@
// Note, this also sets the BundleContext
BasicTestReport basicReport = new BasicTestReport();
result.addListener(basicReport);
- result.addListener(testSuiteReport);
+ result.addListener(testReporter);
// Get the test name
String testName = null;
@@ -195,11 +199,7 @@
else if (test instanceof TestCase)
testName = ((TestCase)test).getName();
- // Add the standard plain and xml formatters
- String reportDir = new File(reportName).getParentFile() + "/test-reports";
- List<JUnitResultFormatter> formatters = new ArrayList<JUnitResultFormatter>();
- formatters.add(new XMLResultFormatter(reportDir, testName));
- formatters.add(new PlainResultFormatter(reportDir, testName));
+ List<JUnitResultFormatter> formatters = getResultFormatters(testName);
for (JUnitResultFormatter formatter : formatters)
result.addListener(formatter);
@@ -207,7 +207,7 @@
junitTest.setProperties(System.getProperties());
// Start the report formatters
- long startTime = System.currentTimeMillis();
+ startTime = System.currentTimeMillis();
fireStartTestSuite(formatters, junitTest);
basicReport.begin(framework, targetBundle, null, test.countTestCases());
@@ -231,7 +231,7 @@
return allErrors;
} finally {
- testSuiteReport.end();
+ testReporter.end();
if (properties.containsKey("wait")) {
framework.waitForStop(10000000);
@@ -240,6 +240,67 @@
}
}
+ /**
+ * Add the standard plain and xml formatters
+ */
+ private List<JUnitResultFormatter> getResultFormatters(String testName) throws IOException {
+ String reportDir = new File(reportName).getParentFile() + "/test-reports";
+ List<JUnitResultFormatter> formatters = new ArrayList<JUnitResultFormatter>();
+ formatters.add(new XMLResultFormatter(reportDir, testName));
+ formatters.add(new PlainResultFormatter(reportDir, testName));
+ return formatters;
+ }
+
+ private void handleSetupError(Throwable th, long startTime) throws IOException {
+ List<Throwable> errors = Arrays.asList(new Throwable[] { th } );
+ handleSetupErrors(errors, startTime);
+ }
+
+ /**
+ * Handles any error that might occur during
+ *
+ * #1 framework startup
+ * #2 list of test bundle install
+ * #3 list of test bundle start
+ *
+ * [TODO]
+ * The above steps should probably be done as part of normal
+ * JUnit test setup. Special handling should not be necessary.
+ */
+ private void handleSetupErrors(List<Throwable> errors, long startTime) throws IOException {
+
+ // Print the stack traces to the legacy report file
+ PrintStream ps = new PrintStream(new FileOutputStream(reportName));
+ for (Throwable ex : errors) {
+ ex.printStackTrace(ps);
+ ps.println();
+ }
+ ps.close();
+
+ TestResult result = new TestResult();
+
+ String targetName = new File (target).getName();
+ if (targetName.endsWith(".jar"));
+ targetName = targetName.substring(0, targetName.length() - 4);
+
+ List<JUnitResultFormatter> formatters = getResultFormatters(targetName);
+ for (JUnitResultFormatter formatter : formatters)
+ result.addListener(formatter);
+
+ JUnitTest junitTest = new JUnitTest(targetName);
+ junitTest.setProperties(System.getProperties());
+
+ // Start the report formatters
+ fireStartTestSuite(formatters, junitTest);
+ for (Throwable ex : errors)
+ result.addError(null, ex);
+
+ // End the report formatters
+ junitTest.setCounts(0, result.failureCount(), result.errorCount());
+ junitTest.setRunTime(System.currentTimeMillis() - startTime);
+ fireEndTestSuite(formatters, junitTest);
+ }
+
private void fireStartTestSuite(List<JUnitResultFormatter> formatters, JUnitTest junitTest) {
for (JUnitResultFormatter formatter : formatters) {
formatter.startTestSuite(junitTest);
16 years, 9 months
JBoss-OSGI SVN: r94302 - in projects/jboss-osgi/projects/runtime/microcontainer/trunk: scripts and 8 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-10-02 18:54:52 -0400 (Fri, 02 Oct 2009)
New Revision: 94302
Added:
projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/etc/osgitck/jboss-osgi-bootstrap.xml
projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/test/resources/META-INF/jboss-osgi-bootstrap.xml
Removed:
projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/test/resources/bootstrap/
Modified:
projects/jboss-osgi/projects/runtime/microcontainer/trunk/.classpath
projects/jboss-osgi/projects/runtime/microcontainer/trunk/pom.xml
projects/jboss-osgi/projects/runtime/microcontainer/trunk/scripts/assembly-all.xml
projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/framework/bundle/AbstractBundleState.java
projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/framework/bundle/OSGiBundleManager.java
projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/framework/bundle/OSGiBundleState.java
projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/framework/deployers/OSGiBundleStateDeployer.java
projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/framework/plugins/internal/AutoInstallPluginImpl.java
projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/test/java/org/jboss/test/osgi/OSGiTestDelegate.java
projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/test/java/org/jboss/test/osgi/bundle/test/BundleUnitTestCase.java
Log:
Preserve user's bundle location
Modified: projects/jboss-osgi/projects/runtime/microcontainer/trunk/.classpath
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/trunk/.classpath 2009-10-02 22:26:48 UTC (rev 94301)
+++ projects/jboss-osgi/projects/runtime/microcontainer/trunk/.classpath 2009-10-02 22:54:52 UTC (rev 94302)
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
+ <classpathentry kind="lib" path="/licensed/repo/com.springsource.junit/com.springsource.junit-3.8.2.jar" sourcepath="/home/tdiesler/Download/java/junit/junit3.8.2/src.jar"/>
<classpathentry kind="src" output="target/classes" path="src/main/java"/>
<classpathentry kind="src" output="target/classes" path="target/generated-sources/javacc"/>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
Modified: projects/jboss-osgi/projects/runtime/microcontainer/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/trunk/pom.xml 2009-10-02 22:26:48 UTC (rev 94301)
+++ projects/jboss-osgi/projects/runtime/microcontainer/trunk/pom.xml 2009-10-02 22:54:52 UTC (rev 94302)
@@ -17,7 +17,7 @@
<!--
Set these VM properties in your IDE debugger
- -Dlog4j.output.dir=${workspace_loc:jboss-osgi-runtime-microcontainer/target}
+ -Dlog4j.output.dir=${workspace_loc:jboss-osgi-framework/target}
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
Modified: projects/jboss-osgi/projects/runtime/microcontainer/trunk/scripts/assembly-all.xml
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/trunk/scripts/assembly-all.xml 2009-10-02 22:26:48 UTC (rev 94301)
+++ projects/jboss-osgi/projects/runtime/microcontainer/trunk/scripts/assembly-all.xml 2009-10-02 22:54:52 UTC (rev 94302)
@@ -64,8 +64,18 @@
<outputDirectory>/</outputDirectory>
</fileSet>
<fileSet>
- <directory>target/test-classes/bootstrap</directory>
- <outputDirectory>/bootstrap</outputDirectory>
+ <directory>target/test-classes</directory>
+ <outputDirectory>/</outputDirectory>
+ <includes>
+ <include>log4j.xml</include>
+ </includes>
</fileSet>
+ <fileSet>
+ <directory>src/etc/osgitck</directory>
+ <outputDirectory>/</outputDirectory>
+ <includes>
+ <include>jboss-osgi-bootstrap.xml</include>
+ </includes>
+ </fileSet>
</fileSets>
</assembly>
Added: projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/etc/osgitck/jboss-osgi-bootstrap.xml
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/etc/osgitck/jboss-osgi-bootstrap.xml (rev 0)
+++ projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/etc/osgitck/jboss-osgi-bootstrap.xml 2009-10-02 22:54:52 UTC (rev 94302)
@@ -0,0 +1,175 @@
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+ <!--
+ ********************************
+ * *
+ * OSGi Framework *
+ * *
+ ********************************
+ -->
+
+ <bean name="OSGiBundleManager" class="org.jboss.osgi.framework.bundle.OSGiBundleManager">
+ <constructor>
+ <parameter><inject bean="jboss.kernel:service=Kernel" /></parameter>
+ <parameter><inject bean="MainDeployer" /></parameter>
+ </constructor>
+ <property name="properties">
+ <map keyClass="java.lang.String" valueClass="java.lang.String">
+ <entry><key>org.osgi.framework.storage</key><value>${log4j.output.dir}/osgi-store</value></entry>
+ <entry><key>org.osgi.framework.storage.clean</key><value>onFirstInit</value></entry>
+ <entry><key>org.osgi.framework.system.packages.extra</key><value>
+
+ junit.framework;version=3.8.1,
+
+ org.jboss.logging;version=2.0,
+ org.jboss.osgi.spi.capability;version=1.0,
+ org.jboss.osgi.spi.logging;version=1.0,
+ org.jboss.osgi.spi.management;version=1.0,
+ org.jboss.osgi.spi.service;version=1.0,
+ org.jboss.osgi.spi.testing;version=1.0,
+ org.jboss.osgi.spi.util;version=1.0,
+
+ org.osgi.framework,
+ org.osgi.framework.launch,
+ org.osgi.service.startlevel,
+ org.osgi.service.packageadmin
+ </value></entry>
+ </map>
+ </property>
+ <incallback method="addPlugin" />
+ <uncallback method="removePlugin" />
+ </bean>
+
+ <!--
+ ********************************
+ * *
+ * OSGi Framework Plugins *
+ * *
+ ********************************
+ -->
+
+ <bean name="OSGiFrameworkEventsPlugin" class="org.jboss.osgi.framework.plugins.internal.FrameworkEventsPluginImpl">
+ <constructor><parameter><inject bean="OSGiBundleManager" /></parameter></constructor>
+ </bean>
+ <bean name="OSGiStoragePlugin" class="org.jboss.osgi.framework.plugins.internal.BundleStoragePluginImpl">
+ <constructor><parameter><inject bean="OSGiBundleManager" /></parameter></constructor>
+ </bean>
+ <bean name="OSGiSystemPackages" class="org.jboss.osgi.framework.plugins.internal.SystemPackagesPluginImpl">
+ <constructor><parameter><inject bean="OSGiBundleManager" /></parameter></constructor>
+ </bean>
+
+ <!--
+ ********************************
+ * *
+ * OSGi Service Plugins *
+ * *
+ ********************************
+ -->
+
+ <bean name="MicrocontainerService" class="org.jboss.osgi.framework.service.internal.MicrocontainerServiceImpl">
+ <constructor><parameter><inject bean="OSGiBundleManager" /></parameter></constructor>
+ </bean>
+ <bean name="StartLevelService" class="org.jboss.osgi.framework.service.internal.StartLevelImpl">
+ <constructor><parameter><inject bean="OSGiBundleManager" /></parameter></constructor>
+ </bean>
+ <bean name="PackageAdminService" class="org.jboss.osgi.framework.service.internal.PackageAdminImpl">
+ <constructor><parameter><inject bean="OSGiBundleManager" /></parameter></constructor>
+ </bean>
+
+ <!--
+ ********************************
+ * *
+ * OSGi Deployment *
+ * *
+ ********************************
+ -->
+
+ <!-- The MainDeployer -->
+ <bean name="MainDeployer" class="org.jboss.deployers.plugins.main.MainDeployerImpl">
+ <property name="structuralDeployers"><inject bean="StructuralDeployers" /></property>
+ <property name="deployers"><inject bean="Deployers" /></property>
+ </bean>
+
+ <!-- The holder for deployers that determine structure -->
+ <bean name="StructuralDeployers" class="org.jboss.deployers.vfs.plugins.structure.VFSStructuralDeployersImpl">
+ <property name="structureBuilder">
+ <!-- The consolidator of the structure information -->
+ <bean name="StructureBuilder" class="org.jboss.deployers.vfs.plugins.structure.VFSStructureBuilder" />
+ </property>
+ <!-- Accept any implementor of structure deployer -->
+ <incallback method="addDeployer" />
+ <uncallback method="removeDeployer" />
+ </bean>
+
+ <!-- The holder for deployers that do real deployment -->
+ <bean name="Deployers" class="org.jboss.deployers.plugins.deployers.DeployersImpl">
+ <constructor><parameter><inject bean="jboss.kernel:service=KernelController" /></parameter></constructor>
+ <!-- Accept any implementor of deployer -->
+ <incallback method="addDeployer" />
+ <uncallback method="removeDeployer" />
+ </bean>
+
+ <!-- Bundle Structure -->
+ <bean name="BundleStructure" class="org.jboss.osgi.deployer.BundleStructureDeployer" />
+
+ <!-- JAR & File Structure (needed for negative testing) -->
+ <bean name="JARStructure" class="org.jboss.deployers.vfs.plugins.structure.jar.JARStructure" />
+ <bean name="FileStructure" class="org.jboss.deployers.vfs.plugins.structure.file.FileStructure" />
+
+ <!-- POJO Deployment -->
+ <bean name="BeanDeployer" class="org.jboss.deployers.vfs.deployer.kernel.BeanDeployer" />
+ <bean name="KernelDeploymentDeployer" class="org.jboss.deployers.vfs.deployer.kernel.KernelDeploymentDeployer" />
+ <bean name="BeanMetaDataDeployer" class="org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer">
+ <constructor>
+ <parameter class="org.jboss.dependency.spi.Controller"><inject bean="jboss.kernel:service=KernelController" /></parameter>
+ </constructor>
+ </bean>
+
+ <!-- OSGI Deployment -->
+ <bean name="OSGiManifestParsingDeployer" class="org.jboss.osgi.framework.deployers.OSGiManifestParsingDeployer" />
+ <bean name="OSGiBundleStateDeployer" class="org.jboss.osgi.framework.deployers.OSGiBundleStateDeployer">
+ <constructor><parameter><inject bean="OSGiBundleManager" /></parameter></constructor>
+ </bean>
+ <bean name="OSGiBundleActivatorDeployer" class="org.jboss.osgi.framework.deployers.OSGiBundleActivatorDeployer" />
+
+ <!--
+ ********************************
+ * *
+ * OSGi Classloading *
+ * *
+ ********************************
+ -->
+
+ <bean name="OSGiClassLoaderSystem" class="org.jboss.osgi.framework.classloading.OSGiClassLoaderSystem" />
+ <bean name="OSGiClassLoaderDomain" class="org.jboss.osgi.framework.classloading.OSGiClassLoaderDomain" >
+ <constructor><parameter>OSGiClassLoaderDomain</parameter></constructor>
+ <property name="classLoaderSystem"><inject bean="OSGiClassLoaderSystem"/></property>
+ <property name="bundleManager"><inject bean="OSGiBundleManager" /></property>
+ </bean>
+ <bean name="OSGiClassLoaderFactory" class="org.jboss.osgi.framework.classloading.OSGiClassLoaderFactory" >
+ <property name="system"><inject bean="OSGiClassLoaderSystem"/></property>
+ </bean>
+ <bean name="OSGiBundleClassLoadingDeployer" class="org.jboss.osgi.framework.classloading.OSGiBundleClassLoadingDeployer">
+ <property name="domain"><inject bean="OSGiClassLoaderDomain"/></property>
+ <property name="factory"><inject bean="OSGiClassLoaderFactory"/></property>
+ </bean>
+
+ <bean name="ClassLoading" class="org.jboss.classloading.spi.dependency.ClassLoading">
+ <incallback method="addModule" state="Configured" />
+ <uncallback method="removeModule" state="Configured" />
+ </bean>
+ <bean name="ClassLoadingDefaultDeployer" class="org.jboss.deployers.plugins.classloading.ClassLoadingDefaultDeployer">
+ <property name="defaultMetaData">
+ <classloading xmlns="urn:jboss:classloading:1.0" export-all="NON_EMPTY" import-all="true" />
+ </property>
+ </bean>
+ <bean name="ClassLoaderClassPathDeployer" class="org.jboss.deployers.vfs.plugins.classloader.VFSClassLoaderClassPathDeployer" />
+ <bean name="ClassLoaderDescribeDeployer" class="org.jboss.deployers.vfs.plugins.classloader.VFSClassLoaderDescribeDeployer">
+ <property name="classLoading"><inject bean="ClassLoading" /></property>
+ </bean>
+ <bean name="ClassLoaderDeployer" class="org.jboss.deployers.plugins.classloading.AbstractLevelClassLoaderSystemDeployer">
+ <property name="classLoading"><inject bean="ClassLoading" /></property>
+ <property name="system"><inject bean="OSGiClassLoaderSystem" /></property>
+ </bean>
+
+</deployment>
Modified: projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/framework/bundle/AbstractBundleState.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/framework/bundle/AbstractBundleState.java 2009-10-02 22:26:48 UTC (rev 94301)
+++ projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/framework/bundle/AbstractBundleState.java 2009-10-02 22:54:52 UTC (rev 94302)
@@ -23,8 +23,6 @@
import java.io.File;
import java.io.InputStream;
-import java.net.MalformedURLException;
-import java.net.URL;
import java.security.Permission;
import java.security.cert.X509Certificate;
import java.util.ArrayList;
@@ -100,7 +98,7 @@
/** The cached symbolic name */
private String symbolicName;
- /** The cached */
+ /** The cached version */
private Version version;
/**
@@ -585,52 +583,14 @@
{
checkValidBundleContext();
checkAdminPermission(AdminPermission.LIFECYCLE); // [TODO] extension bundles
- // [TODO] installBundle
- throw new UnsupportedOperationException("installBundle");
- }
- public Bundle installBundle(String location) throws BundleException
- {
- checkValidBundleContext();
- checkAdminPermission(AdminPermission.LIFECYCLE); // [TODO] extension bundles
-
- URL url = getLocationURL(location);
- AbstractBundleState bundleState = getBundleManager().install(url);
+ AbstractBundleState bundleState = getBundleManager().install(location, input);
return bundleState.getBundleInternal();
}
- private URL getLocationURL(String location) throws BundleException
+ public Bundle installBundle(String location) throws BundleException
{
- // Try location as URL
- URL url = null;
- try
- {
- url = new URL(location);
- }
- catch (MalformedURLException e)
- {
- // ignore
- }
-
- // Try location as File
- if (url == null)
- {
- try
- {
- File file = new File(location);
- if (file.exists())
- url = file.toURL();
- }
- catch (MalformedURLException e)
- {
- // ignore
- }
- }
-
- if (url == null)
- throw new BundleException("Unable to handle location=" + location);
-
- return url;
+ return installBundle(location, null);
}
@Override
Modified: projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/framework/bundle/OSGiBundleManager.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/framework/bundle/OSGiBundleManager.java 2009-10-02 22:26:48 UTC (rev 94301)
+++ projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/framework/bundle/OSGiBundleManager.java 2009-10-02 22:54:52 UTC (rev 94302)
@@ -23,7 +23,11 @@
import static org.jboss.osgi.spi.Constants.PROPERTY_AUTO_START;
+import java.io.File;
+import java.io.FileOutputStream;
import java.io.IOException;
+import java.io.InputStream;
+import java.net.MalformedURLException;
import java.net.URL;
import java.security.AccessController;
import java.security.PrivilegedAction;
@@ -71,6 +75,7 @@
import org.jboss.osgi.framework.resolver.BundleResolver;
import org.jboss.util.collection.ConcurrentSet;
import org.jboss.virtual.VFS;
+import org.jboss.virtual.VFSUtils;
import org.jboss.virtual.VirtualFile;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
@@ -99,6 +104,9 @@
/** The bundle manager's bean name: OSGiBundleManager */
public static final String BEAN_BUNDLE_MANAGER = "OSGiBundleManager";
+ /** The string representation of this bundle's location identifier. */
+ private static final String PROPERTY_BUNDLE_LOCATION = "org.jboss.osgi.bundle.location";
+
/** The framework version */
private static String OSGi_FRAMEWORK_VERSION = "r4v42"; // [TODO] externalise
@@ -375,36 +383,91 @@
{
if (url == null)
throw new BundleException("Null url");
+
+ VirtualFile root;
+ try
+ {
+ root = VFS.getRoot(url);
+ }
+ catch (IOException e)
+ {
+ throw new BundleException("Invalid bundle location=" + url, e);
+ }
+ return install(root, null);
+ }
+
+ /**
+ * Install a bundle
+ *
+ * @param location the bundle's location identifier
+ * @param input an optional input stream to read the bundle content from
+ * @return the bundle state
+ * @throws BundleException for any error
+ */
+ public AbstractBundleState install(String location, InputStream input) throws BundleException
+ {
+ if (location == null)
+ throw new BundleException("Null location");
+
+ // Get the location URL
+ URL locationURL = getLocationURL(location);
+ if (input != null)
+ {
+ try
+ {
+ BundleStoragePlugin plugin = getPlugin(BundleStoragePlugin.class);
+ String path = plugin.getStorageDir(getSystemBundle()).getCanonicalPath();
+
+ // [TODO] do properly
+ File file = new File(path + "/installBundle-" + System.currentTimeMillis() + ".jar");
+ FileOutputStream fos = new FileOutputStream(file);
+ VFSUtils.copyStream(input, fos);
+ fos.close();
+
+ locationURL = file.toURI().toURL();
+ }
+ catch (IOException ex)
+ {
+ throw new BundleException("Cannot store bundle from input stream", ex);
+ }
+ }
+
+ // Get the root file
+ VirtualFile root;
try
{
- VirtualFile root = VFS.getRoot(url);
- return install(root);
+ root = VFS.getRoot(locationURL);
}
catch (IOException e)
{
- throw new BundleException("Error installing bundle from location=" + url, e);
+ throw new BundleException("Invalid bundle location=" + locationURL, e);
}
+
+ return install(root, location);
}
/**
- * Install a bundle
+ * Install a bundle
+ * @param root the virtual file that point to the bundle
+ * @param location the optional bundle location
*
- * @param file the virtual file
* @return the bundle state
* @throws BundleException for any error
*/
- public AbstractBundleState install(VirtualFile file) throws BundleException
+ public AbstractBundleState install(VirtualFile root, String location) throws BundleException
{
- if (file == null)
- throw new BundleException("Null file");
+ if (location == null)
+ location = root.toString();
+ // Create the deployment and deploy it
try
{
- VFSDeployment deployment = VFSDeploymentFactory.getInstance().createVFSDeployment(file);
+ VFSDeployment deployment = VFSDeploymentFactory.getInstance().createVFSDeployment(root);
MutableAttachments att = (MutableAttachments)deployment.getPredeterminedManagedObjects();
att.addAttachment(PROPERTY_AUTO_START, Boolean.FALSE);
-
+ att.addAttachment(PROPERTY_BUNDLE_LOCATION, location);
+
deployerClient.deploy(deployment);
try
{
@@ -423,10 +486,44 @@
}
catch (Exception e)
{
- throw new BundleException("Error installing bundle from location=" + file, e);
+ throw new BundleException("Error installing bundle from location=" + root, e);
}
}
+ private URL getLocationURL(String location) throws BundleException
+ {
+ // Try location as URL
+ URL url = null;
+ try
+ {
+ url = new URL(location);
+ }
+ catch (MalformedURLException e)
+ {
+ // ignore
+ }
+
+ // Try location as File
+ if (url == null)
+ {
+ try
+ {
+ File file = new File(location);
+ if (file.exists())
+ url = file.toURI().toURL();
+ }
+ catch (MalformedURLException e)
+ {
+ // ignore
+ }
+ }
+
+ if (url == null)
+ throw new BundleException("Unable to handle location=" + location);
+
+ return url;
+ }
+
/**
* Uninstall a bundle
*
@@ -471,7 +568,11 @@
if (osgiMetaData == null)
throw new IllegalStateException("Cannot obtain OSGi metadata");
- OSGiBundleState bundleState = new OSGiBundleState(osgiMetaData, unit);
+ String location = (String)unit.getAttachment(PROPERTY_BUNDLE_LOCATION);
+ if (location == null)
+ throw new IllegalStateException("Cannot obtain bundle location");
+
+ OSGiBundleState bundleState = new OSGiBundleState(location, osgiMetaData, unit);
addBundle(bundleState);
return bundleState;
}
@@ -613,15 +714,30 @@
*/
public AbstractBundleState getBundleByLocation(String location)
{
+ if (location == null)
+ throw new IllegalArgumentException("Null location");
+
AbstractBundleState result = null;
+
for (AbstractBundleState aux : bundles)
{
String auxLocation = aux.getLocation();
- if (auxLocation.equals(location))
+ if (location.equals(auxLocation))
{
result = aux;
break;
}
+
+ // Fallback to the deployment name
+ else if (aux instanceof OSGiBundleState)
+ {
+ DeploymentUnit unit = ((OSGiBundleState)aux).getDeploymentUnit();
+ if (location.equals(unit.getName()))
+ {
+ result = aux;
+ break;
+ }
+ }
}
return result;
}
@@ -755,7 +871,7 @@
if (registeredServices.isEmpty())
return null;
-
+
// Don't check assignabilty for the system bundle
if (bundle.getBundleId() == 0)
checkAssignable = false;
@@ -796,7 +912,7 @@
// If multiple such services exist, the service with the highest ranking (as specified in its SERVICE_RANKING property) is returned.
// If there is a tie in ranking, the service with the lowest service ID (as specified in its SERVICE_ID property);
// that is, the service that was registered first is returned.
-
+
long bestId = 0;
int bestRanking = 0;
ServiceReference bestMatch = null;
@@ -829,13 +945,13 @@
Collection<OSGiServiceState> services = getServices(bundle, clazz, filter, checkAssignable);
if (services == null || services.isEmpty())
return null;
-
+
ServiceReference[] result = new ServiceReference[services.size()];
-
+
int i = 0;
for (OSGiServiceState service : services)
result[i++] = service.getReferenceInternal();
-
+
return result;
}
@@ -855,7 +971,7 @@
Filter filter = NoFilter.INSTANCE;
if (filterStr != null)
filter = FrameworkUtil.createFilter(filterStr);
-
+
return getServiceReferences(bundle, clazz, filter, checkAssignable);
}
Modified: projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/framework/bundle/OSGiBundleState.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/framework/bundle/OSGiBundleState.java 2009-10-02 22:26:48 UTC (rev 94301)
+++ projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/framework/bundle/OSGiBundleState.java 2009-10-02 22:54:52 UTC (rev 94302)
@@ -57,22 +57,32 @@
/** The bundle id */
private long bundleId;
+ /** The bundle location */
+ private String location;
+
/** The deployment unit */
private DeploymentUnit unit;
-
+
/**
* Create a new BundleState.
*
+ * @param location The string representation of this bundle's location identifier
* @param osgiMetaData the osgi metadata
* @param unit the deployment unit
* @throws IllegalArgumentException for a null parameter
*/
- public OSGiBundleState(OSGiMetaData osgiMetaData, DeploymentUnit unit)
+ public OSGiBundleState(String location, OSGiMetaData osgiMetaData, DeploymentUnit unit)
{
super(osgiMetaData);
+
+ if (location == null)
+ throw new IllegalArgumentException("Null bundle location");
if (unit == null)
- throw new IllegalArgumentException("Null deployment unit");
+ throw new IllegalArgumentException("Null deployment unit");
+
this.unit = unit;
+ this.location = location;
+
this.bundleId = bundleIDGenerator.incrementAndGet();
unit.getMutableMetaData().addMetaData(unit, DeploymentUnit.class);
}
@@ -94,14 +104,7 @@
public String getLocation()
{
- checkAdminPermission(AdminPermission.METADATA);
-
- URL url = getOSGiMetaData().getBundleUpdateLocation();
- if (url != null)
- return url.toString();
-
- DeploymentUnit unit = getDeploymentUnit();
- return unit.getName();
+ return location;
}
public URL getEntry(String path)
Modified: projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/framework/deployers/OSGiBundleStateDeployer.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/framework/deployers/OSGiBundleStateDeployer.java 2009-10-02 22:26:48 UTC (rev 94301)
+++ projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/framework/deployers/OSGiBundleStateDeployer.java 2009-10-02 22:54:52 UTC (rev 94302)
@@ -21,7 +21,6 @@
*/
package org.jboss.osgi.framework.deployers;
-import org.jboss.dependency.spi.ControllerContext;
import org.jboss.deployers.spi.DeploymentException;
import org.jboss.deployers.spi.deployer.DeploymentStage;
import org.jboss.deployers.spi.deployer.DeploymentStages;
@@ -79,10 +78,6 @@
OSGiBundleState bundleState = bundleManager.addDeployment(unit);
unit.addAttachment(OSGiBundleState.class, bundleState);
-
- ControllerContext context = unit.getAttachment(ControllerContext.class);
- if (context == null)
- throw new IllegalStateException("Cannot obtain ControllerContext");
}
@Override
Modified: projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/framework/plugins/internal/AutoInstallPluginImpl.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/framework/plugins/internal/AutoInstallPluginImpl.java 2009-10-02 22:26:48 UTC (rev 94301)
+++ projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/framework/plugins/internal/AutoInstallPluginImpl.java 2009-10-02 22:54:52 UTC (rev 94302)
@@ -77,6 +77,7 @@
// Install autoInstall bundles
for (URL bundleURL : autoInstall)
{
+
Bundle bundle = bundleManager.install(bundleURL);
autoBundles.put(bundleURL, bundle);
}
Modified: projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/test/java/org/jboss/test/osgi/OSGiTestDelegate.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/test/java/org/jboss/test/osgi/OSGiTestDelegate.java 2009-10-02 22:26:48 UTC (rev 94301)
+++ projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/test/java/org/jboss/test/osgi/OSGiTestDelegate.java 2009-10-02 22:54:52 UTC (rev 94302)
@@ -77,11 +77,11 @@
}
/**
- * Deploys the bootstrap.xml bean descriptor to setup OSGi deployers
+ * Deploys the jboss-osgi-bootstrap.xml bean descriptor to setup OSGi deployers
*/
protected void deploy() throws Exception
{
- String common = "/bootstrap/bootstrap.xml";
+ String common = "/META-INF/jboss-osgi-bootstrap.xml";
URL url = getClass().getResource(common);
if (url == null)
throw new IllegalStateException(common + " not found");
@@ -202,7 +202,7 @@
*/
public Bundle addBundle(VirtualFile file) throws Exception
{
- AbstractBundleState bundleState = getBundleManager().install(file);
+ AbstractBundleState bundleState = getBundleManager().install(file, null);
return bundleState.getBundleInternal();
}
Modified: projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/test/java/org/jboss/test/osgi/bundle/test/BundleUnitTestCase.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/test/java/org/jboss/test/osgi/bundle/test/BundleUnitTestCase.java 2009-10-02 22:26:48 UTC (rev 94301)
+++ projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/test/java/org/jboss/test/osgi/bundle/test/BundleUnitTestCase.java 2009-10-02 22:54:52 UTC (rev 94302)
@@ -25,8 +25,6 @@
import java.util.Hashtable;
import java.util.jar.Attributes;
-import junit.framework.Test;
-
import org.jboss.test.osgi.OSGiTestCase;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
Copied: projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/test/resources/META-INF/jboss-osgi-bootstrap.xml (from rev 94274, projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/test/resources/bootstrap/bootstrap.xml)
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/test/resources/META-INF/jboss-osgi-bootstrap.xml (rev 0)
+++ projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/test/resources/META-INF/jboss-osgi-bootstrap.xml 2009-10-02 22:54:52 UTC (rev 94302)
@@ -0,0 +1,172 @@
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+ <!--
+ ********************************
+ * *
+ * OSGi Framework *
+ * *
+ ********************************
+ -->
+
+ <bean name="OSGiBundleManager" class="org.jboss.osgi.framework.bundle.OSGiBundleManager">
+ <constructor>
+ <parameter><inject bean="jboss.kernel:service=Kernel" /></parameter>
+ <parameter><inject bean="MainDeployer" /></parameter>
+ </constructor>
+ <property name="properties">
+ <map keyClass="java.lang.String" valueClass="java.lang.String">
+ <entry><key>org.osgi.framework.storage</key><value>${log4j.output.dir}/osgi-store</value></entry>
+ <entry><key>org.osgi.framework.storage.clean</key><value>onFirstInit</value></entry>
+ <entry><key>org.osgi.framework.system.packages.extra</key><value>
+ org.jboss.logging;version=2.0,
+ org.jboss.osgi.spi.capability;version=1.0,
+ org.jboss.osgi.spi.logging;version=1.0,
+ org.jboss.osgi.spi.management;version=1.0,
+ org.jboss.osgi.spi.service;version=1.0,
+ org.jboss.osgi.spi.testing;version=1.0,
+ org.jboss.osgi.spi.util;version=1.0,
+
+ org.osgi.framework,
+ org.osgi.framework.launch,
+ org.osgi.service.startlevel,
+ org.osgi.service.packageadmin
+ </value></entry>
+ </map>
+ </property>
+ <incallback method="addPlugin" />
+ <uncallback method="removePlugin" />
+ </bean>
+
+ <!--
+ ********************************
+ * *
+ * OSGi Framework Plugins *
+ * *
+ ********************************
+ -->
+
+ <bean name="OSGiFrameworkEventsPlugin" class="org.jboss.osgi.framework.plugins.internal.FrameworkEventsPluginImpl">
+ <constructor><parameter><inject bean="OSGiBundleManager" /></parameter></constructor>
+ </bean>
+ <bean name="OSGiStoragePlugin" class="org.jboss.osgi.framework.plugins.internal.BundleStoragePluginImpl">
+ <constructor><parameter><inject bean="OSGiBundleManager" /></parameter></constructor>
+ </bean>
+ <bean name="OSGiSystemPackages" class="org.jboss.osgi.framework.plugins.internal.SystemPackagesPluginImpl">
+ <constructor><parameter><inject bean="OSGiBundleManager" /></parameter></constructor>
+ </bean>
+
+ <!--
+ ********************************
+ * *
+ * OSGi Service Plugins *
+ * *
+ ********************************
+ -->
+
+ <bean name="MicrocontainerService" class="org.jboss.osgi.framework.service.internal.MicrocontainerServiceImpl">
+ <constructor><parameter><inject bean="OSGiBundleManager" /></parameter></constructor>
+ </bean>
+ <bean name="StartLevelService" class="org.jboss.osgi.framework.service.internal.StartLevelImpl">
+ <constructor><parameter><inject bean="OSGiBundleManager" /></parameter></constructor>
+ </bean>
+ <bean name="PackageAdminService" class="org.jboss.osgi.framework.service.internal.PackageAdminImpl">
+ <constructor><parameter><inject bean="OSGiBundleManager" /></parameter></constructor>
+ </bean>
+
+ <!--
+ ********************************
+ * *
+ * OSGi Deployment *
+ * *
+ ********************************
+ -->
+
+ <!-- The MainDeployer -->
+ <bean name="MainDeployer" class="org.jboss.deployers.plugins.main.MainDeployerImpl">
+ <property name="structuralDeployers"><inject bean="StructuralDeployers" /></property>
+ <property name="deployers"><inject bean="Deployers" /></property>
+ </bean>
+
+ <!-- The holder for deployers that determine structure -->
+ <bean name="StructuralDeployers" class="org.jboss.deployers.vfs.plugins.structure.VFSStructuralDeployersImpl">
+ <property name="structureBuilder">
+ <!-- The consolidator of the structure information -->
+ <bean name="StructureBuilder" class="org.jboss.deployers.vfs.plugins.structure.VFSStructureBuilder" />
+ </property>
+ <!-- Accept any implementor of structure deployer -->
+ <incallback method="addDeployer" />
+ <uncallback method="removeDeployer" />
+ </bean>
+
+ <!-- The holder for deployers that do real deployment -->
+ <bean name="Deployers" class="org.jboss.deployers.plugins.deployers.DeployersImpl">
+ <constructor><parameter><inject bean="jboss.kernel:service=KernelController" /></parameter></constructor>
+ <!-- Accept any implementor of deployer -->
+ <incallback method="addDeployer" />
+ <uncallback method="removeDeployer" />
+ </bean>
+
+ <!-- Bundle Structure -->
+ <bean name="BundleStructure" class="org.jboss.osgi.deployer.BundleStructureDeployer" />
+
+ <!-- JAR & File Structure (needed for negative testing) -->
+ <bean name="JARStructure" class="org.jboss.deployers.vfs.plugins.structure.jar.JARStructure" />
+ <bean name="FileStructure" class="org.jboss.deployers.vfs.plugins.structure.file.FileStructure" />
+
+ <!-- POJO Deployment -->
+ <bean name="BeanDeployer" class="org.jboss.deployers.vfs.deployer.kernel.BeanDeployer" />
+ <bean name="KernelDeploymentDeployer" class="org.jboss.deployers.vfs.deployer.kernel.KernelDeploymentDeployer" />
+ <bean name="BeanMetaDataDeployer" class="org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer">
+ <constructor>
+ <parameter class="org.jboss.dependency.spi.Controller"><inject bean="jboss.kernel:service=KernelController" /></parameter>
+ </constructor>
+ </bean>
+
+ <!-- OSGI Deployment -->
+ <bean name="OSGiManifestParsingDeployer" class="org.jboss.osgi.framework.deployers.OSGiManifestParsingDeployer" />
+ <bean name="OSGiBundleStateDeployer" class="org.jboss.osgi.framework.deployers.OSGiBundleStateDeployer">
+ <constructor><parameter><inject bean="OSGiBundleManager" /></parameter></constructor>
+ </bean>
+ <bean name="OSGiBundleActivatorDeployer" class="org.jboss.osgi.framework.deployers.OSGiBundleActivatorDeployer" />
+
+ <!--
+ ********************************
+ * *
+ * OSGi Classloading *
+ * *
+ ********************************
+ -->
+
+ <bean name="OSGiClassLoaderSystem" class="org.jboss.osgi.framework.classloading.OSGiClassLoaderSystem" />
+ <bean name="OSGiClassLoaderDomain" class="org.jboss.osgi.framework.classloading.OSGiClassLoaderDomain" >
+ <constructor><parameter>OSGiClassLoaderDomain</parameter></constructor>
+ <property name="classLoaderSystem"><inject bean="OSGiClassLoaderSystem"/></property>
+ <property name="bundleManager"><inject bean="OSGiBundleManager" /></property>
+ </bean>
+ <bean name="OSGiClassLoaderFactory" class="org.jboss.osgi.framework.classloading.OSGiClassLoaderFactory" >
+ <property name="system"><inject bean="OSGiClassLoaderSystem"/></property>
+ </bean>
+ <bean name="OSGiBundleClassLoadingDeployer" class="org.jboss.osgi.framework.classloading.OSGiBundleClassLoadingDeployer">
+ <property name="domain"><inject bean="OSGiClassLoaderDomain"/></property>
+ <property name="factory"><inject bean="OSGiClassLoaderFactory"/></property>
+ </bean>
+
+ <bean name="ClassLoading" class="org.jboss.classloading.spi.dependency.ClassLoading">
+ <incallback method="addModule" state="Configured" />
+ <uncallback method="removeModule" state="Configured" />
+ </bean>
+ <bean name="ClassLoadingDefaultDeployer" class="org.jboss.deployers.plugins.classloading.ClassLoadingDefaultDeployer">
+ <property name="defaultMetaData">
+ <classloading xmlns="urn:jboss:classloading:1.0" export-all="NON_EMPTY" import-all="true" />
+ </property>
+ </bean>
+ <bean name="ClassLoaderClassPathDeployer" class="org.jboss.deployers.vfs.plugins.classloader.VFSClassLoaderClassPathDeployer" />
+ <bean name="ClassLoaderDescribeDeployer" class="org.jboss.deployers.vfs.plugins.classloader.VFSClassLoaderDescribeDeployer">
+ <property name="classLoading"><inject bean="ClassLoading" /></property>
+ </bean>
+ <bean name="ClassLoaderDeployer" class="org.jboss.deployers.plugins.classloading.AbstractLevelClassLoaderSystemDeployer">
+ <property name="classLoading"><inject bean="ClassLoading" /></property>
+ <property name="system"><inject bean="OSGiClassLoaderSystem" /></property>
+ </bean>
+
+</deployment>
16 years, 9 months