Skip to content

Commit

Permalink
Add KarafDistributionOption.systemBundle
Browse files Browse the repository at this point in the history
  • Loading branch information
Flamenco committed Dec 8, 2016
1 parent 2f9d58d commit 108c17b
Show file tree
Hide file tree
Showing 4 changed files with 197 additions and 49 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,8 @@
import org.apache.commons.io.FileUtils;
import org.ops4j.pax.exam.ExamSystem;
import org.ops4j.pax.exam.karaf.options.KarafFeaturesOption;
import org.ops4j.pax.exam.options.BootClasspathLibraryOption;
import org.ops4j.pax.exam.options.ProvisionOption;
import org.ops4j.pax.exam.options.UrlReference;
import org.ops4j.pax.exam.karaf.options.SystemBundleOption;
import org.ops4j.pax.exam.options.*;

/**
* Deploys exam and the user specified dependencies and creates the
Expand Down Expand Up @@ -69,7 +68,25 @@ public void copyBootClasspathLibraries() throws IOException {
karafHome + "/lib"), new String[] { "jar" }));
}
}


/**
*
* Copies SystemBundleOption entries into the Karaf system folder using the Maven repository folder convention.
*
* @throws IOException if copy fails
*/
public void copySystemLibraries() throws IOException {
SystemBundleOption[] systemBundleOptions = subsystem
.getOptions(SystemBundleOption.class);
for (SystemBundleOption systemBundleOption : systemBundleOptions) {
UrlReference libraryUrl = systemBundleOption.getLibraryUrl();
String destPath = karafHome + "/system" + systemBundleOption.getRepositoryPath();
FileUtils.copyURLToFile(
new URL(libraryUrl.getURL()),
new File(destPath));
}
}

/**
* Copy dependencies specified as ProvisionOption in system to the deploy folder
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ public synchronized TestContainer start() {
DependenciesDeployer deployer = new DependenciesDeployer(subsystem, karafBase,
karafHome);
deployer.copyBootClasspathLibraries();
deployer.copySystemLibraries();

updateLogProperties(karafHome, subsystem);
setupSystemProperties(karafHome, subsystem);
Expand Down
Loading

0 comments on commit 108c17b

Please sign in to comment.