Skip to content

Apache Lucene open-source search software

SOLR-503 -- restructure src/webapp to keep jsps and WEB-INF in same directory. Added test to hit jsp files. (currently only checks if they compile ok)

Ryan McKinley7a32b537a934
diff --git a/build.xml b/build.xml
index ae53e501c61..3cb1bc53794 100644
--- a/build.xml
+++ b/build.xml
@@ -371,7 +371,7 @@
<!-- jetty -->
<fileset dir="example/lib">
- <include name="*.jar" />
+ <include name="**/*.jar" />
</fileset>
</path>
@@ -618,7 +618,7 @@
depends="compile, make-manifest, dist-jar">
<mkdir dir="${dist}" />
<war destfile="${dist}/${fullnamever}.war"
- webxml="${src}/webapp/WEB-INF/web.xml"
+ webxml="${src}/webapp/web/WEB-INF/web.xml"
filesetmanifest="skip"
manifest="${dest}/META-INF/MANIFEST.MF">
<lib dir="${lib}">
@@ -630,7 +630,7 @@
<include name="${fullname}-common-${version}.jar" />
</lib>
<lib dir="client/java/solrj/lib"/>
- <fileset dir="${src}/webapp/resources" />
+ <fileset dir="${src}/webapp/web" />
<metainf dir="${basedir}" includes="LICENSE.txt,NOTICE.txt"/>
</war>
</target>
diff --git a/client/java/solrj/test/org/apache/solr/client/solrj/embedded/JettyWebappTest.java b/client/java/solrj/test/org/apache/solr/client/solrj/embedded/JettyWebappTest.java
new file mode 100644
index 00000000000..458306afa5a
--- /dev/null
+++ b/client/java/solrj/test/org/apache/solr/client/solrj/embedded/JettyWebappTest.java
@@ -0,0 +1,85 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.solr.client.solrj.embedded;
+
+import java.net.URL;
+
+import junit.framework.TestCase;
+
+import org.apache.commons.io.IOUtils;
+import org.mortbay.jetty.Connector;
+import org.mortbay.jetty.Server;
+import org.mortbay.jetty.bio.SocketConnector;
+import org.mortbay.jetty.webapp.WebAppContext;
+
+/**
+ * @version $Id$
+ * @since solr 1.3
+ */
+public class JettyWebappTest extends TestCase
+{
+ static final int port = 8985; // not 8983
+ static final String context = "/test";
+
+ Server server;
+
+ @Override
+ public void setUp() throws Exception
+ {
+ System.setProperty("solr.solr.home", "../../../example/solr");
+ String path = "../../webapp/web";
+
+ Server server = new Server(port);
+ new WebAppContext(server, path, context );
+
+ SocketConnector connector = new SocketConnector();
+ connector.setMaxIdleTime(1000 * 60 * 60);
+ connector.setSoLingerTime(-1);
+ connector.setPort(port);
+ server.setConnectors(new Connector[]{connector});
+ server.setStopAtShutdown( true );
+
+ server.start();
+ }
+
+ @Override
+ public void tearDown() throws Exception
+ {
+ try {
+ server.stop();
+ } catch( Exception ex ) {}
+ }
+
+ public void testJSP() throws Exception
+ {
+ // Currently not an extensive test, but it does fire up the JSP pages and make
+ // sure they compile ok
+
+ String adminPath = "http://localhost:"+port+context+"/admin/";
+ String html = IOUtils.toString( new URL(adminPath).openStream() );
+ assertNotNull( html ); // real error will be an exception
+
+ // analysis
+ html = IOUtils.toString( new URL(adminPath+"analysis.jsp").openStream() );
+ assertNotNull( html ); // real error will be an exception
+
+ // schema browser
+ html = IOUtils.toString( new URL(adminPath+"schema.jsp").openStream() );
+ assertNotNull( html ); // real error will be an exception
+ }
+}
diff --git a/src/webapp/WEB-INF/web.xml b/src/webapp/web/WEB-INF/web.xml
similarity index 100%
rename from src/webapp/WEB-INF/web.xml
rename to src/webapp/web/WEB-INF/web.xml
diff --git a/src/webapp/resources/admin/_info.jsp b/src/webapp/web/admin/_info.jsp
similarity index 100%
rename from src/webapp/resources/admin/_info.jsp
rename to src/webapp/web/admin/_info.jsp
diff --git a/src/webapp/resources/admin/action.jsp b/src/webapp/web/admin/action.jsp
similarity index 100%
rename from src/webapp/resources/admin/action.jsp
rename to src/webapp/web/admin/action.jsp
diff --git a/src/webapp/resources/admin/analysis.jsp b/src/webapp/web/admin/analysis.jsp
similarity index 100%
rename from src/webapp/resources/admin/analysis.jsp
rename to src/webapp/web/admin/analysis.jsp
diff --git a/src/webapp/resources/admin/analysis.xsl b/src/webapp/web/admin/analysis.xsl
similarity index 100%
rename from src/webapp/resources/admin/analysis.xsl
rename to src/webapp/web/admin/analysis.xsl
diff --git a/src/webapp/resources/admin/distributiondump.jsp b/src/webapp/web/admin/distributiondump.jsp
similarity index 100%
rename from src/webapp/resources/admin/distributiondump.jsp
rename to src/webapp/web/admin/distributiondump.jsp
diff --git a/src/webapp/resources/admin/favicon.ico b/src/webapp/web/admin/favicon.ico
similarity index 100%
rename from src/webapp/resources/admin/favicon.ico
rename to src/webapp/web/admin/favicon.ico
diff --git a/src/webapp/resources/admin/form.jsp b/src/webapp/web/admin/form.jsp
similarity index 100%
rename from src/webapp/resources/admin/form.jsp
rename to src/webapp/web/admin/form.jsp
diff --git a/src/webapp/resources/admin/get-file.jsp b/src/webapp/web/admin/get-file.jsp
similarity index 100%
rename from src/webapp/resources/admin/get-file.jsp
rename to src/webapp/web/admin/get-file.jsp
diff --git a/src/webapp/resources/admin/get-properties.jsp b/src/webapp/web/admin/get-properties.jsp
similarity index 100%
rename from src/webapp/resources/admin/get-properties.jsp
rename to src/webapp/web/admin/get-properties.jsp
diff --git a/src/webapp/resources/admin/header.jsp b/src/webapp/web/admin/header.jsp
similarity index 100%
rename from src/webapp/resources/admin/header.jsp
rename to src/webapp/web/admin/header.jsp
diff --git a/src/webapp/resources/admin/index.jsp b/src/webapp/web/admin/index.jsp
similarity index 100%
rename from src/webapp/resources/admin/index.jsp
rename to src/webapp/web/admin/index.jsp
diff --git a/src/webapp/resources/admin/jquery-1.2.3.min.js b/src/webapp/web/admin/jquery-1.2.3.min.js
similarity index 100%
rename from src/webapp/resources/admin/jquery-1.2.3.min.js
rename to src/webapp/web/admin/jquery-1.2.3.min.js
diff --git a/src/webapp/resources/admin/logging.jsp b/src/webapp/web/admin/logging.jsp
similarity index 100%
rename from src/webapp/resources/admin/logging.jsp
rename to src/webapp/web/admin/logging.jsp
diff --git a/src/webapp/resources/admin/logging.xsl b/src/webapp/web/admin/logging.xsl
similarity index 100%
rename from src/webapp/resources/admin/logging.xsl
rename to src/webapp/web/admin/logging.xsl
diff --git a/src/webapp/resources/admin/meta.xsl b/src/webapp/web/admin/meta.xsl
similarity index 100%
rename from src/webapp/resources/admin/meta.xsl
rename to src/webapp/web/admin/meta.xsl
diff --git a/src/webapp/resources/admin/ping.jsp b/src/webapp/web/admin/ping.jsp
similarity index 100%
rename from src/webapp/resources/admin/ping.jsp
rename to src/webapp/web/admin/ping.jsp
diff --git a/src/webapp/resources/admin/ping.xsl b/src/webapp/web/admin/ping.xsl
similarity index 100%
rename from src/webapp/resources/admin/ping.xsl
rename to src/webapp/web/admin/ping.xsl
diff --git a/src/webapp/resources/admin/raw-schema.jsp b/src/webapp/web/admin/raw-schema.jsp
similarity index 100%
rename from src/webapp/resources/admin/raw-schema.jsp
rename to src/webapp/web/admin/raw-schema.jsp
diff --git a/src/webapp/resources/admin/registry.jsp b/src/webapp/web/admin/registry.jsp
similarity index 100%
rename from src/webapp/resources/admin/registry.jsp
rename to src/webapp/web/admin/registry.jsp
diff --git a/src/webapp/resources/admin/registry.xsl b/src/webapp/web/admin/registry.xsl
similarity index 100%
rename from src/webapp/resources/admin/registry.xsl
rename to src/webapp/web/admin/registry.xsl
diff --git a/src/webapp/resources/admin/schema.jsp b/src/webapp/web/admin/schema.jsp
similarity index 100%
rename from src/webapp/resources/admin/schema.jsp
rename to src/webapp/web/admin/schema.jsp
diff --git a/src/webapp/resources/admin/solr-admin.css b/src/webapp/web/admin/solr-admin.css
similarity index 100%
rename from src/webapp/resources/admin/solr-admin.css
rename to src/webapp/web/admin/solr-admin.css
diff --git a/src/webapp/resources/admin/solr-head.gif b/src/webapp/web/admin/solr-head.gif
similarity index 100%
rename from src/webapp/resources/admin/solr-head.gif
rename to src/webapp/web/admin/solr-head.gif
diff --git a/src/webapp/resources/admin/solr-head.png b/src/webapp/web/admin/solr-head.png
similarity index 100%
rename from src/webapp/resources/admin/solr-head.png
rename to src/webapp/web/admin/solr-head.png
diff --git a/src/webapp/resources/admin/solr-lowercase.gif b/src/webapp/web/admin/solr-lowercase.gif
similarity index 100%
rename from src/webapp/resources/admin/solr-lowercase.gif
rename to src/webapp/web/admin/solr-lowercase.gif
diff --git a/src/webapp/resources/admin/solr-lowercase.png b/src/webapp/web/admin/solr-lowercase.png
similarity index 100%
rename from src/webapp/resources/admin/solr-lowercase.png
rename to src/webapp/web/admin/solr-lowercase.png
diff --git a/src/webapp/resources/admin/stats.jsp b/src/webapp/web/admin/stats.jsp
similarity index 100%
rename from src/webapp/resources/admin/stats.jsp
rename to src/webapp/web/admin/stats.jsp
diff --git a/src/webapp/resources/admin/stats.xsl b/src/webapp/web/admin/stats.xsl
similarity index 100%
rename from src/webapp/resources/admin/stats.xsl
rename to src/webapp/web/admin/stats.xsl
diff --git a/src/webapp/resources/admin/tabular.xsl b/src/webapp/web/admin/tabular.xsl
similarity index 100%
rename from src/webapp/resources/admin/tabular.xsl
rename to src/webapp/web/admin/tabular.xsl
diff --git a/src/webapp/resources/admin/threaddump.jsp b/src/webapp/web/admin/threaddump.jsp
similarity index 100%
rename from src/webapp/resources/admin/threaddump.jsp
rename to src/webapp/web/admin/threaddump.jsp
diff --git a/src/webapp/resources/admin/threaddump.xsl b/src/webapp/web/admin/threaddump.xsl
similarity index 100%
rename from src/webapp/resources/admin/threaddump.xsl
rename to src/webapp/web/admin/threaddump.xsl
diff --git a/src/webapp/resources/index.jsp b/src/webapp/web/index.jsp
similarity index 100%
rename from src/webapp/resources/index.jsp
rename to src/webapp/web/index.jsp