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/files
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/files')
-rw-r--r--dev-java/jfreechart/files/1.0.8-test-timezone.patch141
1 files changed, 141 insertions, 0 deletions
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);
+ }
+
+ /**