使用 MobileFirst 平台 6.3。
当我尝试使用 junit 从 worklight.properties 获取 worklight 项目中服务器文件夹的配置路径时,返回的值为 null。
我正在使用以下代码来获取路径。
WorklightConfiguration.getInstance().getString("mbaas.configRootDir");
编辑:这就是我想要做的。我在 junit 中运行这段代码,它应该返回true
.
public class Test2 {
@Test
public void test() {
//customProperty=123
String str=getWorklightProperty("customProperty");
assertEquals("123", str);
}
public String getWorklightProperty(String propertyName) {
return WorklightConfiguration.getInstance().getString(propertyName);
}
}