[jboss-cvs] JBossAS SVN: r99106 - in projects/jboss-osgi/trunk/testsuite/functional: src/test/java/org/jboss/test/osgi and 5 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Jan 7 06:02:59 EST 2010


Author: thomas.diesler at jboss.com
Date: 2010-01-07 06:02:59 -0500 (Thu, 07 Jan 2010)
New Revision: 99106

Added:
   projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/fragments/
   projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/fragments/FragmentTestCase.java
   projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/fragments/frgmA/
   projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/fragments/frgmA/FragmentService.java
   projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/fragments/hostA/
   projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/fragments/hostA/FragmentHostActivator.java
   projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/fragments/
   projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/fragments/simple-frgmA.bnd
   projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/fragments/simple-hostA.bnd
Removed:
   projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi212/
Modified:
   projects/jboss-osgi/trunk/testsuite/functional/scripts/antrun-test-jars.xml
Log:
Add basic fragment tests

Modified: projects/jboss-osgi/trunk/testsuite/functional/scripts/antrun-test-jars.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/scripts/antrun-test-jars.xml	2010-01-07 10:55:57 UTC (rev 99105)
+++ projects/jboss-osgi/trunk/testsuite/functional/scripts/antrun-test-jars.xml	2010-01-07 11:02:59 UTC (rev 99106)
@@ -28,126 +28,130 @@
 
 <project default="build-test-jars">
 
-	<description>OSGi test archive builder</description>
+  <description>OSGi test archive builder</description>
 
-	<!-- ================================================================== -->
-	<!-- Init                                                               -->
-	<!-- ================================================================== -->
+  <!-- ================================================================== -->
+  <!-- Init                                                               -->
+  <!-- ================================================================== -->
 
-	<target name="init">
+  <target name="init">
 
-		<!-- Property override when not called from maven -->
-		<property name="maven.runtime.classpath" value="/usr/java/bnd.jar" />
-		<property name="tests.output.dir" value="${basedir}/../target" />
+    <!-- Property override when not called from maven -->
+    <property name="maven.runtime.classpath" value="/usr/java/bnd.jar" />
+    <property name="tests.output.dir" value="${basedir}/../target" />
 
-		<mkdir dir="${tests.output.dir}/test-libs/example" />
-		<mkdir dir="${tests.output.dir}/test-libs/service" />
+    <mkdir dir="${tests.output.dir}/test-libs/example" />
+    <mkdir dir="${tests.output.dir}/test-libs/service" />
 
-		<property name="tests.classes.dir" value="${tests.output.dir}/test-classes" />
-		<property name="tests.resources.dir" value="${tests.output.dir}/test-classes" />
+    <property name="tests.classes.dir" value="${tests.output.dir}/test-classes" />
+    <property name="tests.resources.dir" value="${tests.output.dir}/test-classes" />
 
-		<taskdef resource="aQute/bnd/ant/taskdef.properties">
-			<classpath>
-				<pathelement path="${maven.runtime.classpath}" />
-			</classpath>
-		</taskdef>
+    <taskdef resource="aQute/bnd/ant/taskdef.properties">
+      <classpath>
+        <pathelement path="${maven.runtime.classpath}" />
+      </classpath>
+    </taskdef>
 
-	</target>
+  </target>
 
-	<!-- ================================================================== -->
-	<!-- Building                                                           -->
-	<!-- ================================================================== -->
+  <!-- ================================================================== -->
+  <!-- Building                                                           -->
+  <!-- ================================================================== -->
 
-	<target name="build-test-jars" depends="init" description="Build the test deployments">
+  <target name="build-test-jars" depends="init" description="Build the test deployments">
 
-		<!-- Please add alphabetically -->
+    <!-- Please add alphabetically -->
 
-		<!-- jbossas/jbosgi36 -->
-		<bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi36-bundle.jar" files="${tests.resources.dir}/jbossas/jbosgi36/jbosgi36.bnd" />
-		<jar jarfile="${tests.output.dir}/test-libs/jbosgi36-mbean.jar">
-			<fileset dir="${tests.classes.dir}">
-				<include name="org/jboss/test/osgi/jbossas/jbosgi36/mbean/Foo.class" />
-				<include name="org/jboss/test/osgi/jbossas/jbosgi36/mbean/FooMBean.class" />
-			</fileset>
-			<fileset dir="${tests.resources.dir}/jbossas/jbosgi36">
-				<include name="META-INF/jbosgi36-jboss-beans.xml" />
-			</fileset>
-		</jar>
+    <!-- fragments/simple -->
+    <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/fragments-simple-hostA.jar" files="${tests.resources.dir}/fragments/simple-hostA.bnd" />
+    <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/fragments-simple-frgmA.jar" files="${tests.resources.dir}/fragments/simple-frgmA.bnd" />
+    
+    <!-- jbossas/jbosgi36 -->
+    <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi36-bundle.jar" files="${tests.resources.dir}/jbossas/jbosgi36/jbosgi36.bnd" />
+    <jar jarfile="${tests.output.dir}/test-libs/jbosgi36-mbean.jar">
+      <fileset dir="${tests.classes.dir}">
+        <include name="org/jboss/test/osgi/jbossas/jbosgi36/mbean/Foo.class" />
+        <include name="org/jboss/test/osgi/jbossas/jbosgi36/mbean/FooMBean.class" />
+      </fileset>
+      <fileset dir="${tests.resources.dir}/jbossas/jbosgi36">
+        <include name="META-INF/jbosgi36-jboss-beans.xml" />
+      </fileset>
+    </jar>
 
-		<!-- jbosgi37 -->
-		<jar jarfile="${tests.output.dir}/test-libs/jbosgi37-subB.jar">
-			<fileset dir="${tests.classes.dir}">
-				<include name="org/jboss/test/osgi/jbosgi37/subB/PojoB.class" />
-			</fileset>
-		</jar>
-		<bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi37-subA.jar" files="${tests.resources.dir}/jbosgi37/jbosgi37-subA.bnd" />
-		<bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi37-bundleA.jar" files="${tests.resources.dir}/jbosgi37/jbosgi37-bundleA.bnd" />
-		<bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi37-bundleB.jar" files="${tests.resources.dir}/jbosgi37/jbosgi37-bundleB.bnd" />
+    <!-- jbosgi37 -->
+    <jar jarfile="${tests.output.dir}/test-libs/jbosgi37-subB.jar">
+      <fileset dir="${tests.classes.dir}">
+        <include name="org/jboss/test/osgi/jbosgi37/subB/PojoB.class" />
+      </fileset>
+    </jar>
+    <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi37-subA.jar" files="${tests.resources.dir}/jbosgi37/jbosgi37-subA.bnd" />
+    <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi37-bundleA.jar" files="${tests.resources.dir}/jbosgi37/jbosgi37-bundleA.bnd" />
+    <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi37-bundleB.jar" files="${tests.resources.dir}/jbosgi37/jbosgi37-bundleB.bnd" />
 
-		<!-- jbosgi38 -->
-		<bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi38-bundleA.jar" files="${tests.resources.dir}/jbosgi38/jbosgi38-bundleA.bnd" />
-		<bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi38-bundleB.jar" files="${tests.resources.dir}/jbosgi38/jbosgi38-bundleB.bnd" />
-		<bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi38-bundleX.jar" files="${tests.resources.dir}/jbosgi38/jbosgi38-bundleX.bnd" />
+    <!-- jbosgi38 -->
+    <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi38-bundleA.jar" files="${tests.resources.dir}/jbosgi38/jbosgi38-bundleA.bnd" />
+    <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi38-bundleB.jar" files="${tests.resources.dir}/jbosgi38/jbosgi38-bundleB.bnd" />
+    <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi38-bundleX.jar" files="${tests.resources.dir}/jbosgi38/jbosgi38-bundleX.bnd" />
 
-		<!-- jbosgi39 -->
-		<bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi39-bundleB.jar" files="${tests.resources.dir}/jbosgi39/jbosgi39-bundleB.bnd" />
-		<bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi39-bundleX.jar" files="${tests.resources.dir}/jbosgi39/jbosgi39-bundleX.bnd" />
+    <!-- jbosgi39 -->
+    <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi39-bundleB.jar" files="${tests.resources.dir}/jbosgi39/jbosgi39-bundleB.bnd" />
+    <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi39-bundleX.jar" files="${tests.resources.dir}/jbosgi39/jbosgi39-bundleX.bnd" />
 
-		<!-- jbosgi41 -->
-		<bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi41-bundleA.jar" files="${tests.resources.dir}/jbosgi41/jbosgi41-bundleA.bnd" />
+    <!-- jbosgi41 -->
+    <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi41-bundleA.jar" files="${tests.resources.dir}/jbosgi41/jbosgi41-bundleA.bnd" />
 
-		<!-- jbosgi58 -->
-		<jar jarfile="${tests.output.dir}/test-libs/jbosgi58-ejb.jar">
-			<fileset dir="${tests.classes.dir}">
-				<include name="org/jboss/test/osgi/jbossas/jbosgi58/ejb/**" />
-			</fileset>
-		</jar>
+    <!-- jbosgi58 -->
+    <jar jarfile="${tests.output.dir}/test-libs/jbosgi58-ejb.jar">
+      <fileset dir="${tests.classes.dir}">
+        <include name="org/jboss/test/osgi/jbossas/jbosgi58/ejb/**" />
+      </fileset>
+    </jar>
 
-		<!-- jbosgi92 -->
-		<bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi92-bundleA.jar" files="${tests.resources.dir}/jbosgi92/jbosgi92-bundleA.bnd" />
+    <!-- jbosgi92 -->
+    <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi92-bundleA.jar" files="${tests.resources.dir}/jbosgi92/jbosgi92-bundleA.bnd" />
 
-		<!-- jbosgi99 -->
-		<bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi99-allgood.jar" files="${tests.resources.dir}/jbosgi99/jbosgi99-allgood.bnd" />
-		<bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi99-failonresolve.jar" files="${tests.resources.dir}/jbosgi99/jbosgi99-failonresolve.bnd" />
-		<bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi99-failonstart.jar" files="${tests.resources.dir}/jbosgi99/jbosgi99-failonstart.bnd" />
+    <!-- jbosgi99 -->
+    <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi99-allgood.jar" files="${tests.resources.dir}/jbosgi99/jbosgi99-allgood.bnd" />
+    <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi99-failonresolve.jar" files="${tests.resources.dir}/jbosgi99/jbosgi99-failonresolve.bnd" />
+    <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi99-failonstart.jar" files="${tests.resources.dir}/jbosgi99/jbosgi99-failonstart.bnd" />
 
-		<!-- jbosgi108 -->
-		<bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi108-bundleA.jar" files="${tests.resources.dir}/jbosgi108/jbosgi108-bundleA.bnd" />
-		<bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi108-bundleB.jar" files="${tests.resources.dir}/jbosgi108/jbosgi108-bundleB.bnd" />
+    <!-- jbosgi108 -->
+    <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi108-bundleA.jar" files="${tests.resources.dir}/jbosgi108/jbosgi108-bundleA.bnd" />
+    <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi108-bundleB.jar" files="${tests.resources.dir}/jbosgi108/jbosgi108-bundleB.bnd" />
 
-		<!-- jbosgi112 -->
-		<bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi112-bundleA.jar" files="${tests.resources.dir}/jbosgi112/jbosgi112-bundleA.bnd" />
-		<bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi112-bundleB.jar" files="${tests.resources.dir}/jbosgi112/jbosgi112-bundleB.bnd" />
+    <!-- jbosgi112 -->
+    <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi112-bundleA.jar" files="${tests.resources.dir}/jbosgi112/jbosgi112-bundleA.bnd" />
+    <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi112-bundleB.jar" files="${tests.resources.dir}/jbosgi112/jbosgi112-bundleB.bnd" />
 
-		<!-- jbosgi142 -->
-		<bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi142-bundleA.jar" files="${tests.resources.dir}/jbosgi142/jbosgi142-bundleA.bnd" />
-		<bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi142-bundleB.jar" files="${tests.resources.dir}/jbosgi142/jbosgi142-bundleB.bnd" />
-		<bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi142-bundleX.jar" files="${tests.resources.dir}/jbosgi142/jbosgi142-bundleX.bnd" />
+    <!-- jbosgi142 -->
+    <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi142-bundleA.jar" files="${tests.resources.dir}/jbosgi142/jbosgi142-bundleA.bnd" />
+    <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi142-bundleB.jar" files="${tests.resources.dir}/jbosgi142/jbosgi142-bundleB.bnd" />
+    <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi142-bundleX.jar" files="${tests.resources.dir}/jbosgi142/jbosgi142-bundleX.bnd" />
 
-		<!-- jbosgi143 -->
-		<bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi143-bundleA.jar" files="${tests.resources.dir}/jbosgi143/jbosgi143-bundleA.bnd" />
-		<bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi143-bundleX.jar" files="${tests.resources.dir}/jbosgi143/jbosgi143-bundleX.bnd" />
+    <!-- jbosgi143 -->
+    <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi143-bundleA.jar" files="${tests.resources.dir}/jbosgi143/jbosgi143-bundleA.bnd" />
+    <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi143-bundleX.jar" files="${tests.resources.dir}/jbosgi143/jbosgi143-bundleX.bnd" />
 
-		<!-- jbosgi151 -->
-		<bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi151-bundleA.jar" files="${tests.resources.dir}/jbosgi151/jbosgi151-bundleA.bnd" />
-		<bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi151-bundleB.jar" files="${tests.resources.dir}/jbosgi151/jbosgi151-bundleB.bnd" />
-		<bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi151-bundleC.jar" files="${tests.resources.dir}/jbosgi151/jbosgi151-bundleC.bnd" />
-		<bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi151-bundleD.jar" files="${tests.resources.dir}/jbosgi151/jbosgi151-bundleD.bnd" />
+    <!-- jbosgi151 -->
+    <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi151-bundleA.jar" files="${tests.resources.dir}/jbosgi151/jbosgi151-bundleA.bnd" />
+    <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi151-bundleB.jar" files="${tests.resources.dir}/jbosgi151/jbosgi151-bundleB.bnd" />
+    <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi151-bundleC.jar" files="${tests.resources.dir}/jbosgi151/jbosgi151-bundleC.bnd" />
+    <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi151-bundleD.jar" files="${tests.resources.dir}/jbosgi151/jbosgi151-bundleD.bnd" />
 
-		<!-- jbosgi161 -->
-		<bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi161-bundle.jar" files="${tests.resources.dir}/jbosgi161/jbosgi161-bundle.bnd" />
+    <!-- jbosgi161 -->
+    <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi161-bundle.jar" files="${tests.resources.dir}/jbosgi161/jbosgi161-bundle.bnd" />
 
-		<!-- jbosgi214 -->
-		<bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi214-bundle.jar" files="${tests.resources.dir}/jbosgi214/jbosgi214-bundle.bnd" />
+    <!-- jbosgi214 -->
+    <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi214-bundle.jar" files="${tests.resources.dir}/jbosgi214/jbosgi214-bundle.bnd" />
 
-		<!-- performance -->
-		<bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/performance-blueprint.jar" files="${tests.resources.dir}/performance/blueprint/performance-blueprint.bnd" />
+    <!-- performance -->
+    <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/performance-blueprint.jar" files="${tests.resources.dir}/performance/blueprint/performance-blueprint.bnd" />
 
-		<!-- startlevel -->
-		<bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/service/startlevel.jar" files="${tests.resources.dir}/service/startlevel/startlevel.bnd" />
+    <!-- startlevel -->
+    <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/service/startlevel.jar" files="${tests.resources.dir}/service/startlevel/startlevel.bnd" />
 
-		<!-- Please add alphabetically -->
+    <!-- Please add alphabetically -->
 
-	</target>
+  </target>
 
 </project>

Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/fragments/FragmentTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/fragments/FragmentTestCase.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/fragments/FragmentTestCase.java	2010-01-07 11:02:59 UTC (rev 99106)
@@ -0,0 +1,120 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.osgi.fragments;
+
+//$Id$
+
+import static org.junit.Assert.*;
+
+import org.jboss.osgi.testing.OSGiBundle;
+import org.jboss.osgi.testing.OSGiRuntime;
+import org.jboss.osgi.testing.OSGiTest;
+import org.junit.Test;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleException;
+
+/**
+ * Test Fragment functionality
+ * 
+ * @author thomas.diesler at jboss.com
+ * @since 07-Jan-2010
+ */
+public class FragmentTestCase extends OSGiTest
+{
+   @Test
+   public void testHostOnly() throws Exception
+   {
+      OSGiRuntime runtime = getDefaultRuntime();
+      try
+      {
+         OSGiBundle host = runtime.installBundle("fragments-simple-hostA.jar");
+         assertBundleState(Bundle.INSTALLED, host.getState());
+         
+         host.start();
+         assertBundleState(Bundle.ACTIVE, host.getState());
+         
+         host.uninstall();
+         assertBundleState(Bundle.UNINSTALLED, host.getState());
+      }
+      finally
+      {
+         runtime.shutdown();
+      }
+   }
+
+   @Test
+   public void testFragmentOnly() throws Exception
+   {
+      OSGiRuntime runtime = getDefaultRuntime();
+      try
+      {
+         OSGiBundle fragment = runtime.installBundle("fragments-simple-frgmA.jar");
+         assertBundleState(Bundle.INSTALLED, fragment.getState());
+         
+         try
+         {
+            fragment.start();
+            fail("Fragment bundles can not be started");
+         }
+         catch (BundleException e)
+         {
+            assertBundleState(Bundle.INSTALLED, fragment.getState());
+         }
+         
+         fragment.uninstall();
+         assertBundleState(Bundle.UNINSTALLED, fragment.getState());
+      }
+      finally
+      {
+         runtime.shutdown();
+      }
+   }
+
+   @Test
+   public void testAttachedFragment() throws Exception
+   {
+      OSGiRuntime runtime = getDefaultRuntime();
+      try
+      {
+         OSGiBundle host = runtime.installBundle("fragments-simple-hostA.jar");
+         assertBundleState(Bundle.INSTALLED, host.getState());
+         
+         OSGiBundle fragment = runtime.installBundle("fragments-simple-frgmA.jar");
+         assertBundleState(Bundle.INSTALLED, fragment.getState());
+         
+         host.start();
+         assertBundleState(Bundle.ACTIVE, host.getState());
+         assertBundleState(Bundle.RESOLVED, fragment.getState());
+         
+         host.uninstall();
+         assertBundleState(Bundle.UNINSTALLED, host.getState());
+         assertBundleState(Bundle.RESOLVED, fragment.getState());
+
+         fragment.uninstall();
+         assertBundleState(Bundle.UNINSTALLED, fragment.getState());
+      }
+      finally
+      {
+         runtime.shutdown();
+      }
+   }
+}
\ No newline at end of file


Property changes on: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/fragments/FragmentTestCase.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/fragments/frgmA/FragmentService.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/fragments/frgmA/FragmentService.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/fragments/frgmA/FragmentService.java	2010-01-07 11:02:59 UTC (rev 99106)
@@ -0,0 +1,29 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.osgi.fragments.frgmA;
+
+//$Id$
+
+
+public class FragmentService
+{
+}
\ No newline at end of file


Property changes on: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/fragments/frgmA/FragmentService.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/fragments/hostA/FragmentHostActivator.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/fragments/hostA/FragmentHostActivator.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/fragments/hostA/FragmentHostActivator.java	2010-01-07 11:02:59 UTC (rev 99106)
@@ -0,0 +1,38 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.osgi.fragments.hostA;
+
+//$Id$
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+public class FragmentHostActivator implements BundleActivator
+{
+   public void start(BundleContext context)
+   {
+   }
+
+   public void stop(BundleContext context)
+   {
+   }
+}
\ No newline at end of file


Property changes on: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/fragments/hostA/FragmentHostActivator.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/fragments/simple-frgmA.bnd
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/fragments/simple-frgmA.bnd	                        (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/fragments/simple-frgmA.bnd	2010-01-07 11:02:59 UTC (rev 99106)
@@ -0,0 +1,6 @@
+# bnd build -classpath target/test-classes -output target/test-libs/jbosgi108-bundleA.jar src/test/resources/jbosgi108/jbosgi108-bundleA.bnd
+
+Bundle-SymbolicName: simple-frgmA
+Fragment-Host: simple-hostA
+Export-Package: org.jboss.test.osgi.fragments.frgmA
+

Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/fragments/simple-hostA.bnd
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/fragments/simple-hostA.bnd	                        (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/fragments/simple-hostA.bnd	2010-01-07 11:02:59 UTC (rev 99106)
@@ -0,0 +1,6 @@
+# bnd build -classpath target/test-classes -output target/test-libs/jbosgi108-bundleA.jar src/test/resources/jbosgi108/jbosgi108-bundleA.bnd
+
+Bundle-SymbolicName: simple-hostA
+Bundle-Activator: org.jboss.test.osgi.fragments.hostA.FragmentHostActivator
+Private-Package: org.jboss.test.osgi.fragments.hostA
+




More information about the jboss-cvs-commits mailing list