[openmeetings] 07/27: The build is green
This is an automated email from the ASF dual-hosted git repository. solomax pushed a commit to branch jakarta-spring-6 in repository https://gitbox.apache.org/repos/asf/openmeetings.git commit cdbf02c4dd2afccad7b1adaacd70e67dd6d40d66 Author: Maxim Solodovnik AuthorDate: Thu Apr 21 15:52:27 2022 +0700 The build is green --- .../openmeetings/db/util/ApplicationHelper.java| 6 ++- .../apache/openmeetings/backup/BackupImport.java | 48 +++--- .../service/scheduler/ReminderJob.java | 4 +- .../org/apache/openmeetings/backup/TestExport.java | 6 +-- .../mail/template/subject/TestSubjTemplate.java| 2 +- 5 files changed, 44 insertions(+), 22 deletions(-) diff --git a/openmeetings-db/src/main/java/org/apache/openmeetings/db/util/ApplicationHelper.java b/openmeetings-db/src/main/java/org/apache/openmeetings/db/util/ApplicationHelper.java index d63c6c20a..89f3bee09 100644 --- a/openmeetings-db/src/main/java/org/apache/openmeetings/db/util/ApplicationHelper.java +++ b/openmeetings-db/src/main/java/org/apache/openmeetings/db/util/ApplicationHelper.java @@ -123,7 +123,11 @@ public class ApplicationHelper { } catch(IllegalStateException e) { app.setServletContext(new MockServletContext(app, null)); } - app.setConfigurationType(RuntimeConfigurationType.DEPLOYMENT); + try { + app.setConfigurationType(RuntimeConfigurationType.DEPLOYMENT); + } catch (IllegalStateException e) { + // no-op, might be already set + } OMContextListener omcl = new OMContextListener(); omcl.contextInitialized(new ServletContextEvent(app.getServletContext())); ThreadContext.setApplication(app); diff --git a/openmeetings-install/src/main/java/org/apache/openmeetings/backup/BackupImport.java b/openmeetings-install/src/main/java/org/apache/openmeetings/backup/BackupImport.java index 6ec134772..0ac284644 100644 --- a/openmeetings-install/src/main/java/org/apache/openmeetings/backup/BackupImport.java +++ b/openmeetings-install/src/main/java/org/apache/openmeetings/backup/BackupImport.java @@ -523,7 +523,8 @@ public class BackupImport { messageFolderMap.put(TRASH_FOLDER_ID, TRASH_FOLDER_ID); } - static BackupVersion getVersion(File base) { + // public for testing + public static BackupVersion getVersion(File base) { List list = new ArrayList<>(1); readList(base, "version.xml", VERSION_LIST_NODE, VERSION_NODE, BackupVersion.class, list::add, true); return list.isEmpty() ? new BackupVersion() : list.get(0); @@ -532,7 +533,8 @@ public class BackupImport { /* * # Import Configs */ - void importConfigs(File base) throws Exception { + // public for testing + public void importConfigs(File base) throws Exception { final Map keyMap = new HashMap<>(); Arrays.stream(KeyEvent.class.getDeclaredFields()) .filter(fld -> fld.getName().startsWith("VK_")) @@ -595,7 +597,8 @@ public class BackupImport { /* * # Import Groups */ - void importGroups(File base) { + // public for testing + public void importGroups(File base) { log.info("Configs import complete, starting group import"); readList(base, "organizations.xml", GROUP_LIST_NODE, GROUP_NODE, Group.class, g -> { Long oldId = g.getId(); @@ -608,7 +611,8 @@ public class BackupImport { /* * # Import LDAP Configs */ - Long importLdap(File base) { + // public for testing + public Long importLdap(File base) { log.info("Groups import complete, starting LDAP config import"); Long[] defaultLdapId = {cfgDao.getLong(CONFIG_DEFAULT_LDAP_ID, null)}; readList(base, "ldapconfigs.xml", "ldapconfigs", "ldapconfig", LdapConfig.class, c -> { @@ -631,7 +635,8 @@ public class BackupImport { /* * # OAuth2 servers */ - void importOauth(File base) { + // public for testing + public void importOauth(File base) { log.info("Ldap config import complete, starting OAuth2 server import"); readList(base, "oauth2servers.xml", OAUTH_LIST_NODE, OAUTH_NODE, OAuthServer.class , s -> { @@ -676,7 +681,8 @@ public class BackupImport { /* * # Import Users */ - void importUsers(File base) throws Exception { + // public for testing + public void importUsers(File
[openmeetings] 07/27: The build is green
This is an automated email from the ASF dual-hosted git repository. solomax pushed a commit to branch jakarta-spring-6 in repository https://gitbox.apache.org/repos/asf/openmeetings.git commit 01d7fc33abf6361fd5d0b596a7c2ce16f0160d2c Author: Maxim Solodovnik AuthorDate: Thu Apr 21 15:52:27 2022 +0700 The build is green --- .../openmeetings/db/util/ApplicationHelper.java| 6 ++- .../apache/openmeetings/backup/BackupImport.java | 48 +++--- .../service/scheduler/ReminderJob.java | 4 +- .../org/apache/openmeetings/backup/TestExport.java | 6 +-- .../mail/template/subject/TestSubjTemplate.java| 2 +- 5 files changed, 44 insertions(+), 22 deletions(-) diff --git a/openmeetings-db/src/main/java/org/apache/openmeetings/db/util/ApplicationHelper.java b/openmeetings-db/src/main/java/org/apache/openmeetings/db/util/ApplicationHelper.java index d63c6c20a..89f3bee09 100644 --- a/openmeetings-db/src/main/java/org/apache/openmeetings/db/util/ApplicationHelper.java +++ b/openmeetings-db/src/main/java/org/apache/openmeetings/db/util/ApplicationHelper.java @@ -123,7 +123,11 @@ public class ApplicationHelper { } catch(IllegalStateException e) { app.setServletContext(new MockServletContext(app, null)); } - app.setConfigurationType(RuntimeConfigurationType.DEPLOYMENT); + try { + app.setConfigurationType(RuntimeConfigurationType.DEPLOYMENT); + } catch (IllegalStateException e) { + // no-op, might be already set + } OMContextListener omcl = new OMContextListener(); omcl.contextInitialized(new ServletContextEvent(app.getServletContext())); ThreadContext.setApplication(app); diff --git a/openmeetings-install/src/main/java/org/apache/openmeetings/backup/BackupImport.java b/openmeetings-install/src/main/java/org/apache/openmeetings/backup/BackupImport.java index 6ec134772..0ac284644 100644 --- a/openmeetings-install/src/main/java/org/apache/openmeetings/backup/BackupImport.java +++ b/openmeetings-install/src/main/java/org/apache/openmeetings/backup/BackupImport.java @@ -523,7 +523,8 @@ public class BackupImport { messageFolderMap.put(TRASH_FOLDER_ID, TRASH_FOLDER_ID); } - static BackupVersion getVersion(File base) { + // public for testing + public static BackupVersion getVersion(File base) { List list = new ArrayList<>(1); readList(base, "version.xml", VERSION_LIST_NODE, VERSION_NODE, BackupVersion.class, list::add, true); return list.isEmpty() ? new BackupVersion() : list.get(0); @@ -532,7 +533,8 @@ public class BackupImport { /* * # Import Configs */ - void importConfigs(File base) throws Exception { + // public for testing + public void importConfigs(File base) throws Exception { final Map keyMap = new HashMap<>(); Arrays.stream(KeyEvent.class.getDeclaredFields()) .filter(fld -> fld.getName().startsWith("VK_")) @@ -595,7 +597,8 @@ public class BackupImport { /* * # Import Groups */ - void importGroups(File base) { + // public for testing + public void importGroups(File base) { log.info("Configs import complete, starting group import"); readList(base, "organizations.xml", GROUP_LIST_NODE, GROUP_NODE, Group.class, g -> { Long oldId = g.getId(); @@ -608,7 +611,8 @@ public class BackupImport { /* * # Import LDAP Configs */ - Long importLdap(File base) { + // public for testing + public Long importLdap(File base) { log.info("Groups import complete, starting LDAP config import"); Long[] defaultLdapId = {cfgDao.getLong(CONFIG_DEFAULT_LDAP_ID, null)}; readList(base, "ldapconfigs.xml", "ldapconfigs", "ldapconfig", LdapConfig.class, c -> { @@ -631,7 +635,8 @@ public class BackupImport { /* * # OAuth2 servers */ - void importOauth(File base) { + // public for testing + public void importOauth(File base) { log.info("Ldap config import complete, starting OAuth2 server import"); readList(base, "oauth2servers.xml", OAUTH_LIST_NODE, OAUTH_NODE, OAuthServer.class , s -> { @@ -676,7 +681,8 @@ public class BackupImport { /* * # Import Users */ - void importUsers(File base) throws Exception { + // public for testing + public void importUsers(File