fixed testcase

This commit is contained in:
高铁
2016-03-11 11:50:02 +08:00
parent fa102ee0a3
commit a71eb0b6cf
@@ -15,10 +15,17 @@ public class DruidDataSourceConverterTest extends TestCase {
private DruidDataSource dataSource;
protected void setUp() throws Exception {
String osName = System.getProperty("os.name");
String root = DruidDataSourceConverterTest.class
.getResource("/com/alibaba/druid/pool/simplejndi/").toString();
if (root.startsWith("file:/"))
if (root.startsWith("file:/")) {
root = root.substring("file://".length() - 1);
}
if (osName.toLowerCase().indexOf("win") == -1) {
root = "/" + root;
}
Properties props = new Properties();
props.put("org.osjava.sj.root", root);
props.put("java.naming.factory.initial",