Author: thomas.diesler(a)jboss.com
Date: 2010-03-24 12:46:18 -0400 (Wed, 24 Mar 2010)
New Revision: 102909
Modified:
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/service/ServiceMixTestCase.java
projects/jboss-osgi/projects/runtime/framework/trunk/vfs21/.settings/org.eclipse.jdt.core.prefs
projects/jboss-osgi/projects/runtime/framework/trunk/vfs21/src/main/java/org/jboss/osgi/framework/classloading/OSGiBundleClassLoader.java
projects/jboss-osgi/projects/runtime/framework/trunk/vfs21/src/main/java/org/jboss/osgi/framework/classloading/OSGiClassLoaderPolicy.java
projects/jboss-osgi/projects/runtime/framework/trunk/vfs30/src/main/java/org/jboss/osgi/framework/classloading/OSGiBundleClassLoader.java
projects/jboss-osgi/projects/runtime/framework/trunk/vfs30/src/main/java/org/jboss/osgi/framework/classloading/OSGiClassLoaderDomain.java
projects/jboss-osgi/projects/runtime/framework/trunk/vfs30/src/main/java/org/jboss/osgi/framework/classloading/OSGiClassLoaderPolicy.java
Log:
[JBOSGI-246] TCK - Framework util
Modified:
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/service/ServiceMixTestCase.java
===================================================================
---
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/service/ServiceMixTestCase.java 2010-03-24
16:32:05 UTC (rev 102908)
+++
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/service/ServiceMixTestCase.java 2010-03-24
16:46:18 UTC (rev 102909)
@@ -60,9 +60,10 @@
* @author <a href="mailto:ales.justin@jboss.org">Ales Justin</a>
* @author thomas.diesler(a)jboss.com
*/
+@Ignore
public class ServiceMixTestCase extends AbstractServiceMixTest
{
- @Ignore
+ @Test
public void testGetServiceReferenceFromMC() throws Throwable
{
Deployment bean = deployBeans("beanA", A.class);
@@ -353,7 +354,7 @@
}
}
- @Ignore
+ @Test
@SuppressWarnings("rawtypes")
public void testServiceFactoryMix() throws Throwable
{
@@ -431,7 +432,7 @@
}
}
- @Ignore
+ @Test
public void testFiltering() throws Throwable
{
Deployment bean = deployBeans("beanA", A.class);
@@ -495,7 +496,7 @@
}
}
- @Ignore
+ @Test
public void testBeansMix() throws Throwable
{
VirtualFile assembly = assembleArchive("beans1",
"/bundles/service/service-beans1", A.class);
Modified:
projects/jboss-osgi/projects/runtime/framework/trunk/vfs21/.settings/org.eclipse.jdt.core.prefs
===================================================================
---
projects/jboss-osgi/projects/runtime/framework/trunk/vfs21/.settings/org.eclipse.jdt.core.prefs 2010-03-24
16:32:05 UTC (rev 102908)
+++
projects/jboss-osgi/projects/runtime/framework/trunk/vfs21/.settings/org.eclipse.jdt.core.prefs 2010-03-24
16:46:18 UTC (rev 102909)
@@ -1,4 +1,4 @@
-#Thu Mar 04 08:40:26 CET 2010
+#Wed Mar 24 17:43:19 CET 2010
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
Modified:
projects/jboss-osgi/projects/runtime/framework/trunk/vfs21/src/main/java/org/jboss/osgi/framework/classloading/OSGiBundleClassLoader.java
===================================================================
---
projects/jboss-osgi/projects/runtime/framework/trunk/vfs21/src/main/java/org/jboss/osgi/framework/classloading/OSGiBundleClassLoader.java 2010-03-24
16:32:05 UTC (rev 102908)
+++
projects/jboss-osgi/projects/runtime/framework/trunk/vfs21/src/main/java/org/jboss/osgi/framework/classloading/OSGiBundleClassLoader.java 2010-03-24
16:46:18 UTC (rev 102909)
@@ -25,6 +25,8 @@
import org.jboss.classloader.spi.ClassLoaderPolicy;
import org.jboss.classloader.spi.base.BaseClassLoader;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleReference;
/**
* An OSGi bundle class loader.
@@ -32,16 +34,23 @@
* @author thomas.diesler(a)jboss.com
* @since 19-Dec-2009
*/
-public class OSGiBundleClassLoader extends BaseClassLoader
+public class OSGiBundleClassLoader extends BaseClassLoader implements BundleReference
{
- @SuppressWarnings("unused")
private OSGiClassLoaderPolicy osgiPolicy;
public OSGiBundleClassLoader(ClassLoaderPolicy policy)
{
super(policy);
- if (policy instanceof OSGiClassLoaderPolicy)
- osgiPolicy = (OSGiClassLoaderPolicy)policy;
+ if (policy instanceof OSGiClassLoaderPolicy == false)
+ throw new IllegalArgumentException("Invalid policy: " + policy);
+
+ osgiPolicy = (OSGiClassLoaderPolicy)policy;
}
+
+ @Override
+ public Bundle getBundle()
+ {
+ return osgiPolicy.getBundle();
+ }
}
Modified:
projects/jboss-osgi/projects/runtime/framework/trunk/vfs21/src/main/java/org/jboss/osgi/framework/classloading/OSGiClassLoaderPolicy.java
===================================================================
---
projects/jboss-osgi/projects/runtime/framework/trunk/vfs21/src/main/java/org/jboss/osgi/framework/classloading/OSGiClassLoaderPolicy.java 2010-03-24
16:32:05 UTC (rev 102908)
+++
projects/jboss-osgi/projects/runtime/framework/trunk/vfs21/src/main/java/org/jboss/osgi/framework/classloading/OSGiClassLoaderPolicy.java 2010-03-24
16:46:18 UTC (rev 102909)
@@ -48,6 +48,8 @@
import org.jboss.osgi.vfs.AbstractVFS;
import org.jboss.virtual.VFSUtils;
import org.jboss.virtual.VirtualFile;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleReference;
/**
* The ClassLoaderPolicy for OSGi bundles.
@@ -55,7 +57,7 @@
* @author thomas.diesler(a)jboss.com
* @since 11-Sep-2009
*/
-public class OSGiClassLoaderPolicy extends VFSClassLoaderPolicy
+public class OSGiClassLoaderPolicy extends VFSClassLoaderPolicy implements
BundleReference
{
/** The associated bundle state */
private AbstractBundleState bundleState;
@@ -95,6 +97,11 @@
}
}
+ @Override
+ public Bundle getBundle()
+ {
+ return bundleState.getBundle();
+ }
@Override
public String getName()
Modified:
projects/jboss-osgi/projects/runtime/framework/trunk/vfs30/src/main/java/org/jboss/osgi/framework/classloading/OSGiBundleClassLoader.java
===================================================================
---
projects/jboss-osgi/projects/runtime/framework/trunk/vfs30/src/main/java/org/jboss/osgi/framework/classloading/OSGiBundleClassLoader.java 2010-03-24
16:32:05 UTC (rev 102908)
+++
projects/jboss-osgi/projects/runtime/framework/trunk/vfs30/src/main/java/org/jboss/osgi/framework/classloading/OSGiBundleClassLoader.java 2010-03-24
16:46:18 UTC (rev 102909)
@@ -25,6 +25,8 @@
import org.jboss.classloader.spi.ClassLoaderPolicy;
import org.jboss.classloader.spi.base.BaseClassLoader;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleReference;
/**
* An OSGi bundle class loader.
@@ -32,16 +34,23 @@
* @author thomas.diesler(a)jboss.com
* @since 19-Dec-2009
*/
-public class OSGiBundleClassLoader extends BaseClassLoader
+public class OSGiBundleClassLoader extends BaseClassLoader implements BundleReference
{
- @SuppressWarnings("unused")
private OSGiClassLoaderPolicy osgiPolicy;
public OSGiBundleClassLoader(ClassLoaderPolicy policy)
{
super(policy);
- if (policy instanceof OSGiClassLoaderPolicy)
- osgiPolicy = (OSGiClassLoaderPolicy)policy;
+ if (policy instanceof OSGiClassLoaderPolicy == false)
+ throw new IllegalArgumentException("Invalid policy: " + policy);
+
+ osgiPolicy = (OSGiClassLoaderPolicy)policy;
}
+
+ @Override
+ public Bundle getBundle()
+ {
+ return osgiPolicy.getBundle();
+ }
}
Modified:
projects/jboss-osgi/projects/runtime/framework/trunk/vfs30/src/main/java/org/jboss/osgi/framework/classloading/OSGiClassLoaderDomain.java
===================================================================
---
projects/jboss-osgi/projects/runtime/framework/trunk/vfs30/src/main/java/org/jboss/osgi/framework/classloading/OSGiClassLoaderDomain.java 2010-03-24
16:32:05 UTC (rev 102908)
+++
projects/jboss-osgi/projects/runtime/framework/trunk/vfs30/src/main/java/org/jboss/osgi/framework/classloading/OSGiClassLoaderDomain.java 2010-03-24
16:46:18 UTC (rev 102909)
@@ -39,8 +39,8 @@
import org.jboss.classloader.spi.filter.ClassFilterUtils;
import org.jboss.classloader.spi.filter.PackageClassFilter;
import org.jboss.classloader.spi.filter.RecursivePackageClassFilter;
-import org.jboss.classloading.spi.vfs.policy.VFSClassLoaderPolicy;
import org.jboss.osgi.framework.bundle.OSGiBundleManager;
+import org.jboss.osgi.framework.bundle.OSGiSystemState;
import org.jboss.osgi.framework.plugins.SystemPackagesPlugin;
import org.jboss.vfs.VFS;
import org.jboss.vfs.VirtualFile;
@@ -124,7 +124,8 @@
}
// Create and register the ClassLoaderPolicy
- ClassLoaderPolicy systemPolicy = new
VFSClassLoaderPolicy("OSGiSystemPolicy", roots);
+ OSGiSystemState systemBundle = bundleManager.getSystemBundle();
+ ClassLoaderPolicy systemPolicy = new OSGiClassLoaderPolicy(systemBundle, roots);
classLoaderSystem.registerClassLoaderPolicy(getName(), systemPolicy);
}
Modified:
projects/jboss-osgi/projects/runtime/framework/trunk/vfs30/src/main/java/org/jboss/osgi/framework/classloading/OSGiClassLoaderPolicy.java
===================================================================
---
projects/jboss-osgi/projects/runtime/framework/trunk/vfs30/src/main/java/org/jboss/osgi/framework/classloading/OSGiClassLoaderPolicy.java 2010-03-24
16:32:05 UTC (rev 102908)
+++
projects/jboss-osgi/projects/runtime/framework/trunk/vfs30/src/main/java/org/jboss/osgi/framework/classloading/OSGiClassLoaderPolicy.java 2010-03-24
16:46:18 UTC (rev 102909)
@@ -48,6 +48,8 @@
import org.jboss.osgi.vfs.AbstractVFS;
import org.jboss.vfs.VFSUtils;
import org.jboss.vfs.VirtualFile;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleReference;
/**
* The ClassLoaderPolicy for OSGi bundles.
@@ -55,7 +57,7 @@
* @author thomas.diesler(a)jboss.com
* @since 11-Sep-2009
*/
-public class OSGiClassLoaderPolicy extends VFSClassLoaderPolicy
+public class OSGiClassLoaderPolicy extends VFSClassLoaderPolicy implements
BundleReference
{
/** The associated bundle state */
private AbstractBundleState bundleState;
@@ -95,6 +97,11 @@
}
}
+ @Override
+ public Bundle getBundle()
+ {
+ return bundleState.getBundle();
+ }
@Override
public String getName()