cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dkazimirc...@apache.org
Subject svn commit: r1171003 - in /cayenne/main/trunk: ./ framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/unit/ framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/unit/di/server/
Date Thu, 15 Sep 2011 08:27:28 GMT
Author: dkazimirchyk
Date: Thu Sep 15 08:27:28 2011
New Revision: 1171003

URL: http://svn.apache.org/viewvc?rev=1171003&view=rev
Log:
CAY-1210 mysql does not use index for case insensitive searches

modyfied unit test setup to enable testing with maven

Modified:
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/unit/UnitDbAdapter.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/unit/di/server/UnitDbAdapterProvider.java
    cayenne/main/trunk/pom.xml

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/unit/UnitDbAdapter.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/unit/UnitDbAdapter.java?rev=1171003&r1=1171002&r2=1171003&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/unit/UnitDbAdapter.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/unit/UnitDbAdapter.java
Thu Sep 15 08:27:28 2011
@@ -34,8 +34,11 @@ import java.util.HashSet;
 import java.util.Map;
 
 import org.apache.cayenne.CayenneRuntimeException;
+import org.apache.cayenne.configuration.RuntimeProperties;
 import org.apache.cayenne.dba.DbAdapter;
+import org.apache.cayenne.dba.JdbcAdapter;
 import org.apache.cayenne.dba.QuotingStrategy;
+import org.apache.cayenne.di.Inject;
 import org.apache.cayenne.map.DataMap;
 import org.apache.cayenne.map.DbEntity;
 import org.apache.cayenne.map.Procedure;
@@ -51,6 +54,9 @@ import org.apache.commons.logging.LogFac
 public class UnitDbAdapter {
 
     private static Log logger = LogFactory.getLog(UnitDbAdapter.class);
+    
+    @Inject
+    protected RuntimeProperties runtimeProperties;
 
     protected DbAdapter adapter;
 
@@ -213,7 +219,7 @@ public class UnitDbAdapter {
     }
 
     public boolean supportsCaseSensitiveLike() {
-        return true;
+        return !runtimeProperties.getBoolean(JdbcAdapter.CI_PROPERTY, false);
     }
 
     public boolean supportsCaseInsensitiveOrder() {

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/unit/di/server/UnitDbAdapterProvider.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/unit/di/server/UnitDbAdapterProvider.java?rev=1171003&r1=1171002&r2=1171003&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/unit/di/server/UnitDbAdapterProvider.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/unit/di/server/UnitDbAdapterProvider.java
Thu Sep 15 08:27:28 2011
@@ -26,6 +26,7 @@ import org.apache.cayenne.ConfigurationE
 import org.apache.cayenne.conn.DataSourceInfo;
 import org.apache.cayenne.dba.DbAdapter;
 import org.apache.cayenne.di.Inject;
+import org.apache.cayenne.di.Injector;
 import org.apache.cayenne.di.Provider;
 import org.apache.cayenne.unit.UnitDbAdapter;
 import org.apache.cayenne.util.Util;
@@ -34,16 +35,19 @@ public class UnitDbAdapterProvider imple
 
     static final String TEST_ADAPTERS_MAP = "org.apache.cayenne.unit.di.server.CayenneResourcesAccessStackAdapterProvider.adapters";
 
+    private Injector injector;
     private DbAdapter adapter;
     private DataSourceInfo dataSourceInfo;
     private Map<String, String> adapterTypesMap;
 
     public UnitDbAdapterProvider(
             @Inject(TEST_ADAPTERS_MAP) Map<String, String> adapterTypesMap,
-            @Inject DataSourceInfo dataSourceInfo, @Inject DbAdapter adapter) {
+            @Inject DataSourceInfo dataSourceInfo, @Inject DbAdapter adapter,
+            @Inject Injector injector) {
         this.dataSourceInfo = dataSourceInfo;
         this.adapterTypesMap = adapterTypesMap;
         this.adapter = adapter;
+        this.injector = injector;
     }
 
     public UnitDbAdapter get() throws ConfigurationException {
@@ -74,7 +78,9 @@ public class UnitDbAdapterProvider imple
 
         try {
             Constructor<UnitDbAdapter> c = type.getConstructor(DbAdapter.class);
-            return c.newInstance(adapter);
+            UnitDbAdapter unitAdapter = c.newInstance(adapter);
+            injector.injectMembers(unitAdapter);
+            return unitAdapter;
         }
         catch (Exception e) {
             throw new ConfigurationException("Error instantiating " + testAdapterType, e);

Modified: cayenne/main/trunk/pom.xml
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/pom.xml?rev=1171003&r1=1171002&r2=1171003&view=diff
==============================================================================
--- cayenne/main/trunk/pom.xml (original)
+++ cayenne/main/trunk/pom.xml Thu Sep 15 08:27:28 2011
@@ -573,7 +573,7 @@
 				<version>2.5</version>
 				<configuration>
 					<argLine>
-						-DcayenneTestConnection=${cayenneTestConnection} -Djava.net.preferIPv4Stack=true
+						-DcayenneTestConnection=${cayenneTestConnection} -Djava.net.preferIPv4Stack=true -Dcayenne.runtime.db.collation.assume.ci=${cayenne.runtime.db.collation.assume.ci}
 					</argLine>
 					<systemPropertyVariables>
 						<property>



Mime
View raw message