[exo-jcr-commits] exo-jcr SVN: r4070 - in jcr/trunk/exo.jcr.component.core: src/main/java/org/exoplatform/services/jcr/impl/core/lock/jbosscache/jdbc and 1 other directory.

do-not-reply at jboss.org do-not-reply at jboss.org
Thu Mar 10 09:26:45 EST 2011


Author: tolusha
Date: 2011-03-10 09:26:45 -0500 (Thu, 10 Mar 2011)
New Revision: 4070

Modified:
   jcr/trunk/exo.jcr.component.core/pom.xml
   jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/jbosscache/jdbc/LockJDBCContainer.java
Log:
EXOJCR-1048: fix tests

Modified: jcr/trunk/exo.jcr.component.core/pom.xml
===================================================================
--- jcr/trunk/exo.jcr.component.core/pom.xml	2011-03-10 12:34:43 UTC (rev 4069)
+++ jcr/trunk/exo.jcr.component.core/pom.xml	2011-03-10 14:26:45 UTC (rev 4070)
@@ -421,7 +421,6 @@
                   <exclude>org/exoplatform/services/jcr/**/usecases/BaseUsecasesTest.java</exclude>
                   <exclude>org/exoplatform/services/jcr/**/impl/**/TestSessionDataManager.java</exclude>
                   <exclude>org/exoplatform/services/jcr/**/impl/**/SQLBenchmarkTest.java</exclude>
-                  <exclude>org/exoplatform/services/jcr/**/impl/**/TestLockPerstistentDataManager.java</exclude>
                </excludes>
             </configuration>
          </plugin>
@@ -725,7 +724,6 @@
                         <exclude>org/exoplatform/services/jcr/**/impl/**/TestLinkedWorkspaceStorageCacheMetrics.java</exclude>
                         <exclude>org/exoplatform/services/jcr/**/impl/**/SQLBenchmarkTest.java</exclude>
                         <exclude>org/exoplatform/services/jcr/**/impl/**/TestCleanableFileStreamValueData.java</exclude>
-                        <exclude>org/exoplatform/services/jcr/**/impl/**/TestLockPerstistentDataManager.java</exclude>
                         <!-- From TCK -->
                         <exclude>org/apache/jackrabbit/test/api/TestAll.java</exclude>
                         <exclude>org/apache/jackrabbit/test/api/**/Abstract*.java</exclude>

Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/jbosscache/jdbc/LockJDBCContainer.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/jbosscache/jdbc/LockJDBCContainer.java	2011-03-10 12:34:43 UTC (rev 4069)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/jbosscache/jdbc/LockJDBCContainer.java	2011-03-10 14:26:45 UTC (rev 4070)
@@ -18,12 +18,14 @@
  */
 package org.exoplatform.services.jcr.impl.core.lock.jbosscache.jdbc;
 
+import org.exoplatform.commons.utils.SecurityHelper;
 import org.exoplatform.services.jcr.impl.util.jdbc.DBInitializer;
 import org.exoplatform.services.jcr.impl.util.jdbc.DBInitializerException;
 import org.exoplatform.services.log.ExoLogger;
 import org.exoplatform.services.log.Log;
 
 import java.io.IOException;
+import java.security.PrivilegedExceptionAction;
 import java.sql.Connection;
 import java.sql.SQLException;
 
@@ -67,7 +69,14 @@
             try
             {
                log.info("Creating LockManager DB tables.");
-               jdbcConn = dataSource.getConnection();
+
+               jdbcConn = SecurityHelper.doPrivilegedSQLExceptionAction(new PrivilegedExceptionAction<Connection>()
+               {
+                  public Connection run() throws Exception
+                  {
+                     return dataSource.getConnection();
+                  }
+               });
                // if table not exists, create it  
                // connection is closed by DB initializer
                initDatabase(dataSourceName, jdbcConn);



More information about the exo-jcr-commits mailing list