Author: bdelacretaz
Date: Fri Mar 7 14:20:29 2014
New Revision: 1575265
URL: http://svn.apache.org/r1575265
Log:
SLING-3442 - new optional startLevel parameter for
WebConsoleClient.installBundle
Modified:
sling/trunk/testing/tools/src/main/java/org/apache/sling/testing/tools/osgi/WebconsoleClient.java
Modified:
sling/trunk/testing/tools/src/main/java/org/apache/sling/testing/tools/osgi/WebconsoleClient.java
URL:
http://svn.apache.org/viewvc/sling/trunk/testing/tools/src/main/java/org/apache/sling/testing/tools/osgi/WebconsoleClient.java?rev=1575265&r1=1575264&r2=1575265&view=diff
==============================================================================
---
sling/trunk/testing/tools/src/main/java/org/apache/sling/testing/tools/osgi/WebconsoleClient.java
(original)
+++
sling/trunk/testing/tools/src/main/java/org/apache/sling/testing/tools/osgi/WebconsoleClient.java
Fri Mar 7 14:20:29 2014
@@ -51,9 +51,13 @@ public class WebconsoleClient {
this.password = password;
}
- /** Install a bundle using the Felix webconsole HTTP interface */
+ /** Install a bundle using the Felix webconsole HTTP interface, with a
specific start level */
public void installBundle(File f, boolean startBundle) throws Exception {
- log.info("Installing bundle {}", f.getName());
+ installBundle(f, startBundle, 0);
+ }
+
+ /** Install a bundle using the Felix webconsole HTTP interface, with a
specific start level */
+ public void installBundle(File f, boolean startBundle, int startLevel)
throws Exception {
// Setup request for Felix Webconsole bundle install
final MultipartEntity entity = new MultipartEntity();
@@ -63,6 +67,13 @@ public class WebconsoleClient {
}
entity.addPart("bundlefile", new FileBody(f));
+ if(startLevel > 0) {
+ entity.addPart("bundlestartlevel", new
StringBody(String.valueOf(startLevel)));
+ log.info("Installing bundle {} at start level {}", f.getName(),
startLevel);
+ } else {
+ log.info("Installing bundle {} at default start level",
f.getName());
+ }
+
// Console returns a 302 on success (and in a POST this
// is not handled automatically as per HTTP spec)
executor.execute(