lucene-solr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject svn commit: r640123 - in /lucene/solr/trunk: build.xml client/java/solrj/test/org/apache/solr/client/solrj/embedded/JettyWebappTest.java src/webapp/WEB-INF/ src/webapp/resources/ src/webapp/web/ src/webapp/web/WEB-INF/
Date Sat, 22 Mar 2008 23:57:53 GMT
Author: ryan
Date: Sat Mar 22 16:57:52 2008
New Revision: 640123

URL: http://svn.apache.org/viewvc?rev=640123&view=rev
Log:
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)

Added:
    lucene/solr/trunk/client/java/solrj/test/org/apache/solr/client/solrj/embedded/JettyWebappTest.java
  (with props)
    lucene/solr/trunk/src/webapp/web/
      - copied from r640091, lucene/solr/trunk/src/webapp/resources/
    lucene/solr/trunk/src/webapp/web/WEB-INF/
      - copied from r640091, lucene/solr/trunk/src/webapp/WEB-INF/
Removed:
    lucene/solr/trunk/src/webapp/WEB-INF/
    lucene/solr/trunk/src/webapp/resources/
Modified:
    lucene/solr/trunk/build.xml

Modified: lucene/solr/trunk/build.xml
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/build.xml?rev=640123&r1=640122&r2=640123&view=diff
==============================================================================
--- lucene/solr/trunk/build.xml (original)
+++ lucene/solr/trunk/build.xml Sat Mar 22 16:57:52 2008
@@ -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>

Added: lucene/solr/trunk/client/java/solrj/test/org/apache/solr/client/solrj/embedded/JettyWebappTest.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/client/java/solrj/test/org/apache/solr/client/solrj/embedded/JettyWebappTest.java?rev=640123&view=auto
==============================================================================
--- lucene/solr/trunk/client/java/solrj/test/org/apache/solr/client/solrj/embedded/JettyWebappTest.java
(added)
+++ lucene/solr/trunk/client/java/solrj/test/org/apache/solr/client/solrj/embedded/JettyWebappTest.java
Sat Mar 22 16:57:52 2008
@@ -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
+  }
+}

Propchange: lucene/solr/trunk/client/java/solrj/test/org/apache/solr/client/solrj/embedded/JettyWebappTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: lucene/solr/trunk/client/java/solrj/test/org/apache/solr/client/solrj/embedded/JettyWebappTest.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL



Mime
View raw message