From a98bbc31e007fad4be62e796b08ffb6d43aa3e58 Mon Sep 17 00:00:00 2001 From: Jan Bartel Date: Mon, 2 Sep 2013 17:13:20 +1000 Subject: [PATCH] Make jsp 2.3.2 work for jetty-9.1, bring osgi tests back into the build. --- jetty-osgi/jetty-osgi-boot-jsp/pom.xml | 37 ++++++++++--------- jetty-osgi/jetty-osgi-boot/pom.xml | 6 +-- jetty-osgi/jetty-osgi-httpservice/pom.xml | 8 ++-- jetty-osgi/pom.xml | 2 - jetty-osgi/test-jetty-osgi-context/pom.xml | 10 +++-- jetty-osgi/test-jetty-osgi-webapp/pom.xml | 2 +- jetty-osgi/test-jetty-osgi/pom.xml | 17 +++++++++ .../TestJettyOSGiBootContextAsService.java | 20 +++++----- .../osgi/test/TestJettyOSGiBootCore.java | 5 +-- .../osgi/test/TestJettyOSGiBootSpdy.java | 1 + .../TestJettyOSGiBootWebAppAsService.java | 32 ++++++++-------- .../osgi/test/TestJettyOSGiBootWithJsp.java | 26 ++++++------- pom.xml | 2 +- 13 files changed, 93 insertions(+), 75 deletions(-) diff --git a/jetty-osgi/jetty-osgi-boot-jsp/pom.xml b/jetty-osgi/jetty-osgi-boot-jsp/pom.xml index 6d808444474..d4bc575a192 100644 --- a/jetty-osgi/jetty-osgi-boot-jsp/pom.xml +++ b/jetty-osgi/jetty-osgi-boot-jsp/pom.xml @@ -88,31 +88,32 @@ org.eclipse.jetty.osgi.boot !org.eclipse.jetty.osgi.boot.* - com.sun.el;resolution:=optional, + org.eclipse.jdt.*;resolution:=optional, + com.sun.el;resolution:=optional, com.sun.el.lang;resolution:=optional, com.sun.el.parser;resolution:=optional, com.sun.el.util;resolution:=optional, - javax.el;version="[3.0,3.1)";resolution:=optional, - javax.servlet;version="[2.6.0,3.2)", - javax.servlet.jsp;version="2.3", - javax.servlet.jsp.el;version="2.3", + javax.el;version="[3.0,3.1)", + javax.servlet;version="[3.1,3.2)", + javax.servlet.resources;version="[3.1,3.2)", + javax.servlet.jsp.resources;version="[3.1,3.2)", + javax.servlet.jsp;version="[2.3,2.4)", + javax.servlet.jsp.el;version="[2.3,2.4)", + javax.servlet.jsp.tagext;version="[2.3,2.4)", javax.servlet.jsp.jstl.core;version="1.2.0";resolution:=optional, javax.servlet.jsp.jstl.fmt;version="1.2.0";resolution:=optional, javax.servlet.jsp.jstl.sql;version="1.2.0";resolution:=optional, javax.servlet.jsp.jstl.tlv;version="1.2.0";resolution:=optional, - javax.servlet.jsp.resources;version="2.3", - javax.servlet.jsp.tagext;version="2.3", - javax.servlet.resources;version="(2.6.0,3.2)", - org.apache.jasper;version="2.3.2";resolution:=optional, - org.apache.jasper.compiler;version="2.3.2";resolution:=optional, - org.apache.jasper.compiler.tagplugin;version="2.3.2";resolution:=optional, - org.apache.jasper.runtime;version="2.3.2";resolution:=optional, - org.apache.jasper.security;version="2.3.2";resolution:=optional, - org.apache.jasper.servlet;version="2.3.2";resolution:=optional, - org.apache.jasper.tagplugins.jstl;version="2.3.2";resolution:=optional, - org.apache.jasper.util;version="2.3.2";resolution:=optional, - org.apache.jasper.xmlparser;version="2.3.2";resolution:=optional, - org.glassfish.jsp.api;version="2.3.2";resolution:=optional, + org.apache.jasper;version="[2.3.2,2.4)";resolution:=optional, + org.apache.jasper.compiler;version="[2.3.2,2.4)";resolution:=optional, + org.apache.jasper.compiler.tagplugin;version="[2.3.2,2.4)";resolution:=optional, + org.apache.jasper.runtime;version="[2.3.2,2.4)";resolution:=optional, + org.apache.jasper.security;version="[2.3.2,2.4)";resolution:=optional, + org.apache.jasper.servlet;version="[2.3.2,2.4)";resolution:=optional, + org.apache.jasper.tagplugins.jstl;version="[2.3.2,2.4)";resolution:=optional, + org.apache.jasper.util;version="[2.3.2,2.4)";resolution:=optional, + org.apache.jasper.xmlparser;version="[2.3.2,2.4)";resolution:=optional, + org.glassfish.jsp.api;version="[2.3.2,2.4)";resolution:=optional, org.apache.taglibs.standard;version="1.2.0";resolution:=optional, org.apache.taglibs.standard.extra.spath;version="1.2.0";resolution:=optional, org.apache.taglibs.standard.functions;version="1.2.0";resolution:=optional, diff --git a/jetty-osgi/jetty-osgi-boot/pom.xml b/jetty-osgi/jetty-osgi-boot/pom.xml index 7e0608a51b5..8928798ecbb 100644 --- a/jetty-osgi/jetty-osgi-boot/pom.xml +++ b/jetty-osgi/jetty-osgi-boot/pom.xml @@ -102,14 +102,14 @@ org.eclipse.jetty.osgi.boot;singleton:=true org.eclipse.jetty.osgi.boot.JettyBootstrapActivator - org.eclipse.jetty.*;version="[9.0,10.0)" + org.eclipse.jetty.*;version="[9.1,10.0)" javax.mail;version="1.4.0";resolution:=optional, javax.mail.event;version="1.4.0";resolution:=optional, javax.mail.internet;version="1.4.0";resolution:=optional, javax.mail.search;version="1.4.0";resolution:=optional, javax.mail.util;version="1.4.0";resolution:=optional, - javax.servlet;version="[2.6,3.2)", - javax.servlet.http;version="[2.6,3.2)", + javax.servlet;version="[3.1,3.2)", + javax.servlet.http;version="[3.1,3.2)", javax.transaction;version="1.1.0";resolution:=optional, javax.transaction.xa;version="1.1.0";resolution:=optional, org.eclipse.jetty.annotations;version="9.0.0";resolution:=optional, diff --git a/jetty-osgi/jetty-osgi-httpservice/pom.xml b/jetty-osgi/jetty-osgi-httpservice/pom.xml index b7ec57fdb51..8a68dd5350f 100644 --- a/jetty-osgi/jetty-osgi-httpservice/pom.xml +++ b/jetty-osgi/jetty-osgi-httpservice/pom.xml @@ -96,10 +96,10 @@ org.eclipse.jetty.osgi.httpservice OSGi HttpService contexts/httpservice.xml - org.eclipse.jetty.server.handler;version="[9.0,10.0)", -org.eclipse.jetty.util.component;version="[9.0,10.0)", -org.eclipse.jetty.server.session;version="[9.0,10.0)", -org.eclipse.jetty.servlet;version="[9.0,10.0)", + org.eclipse.jetty.server.handler;version="[9.1,10.0)", +org.eclipse.jetty.util.component;version="[9.1,10.0)", +org.eclipse.jetty.server.session;version="[9.1,10.0)", +org.eclipse.jetty.servlet;version="[9.1,10.0)", org.eclipse.equinox.http.servlet, * diff --git a/jetty-osgi/pom.xml b/jetty-osgi/pom.xml index 48675f8655c..3bd94088d7e 100644 --- a/jetty-osgi/pom.xml +++ b/jetty-osgi/pom.xml @@ -26,9 +26,7 @@ jetty-osgi-httpservice test-jetty-osgi-webapp test-jetty-osgi-context - diff --git a/jetty-osgi/test-jetty-osgi-context/pom.xml b/jetty-osgi/test-jetty-osgi-context/pom.xml index c72a109ba86..48d69e6a3fd 100644 --- a/jetty-osgi/test-jetty-osgi-context/pom.xml +++ b/jetty-osgi/test-jetty-osgi-context/pom.xml @@ -26,6 +26,10 @@ org.eclipse.osgi org.eclipse.osgi.services + + org.eclipse.jetty.toolchain + jetty-schemas + @@ -94,8 +98,8 @@ compilation time. --> <_nouses>true - javax.servlet;version="[2.6.0,3.2)", - javax.servlet.resources;version="[2.6.0,3.2)", + javax.servlet;version="[3.1,3.2)", + javax.servlet.resources;version="[3.1,3.2)", org.osgi.framework, org.osgi.service.cm;version="1.2.0", org.osgi.service.packageadmin, @@ -109,7 +113,7 @@ org.xml.sax.helpers, * - org.eclipse.jetty.*;version="[9.0,10.0)" + org.eclipse.jetty.*;version="[9.1,10.0)" diff --git a/jetty-osgi/test-jetty-osgi-webapp/pom.xml b/jetty-osgi/test-jetty-osgi-webapp/pom.xml index 3ac4048445c..b41c51405a9 100644 --- a/jetty-osgi/test-jetty-osgi-webapp/pom.xml +++ b/jetty-osgi/test-jetty-osgi-webapp/pom.xml @@ -104,7 +104,7 @@ org.xml.sax.helpers, * - org.eclipse.jetty.*;version="[9.0,10.0)" + org.eclipse.jetty.*;version="[9.1,10.0)" diff --git a/jetty-osgi/test-jetty-osgi/pom.xml b/jetty-osgi/test-jetty-osgi/pom.xml index d4cec62ba32..6496b4110c7 100644 --- a/jetty-osgi/test-jetty-osgi/pom.xml +++ b/jetty-osgi/test-jetty-osgi/pom.xml @@ -170,6 +170,12 @@ ${project.version} provided + + org.eclipse.jetty.toolchain + jetty-jsp-fragment + 2.3.2 + provided + org.eclipse.jetty.osgi jetty-httpservice @@ -261,6 +267,12 @@ ${project.version} runtime + + javax.websocket + javax.websocket-api + runtime + + org.eclipse.jetty.spdy @@ -298,6 +310,11 @@ ${project.version} test + + org.eclipse.jetty.toolchain + jetty-schemas + runtime + diff --git a/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootContextAsService.java b/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootContextAsService.java index b15e002f0c7..d3e980d7556 100644 --- a/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootContextAsService.java +++ b/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootContextAsService.java @@ -18,6 +18,9 @@ package org.eclipse.jetty.osgi.test; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; import static org.ops4j.pax.exam.CoreOptions.mavenBundle; import static org.ops4j.pax.exam.CoreOptions.options; import static org.ops4j.pax.exam.CoreOptions.systemProperty; @@ -29,8 +32,6 @@ import java.util.List; import javax.inject.Inject; -import junit.framework.Assert; - import org.eclipse.jetty.client.HttpClient; import org.eclipse.jetty.client.api.ContentResponse; import org.eclipse.jetty.http.HttpStatus; @@ -122,6 +123,7 @@ public class TestJettyOSGiBootContextAsService TestOSGiUtil.assertAllBundlesActiveOrResolved(bundleContext); } + /** */ @Test @@ -133,10 +135,10 @@ public class TestJettyOSGiBootContextAsService { client.start(); ContentResponse response = client.GET("http://127.0.0.1:" + TestJettyOSGiBootCore.DEFAULT_JETTY_HTTP_PORT + "/acme/index.html"); - Assert.assertEquals(HttpStatus.OK_200, response.getStatus()); + assertEquals(HttpStatus.OK_200, response.getStatus()); String content = new String(response.getContent()); - Assert.assertTrue(content.indexOf("

Test OSGi Context

") != -1); + assertTrue(content.indexOf("

Test OSGi Context

") != -1); } finally { @@ -144,8 +146,8 @@ public class TestJettyOSGiBootContextAsService } ServiceReference[] refs = bundleContext.getServiceReferences(ContextHandler.class.getName(), null); - Assert.assertNotNull(refs); - Assert.assertEquals(1, refs.length); + assertNotNull(refs); + assertEquals(1, refs.length); //uncomment for debugging /* String[] keys = refs[0].getPropertyKeys(); @@ -155,15 +157,15 @@ public class TestJettyOSGiBootContextAsService System.err.println("service property: " + k + ", " + refs[0].getProperty(k)); }*/ ContextHandler ch = (ContextHandler) bundleContext.getService(refs[0]); - Assert.assertEquals("/acme", ch.getContextPath()); + assertEquals("/acme", ch.getContextPath()); // Stop the bundle with the ContextHandler in it and check the jetty // Context is destroyed for it. // TODO: think of a better way to communicate this to the test, other // than checking stderr output Bundle testWebBundle = TestOSGiUtil.getBundle(bundleContext, "org.eclipse.jetty.osgi.testcontext"); - Assert.assertNotNull("Could not find the org.eclipse.jetty.test-jetty-osgi-context.jar bundle", testWebBundle); - Assert.assertTrue("The bundle org.eclipse.jetty.testcontext is not correctly resolved", testWebBundle.getState() == Bundle.ACTIVE); + assertNotNull("Could not find the org.eclipse.jetty.test-jetty-osgi-context.jar bundle", testWebBundle); + assertTrue("The bundle org.eclipse.jetty.testcontext is not correctly resolved", testWebBundle.getState() == Bundle.ACTIVE); testWebBundle.stop(); } } diff --git a/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootCore.java b/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootCore.java index 2784b202bcb..ca99c64fda3 100644 --- a/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootCore.java +++ b/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootCore.java @@ -78,8 +78,8 @@ public class TestJettyOSGiBootCore res.add(mavenBundle().groupId( "org.eclipse.jetty.osgi" ).artifactId( "jetty-osgi-boot" ).versionAsInProject().start()); - //res.add(mavenBundle().groupId( "org.eclipse.jetty.orbit" ).artifactId( "javax.servlet" ).versionAsInProject().noStart()); res.add(mavenBundle().groupId( "javax.servlet" ).artifactId( "javax.servlet-api" ).versionAsInProject().noStart()); + res.add(mavenBundle().groupId( "org.eclipse.jetty.toolchain" ).artifactId( "jetty-schemas" ).versionAsInProject().noStart()); res.add(mavenBundle().groupId( "org.eclipse.jetty" ).artifactId( "jetty-deploy" ).versionAsInProject().noStart()); res.add(mavenBundle().groupId( "org.eclipse.jetty" ).artifactId( "jetty-server" ).versionAsInProject().noStart()); res.add(mavenBundle().groupId( "org.eclipse.jetty" ).artifactId( "jetty-servlet" ).versionAsInProject().noStart()); @@ -96,6 +96,7 @@ public class TestJettyOSGiBootCore res.add(mavenBundle().groupId( "org.eclipse.jetty.websocket" ).artifactId( "websocket-common" ).versionAsInProject().noStart()); res.add(mavenBundle().groupId( "org.eclipse.jetty.websocket" ).artifactId( "websocket-servlet" ).versionAsInProject().noStart()); res.add(mavenBundle().groupId( "org.eclipse.jetty.websocket" ).artifactId( "websocket-server" ).versionAsInProject().noStart()); + res.add(mavenBundle().groupId( "javax.websocket" ).artifactId( "javax.websocket-api" ).versionAsInProject().noStart()); return res; } @@ -127,6 +128,4 @@ public class TestJettyOSGiBootCore { TestOSGiUtil.testHttpServiceGreetings(bundleContext, "http", DEFAULT_JETTY_HTTP_PORT); } - - } diff --git a/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootSpdy.java b/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootSpdy.java index a99d74452d8..c17838a158c 100644 --- a/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootSpdy.java +++ b/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootSpdy.java @@ -104,6 +104,7 @@ public class TestJettyOSGiBootSpdy res.add(mavenBundle().groupId("org.eclipse.jetty.osgi").artifactId("jetty-osgi-npn").versionAsInProject().noStart()); res.add(mavenBundle().groupId("org.eclipse.jetty.spdy").artifactId("spdy-core").versionAsInProject().noStart()); res.add(mavenBundle().groupId("org.eclipse.jetty.spdy").artifactId("spdy-server").versionAsInProject().noStart()); + res.add(mavenBundle().groupId("org.eclipse.jetty.spdy").artifactId("spdy-http-common").versionAsInProject().noStart()); res.add(mavenBundle().groupId("org.eclipse.jetty.spdy").artifactId("spdy-http-server").versionAsInProject().noStart()); res.add(mavenBundle().groupId("org.eclipse.jetty.spdy").artifactId("spdy-client").versionAsInProject().noStart()); return res; diff --git a/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootWebAppAsService.java b/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootWebAppAsService.java index be7cd780b4a..9510412e685 100644 --- a/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootWebAppAsService.java +++ b/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootWebAppAsService.java @@ -18,6 +18,9 @@ package org.eclipse.jetty.osgi.test; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; import static org.ops4j.pax.exam.CoreOptions.mavenBundle; import static org.ops4j.pax.exam.CoreOptions.options; import static org.ops4j.pax.exam.CoreOptions.systemProperty; @@ -29,8 +32,6 @@ import java.util.List; import javax.inject.Inject; -import junit.framework.Assert; - import org.eclipse.jetty.client.HttpClient; import org.eclipse.jetty.client.api.ContentResponse; import org.eclipse.jetty.http.HttpStatus; @@ -82,7 +83,6 @@ public class TestJettyOSGiBootWebAppAsService if (LOGGING_ENABLED) logLevel = "INFO"; - options.addAll(Arrays.asList(options( // install log service using pax runners profile abstraction (there // are more profiles, like DS) @@ -94,8 +94,8 @@ public class TestJettyOSGiBootWebAppAsService options.addAll(jspDependencies()); return options.toArray(new Option[options.size()]); - } + public static List