jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r1489772 - in /jackrabbit/trunk: jackrabbit-core/src/test/java/org/apache/jackrabbit/core/integration/ jackrabbit-core/src/test/resources/ jackrabbit-webapp/ jackrabbit-webapp/src/main/java/org/apache/jackrabbit/j2ee/ jackrabbit-webapp/src/...
Date Wed, 05 Jun 2013 09:39:22 GMT
Author: jukka
Date: Wed Jun  5 09:39:21 2013
New Revision: 1489772

URL: http://svn.apache.org/r1489772
Log:
JCR-3598: Oak in Jackrabbit deployment packages

Add Oak dependencies to jackrabbit-webapp.
Move backwards compatibility tests to -webapp.
Update the Tomcat dependency and streamline test setup.

Added:
    jackrabbit/trunk/jackrabbit-webapp/src/test/java/org/apache/jackrabbit/j2ee/BackwardsCompatibilityIT.java
  (contents, props changed)
      - copied, changed from r1488687, jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/integration/BackwardsCompatibilityTest.java
    jackrabbit/trunk/jackrabbit-webapp/src/test/resources/compatibility.zip
      - copied, changed from r1488687, jackrabbit/trunk/jackrabbit-core/src/test/resources/compatibility.zip
Removed:
    jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/integration/BackwardsCompatibilityTest.java
    jackrabbit/trunk/jackrabbit-core/src/test/resources/compatibility.zip
    jackrabbit/trunk/jackrabbit-webapp/src/test/resources/default-web.xml
Modified:
    jackrabbit/trunk/jackrabbit-webapp/pom.xml
    jackrabbit/trunk/jackrabbit-webapp/src/main/java/org/apache/jackrabbit/j2ee/RepositoryAccessServlet.java
    jackrabbit/trunk/jackrabbit-webapp/src/main/java/org/apache/jackrabbit/j2ee/RepositoryStartupServlet.java
    jackrabbit/trunk/jackrabbit-webapp/src/test/java/org/apache/jackrabbit/j2ee/TomcatIT.java
    jackrabbit/trunk/jackrabbit-webapp/src/test/resources/logback-test.xml

Modified: jackrabbit/trunk/jackrabbit-webapp/pom.xml
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-webapp/pom.xml?rev=1489772&r1=1489771&r2=1489772&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-webapp/pom.xml (original)
+++ jackrabbit/trunk/jackrabbit-webapp/pom.xml Wed Jun  5 09:39:21 2013
@@ -35,7 +35,8 @@
   <description>Web application that hosts and serves a Jackrabbit content repository</description>
 
   <properties>
-    <tomcat.version>6.0.29</tomcat.version>
+    <oak.version>0.8</oak.version>
+    <tomcat.version>7.0.40</tomcat.version>
   </properties>
 
   <dependencies>
@@ -78,12 +79,22 @@
       <version>${project.version}</version>
     </dependency>
     <dependency>
+      <groupId>org.apache.jackrabbit</groupId>
+      <artifactId>oak-jcr</artifactId>
+      <version>${oak.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.jackrabbit</groupId>
+      <artifactId>oak-upgrade</artifactId>
+      <version>${oak.version}</version>
+    </dependency>
+    <dependency>
       <groupId>ch.qos.logback</groupId>
       <artifactId>logback-classic</artifactId>
     </dependency>
     <dependency>
       <groupId>org.apache.tomcat</groupId>
-      <artifactId>servlet-api</artifactId>
+      <artifactId>tomcat-servlet-api</artifactId>
       <version>${tomcat.version}</version>
       <scope>provided</scope>
     </dependency>
@@ -95,19 +106,19 @@
     </dependency>
     <dependency>
       <groupId>org.apache.tomcat</groupId>
-      <artifactId>catalina</artifactId>
+      <artifactId>tomcat-catalina</artifactId>
       <version>${tomcat.version}</version>
       <scope>test</scope>
     </dependency>
     <dependency>
       <groupId>org.apache.tomcat</groupId>
-      <artifactId>coyote</artifactId>
+      <artifactId>tomcat-coyote</artifactId>
       <version>${tomcat.version}</version>
       <scope>test</scope>
     </dependency>
     <dependency>
       <groupId>org.apache.tomcat</groupId>
-      <artifactId>jasper</artifactId>
+      <artifactId>tomcat-jasper</artifactId>
       <version>${tomcat.version}</version>
       <scope>test</scope>
     </dependency>
@@ -201,10 +212,8 @@
         <plugin>
           <artifactId>maven-failsafe-plugin</artifactId>
           <configuration>
-            <workingDirectory>${project.build.directory}</workingDirectory>
             <systemPropertyVariables>
-              <webapp.directory>${project.build.directory}/${project.artifactId}-${project.version}</webapp.directory>
-              <default.webxml>${basedir}/src/test/resources/default-web.xml</default.webxml>
+              <derby.stream.error.file>target/derby.log</derby.stream.error.file>
             </systemPropertyVariables>
           </configuration>
         </plugin>

Modified: jackrabbit/trunk/jackrabbit-webapp/src/main/java/org/apache/jackrabbit/j2ee/RepositoryAccessServlet.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-webapp/src/main/java/org/apache/jackrabbit/j2ee/RepositoryAccessServlet.java?rev=1489772&r1=1489771&r2=1489772&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-webapp/src/main/java/org/apache/jackrabbit/j2ee/RepositoryAccessServlet.java
(original)
+++ jackrabbit/trunk/jackrabbit-webapp/src/main/java/org/apache/jackrabbit/j2ee/RepositoryAccessServlet.java
Wed Jun  5 09:39:21 2013
@@ -59,6 +59,11 @@ public class RepositoryAccessServlet ext
     private final static String CTX_PARAM_THIS = "repository.access.servlet";
 
     /**
+     * Ugly hack to override the bootstrap file location in the test cases
+     */
+    static String bootstrapOverride = null;
+
+    /**
      * the bootstrap config
      */
     private BootstrapConfig config;
@@ -122,7 +127,10 @@ public class RepositoryAccessServlet ext
         if (config == null) {
             // check if there is a loadable bootstrap config
             Properties bootstrapProps = new Properties();
-            String bstrp = getServletConfig().getInitParameter(INIT_PARAM_BOOTSTRAP_CONFIG);
+            String bstrp = bootstrapOverride;
+            if (bstrp == null) {
+                bstrp = getServletConfig().getInitParameter(INIT_PARAM_BOOTSTRAP_CONFIG);
+            }
             if (bstrp != null) {
                 // check if it's a web-resource
                 InputStream in = getServletContext().getResourceAsStream(bstrp);

Modified: jackrabbit/trunk/jackrabbit-webapp/src/main/java/org/apache/jackrabbit/j2ee/RepositoryStartupServlet.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-webapp/src/main/java/org/apache/jackrabbit/j2ee/RepositoryStartupServlet.java?rev=1489772&r1=1489771&r2=1489772&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-webapp/src/main/java/org/apache/jackrabbit/j2ee/RepositoryStartupServlet.java
(original)
+++ jackrabbit/trunk/jackrabbit-webapp/src/main/java/org/apache/jackrabbit/j2ee/RepositoryStartupServlet.java
Wed Jun  5 09:39:21 2013
@@ -163,6 +163,11 @@ public class RepositoryStartupServlet ex
     public final static String INIT_PARAM_BOOTSTRAP_CONFIG = "bootstrap-config";
 
     /**
+     * Ugly hack to override the bootstrap file location in the test cases
+     */
+    static String bootstrapOverride = null;
+
+    /**
      * the registered repository
      */
     private Repository repository;
@@ -324,7 +329,10 @@ public class RepositoryStartupServlet ex
     private boolean configure() throws ServletException {
         // check if there is a loadable bootstrap config
         Properties bootstrapProps = new Properties();
-        String bstrp = getServletConfig().getInitParameter(INIT_PARAM_BOOTSTRAP_CONFIG);
+        String bstrp = bootstrapOverride;
+        if (bstrp == null) {
+            bstrp = getServletConfig().getInitParameter(INIT_PARAM_BOOTSTRAP_CONFIG);
+        }
         if (bstrp != null) {
             // check if it's a web-resource
             InputStream in = getServletContext().getResourceAsStream(bstrp);

Copied: jackrabbit/trunk/jackrabbit-webapp/src/test/java/org/apache/jackrabbit/j2ee/BackwardsCompatibilityIT.java
(from r1488687, jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/integration/BackwardsCompatibilityTest.java)
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-webapp/src/test/java/org/apache/jackrabbit/j2ee/BackwardsCompatibilityIT.java?p2=jackrabbit/trunk/jackrabbit-webapp/src/test/java/org/apache/jackrabbit/j2ee/BackwardsCompatibilityIT.java&p1=jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/integration/BackwardsCompatibilityTest.java&r1=1488687&r2=1489772&rev=1489772&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/integration/BackwardsCompatibilityTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-webapp/src/test/java/org/apache/jackrabbit/j2ee/BackwardsCompatibilityIT.java
Wed Jun  5 09:39:21 2013
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.jackrabbit.core.integration;
+package org.apache.jackrabbit.j2ee;
 
 import java.io.File;
 import java.io.FileOutputStream;
@@ -47,13 +47,13 @@ import org.apache.jackrabbit.core.config
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-public class BackwardsCompatibilityTest extends TestCase {
+public class BackwardsCompatibilityIT extends TestCase {
 
     /**
      * Logger instance
      */
     private static final Logger log =
-        LoggerFactory.getLogger(BackwardsCompatibilityTest.class);
+        LoggerFactory.getLogger(BackwardsCompatibilityIT.class);
 
     public void testBackwardsCompatibility() throws Exception {
         File target = new File("target/backwards-compatibility-test");
@@ -109,6 +109,7 @@ public class BackwardsCompatibilityTest 
         assertUsers(session);
     }
 
+    @SuppressWarnings("deprecation")
     private Node assertVersionable(Node test) throws RepositoryException {
         assertTrue(test.hasNode("versionable"));
         Node versionable = test.getNode("versionable");
@@ -130,6 +131,7 @@ public class BackwardsCompatibilityTest 
         return versionable;
     }
 
+    @SuppressWarnings("deprecation")
     private void assertProperties(Node test, Node versionable)
             throws RepositoryException, PathNotFoundException,
             ValueFormatException, IOException {
@@ -163,6 +165,7 @@ public class BackwardsCompatibilityTest 
         }
     }
 
+    @SuppressWarnings("deprecation")
     private void assertVersionableCopy(Node test, Node versionable)
             throws RepositoryException, IOException {
         test.getSession().getWorkspace().copy(

Propchange: jackrabbit/trunk/jackrabbit-webapp/src/test/java/org/apache/jackrabbit/j2ee/BackwardsCompatibilityIT.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: jackrabbit/trunk/jackrabbit-webapp/src/test/java/org/apache/jackrabbit/j2ee/TomcatIT.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-webapp/src/test/java/org/apache/jackrabbit/j2ee/TomcatIT.java?rev=1489772&r1=1489771&r2=1489772&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-webapp/src/test/java/org/apache/jackrabbit/j2ee/TomcatIT.java
(original)
+++ jackrabbit/trunk/jackrabbit-webapp/src/test/java/org/apache/jackrabbit/j2ee/TomcatIT.java
Wed Jun  5 09:39:21 2013
@@ -16,16 +16,14 @@
  */
 package org.apache.jackrabbit.j2ee;
 
+import java.io.File;
 import java.io.IOException;
 import java.net.URL;
 
 import junit.framework.TestCase;
 
-import org.apache.catalina.Engine;
-import org.apache.catalina.Host;
-import org.apache.catalina.connector.Connector;
-import org.apache.catalina.core.StandardContext;
-import org.apache.catalina.startup.Embedded;
+import org.apache.catalina.startup.Tomcat;
+import org.apache.commons.io.FileUtils;
 import org.slf4j.bridge.SLF4JBridgeHandler;
 
 import com.gargoylesoftware.htmlunit.WebClient;
@@ -36,42 +34,47 @@ import com.gargoylesoftware.htmlunit.htm
 
 public class TomcatIT extends TestCase {
 
+    static {
+        SLF4JBridgeHandler.install();
+    }
+
     private URL url;
 
-    private Embedded tomcat;
+    private Tomcat tomcat;
 
     private WebClient client;
 
     protected void setUp() throws Exception {
-        SLF4JBridgeHandler.install();
+        File war = null;
+        for (File f : new File("target").listFiles()) {
+            if (f.isDirectory() && new File(f, "WEB-INF/web.xml").isFile()) {
+                war = f;
+                break;
+            }
+        }
+        assertNotNull(war);
+
+        File bootstrap = new File("target", "bootstrap.properties");
+        bootstrap.delete();
+        RepositoryAccessServlet.bootstrapOverride = bootstrap.getPath();
+        RepositoryStartupServlet.bootstrapOverride = bootstrap.getPath();
+
+        File baseDir = new File("target", "tomcat");
+        FileUtils.deleteQuietly(baseDir);
+
+        File repoDir = new File("target", "repository");
+        FileUtils.deleteQuietly(repoDir);
 
         url = new URL("http://localhost:12856/");
 
-        tomcat = new Embedded();
-        tomcat.setCatalinaBase("tomcat");
-        tomcat.setCatalinaHome("tomcat");
-
-        Engine engine = tomcat.createEngine();
-        engine.setName("localengine");
-        engine.setDefaultHost(url.getHost());
-
-        Host host = tomcat.createHost(url.getHost(), "webapps");
-        host.setAutoDeploy(false);
-        engine.addChild(host);
-
-        String webapp = System.getProperty("webapp.directory");
-        StandardContext context =
-            (StandardContext) tomcat.createContext("", webapp);
-        context.setDefaultWebXml(System.getProperty("default.webxml"));
-        host.addChild(context);
-
-        tomcat.addEngine(engine);
-
-        Connector connector =
-            tomcat.createConnector(url.getHost(), url.getPort(), false);
-        tomcat.addConnector(connector);
+        tomcat = new Tomcat();
+        tomcat.setSilent(true);
+        tomcat.setBaseDir(baseDir.getPath());
+        tomcat.setHostname(url.getHost());
+        tomcat.setPort(url.getPort());
+
+        tomcat.addWebapp("", war.getAbsolutePath());
 
-        tomcat.setAwait(true);
         tomcat.start();
 
         client = new WebClient();
@@ -93,7 +96,7 @@ public class TomcatIT extends TestCase {
             for (HtmlInput mode : form.getInputsByName("mode")) {
                 if ("new".equals(mode.getValueAttribute())) {
                     for (HtmlInput home : form.getInputsByName("repository_home")) {
-                        home.setValueAttribute("repository");
+                        home.setValueAttribute("target/repository");
                         for (HtmlElement submit : form.getElementsByAttribute("input", "type",
"submit")) {
                             return submit.click();
                         }

Copied: jackrabbit/trunk/jackrabbit-webapp/src/test/resources/compatibility.zip (from r1488687,
jackrabbit/trunk/jackrabbit-core/src/test/resources/compatibility.zip)
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-webapp/src/test/resources/compatibility.zip?p2=jackrabbit/trunk/jackrabbit-webapp/src/test/resources/compatibility.zip&p1=jackrabbit/trunk/jackrabbit-core/src/test/resources/compatibility.zip&r1=1488687&r2=1489772&rev=1489772&view=diff
==============================================================================
Binary files - no diff available.

Modified: jackrabbit/trunk/jackrabbit-webapp/src/test/resources/logback-test.xml
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-webapp/src/test/resources/logback-test.xml?rev=1489772&r1=1489771&r2=1489772&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-webapp/src/test/resources/logback-test.xml (original)
+++ jackrabbit/trunk/jackrabbit-webapp/src/test/resources/logback-test.xml Wed Jun  5 09:39:21
2013
@@ -24,7 +24,7 @@
     </encoder>
   </appender>
 
-  <root level="DEBUG">
+  <root level="INFO">
     <appender-ref ref="file"/>
   </root>
 



Mime
View raw message