ConfigPackage extends JarFile implements Closeable { public Map<String, String> getProperties(String appName) { if (appName == null || !appProperties.containsKey(appName)) { return properties; } else { return appProperties.get(appName); } } ConfigPackage(File file); List<AppPackage.AppInfo> getApplications(); String tempDirectory(); @Override void close(); String getConfigPackageName(); String getAppPackageName(); String getAppPackageGroupId(); String getAppPackageMinVersion(); String getAppPackageMaxVersion(); String getConfigPackageDescription(); List<String> getClassPath(); List<String> getFiles(); Map<String, String> getProperties(String appName); static final String ATTRIBUTE_DT_CONF_PACKAGE_NAME; static final String ATTRIBUTE_DT_APP_PACKAGE_NAME; static final String ATTRIBUTE_DT_APP_PACKAGE_GROUP_ID; static final String ATTRIBUTE_DT_APP_PACKAGE_MIN_VERSION; static final String ATTRIBUTE_DT_APP_PACKAGE_MAX_VERSION; static final String ATTRIBUTE_DT_CONF_PACKAGE_DESCRIPTION; static final String ATTRIBUTE_CLASS_PATH; static final String ATTRIBUTE_FILES; }
@Test public void testGlobalProperties() { Map<String, String> properties = cp.getProperties(null); Assert.assertEquals("000", properties.get("aaa")); Assert.assertEquals("123", properties.get("foo")); Assert.assertEquals("456", properties.get("bar")); }
@Test public void testAppProperties() { Map<String, String> properties = cp.getProperties("app1"); Assert.assertEquals("111", properties.get("aaa")); Assert.assertEquals("789", properties.get("foo")); Assert.assertEquals("456", properties.get("bar")); Assert.assertEquals("888", properties.get("baz")); }