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)
git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@640123 13f79535-47bb-0310-9956-ffa450edef68
|
@ -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>
|
||||
|
|
|
@ -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
|
||||
}
|
||||
}
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 4.0 KiB |
Before Width: | Height: | Size: 9.7 KiB After Width: | Height: | Size: 9.7 KiB |
Before Width: | Height: | Size: 4.9 KiB After Width: | Height: | Size: 4.9 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |