cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r535204 - in /cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src: main/java/org/apache/cayenne/conf/DBCPDataSourceProperties.java test/java/org/apache/cayenne/conf/DBCPDataSourcePropertiesTest.java test/resources/dbcp.properties
Date Fri, 04 May 2007 12:29:46 GMT
Author: aadamchik
Date: Fri May  4 05:29:45 2007
New Revision: 535204

URL: http://svn.apache.org/viewvc?view=rev&rev=535204
Log:
CAY-785   Cayenne Modeler Fails to Open Project
(tests that demonstrate that DBCPDataSourceProperties actually does the right thing)

Added:
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/test/resources/dbcp.properties
Modified:
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/conf/DBCPDataSourceProperties.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/test/java/org/apache/cayenne/conf/DBCPDataSourcePropertiesTest.java

Modified: cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/conf/DBCPDataSourceProperties.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/conf/DBCPDataSourceProperties.java?view=diff&rev=535204&r1=535203&r2=535204
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/conf/DBCPDataSourceProperties.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/conf/DBCPDataSourceProperties.java
Fri May  4 05:29:45 2007
@@ -42,9 +42,8 @@
     /**
      * Loads properties from the specified location.
      */
-    private static Properties loadProperties(
-            ResourceLocator resourceLocator,
-            String location) throws IOException {
+    static Properties loadProperties(ResourceLocator resourceLocator, String location)
+            throws IOException {
 
         InputStream in = resourceLocator.findResourceStream(location);
 

Modified: cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/test/java/org/apache/cayenne/conf/DBCPDataSourcePropertiesTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/test/java/org/apache/cayenne/conf/DBCPDataSourcePropertiesTest.java?view=diff&rev=535204&r1=535203&r2=535204
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/test/java/org/apache/cayenne/conf/DBCPDataSourcePropertiesTest.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/test/java/org/apache/cayenne/conf/DBCPDataSourcePropertiesTest.java
Fri May  4 05:29:45 2007
@@ -25,12 +25,26 @@
 import junit.framework.TestCase;
 
 import org.apache.cayenne.ConfigurationException;
+import org.apache.cayenne.util.ResourceLocator;
 import org.apache.commons.pool.impl.GenericObjectPool;
 
 /**
  * @author Andrus Adamchik
  */
 public class DBCPDataSourcePropertiesTest extends TestCase {
+
+    public void testLoadProperties() throws Exception {
+        ResourceLocator locator = new ResourceLocator();
+        locator.setSkipClasspath(false);
+
+        Properties props1 = DBCPDataSourceProperties.loadProperties(locator, "dbcp");
+        assertNotNull(props1);
+        assertEquals("a", props1.get("b"));
+        
+        Properties props2 = DBCPDataSourceProperties.loadProperties(locator, "dbcp.properties");
+        assertNotNull(props2);
+        assertEquals("a", props2.get("b"));
+    }
 
     public void testStringProperty() {
         Properties props = new Properties();

Added: cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/test/resources/dbcp.properties
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/test/resources/dbcp.properties?view=auto&rev=535204
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/test/resources/dbcp.properties
(added)
+++ cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/test/resources/dbcp.properties
Fri May  4 05:29:45 2007
@@ -0,0 +1 @@
+b=a
\ No newline at end of file



Mime
View raw message