struts-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lukaszlen...@apache.org
Subject struts git commit: Tries to fix build on Travis
Date Tue, 12 Apr 2016 16:18:12 GMT
Repository: struts
Updated Branches:
  refs/heads/master 28beda74e -> cb5e19723


Tries to fix build on Travis


Project: http://git-wip-us.apache.org/repos/asf/struts/repo
Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/cb5e1972
Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/cb5e1972
Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/cb5e1972

Branch: refs/heads/master
Commit: cb5e197237fd851a4aaffc1c9d05f9d52126c325
Parents: 28beda7
Author: Lukasz Lenart <lukaszlenart@apache.org>
Authored: Tue Apr 12 18:17:52 2016 +0200
Committer: Lukasz Lenart <lukaszlenart@apache.org>
Committed: Tue Apr 12 18:17:52 2016 +0200

----------------------------------------------------------------------
 .../struts2/portlet/test/BasePortletTest.java   | 20 +++++++++++++++++---
 1 file changed, 17 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/struts/blob/cb5e1972/apps/portlet/src/test/java/org/apache/struts2/portlet/test/BasePortletTest.java
----------------------------------------------------------------------
diff --git a/apps/portlet/src/test/java/org/apache/struts2/portlet/test/BasePortletTest.java
b/apps/portlet/src/test/java/org/apache/struts2/portlet/test/BasePortletTest.java
index 4f63080..c46f2ed 100644
--- a/apps/portlet/src/test/java/org/apache/struts2/portlet/test/BasePortletTest.java
+++ b/apps/portlet/src/test/java/org/apache/struts2/portlet/test/BasePortletTest.java
@@ -9,6 +9,8 @@ import org.mortbay.jetty.webapp.WebAppContext;
 import junit.framework.TestCase;
 
 import java.io.File;
+import java.net.URL;
+import java.net.URLClassLoader;
 
 public abstract class BasePortletTest extends TestCase {
 	
@@ -20,17 +22,29 @@ public abstract class BasePortletTest extends TestCase {
 	
 	public void setUp() throws Exception {
 		System.setProperty("org.apache.pluto.embedded.portletIds", getPortletName());
+        System.setProperty("org.apache.jasper.compiler.disablejsr199", "false");
+
 		server = new Server(port);
 
 		WebAppContext webapp = new WebAppContext("src/main/webapp", contextPath);
 		webapp.setTempDirectory(new File("target/work"));
 		webapp.setDefaultsDescriptor("/WEB-INF/jetty-pluto-web-default.xml");
-		ServletHolder portletServlet = new ServletHolder(new PortletServlet());
+
+        // Set Classloader of Context to be sane (needed for JSTL)
+        // JSP requires a non-System classloader, this simply wraps the
+        // embedded System classloader in a way that makes it suitable
+        // for JSP to use
+        ClassLoader jspClassLoader = new URLClassLoader(new URL[0], this.getClass().getClassLoader());
+        webapp.setClassLoader(jspClassLoader);
+
+        ServletHolder portletServlet = new ServletHolder(new PortletServlet());
 		portletServlet.setInitParameter("portlet-name", getPortletName());
 		portletServlet.setInitOrder(1);
 		webapp.addServlet(portletServlet, "/PlutoInvoker/" + getPortletName());
-		server.addHandler(webapp);
-		server.start();
+
+        server.addHandler(webapp);
+
+        server.start();
 		// Retrieve the actual port that is used, in case a random, free port is
 		// picked
 		int port = server.getConnectors()[0].getLocalPort();


Mime
View raw message