Elffuss BraidHub

kikocis/java-driver public

Add workaround for FELIX-5184 w/ Win2012

Felix does not properly alias 'windowsserver2012' 'win32', because of
this some native libraries may fail to load.  To work around this,
force the os.name property to win32 if on a windows platform.

See: https://issues.apache.org/jira/browse/FELIX-5184

Also use Apache Felix 4.4.1 instead of 4.6.0.

pax-exam < 4.5.0 has an issue with OSGi R6 frameworks on windows
caused by PAXEXAM-701 (https://ops4j1.jira.com/browse/PAXEXAM-701).

pax-exam 4.X+ cannot be used since it requires JDK7.
Changeset34d0d33aadac03bcd097887323d089fe0208b2bdcd1ed41a95b0b4510dcd1028
AuthorAndrew Tolbert <andrew.tolbert@datastax.com> · 2016-07-15 16:42 -05:00
CommitterAndrew Tolbert <andrew.tolbert@datastax.com> · 2016-07-19 13:23 -05:00
Parents52c6910bffed

Browse the files at this changeset

2 files changed

modified driver-tests/osgi/pom.xml +1 −1
@@ -31,7 +31,7 @@
3131
3232 <properties>
3333 <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
34- <felix.version>4.6.0</felix.version>
34+ <felix.version>4.4.1</felix.version>
3535 <!-- more recent version require JDK7+ -->
3636 <pax-exam.version>3.6.0</pax-exam.version>
3737 <url.version>2.4.0</url.version>
modified driver-tests/osgi/src/test/java/com/datastax/driver/osgi/BundleOptions.java +13 −1
@@ -18,12 +18,15 @@
1818 import com.datastax.driver.core.CCMBridge;
1919 import com.datastax.driver.core.ProtocolOptions;
2020 import com.datastax.driver.core.TestUtils;
21+import com.google.common.collect.Lists;
2122 import org.ops4j.pax.exam.Option;
2223 import org.ops4j.pax.exam.options.CompositeOption;
2324 import org.ops4j.pax.exam.options.MavenArtifactProvisionOption;
2425 import org.ops4j.pax.exam.options.UrlProvisionOption;
2526 import org.ops4j.pax.exam.util.PathUtils;
2627
28+import java.util.List;
29+
2730 import static com.datastax.driver.osgi.VersionProvider.projectVersion;
2831 import static org.ops4j.pax.exam.CoreOptions.*;
2932
@@ -115,7 +118,7 @@
115118
116119 @Override
117120 public Option[] getOptions() {
118- return options(
121+ List<Option> options = Lists.newArrayList(
119122 // Delegate javax.security.cert to the parent classloader. javax.security.cert.X509Certificate is used in
120123 // io.netty.util.internal.EmptyArrays, but not directly by the driver.
121124 bootDelegationPackage("javax.security.cert"),
@@ -130,6 +133,15 @@
130133 systemPackages("org.testng", "org.junit", "org.junit.runner", "org.junit.runner.manipulation",
131134 "org.junit.runner.notification", "com.jcabi.manifests")
132135 );
136+ if (CCMBridge.isWindows()) {
137+ // Workaround for Felix + Windows Server 2012. Felix does not properly alias 'windowsserver2012'
138+ // to 'win32', because of this some native libraries may fail to load. To work around this, force
139+ // the os.name property to win32 if on a windows platform.
140+ // See: https://issues.apache.org/jira/browse/FELIX-5184
141+ options.add(systemProperty("os.name").value("win32"));
142+ }
143+
144+ return options.toArray(new Option[options.size()]);
133145 }
134146 };
135147 }