[mchange-commons] Added patch to build with JDBC 4.1/Java 7 Added patch to disable one of the tests that is not always

Deepak Bhole dbhole at fedoraproject.org
Wed Jan 25 15:31:42 UTC 2012


commit a312a1947ed2d479f984563af85f0968a67dd827
Author: Deepak Bhole <dbhole at redhat.com>
Date:   Wed Jan 25 10:31:25 2012 -0500

    Added patch to build with JDBC 4.1/Java 7
    Added patch to disable one of the tests that is not always guaranteed to pass

 mchange-commons-jdbc-4.1.patch             |   24 +++++++++++++++
 mchange-commons-remove-weakness-test.patch |   44 ++++++++++++++++++++++++++++
 mchange-commons.spec                       |   14 ++++++++-
 3 files changed, 81 insertions(+), 1 deletions(-)
---
diff --git a/mchange-commons-jdbc-4.1.patch b/mchange-commons-jdbc-4.1.patch
new file mode 100644
index 0000000..6af705b
--- /dev/null
+++ b/mchange-commons-jdbc-4.1.patch
@@ -0,0 +1,24 @@
+diff -up ./src/java/com/mchange/v1/db/sql/DriverManagerDataSource.java.sav ./src/java/com/mchange/v1/db/sql/DriverManagerDataSource.java
+--- ./src/java/com/mchange/v1/db/sql/DriverManagerDataSource.java.sav	2012-01-24 16:19:51.000000000 -0500
++++ ./src/java/com/mchange/v1/db/sql/DriverManagerDataSource.java	2012-01-24 16:21:06.000000000 -0500
+@@ -31,6 +31,9 @@ import javax.naming.spi.ObjectFactory;
+ import javax.sql.DataSource;
+ import com.mchange.io.UnsupportedVersionException;
+ 
++import java.sql.SQLFeatureNotSupportedException;
++import java.util.logging.Logger;
++
+ /**
+  * @deprecated use com.mchange.v2.c3p0.DriverManagerDataSource
+  */
+@@ -144,6 +147,10 @@ public class DriverManagerDataSource imp
+ 	    }
+     }
+ 
++    public Logger getParentLogger() throws SQLFeatureNotSupportedException {
++        throw new SQLFeatureNotSupportedException();
++    }
++
+     //ObjectFactory for JNDI referencing
+     public static class DmdsObjectFactory implements ObjectFactory
+     {
diff --git a/mchange-commons-remove-weakness-test.patch b/mchange-commons-remove-weakness-test.patch
new file mode 100644
index 0000000..ee41f34
--- /dev/null
+++ b/mchange-commons-remove-weakness-test.patch
@@ -0,0 +1,44 @@
+diff -up ./src/java/com/mchange/v2/util/junit/DoubleWeakHashMapJUnitTestCase.java.sav ./src/java/com/mchange/v2/util/junit/DoubleWeakHashMapJUnitTestCase.java
+--- ./src/java/com/mchange/v2/util/junit/DoubleWeakHashMapJUnitTestCase.java.sav	2012-01-24 16:29:35.000000000 -0500
++++ ./src/java/com/mchange/v2/util/junit/DoubleWeakHashMapJUnitTestCase.java	2012-01-24 16:29:53.000000000 -0500
+@@ -71,40 +71,4 @@ public class DoubleWeakHashMapJUnitTestC
+         assertEquals("After removing a doubled value, size should be 2", m.size(), 2);
+     }
+     
+-    public void testWeakness()
+-    {
+-        Integer a = new Integer(1);
+-        Integer b = new Integer(2);
+-        Integer c = new Integer(3);
+-        
+-        String poop = new String("poop");
+-
+-        Map m = new DoubleWeakHashMap();
+-        m.put(a, poop);
+-        m.put(b, new Object());
+-        m.put(c, new Object());
+-        
+-        //race condition... b & c might already have been removed... but i doubt it
+-        assertEquals("1) Weak values should not yet have been removed (but not guaranteed! sometimes fails without a defect!)", 3, m.size());
+-        
+-        // we are relying that a full, synchronous GC occurs,
+-        // which is not guaranteed in all VMs
+-        System.gc();
+-        
+-        // let's see if we can force a deeper gc via a big array creation
+-        byte[] bArray = new byte[ARRAY_SZ];
+-        
+-        assertEquals("2) Weak values should have been automatically removed (but not guaranteed! sometimes fails without a defect!)", 1, m.size());
+-        
+-        m.put( new Object(), b);
+-        
+-        //race condition... b & c might already have been removed... but i doubt it
+-        assertEquals("3) Weak key should not yet have been removed (but not guaranteed! sometimes fails without a defect!)", 2, m.size());
+-
+-        System.gc();
+-        // let's see if we can force a deeper gc via a big array creation
+-        bArray = new byte[ARRAY_SZ];
+-
+-        assertEquals("4) Weak key should have been automatically removed (but not guaranteed! sometimes fails without a defect!)", m.size(), 1);
+-    }
+ }
diff --git a/mchange-commons.spec b/mchange-commons.spec
index 2295f87..9578678 100644
--- a/mchange-commons.spec
+++ b/mchange-commons.spec
@@ -2,7 +2,7 @@
 
 Name:    mchange-commons
 Version: 0.2
-Release: 0.4.%{hgcheckout}%{?dist}
+Release: 0.5.%{hgcheckout}%{?dist}
 Summary: A collection of general purpose utilities for c3p0
 License: LGPLv2
 URL:     http://sourceforge.net/projects/c3p0
@@ -26,6 +26,12 @@ Source0: %{name}-%{hgcheckout}.tar.gz
 # Patch the build to include javadocs
 Patch0: mchange-commons-javadoc.patch
 
+# Patch to build with JDBC 4.1/Java 7
+Patch1: mchange-commons-jdbc-4.1.patch
+
+# Remove one of the tests that intermittently fails
+Patch2: mchange-commons-remove-weakness-test.patch
+
 BuildArch: noarch
 
 %description
@@ -45,6 +51,8 @@ Requires:      java-javadoc
 %setup -q -n %{name}
 
 %patch0 -p0 -b .orig
+%patch1 -p0 -b .jdbc41
+%patch2 -p0 -b .testweakness
 
 # remove all binary bits
 find -name '*.class' -exec rm -f '{}' \;
@@ -75,6 +83,10 @@ cp -pr docs/* %{buildroot}%{_javadocdir}/%{name}
 %{_javadocdir}/%{name}
 
 %changelog
+* Wed Jan 25 2012 Deepak Bhole <dbhole at redhat.com> - 0.2-0.5.20110130hg
+- Added patch to build with JDBC 4.1/Java 7
+- Added patch to disable one of the tests that is not always guaranteed to pass
+
 * Fri Jan 13 2012 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 0.2-0.4.20110130hg
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
 


More information about the scm-commits mailing list