jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r898715 - in /jackrabbit/trunk/jackrabbit-jcr2dav: ./ src/test/ src/test/java/ src/test/java/org/ src/test/java/org/apache/ src/test/java/org/apache/jackrabbit/ src/test/java/org/apache/jackrabbit/jcr2dav/ src/test/resources/
Date Wed, 13 Jan 2010 11:03:44 GMT
Author: jukka
Date: Wed Jan 13 11:03:44 2010
New Revision: 898715

URL: http://svn.apache.org/viewvc?rev=898715&view=rev
Log:
JCR-2451: Implement RepositoryFactory in jcr2dav

Run the TCK against davex. For now use the "integration" profile since the test takes hours
to complete.

Added:
    jackrabbit/trunk/jackrabbit-jcr2dav/src/test/
    jackrabbit/trunk/jackrabbit-jcr2dav/src/test/java/
    jackrabbit/trunk/jackrabbit-jcr2dav/src/test/java/org/
    jackrabbit/trunk/jackrabbit-jcr2dav/src/test/java/org/apache/
    jackrabbit/trunk/jackrabbit-jcr2dav/src/test/java/org/apache/jackrabbit/
    jackrabbit/trunk/jackrabbit-jcr2dav/src/test/java/org/apache/jackrabbit/jcr2dav/
    jackrabbit/trunk/jackrabbit-jcr2dav/src/test/java/org/apache/jackrabbit/jcr2dav/ConformanceTest.java
  (with props)
    jackrabbit/trunk/jackrabbit-jcr2dav/src/test/java/org/apache/jackrabbit/jcr2dav/RepositoryStubImpl.java
  (with props)
    jackrabbit/trunk/jackrabbit-jcr2dav/src/test/resources/
    jackrabbit/trunk/jackrabbit-jcr2dav/src/test/resources/log4j.properties   (with props)
    jackrabbit/trunk/jackrabbit-jcr2dav/src/test/resources/repositoryStubImpl.properties 
 (with props)
Modified:
    jackrabbit/trunk/jackrabbit-jcr2dav/pom.xml

Modified: jackrabbit/trunk/jackrabbit-jcr2dav/pom.xml
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr2dav/pom.xml?rev=898715&r1=898714&r2=898715&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr2dav/pom.xml (original)
+++ jackrabbit/trunk/jackrabbit-jcr2dav/pom.xml Wed Jan 13 11:03:44 2010
@@ -32,6 +32,47 @@
   <artifactId>jackrabbit-jcr2dav</artifactId>
   <name>Jackrabbit JCR to WebDAV</name>
 
+  <profiles>
+    <profile>
+      <id>integration</id>
+      <build>
+        <plugins>
+          <plugin>
+            <artifactId>maven-surefire-plugin</artifactId>
+            <configuration>
+              <argLine>-Xmx256m</argLine>
+              <fork>true</fork>
+              <systemProperties>
+                <property>
+                  <name>jackrabbit.test.integration</name>
+                  <value>true</value>
+                </property>
+                <property>
+                  <name>known.issues</name>
+                  <value>
+                    foo#bar
+                  </value>
+                </property>
+                <property>
+                  <name>derby.system.durability</name>
+                  <value>test</value>
+                </property>
+                <property>
+                  <name>derby.storage.fileSyncTransactionLog</name>
+                  <value>true</value>
+                </property>
+                <property>
+                  <name>derby.stream.error.file</name>
+                  <value>target/derby.log</value>
+                </property>
+              </systemProperties>
+            </configuration>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
+  </profiles>
+
   <dependencies>
     <dependency>
       <groupId>javax.jcr</groupId>
@@ -47,6 +88,35 @@
       <artifactId>jackrabbit-spi2dav</artifactId>
       <version>2.1-SNAPSHOT</version>
     </dependency>
+
+    <dependency>
+      <groupId>org.apache.jackrabbit</groupId>
+      <artifactId>jackrabbit-jcr-tests</artifactId>
+      <version>2.1-SNAPSHOT</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.jackrabbit</groupId>
+      <artifactId>jackrabbit-core</artifactId>
+      <version>2.1-SNAPSHOT</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.jackrabbit</groupId>
+      <artifactId>jackrabbit-jcr-server</artifactId>
+      <version>2.1-SNAPSHOT</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.mortbay.jetty</groupId>
+      <artifactId>jetty</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>slf4j-log4j12</artifactId>
+      <scope>test</scope>
+    </dependency>
   </dependencies>
 
 </project>

Added: jackrabbit/trunk/jackrabbit-jcr2dav/src/test/java/org/apache/jackrabbit/jcr2dav/ConformanceTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr2dav/src/test/java/org/apache/jackrabbit/jcr2dav/ConformanceTest.java?rev=898715&view=auto
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr2dav/src/test/java/org/apache/jackrabbit/jcr2dav/ConformanceTest.java
(added)
+++ jackrabbit/trunk/jackrabbit-jcr2dav/src/test/java/org/apache/jackrabbit/jcr2dav/ConformanceTest.java
Wed Jan 13 11:03:44 2010
@@ -0,0 +1,58 @@
+/*
+ * 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.jackrabbit.jcr2dav;
+
+import java.io.IOException;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestResult;
+import junit.framework.TestSuite;
+
+import org.apache.jackrabbit.test.JCRTestSuite;
+
+/**
+ * JCR API conformance test suite.
+ */
+public class ConformanceTest extends TestCase {
+
+    public static TestSuite suite() {
+        TestSuite suite = new TestSuite();
+        if (Boolean.getBoolean("jackrabbit.test.integration")) {
+            suite.addTest(new JCRTestSuite());
+            suite.addTest(new StopRepository());
+        }
+        return suite;
+    }
+
+    private static class StopRepository implements Test {
+
+        public int countTestCases() {
+            return 1;
+        }
+
+        public void run(TestResult result) {
+            try {
+                RepositoryStubImpl.stopServer();
+            } catch (Exception e) {
+                result.addError(this, e);
+            }
+        }
+
+    }
+
+}

Propchange: jackrabbit/trunk/jackrabbit-jcr2dav/src/test/java/org/apache/jackrabbit/jcr2dav/ConformanceTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: jackrabbit/trunk/jackrabbit-jcr2dav/src/test/java/org/apache/jackrabbit/jcr2dav/RepositoryStubImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr2dav/src/test/java/org/apache/jackrabbit/jcr2dav/RepositoryStubImpl.java?rev=898715&view=auto
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr2dav/src/test/java/org/apache/jackrabbit/jcr2dav/RepositoryStubImpl.java
(added)
+++ jackrabbit/trunk/jackrabbit-jcr2dav/src/test/java/org/apache/jackrabbit/jcr2dav/RepositoryStubImpl.java
Wed Jan 13 11:03:44 2010
@@ -0,0 +1,105 @@
+/*
+ * 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.jackrabbit.jcr2dav;
+
+import java.util.Properties;
+
+import javax.jcr.Repository;
+
+import org.apache.jackrabbit.commons.JcrUtils;
+import org.apache.jackrabbit.core.JackrabbitRepositoryStub;
+import org.apache.jackrabbit.server.remoting.davex.JcrRemotingServlet;
+import org.apache.jackrabbit.test.RepositoryStubException;
+import org.apache.jackrabbit.webdav.jcr.JCRWebdavServerServlet;
+import org.mortbay.jetty.Server;
+import org.mortbay.jetty.bio.SocketConnector;
+import org.mortbay.jetty.servlet.Context;
+import org.mortbay.jetty.servlet.ServletHolder;
+
+public class RepositoryStubImpl extends JackrabbitRepositoryStub {
+
+    private static Repository repository;
+
+    private static SocketConnector connector;
+
+    private static Server server;
+
+    private static Repository client;
+
+    public RepositoryStubImpl(Properties env) {
+        super(env);
+    }
+
+    @Override
+    public Repository getRepository() throws RepositoryStubException {
+        if (repository == null) {
+            repository = super.getRepository();
+        }
+
+        if (connector == null) {
+            connector = new SocketConnector();
+            connector.setHost("localhost");
+            connector.setPort(0);
+        }
+
+        if (server == null) {
+            server = new Server();
+            server.addConnector(connector);
+
+            ServletHolder holder = new ServletHolder(
+                    new JcrRemotingServlet() {
+                        protected Repository getRepository() {
+                            return repository;
+                        }
+                    });
+            holder.setInitParameter(
+                    JCRWebdavServerServlet.INIT_PARAM_RESOURCE_PATH_PREFIX,
+                    "");
+            holder.setInitParameter(
+                    JCRWebdavServerServlet.INIT_PARAM_MISSING_AUTH_MAPPING,
+                    "");
+
+            Context context = new Context(server, "/");
+            context.addServlet(holder, "/*");
+            server.addHandler(context);
+
+            try {
+                server.start();
+            } catch (Exception e) {
+                e.printStackTrace();
+                throw new RepositoryStubException(e.getMessage());
+            }
+        }
+
+        if (client == null) {
+            try {
+                client = JcrUtils.getRepository(
+                        "http://localhost:" + connector.getLocalPort() + "/");
+            } catch (Exception e) {
+                e.printStackTrace();
+                throw new RepositoryStubException(e.getMessage());
+            }
+        }
+
+        return client;
+    }
+
+    public static void stopServer() throws Exception {
+        server.stop();
+    }
+
+}

Propchange: jackrabbit/trunk/jackrabbit-jcr2dav/src/test/java/org/apache/jackrabbit/jcr2dav/RepositoryStubImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: jackrabbit/trunk/jackrabbit-jcr2dav/src/test/resources/log4j.properties
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr2dav/src/test/resources/log4j.properties?rev=898715&view=auto
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr2dav/src/test/resources/log4j.properties (added)
+++ jackrabbit/trunk/jackrabbit-jcr2dav/src/test/resources/log4j.properties Wed Jan 13 11:03:44
2010
@@ -0,0 +1,25 @@
+#  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.
+
+# Set root logger level to DEBUG and its only appender to file.
+log4j.rootLogger=INFO, file
+
+# 'file' is set to be a FileAppender.
+log4j.appender.file=org.apache.log4j.FileAppender
+log4j.appender.file.File=target/jcr.log
+
+# 'file' uses PatternLayout.
+log4j.appender.file.layout=org.apache.log4j.PatternLayout
+log4j.appender.file.layout.ConversionPattern=%d{dd.MM.yyyy HH:mm:ss} *%-5p* [%t] %c{1}: %m
(%F, line %L)\n

Propchange: jackrabbit/trunk/jackrabbit-jcr2dav/src/test/resources/log4j.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Added: jackrabbit/trunk/jackrabbit-jcr2dav/src/test/resources/repositoryStubImpl.properties
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr2dav/src/test/resources/repositoryStubImpl.properties?rev=898715&view=auto
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr2dav/src/test/resources/repositoryStubImpl.properties (added)
+++ jackrabbit/trunk/jackrabbit-jcr2dav/src/test/resources/repositoryStubImpl.properties Wed
Jan 13 11:03:44 2010
@@ -0,0 +1,17 @@
+#  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.
+
+# Stub implementation class
+javax.jcr.tck.repository_stub_impl=org.apache.jackrabbit.jcr2dav.RepositoryStubImpl

Propchange: jackrabbit/trunk/jackrabbit-jcr2dav/src/test/resources/repositoryStubImpl.properties
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message