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 48e5a9b  [OPENMEETINGS-1928] tests should be fixed
48e5a9b is described below

commit 48e5a9b0a37707183004567954d731273fa65178
Author: Maxim Solodovnik <[email protected]>
AuthorDate: Mon Sep 17 12:40:04 2018 +0700

    [OPENMEETINGS-1928] tests should be fixed
---
 openmeetings-db/pom.xml                                     |  5 +++++
 .../org/apache/openmeetings/db/util/ApplicationHelper.java  | 13 +++++++++++--
 pom.xml                                                     |  8 +++++++-
 3 files changed, 23 insertions(+), 3 deletions(-)

diff --git a/openmeetings-db/pom.xml b/openmeetings-db/pom.xml
index e67f196..3852612 100644
--- a/openmeetings-db/pom.xml
+++ b/openmeetings-db/pom.xml
@@ -67,6 +67,11 @@
                        <version>${spring.version}</version>
                </dependency>
                <dependency>
+                       <groupId>org.springframework</groupId>
+                       <artifactId>spring-test</artifactId>
+                       <version>${spring.version}</version>
+               </dependency>
+               <dependency>
                        <groupId>org.simpleframework</groupId>
                        <artifactId>simple-xml</artifactId>
                </dependency>
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 3b0caf1..0743e54 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
@@ -25,6 +25,7 @@ import static 
org.springframework.web.context.support.WebApplicationContextUtils
 
 import javax.servlet.ServletContext;
 import javax.servlet.ServletContextEvent;
+import javax.servlet.SessionCookieConfig;
 
 import org.apache.openmeetings.IApplication;
 import org.apache.openmeetings.IWebSession;
@@ -45,6 +46,7 @@ import org.apache.wicket.request.cycle.RequestCycle;
 import org.apache.wicket.request.cycle.RequestCycleContext;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import org.springframework.mock.web.MockSessionCookieConfig;
 import org.springframework.web.context.WebApplicationContext;
 import org.springframework.web.context.support.XmlWebApplicationContext;
 
@@ -82,7 +84,14 @@ public class ApplicationHelper {
                        try {
                                app.getServletContext();
                        } catch(IllegalStateException e) {
-                               app.setServletContext(new 
MockServletContext(app, null));
+                               app.setServletContext(new 
MockServletContext(app, null) {
+                                       @Override
+                                       public SessionCookieConfig 
getSessionCookieConfig() {
+                                               SessionCookieConfig cfg = new 
MockSessionCookieConfig();
+                                               
cfg.setName("_ensureApplication");
+                                               return cfg;
+                                       }
+                               });
                        }
                        
app.setConfigurationType(RuntimeConfigurationType.DEPLOYMENT);
                        OMContextListener omcl = new OMContextListener();
@@ -134,7 +143,7 @@ public class ApplicationHelper {
                WebApplicationContext ctx = 
getWebApplicationContext(app.getServletContext());
                app.internalDestroy(); //need to be called too
                if (ctx != null) {
-                       ((XmlWebApplicationContext)ctx).destroy();
+                       ((XmlWebApplicationContext)ctx).close();
                }
                ThreadContext.setApplication(null);
                ThreadContext.setRequestCycle(null);
diff --git a/pom.xml b/pom.xml
index a465dcd..32d4305 100644
--- a/pom.xml
+++ b/pom.xml
@@ -732,7 +732,7 @@
                                                <artifactId>*</artifactId>
                                        </exclusion>
                                        <exclusion>
-                                               <groupId>asm</groupId>
+                                               <groupId>org.ow2.asm</groupId>
                                                <artifactId>asm</artifactId>
                                        </exclusion>
                                </exclusions>
@@ -850,6 +850,12 @@
                                <groupId>org.apache.tika</groupId>
                                <artifactId>tika-parsers</artifactId>
                                <version>${tika-parsers.version}</version>
+                               <exclusions>
+                                       <exclusion>
+                                               <groupId>org.ow2.asm</groupId>
+                                               <artifactId>asm</artifactId>
+                                       </exclusion>
+                               </exclusions>
                        </dependency>
                </dependencies>
        </dependencyManagement>

Reply via email to