jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r923309 - in /jackrabbit/trunk/jackrabbit-jca: deploy/jboss/4.x/ deploy/weblogic/ src/main/java/org/apache/jackrabbit/jca/ src/main/rar/ src/test/java/org/apache/jackrabbit/jca/test/
Date Mon, 15 Mar 2010 15:51:34 GMT
Author: jukka
Date: Mon Mar 15 15:51:33 2010
New Revision: 923309

URL: http://svn.apache.org/viewvc?rev=923309&view=rev
Log:
JCR-2555: Improved reusability of the JCA package

Drop the old repository.xml file in favor of the default one in jackrabbit-core.

Streamline the RAR configuration.

Removed:
    jackrabbit/trunk/jackrabbit-jca/src/main/rar/repository.xml
Modified:
    jackrabbit/trunk/jackrabbit-jca/deploy/jboss/4.x/jcr-ds.xml
    jackrabbit/trunk/jackrabbit-jca/deploy/weblogic/weblogic-ra.xml
    jackrabbit/trunk/jackrabbit-jca/src/main/java/org/apache/jackrabbit/jca/JCARepositoryManager.java
    jackrabbit/trunk/jackrabbit-jca/src/test/java/org/apache/jackrabbit/jca/test/AbstractTestCase.java

Modified: jackrabbit/trunk/jackrabbit-jca/deploy/jboss/4.x/jcr-ds.xml
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jca/deploy/jboss/4.x/jcr-ds.xml?rev=923309&r1=923308&r2=923309&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jca/deploy/jboss/4.x/jcr-ds.xml (original)
+++ jackrabbit/trunk/jackrabbit-jca/deploy/jboss/4.x/jcr-ds.xml Mon Mar 15 15:51:33 2010
@@ -21,8 +21,8 @@
     <xa-transaction/>
     <rar-name>jackrabbit-jca.rar</rar-name>
     <connection-definition>javax.jcr.Repository</connection-definition>
-    <config-property name="homeDir" type="java.lang.String">/temp/jackrabbit</config-property>
-    <config-property name="configFile" type="java.lang.String">classpath:repository.xml</config-property>
+    <config-property name="homeDir" type="java.lang.String">./jackrabbit</config-property>
+    <config-property name="configFile" type="java.lang.String">classpath:org/apache/jackrabbit/core/repository.xml</config-property>
     <config-property name="bindSessionToTransaction" type="java.lang.Boolean">true</config-property>
   </tx-connection-factory>
 </connection-factories>

Modified: jackrabbit/trunk/jackrabbit-jca/deploy/weblogic/weblogic-ra.xml
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jca/deploy/weblogic/weblogic-ra.xml?rev=923309&r1=923308&r2=923309&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jca/deploy/weblogic/weblogic-ra.xml (original)
+++ jackrabbit/trunk/jackrabbit-jca/deploy/weblogic/weblogic-ra.xml Mon Mar 15 15:51:33 2010
@@ -41,11 +41,11 @@
           <properties>
             <property>
               <name>HomeDir</name>
-              <value>/temp/jackrabbit</value>
+              <value>./jackrabbit</value>
             </property>
             <property>
               <name>ConfigFile</name>
-              <value>/temp/jackrabbit/repository.xml</value>
+              <value>classpath:org/apache/jackrabbit/core/repository.xml</value>
             </property>
           </properties>
         </connection-properties>

Modified: jackrabbit/trunk/jackrabbit-jca/src/main/java/org/apache/jackrabbit/jca/JCARepositoryManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jca/src/main/java/org/apache/jackrabbit/jca/JCARepositoryManager.java?rev=923309&r1=923308&r2=923309&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jca/src/main/java/org/apache/jackrabbit/jca/JCARepositoryManager.java
(original)
+++ jackrabbit/trunk/jackrabbit-jca/src/main/java/org/apache/jackrabbit/jca/JCARepositoryManager.java
Mon Mar 15 15:51:33 2010
@@ -155,24 +155,26 @@ public final class JCARepositoryManager 
          */
         public Repository create() throws RepositoryException {
             if (repository == null) {
-                Map<String, String> parameters = new HashMap<String, String>();
-
-                parameters.put("org.apache.jackrabbit.repository.home", homeDir);
+                File dir = new File(homeDir);
+                dir.mkdirs();
 
+                File xml;
                 if (configFile.startsWith(CLASSPATH_CONFIG_PREFIX)) {
                     String source =
                         configFile.substring(CLASSPATH_CONFIG_PREFIX.length());
-                    File target = new File(homeDir, "repository.xml");
-                    copyConfigFile(source, target);
-                    parameters.put(
-                            "org.apache.jackrabbit.repository.conf",
-                            target.getPath());
+                    xml = new File(homeDir, "repository.xml");
+                    copyConfigFile(source, xml);
                 } else {
-                    parameters.put(
-                            "org.apache.jackrabbit.repository.conf",
-                            configFile);
+                    xml = new File(configFile);
                 }
 
+                Map<String, String> parameters = new HashMap<String, String>();
+                parameters.put(
+                        "org.apache.jackrabbit.repository.home",
+                        dir.getPath());
+                parameters.put(
+                        "org.apache.jackrabbit.repository.conf",
+                        xml.getPath());
                 repository = JcrUtils.getRepository(parameters);
             }
 

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=923309&r1=923308&r2=923309&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
Mon Mar 15 15:51:33 2010
@@ -44,7 +44,7 @@ public abstract class AbstractTestCase
      * Repository configuration file.
      */
     public static final String JCR_CONFIG_FILE =
-        "target/repository/repository.xml";
+        "classpath:org/apache/jackrabbit/core/repository.xml";
 
     /**
      * Default credentials.
@@ -77,27 +77,6 @@ public abstract class AbstractTestCase
             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);



Mime
View raw message