jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r608450 - in /jackrabbit/trunk/jackrabbit-jca: applications/test/ pom.xml src/test/java/org/apache/jackrabbit/jca/test/AbstractTestCase.java src/test/resources/ src/test/resources/log4j.properties
Date Thu, 03 Jan 2008 11:11:03 GMT
Author: jukka
Date: Thu Jan  3 03:10:58 2008
New Revision: 608450

URL: http://svn.apache.org/viewvc?rev=608450&view=rev
Log:
JCR-1203: Reorganize test suites
    - Streamlined the jackrabbit-jca test environment

Added:
    jackrabbit/trunk/jackrabbit-jca/src/test/resources/
    jackrabbit/trunk/jackrabbit-jca/src/test/resources/log4j.properties
      - copied, changed from r608419, jackrabbit/trunk/jackrabbit-jca/applications/test/log4j.properties
Removed:
    jackrabbit/trunk/jackrabbit-jca/applications/test/
Modified:
    jackrabbit/trunk/jackrabbit-jca/pom.xml
    jackrabbit/trunk/jackrabbit-jca/src/test/java/org/apache/jackrabbit/jca/test/AbstractTestCase.java

Modified: jackrabbit/trunk/jackrabbit-jca/pom.xml
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jca/pom.xml?rev=608450&r1=608449&r2=608450&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jca/pom.xml (original)
+++ jackrabbit/trunk/jackrabbit-jca/pom.xml Thu Jan  3 03:10:58 2008
@@ -89,6 +89,21 @@
           </execution>
         </executions>
       </plugin>
+      <plugin>
+        <artifactId>maven-surefire-plugin</artifactId>
+        <configuration>
+          <systemProperties>
+            <property>
+              <name>derby.system.durability</name>
+              <value>test</value>
+            </property>
+            <property>
+              <name>derby.stream.error.file</name>
+              <value>target/derby.log</value>
+            </property>
+          </systemProperties>
+        </configuration>
+      </plugin>
     </plugins>
   </build>
 

Modified: jackrabbit/trunk/jackrabbit-jca/src/test/java/org/apache/jackrabbit/jca/test/AbstractTestCase.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jca/src/test/java/org/apache/jackrabbit/jca/test/AbstractTestCase.java?rev=608450&r1=608449&r2=608450&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jca/src/test/java/org/apache/jackrabbit/jca/test/AbstractTestCase.java
(original)
+++ jackrabbit/trunk/jackrabbit-jca/src/test/java/org/apache/jackrabbit/jca/test/AbstractTestCase.java
Thu Jan  3 03:10:58 2008
@@ -16,7 +16,14 @@
  */
 package org.apache.jackrabbit.jca.test;
 
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.InputStream;
+import java.io.OutputStream;
+
 import junit.framework.TestCase;
+
+import org.apache.jackrabbit.core.RepositoryImpl;
 import org.apache.jackrabbit.jca.JCAManagedConnectionFactory;
 
 import javax.jcr.Credentials;
@@ -31,13 +38,13 @@
     /**
      * Repository home directory.
      */
-    public static final String JCR_HOME_DIR = "applications/test";
+    public static final String JCR_HOME_DIR = "target/repository";
 
     /**
      * Repository configuration file.
      */
     public static final String JCR_CONFIG_FILE =
-        "applications/test/repository.xml";
+        "target/repository/repository.xml";
 
     /**
      * Default credentials.
@@ -64,7 +71,33 @@
     /**
      * Setup the test.
      */
-    protected void setUp() {
+    protected void setUp() throws Exception {
+        File home = new File(JCR_HOME_DIR);
+        if (!home.exists()) {
+            home.mkdirs();
+        }
+
+        File conf = new File(JCR_CONFIG_FILE);
+        if (!conf.exists()) {
+            InputStream input =
+                RepositoryImpl.class.getResourceAsStream("repository.xml");
+            try {
+                OutputStream output = new FileOutputStream(conf);
+                try {
+                    byte[] buffer = new byte[1024];
+                    int n = input.read(buffer);
+                    while (n != -1) {
+                        output.write(buffer, 0, n);
+                        n = input.read(buffer);
+                    }
+                } finally {
+                    output.close();
+                }
+            } finally {
+                input.close();
+            }
+        }
+
         // Construct the managed connection factory
         this.mcf = new JCAManagedConnectionFactory();
         this.mcf.setHomeDir(JCR_HOME_DIR);

Copied: jackrabbit/trunk/jackrabbit-jca/src/test/resources/log4j.properties (from r608419,
jackrabbit/trunk/jackrabbit-jca/applications/test/log4j.properties)
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jca/src/test/resources/log4j.properties?p2=jackrabbit/trunk/jackrabbit-jca/src/test/resources/log4j.properties&p1=jackrabbit/trunk/jackrabbit-jca/applications/test/log4j.properties&r1=608419&r2=608450&rev=608450&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jca/applications/test/log4j.properties (original)
+++ jackrabbit/trunk/jackrabbit-jca/src/test/resources/log4j.properties Thu Jan  3 03:10:58
2008
@@ -29,7 +29,7 @@
 
 # 'file' is set to be a FileAppender.
 log4j.appender.file=org.apache.log4j.FileAppender
-log4j.appender.file.File=jcr.log
+log4j.appender.file.File=target/jcr.log
 
 # 'file' uses PatternLayout.
 log4j.appender.file.layout=org.apache.log4j.PatternLayout



Mime
View raw message