summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPetteri Räty <betelgeuse@gentoo.org>2007-12-25 02:23:06 +0000
committerPetteri Räty <betelgeuse@gentoo.org>2007-12-25 02:23:06 +0000
commit57792023e4010e14863c63f6ce1a01169507ff7b (patch)
tree1938d19a8da9e3f025abe29395710bddb3818078 /dev-java/jfreechart
parentDelete generation 1 ebuild. (diff)
downloadgentoo-2-57792023e4010e14863c63f6ce1a01169507ff7b.tar.gz
gentoo-2-57792023e4010e14863c63f6ce1a01169507ff7b.tar.bz2
gentoo-2-57792023e4010e14863c63f6ce1a01169507ff7b.zip
Add patch from upstream svn for failing tests.
(Portage version: 2.1.4_rc9)
Diffstat (limited to 'dev-java/jfreechart')
-rw-r--r--dev-java/jfreechart/ChangeLog6
-rw-r--r--dev-java/jfreechart/files/1.0.8-test-timezone.patch141
-rw-r--r--dev-java/jfreechart/jfreechart-1.0.8a.ebuild5
3 files changed, 149 insertions, 3 deletions
diff --git a/dev-java/jfreechart/ChangeLog b/dev-java/jfreechart/ChangeLog
index f1e7b32b3102..53f3afc792aa 100644
--- a/dev-java/jfreechart/ChangeLog
+++ b/dev-java/jfreechart/ChangeLog
@@ -1,6 +1,10 @@
# ChangeLog for dev-java/jfreechart
# Copyright 1999-2007 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/dev-java/jfreechart/ChangeLog,v 1.29 2007/12/15 03:50:17 betelgeuse Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-java/jfreechart/ChangeLog,v 1.30 2007/12/25 02:23:05 betelgeuse Exp $
+
+ 25 Dec 2007; Petteri Räty <betelgeuse@gentoo.org>
+ +files/1.0.8-test-timezone.patch, jfreechart-1.0.8a.ebuild:
+ Add patch from upstream svn for failing tests.
*jfreechart-1.0.8a (15 Dec 2007)
diff --git a/dev-java/jfreechart/files/1.0.8-test-timezone.patch b/dev-java/jfreechart/files/1.0.8-test-timezone.patch
new file mode 100644
index 000000000000..8e00f12a0033
--- /dev/null
+++ b/dev-java/jfreechart/files/1.0.8-test-timezone.patch
@@ -0,0 +1,141 @@
+Index: source/org/jfree/data/time/Week.java
+===================================================================
+--- source/org/jfree/data/time/Week.java (revision 691)
++++ source/org/jfree/data/time/Week.java (revision 692)
+@@ -65,6 +65,7 @@
+ * 09-Jan-2007 : Fixed bug in next() (DG);
+ * 28-Aug-2007 : Added new constructor to avoid problem in creating new
+ * instances (DG);
++ * 19-Dec-2007 : Fixed bug in deprecated constructor (DG);
+ *
+ */
+
+@@ -171,7 +172,7 @@
+ */
+ public Week(Date time, TimeZone zone) {
+ // defer argument checking...
+- this(time, RegularTimePeriod.DEFAULT_TIME_ZONE, Locale.getDefault());
++ this(time, zone, Locale.getDefault());
+ }
+
+ /**
+Index: tests/org/jfree/data/time/junit/WeekTests.java
+===================================================================
+--- tests/org/jfree/data/time/junit/WeekTests.java (revision 691)
++++ tests/org/jfree/data/time/junit/WeekTests.java (revision 692)
+@@ -43,6 +43,8 @@
+ * 01-Jun-2006 : Added testBug1498805() method (DG);
+ * 11-Jul-2007 : Fixed bad time zone assumption (DG);
+ * 28-Aug-2007 : Added test for constructor problem (DG);
++ * 19-Dec-2007 : Set default locale for tests that are sensitive
++ * to the locale (DG);
+ *
+ */
+
+@@ -288,22 +290,36 @@
+ * A test case for bug 1448828.
+ */
+ public void testBug1448828() {
+- Week w = new Week(new Date(1136109830000l),
+- TimeZone.getTimeZone("GMT"));
+- assertEquals(2005, w.getYearValue());
+- assertEquals(52, w.getWeek());
++ Locale saved = Locale.getDefault();
++ Locale.setDefault(Locale.UK);
++ try {
++ Week w = new Week(new Date(1136109830000l),
++ TimeZone.getTimeZone("GMT"));
++ assertEquals(2005, w.getYearValue());
++ assertEquals(52, w.getWeek());
++ }
++ finally {
++ Locale.setDefault(saved);
++ }
+ }
+
+ /**
+ * A test case for bug 1498805.
+ */
+ public void testBug1498805() {
+- TimeZone zone = TimeZone.getTimeZone("GMT");
+- GregorianCalendar gc = new GregorianCalendar(zone);
+- gc.set(2005, Calendar.JANUARY, 1, 12, 0, 0);
+- Week w = new Week(gc.getTime(), zone);
+- assertEquals(53, w.getWeek());
+- assertEquals(new Year(2004), w.getYear());
++ Locale saved = Locale.getDefault();
++ Locale.setDefault(Locale.UK);
++ try {
++ TimeZone zone = TimeZone.getTimeZone("GMT");
++ GregorianCalendar gc = new GregorianCalendar(zone);
++ gc.set(2005, Calendar.JANUARY, 1, 12, 0, 0);
++ Week w = new Week(gc.getTime(), zone);
++ assertEquals(53, w.getWeek());
++ assertEquals(new Year(2004), w.getYear());
++ }
++ finally {
++ Locale.setDefault(saved);
++ }
+ }
+
+ /**
+@@ -325,8 +341,15 @@
+ */
+ public void testGetFirstMillisecondWithTimeZone() {
+ Week w = new Week(47, 1950);
+- TimeZone zone = TimeZone.getTimeZone("America/Los_Angeles");
+- assertEquals(-603216000000L, w.getFirstMillisecond(zone));
++ Locale saved = Locale.getDefault();
++ Locale.setDefault(Locale.US);
++ try {
++ TimeZone zone = TimeZone.getTimeZone("America/Los_Angeles");
++ assertEquals(-603302400000L, w.getFirstMillisecond(zone));
++ }
++ finally {
++ Locale.setDefault(saved);
++ }
+
+ // try null calendar
+ boolean pass = false;
+@@ -335,8 +358,8 @@
+ }
+ catch (NullPointerException e) {
+ pass = true;
+- }
+- assertTrue(pass);
++ }
++ assertTrue(pass);
+ }
+
+ /**
+@@ -378,10 +401,17 @@
+ */
+ public void testGetLastMillisecondWithTimeZone() {
+ Week w = new Week(2, 1950);
+- TimeZone zone = TimeZone.getTimeZone("America/Los_Angeles");
+- assertEquals(-629827200001L, w.getLastMillisecond(zone));
+-
+- // try null calendar
++ Locale saved = Locale.getDefault();
++ Locale.setDefault(Locale.US);
++ try {
++ TimeZone zone = TimeZone.getTimeZone("America/Los_Angeles");
++ assertEquals(-629913600001L, w.getLastMillisecond(zone));
++ }
++ finally {
++ Locale.setDefault(saved);
++ }
++
++ // try null zone
+ boolean pass = false;
+ try {
+ w.getLastMillisecond((TimeZone) null);
+@@ -389,7 +419,7 @@
+ catch (NullPointerException e) {
+ pass = true;
+ }
+- assertTrue(pass);
++ assertTrue(pass);
+ }
+
+ /**
diff --git a/dev-java/jfreechart/jfreechart-1.0.8a.ebuild b/dev-java/jfreechart/jfreechart-1.0.8a.ebuild
index 48034fb9d6e6..ebfefd689251 100644
--- a/dev-java/jfreechart/jfreechart-1.0.8a.ebuild
+++ b/dev-java/jfreechart/jfreechart-1.0.8a.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/dev-java/jfreechart/jfreechart-1.0.8a.ebuild,v 1.1 2007/12/15 03:50:17 betelgeuse Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-java/jfreechart/jfreechart-1.0.8a.ebuild,v 1.2 2007/12/25 02:23:05 betelgeuse Exp $
JAVA_PKG_IUSE="doc source"
@@ -32,7 +32,8 @@ src_unpack() {
epatch "${FILESDIR}/${PN}-1.0.4-build.xml.patch"
fi
- rm -v lib/* *.jar || die
+ epatch "${FILESDIR}/1.0.8-test-timezone.patch"
+ rm -v *.jar lib/*.jar || die
}
src_compile() {