ConfigurationUtils { @Deprecated public static String[] retrieveBuildInfo(InputStream inputStream) throws IOException { String name = null; String version = null; try { ConfigurationValidator configDefails = new ConfigurationValidator(inputStream); name = configDefails.getName(); version = configDefails.getVersion(); } catch (ConfigurationException e) { } return new String[] { name, version }; }  static boolean isConfigurationStubbed(ClassLoader classLoader); static String getStubbedConfiguration(Configuration configuration, String originalConfig); static String getActivatedConfiguration(Configuration configuration, String originalConfig); static String getCanonicalizedConfiguration(Configuration configuration, String originalConfig); static String transformConfiguration(Configuration configuration, String originalConfig, String xslt, Map<String, Object> parameters); static String getConfigurationFile(ClassLoader classLoader, String currentConfigurationName); static String getConfigurationVersion(ClassLoader classLoader); static String getApplicationVersion(); static Map<String, Object> getConfigFromDatabase(IbisContext ibisContext, String name); static Map<String, Object> getConfigFromDatabase(IbisContext ibisContext, String name, String jmsRealm); static Map<String, Object> getConfigFromDatabase(IbisContext ibisContext, String name, String jmsRealm, String version); static boolean addConfigToDatabase(IbisContext ibisContext, String datasource, boolean activate_config, boolean automatic_reload, String fileName, InputStream file, String ruser); static String processMultiConfigZipFile(IbisContext ibisContext, String datasource, boolean activate_config, boolean automatic_reload, InputStream file, String ruser); static boolean addConfigToDatabase(IbisContext ibisContext, String datasource, boolean activate_config, boolean automatic_reload, String name, String version, String fileName, InputStream file, String ruser); static void removeConfigFromDatabase(IbisContext ibisContext, String name, String jmsRealm, String version); static boolean activateConfig(IbisContext ibisContext, String name, String version, boolean value, String jmsRealm); static boolean autoReloadConfig(IbisContext ibisContext, String name, String version, boolean booleanValue, String jmsRealm); static Map<String, String> retrieveAllConfigNames(IbisContext ibisContext); static List<String> retrieveConfigNamesFromDatabase(IbisContext ibisContext, String jmsRealm); static List<String> retrieveConfigNamesFromDatabase(IbisContext ibisContext, String jmsRealm, boolean onlyAutoReload); @Deprecated static String[] retrieveBuildInfo(InputStream inputStream); static String ADDITIONAL_PROPERTIES_FILE_SUFFIX; static final String DEFAULT_CONFIGURATION_FILE; }
@Test public void retrieveBuildInfo() throws IOException { URL zip = ConfigurationUtilsTest.class.getResource("/ConfigurationUtils/buildInfoZip.jar"); assertNotNull("BuildInfoZip not found", zip); ConfigurationUtils.ADDITIONAL_PROPERTIES_FILE_SUFFIX = ""; String[] buildInfo = ConfigurationUtils.retrieveBuildInfo(zip.openStream()); String buildInfoName = buildInfo[0]; assertEquals("buildInfo name does not match", "ConfigurationName", buildInfoName); String buildInfoVersion = buildInfo[1]; assertEquals("buildInfo version does not match", "001_20191002-1300", buildInfoVersion); }
@Test public void retrieveBuildInfoSC() throws IOException { URL zip = ConfigurationUtilsTest.class.getResource("/ConfigurationUtils/buildInfoZip.jar"); assertNotNull("BuildInfoZip not found", zip); ConfigurationUtils.ADDITIONAL_PROPERTIES_FILE_SUFFIX = "_SC"; String[] buildInfo = ConfigurationUtils.retrieveBuildInfo(zip.openStream()); String buildInfoName = buildInfo[0]; assertEquals("buildInfo name does not match", "ConfigurationName", buildInfoName); String buildInfoVersion = buildInfo[1]; assertEquals("buildInfo version does not match", "123_20181002-1300", buildInfoVersion); }
@Test public void retrieveBuildInfoCUSTOM() throws IOException { URL zip = ConfigurationUtilsTest.class.getResource("/ConfigurationUtils/buildInfoZip.jar"); assertNotNull("BuildInfoZip not found", zip); ConfigurationUtils.ADDITIONAL_PROPERTIES_FILE_SUFFIX = "_SPECIAL"; String[] buildInfo = ConfigurationUtils.retrieveBuildInfo(zip.openStream()); String buildInfoName = buildInfo[0]; assertEquals("buildInfo name does not match", "ConfigurationName", buildInfoName); String buildInfoVersion = buildInfo[1]; assertEquals("buildInfo version does not match", "789_20171002-1300", buildInfoVersion); }