[jboss-cvs] JBossAS SVN: r97740 - in projects/jboss-osgi: projects/spi/trunk/.settings and 2 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Fri Dec 11 10:54:47 EST 2009
Author: thomas.diesler at jboss.com
Date: 2009-12-11 10:54:47 -0500 (Fri, 11 Dec 2009)
New Revision: 97740
Modified:
projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/internal/RemoteBundle.java
projects/jboss-osgi/projects/spi/trunk/.settings/org.eclipse.jdt.core.prefs
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/management/ManagedBundle.java
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/management/ManagedBundleMBean.java
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/simple/SimpleTestCase.java
Log:
Fix remote uninstall
Add ManagedBundle.getLocation()
Modified: projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/internal/RemoteBundle.java
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/internal/RemoteBundle.java 2009-12-11 15:44:59 UTC (rev 97739)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/internal/RemoteBundle.java 2009-12-11 15:54:47 UTC (rev 97740)
@@ -23,6 +23,7 @@
// $Id$
+import java.net.URL;
import java.util.Dictionary;
import org.jboss.osgi.spi.management.ManagedBundleMBean;
@@ -48,7 +49,6 @@
private final Logger log = LoggerFactory.getLogger(RemoteBundle.class);
private ManagedBundleMBean bundle;
- private BundleInfo bundleInfo;
private String location;
private long bundleId;
@@ -56,11 +56,10 @@
private Dictionary<String, String> headers;
private Version version;
- public RemoteBundle(OSGiRuntimeImpl runtime, ManagedBundleMBean bundle, BundleInfo bundleInfo)
+ public RemoteBundle(OSGiRuntimeImpl runtime, ManagedBundleMBean bundle, BundleInfo info)
{
this(runtime, bundle);
- this.bundleInfo = bundleInfo;
- this.location = bundleInfo.getLocation();
+ this.location = info.getLocation();
}
public RemoteBundle(OSGiRuntimeImpl runtime, ManagedBundleMBean bundle)
@@ -73,6 +72,7 @@
bundleId = bundle.getBundleId();
symbolicName = bundle.getSymbolicName();
+ location = bundle.getLocation();
headers = bundle.getHeaders();
String versionStr = headers.get(Constants.BUNDLE_VERSION);
@@ -144,7 +144,7 @@
try
{
OSGiRuntimeImpl runtimeImpl = (OSGiRuntimeImpl)getRuntime();
- runtimeImpl.undeploy(bundleInfo.getRootURL());
+ runtimeImpl.undeploy(new URL(location));
runtimeImpl.unregisterBundle(this);
setUninstalled(true);
}
Modified: projects/jboss-osgi/projects/spi/trunk/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/.settings/org.eclipse.jdt.core.prefs 2009-12-11 15:44:59 UTC (rev 97739)
+++ projects/jboss-osgi/projects/spi/trunk/.settings/org.eclipse.jdt.core.prefs 2009-12-11 15:54:47 UTC (rev 97740)
@@ -1,12 +1,6 @@
-#Tue Feb 17 14:10:42 CET 2009
+#Fri Dec 11 16:24:04 CET 2009
eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.source=1.5
Modified: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/management/ManagedBundle.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/management/ManagedBundle.java 2009-12-11 15:44:59 UTC (rev 97739)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/management/ManagedBundle.java 2009-12-11 15:54:47 UTC (rev 97740)
@@ -95,6 +95,11 @@
return bundle.getSymbolicName();
}
+ public String getLocation()
+ {
+ return bundle.getLocation();
+ }
+
@SuppressWarnings("rawtypes")
public Dictionary<String, String> getHeaders()
{
Modified: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/management/ManagedBundleMBean.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/management/ManagedBundleMBean.java 2009-12-11 15:44:59 UTC (rev 97739)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/management/ManagedBundleMBean.java 2009-12-11 15:54:47 UTC (rev 97740)
@@ -64,6 +64,11 @@
String getSymbolicName();
/**
+ * Returns the location of this bundle
+ */
+ String getLocation();
+
+ /**
* Returns the bundle manifest headers
*/
Dictionary<String, String> getHeaders();
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/simple/SimpleTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/simple/SimpleTestCase.java 2009-12-11 15:44:59 UTC (rev 97739)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/simple/SimpleTestCase.java 2009-12-11 15:54:47 UTC (rev 97740)
@@ -42,11 +42,11 @@
{
// Get the default runtime
OSGiRuntime runtime = getDefaultRuntime();
-
try
{
// Install the bundle
OSGiBundle bundle = runtime.installBundle("example-simple.jar");
+ assertBundleState(Bundle.INSTALLED, bundle.getState());
// Start the bundle
bundle.start();
@@ -54,6 +54,7 @@
// Uninstall the bundle
bundle.uninstall();
+ assertBundleState(Bundle.UNINSTALLED, bundle.getState());
}
finally
{
More information about the jboss-cvs-commits
mailing list