This is an automated email from the ASF dual-hosted git repository.
solomax pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/openmeetings.git
The following commit(s) were added to refs/heads/master by this push:
new 52a0e04 [OPENMEETINGS-1850] tests seems to be fixed
52a0e04 is described below
commit 52a0e04d14d2fb6d6ef9f77719d80ba5674aebc3
Author: Maxim Solodovnik <[email protected]>
AuthorDate: Thu Mar 15 17:28:50 2018 +0700
[OPENMEETINGS-1850] tests seems to be fixed
---
.../java/org/apache/openmeetings/db/util/ApplicationHelper.java | 9 ++++-----
1 file changed, 4 insertions(+), 5 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 0320712..3b0caf1 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
@@ -18,7 +18,6 @@
*/
package org.apache.openmeetings.db.util;
-import static
org.apache.openmeetings.util.OpenmeetingsVariables.DEFAULT_CONTEXT_NAME;
import static
org.apache.openmeetings.util.OpenmeetingsVariables.getWicketApplicationName;
import static
org.apache.openmeetings.util.OpenmeetingsVariables.isInitComplete;
import static
org.springframework.web.context.WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE;
@@ -61,12 +60,15 @@ public class ApplicationHelper {
// This is the case for non-web-app applications
(command line admin)
try {
app =
(WebApplication)OpenmeetingsVariables.getAppClass().newInstance();
+ app.setName("--dumb--"); //temporary name for
temporary application
ServletContext sc = new MockServletContext(app,
null);
XmlWebApplicationContext xmlContext = new
XmlWebApplicationContext();
xmlContext.setConfigLocation("classpath:applicationContext.xml");
xmlContext.setServletContext(sc);
xmlContext.refresh();
sc.setAttribute(ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE, xmlContext);
+ app = xmlContext.getBean(WebApplication.class);
+ app.setName(getWicketApplicationName());
app.setServletContext(sc);
} catch (InstantiationException |
IllegalAccessException | ClassNotFoundException e) {
log.error("Failed to create Application");
@@ -77,9 +79,6 @@ public class ApplicationHelper {
private static WebApplication initApp(WebApplication app) {
if (app != null) {
- if (app.getName() == null && getWicketApplicationName()
== null) {
- app.setName(DEFAULT_CONTEXT_NAME);
- }
try {
app.getServletContext();
} catch(IllegalStateException e) {
@@ -133,7 +132,7 @@ public class ApplicationHelper {
public static void destroyApplication() {
WebApplication app =
(WebApplication)Application.get(getWicketApplicationName());
WebApplicationContext ctx =
getWebApplicationContext(app.getServletContext());
- app.internalDestroy(); //need to be called to
+ app.internalDestroy(); //need to be called too
if (ctx != null) {
((XmlWebApplicationContext)ctx).destroy();
}
--
To stop receiving notification emails like this one, please contact
[email protected].