use of org.osgi.service.cm.Configuration in project ddf by codice.
the class ConfigurationAdminTest method testGetBundleLocation.
/**
* Tests the {@link ConfigurationAdmin#getBundleLocation(String)} method
*
* @throws Exception
*/
@Test
public void testGetBundleLocation() throws Exception {
org.osgi.service.cm.ConfigurationAdmin testConfigAdmin = mock(org.osgi.service.cm.ConfigurationAdmin.class);
ConfigurationAdmin configAdmin = new ConfigurationAdmin(testConfigAdmin);
Configuration testConfig = mock(Configuration.class);
when(testConfig.getBundleLocation()).thenReturn(TEST_LOCATION);
when(testConfigAdmin.getConfiguration(TEST_PID, null)).thenReturn(testConfig);
assertEquals(TEST_LOCATION, configAdmin.getBundleLocation(TEST_PID));
verify(testConfig, atLeastOnce()).getBundleLocation();
}
use of org.osgi.service.cm.Configuration in project ddf by codice.
the class ConfigureTestCommons method configureFilterInvalidMetacards.
public static void configureFilterInvalidMetacards(String filterErrors, String filterWarnings, AdminConfig configAdmin) throws IOException {
Configuration config = configAdmin.getConfiguration(METACARD_VALIDATITY_FILTER_PLUGIN_SERVICE_PID, null);
Dictionary properties = new Hashtable<>();
properties.put("filterErrors", filterErrors);
properties.put("filterWarnings", filterWarnings);
config.update(properties);
}
use of org.osgi.service.cm.Configuration in project ddf by codice.
the class ConfigureTestCommons method configureEnforceValidityErrorsAndWarnings.
public static void configureEnforceValidityErrorsAndWarnings(String enforceErrors, String enforceWarnings, AdminConfig configAdmin) throws IOException {
Configuration config = configAdmin.getConfiguration(METACARD_VALIDATITY_MARKER_PLUGIN_SERVICE_PID, null);
Dictionary properties = new Hashtable<>();
properties.put("enforceErrors", enforceErrors);
properties.put("enforceWarnings", enforceWarnings);
config.update(properties);
}
use of org.osgi.service.cm.Configuration in project ddf by codice.
the class ConfigureTestCommons method configureEnforcedMetacardValidators.
public static void configureEnforcedMetacardValidators(List<String> enforcedValidators, AdminConfig configAdmin) throws IOException {
// Update metacardMarkerPlugin config with no enforcedMetacardValidators
Configuration config = configAdmin.getConfiguration(METACARD_VALIDATITY_MARKER_PLUGIN_SERVICE_PID, null);
Dictionary<String, Object> properties = new Hashtable<>();
properties.put("enforcedMetacardValidators", enforcedValidators);
config.update(properties);
}
use of org.osgi.service.cm.Configuration in project ddf by codice.
the class ConfigureTestCommons method configureMetacardValidityFilterPlugin.
public static void configureMetacardValidityFilterPlugin(List<String> securityAttributeMappings, AdminConfig configAdmin) throws IOException {
Configuration config = configAdmin.getConfiguration(METACARD_VALIDATITY_FILTER_PLUGIN_SERVICE_PID, null);
Dictionary properties = new Hashtable<>();
properties.put("attributeMap", securityAttributeMappings);
config.update(properties);
}
Aggregations