harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hinde...@apache.org
Subject svn commit: r463260 - /incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/util/TimeZoneTest.java
Date Thu, 12 Oct 2006 14:32:43 GMT
Author: hindessm
Date: Thu Oct 12 07:32:40 2006
New Revision: 463260

URL: http://svn.apache.org/viewvc?view=rev&rev=463260
Log:
Correcting order of assertEquals arguments.  The expected value comes first.

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/util/TimeZoneTest.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/util/TimeZoneTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/util/TimeZoneTest.java?view=diff&rev=463260&r1=463259&r2=463260
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/util/TimeZoneTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/util/TimeZoneTest.java
Thu Oct 12 07:32:40 2006
@@ -32,8 +32,8 @@
 	 * @tests java.util.TimeZone#getDefault()
 	 */
 	public void test_getDefault() {
-		assertTrue("returns identical", TimeZone.getDefault() != TimeZone
-				.getDefault());
+		assertNotSame("returns identical",
+                              TimeZone.getDefault(), TimeZone.getDefault());
 	}
 
 	/**
@@ -44,23 +44,23 @@
 
 		// test on subclass SimpleTimeZone
 		TimeZone st1 = TimeZone.getTimeZone("EST");
-		assertEquals("T1A. Incorrect daylight savings returned, ", ONE_HOUR,
-				st1.getDSTSavings());
+		assertEquals("T1A. Incorrect daylight savings returned",
+                             ONE_HOUR, st1.getDSTSavings());
 
 		// a SimpleTimeZone with daylight savings different then 1 hour
 		st1 = TimeZone.getTimeZone("Australia/Lord_Howe");
-		assertEquals("T1B. Incorrect daylight savings returned, ", 1800000, st1
-				.getDSTSavings());
+		assertEquals("T1B. Incorrect daylight savings returned",
+                             1800000, st1.getDSTSavings());
 
 		// test on subclass Support_TimeZone, an instance with daylight savings
 		TimeZone tz1 = new Support_TimeZone(-5 * ONE_HOUR, true);
-		assertEquals("T2. Incorrect daylight savings returned, ", ONE_HOUR, tz1
-				.getDSTSavings());
+		assertEquals("T2. Incorrect daylight savings returned",
+                             ONE_HOUR, tz1.getDSTSavings());
 
 		// an instance without daylight savings
 		tz1 = new Support_TimeZone(3 * ONE_HOUR, false);
-		assertEquals("T3. Incorrect daylight savings returned, ", 0, tz1
-				.getDSTSavings());
+		assertEquals("T3. Incorrect daylight savings returned, ",
+                             0, tz1.getDSTSavings());
 	}
 
 	/**
@@ -73,100 +73,80 @@
 		TimeZone st1 = TimeZone.getTimeZone("EST");
 		long time1 = new GregorianCalendar(1998, Calendar.NOVEMBER, 11)
 				.getTimeInMillis();
-		assertEquals("T1. Incorrect offset returned, ", -(5 * ONE_HOUR), st1
-				.getOffset(time1));
+		assertEquals("T1. Incorrect offset returned",
+                             -(5 * ONE_HOUR), st1.getOffset(time1));
 
 		long time2 = new GregorianCalendar(1998, Calendar.JUNE, 11)
 				.getTimeInMillis();
 		st1 = TimeZone.getTimeZone("EST");
-		assertEquals("T2. Incorrect offset returned, ", -(4 * ONE_HOUR), st1
-				.getOffset(time2));
+		assertEquals("T2. Incorrect offset returned",
+                             -(4 * ONE_HOUR), st1.getOffset(time2));
 
 		// test on subclass Support_TimeZone, an instance with daylight savings
 		TimeZone tz1 = new Support_TimeZone(-5 * ONE_HOUR, true);
-		assertEquals("T3. Incorrect offset returned, ", -(5 * ONE_HOUR), tz1
-				.getOffset(time1));
-		assertEquals("T4. Incorrect offset returned, ", -(4 * ONE_HOUR), tz1
-				.getOffset(time2));
+		assertEquals("T3. Incorrect offset returned, ",
+                             -(5 * ONE_HOUR), tz1.getOffset(time1));
+		assertEquals("T4. Incorrect offset returned, ",
+                             -(4 * ONE_HOUR), tz1.getOffset(time2));
 
 		// an instance without daylight savings
 		tz1 = new Support_TimeZone(3 * ONE_HOUR, false);
-		assertEquals("T5. Incorrect offset returned, ", (3 * ONE_HOUR), tz1
-				.getOffset(time1));
-		assertEquals("T6. Incorrect offset returned, ", (3 * ONE_HOUR), tz1
-				.getOffset(time2));
+		assertEquals("T5. Incorrect offset returned, ",
+                             (3 * ONE_HOUR), tz1.getOffset(time1));
+		assertEquals("T6. Incorrect offset returned, ",
+                             (3 * ONE_HOUR), tz1.getOffset(time2));
 	}
 
 	/**
 	 * @tests java.util.TimeZone#getTimeZone(java.lang.String)
 	 */
 	public void test_getTimeZoneLjava_lang_String() {
-		assertEquals(
-				"Must return GMT when given an invalid TimeZone id SMT-8.",
-				TimeZone.getTimeZone("SMT-8").getID(), "GMT");
-		assertEquals(
-				"Must return GMT when given an invalid TimeZone time GMT+28:70.",
-				TimeZone.getTimeZone("GMT+28:70").getID(), "GMT");
-		assertEquals(
-				"Must return GMT when given an invalid TimeZone time GMT+28:30.",
-				TimeZone.getTimeZone("GMT+28:30").getID(), "GMT");
-		assertEquals(
-				"Must return GMT when given an invalid TimeZone time GMT+8:70.",
-				TimeZone.getTimeZone("GMT+8:70").getID(), "GMT");
-		assertEquals(
-				"Must return GMT when given an invalid TimeZone time GMT+3:.",
-				TimeZone.getTimeZone("GMT+3:").getID(), "GMT");
-		assertEquals(
-				"Must return GMT when given an invalid TimeZone time GMT+3:0.",
-				TimeZone.getTimeZone("GMT+3:0").getID(), "GMT");
-		assertEquals(
-				"Must return GMT when given an invalid TimeZone time GMT+2360.",
-				TimeZone.getTimeZone("GMT+2360").getID(), "GMT");
-		assertEquals(
-				"Must return GMT when given an invalid TimeZone time GMT+892.",
-				TimeZone.getTimeZone("GMT+892").getID(), "GMT");
-		assertEquals(
-				"Must return GMT when given an invalid TimeZone time GMT+082.",
-				TimeZone.getTimeZone("GMT+082").getID(), "GMT");
-		assertEquals(
-				"Must return GMT when given an invalid TimeZone time GMT+28.",
-				TimeZone.getTimeZone("GMT+28").getID(), "GMT");
-		assertEquals(
-				"Must return GMT when given an invalid TimeZone time GMT+30.",
-				TimeZone.getTimeZone("GMT+30").getID(), "GMT");
-		assertEquals("Must return GMT when given TimeZone GMT.", TimeZone
-				.getTimeZone("GMT").getID(), "GMT");
-		assertEquals("Must return GMT when given TimeZone GMT+.", TimeZone
-				.getTimeZone("GMT+").getID(), "GMT");
-		assertEquals("Must return GMT when given TimeZone GMT-.", TimeZone
-				.getTimeZone("GMT-").getID(), "GMT");
-		assertEquals(
-				"Must return GMT when given an invalid TimeZone time GMT-8.45.",
-				TimeZone.getTimeZone("GMT-8.45").getID(), "GMT");
-		assertEquals(
-				"Must return GMT when given an invalid TimeZone time GMT-123:23.",
-				TimeZone.getTimeZone("GMT-123:23").getID(), "GMT");
-		assertEquals(
-				"Must return proper GMT formatted string for GMT+8:30 (eg. GMT+08:20).",
-				TimeZone.getTimeZone("GMT+8:30").getID(), "GMT+08:30");
-		assertEquals(
-				"Must return proper GMT formatted string for GMT+3 (eg. GMT+08:20).",
-				TimeZone.getTimeZone("GMT+3").getID(), "GMT+03:00");
-		assertEquals(
-				"Must return proper GMT formatted string for GMT+3:02 (eg. GMT+08:20).",
-				TimeZone.getTimeZone("GMT+3:02").getID(), "GMT+03:02");
-		assertEquals(
-				"Must return proper GMT formatted string for GMT+2359 (eg. GMT+08:20).",
-				TimeZone.getTimeZone("GMT+2359").getID(), "GMT+23:59");
-		assertEquals(
-				"Must return proper GMT formatted string for GMT+520 (eg. GMT+08:20).",
-				TimeZone.getTimeZone("GMT+520").getID(), "GMT+05:20");
-		assertEquals(
-				"Must return proper GMT formatted string for GMT+052 (eg. GMT+08:20).",
-				TimeZone.getTimeZone("GMT+052").getID(), "GMT+00:52");
-		assertEquals(
-				"Must return proper GMT formatted string for GMT-0 (eg. GMT+08:20).",
-				TimeZone.getTimeZone("GMT-0").getID(), "GMT-00:00");
+		assertEquals("Must return GMT when given an invalid TimeZone id SMT-8.",
+                             "GMT", TimeZone.getTimeZone("SMT-8").getID());
+		assertEquals("Must return GMT when given an invalid TimeZone time GMT+28:70.",
+                             "GMT", TimeZone.getTimeZone("GMT+28:70").getID());
+		assertEquals("Must return GMT when given an invalid TimeZone time GMT+28:30.",
+                             "GMT", TimeZone.getTimeZone("GMT+28:30").getID());
+		assertEquals("Must return GMT when given an invalid TimeZone time GMT+8:70.",
+                             "GMT", TimeZone.getTimeZone("GMT+8:70").getID());
+		assertEquals("Must return GMT when given an invalid TimeZone time GMT+3:.",
+                             "GMT", TimeZone.getTimeZone("GMT+3:").getID());
+		assertEquals("Must return GMT when given an invalid TimeZone time GMT+3:0.",
+                             "GMT", TimeZone.getTimeZone("GMT+3:0").getID());
+		assertEquals("Must return GMT when given an invalid TimeZone time GMT+2360.",
+                             "GMT", TimeZone.getTimeZone("GMT+2360").getID());
+		assertEquals("Must return GMT when given an invalid TimeZone time GMT+892.",
+                             "GMT", TimeZone.getTimeZone("GMT+892").getID());
+		assertEquals("Must return GMT when given an invalid TimeZone time GMT+082.",
+                             "GMT", TimeZone.getTimeZone("GMT+082").getID());
+		assertEquals("Must return GMT when given an invalid TimeZone time GMT+28.",
+                             "GMT", TimeZone.getTimeZone("GMT+28").getID());
+		assertEquals("Must return GMT when given an invalid TimeZone time GMT+30.",
+                             "GMT", TimeZone.getTimeZone("GMT+30").getID());
+		assertEquals("Must return GMT when given TimeZone GMT.",
+                             "GMT", TimeZone.getTimeZone("GMT").getID());
+		assertEquals("Must return GMT when given TimeZone GMT+.",
+                             "GMT", TimeZone.getTimeZone("GMT+").getID());
+		assertEquals("Must return GMT when given TimeZone GMT-.",
+                             "GMT", TimeZone.getTimeZone("GMT-").getID());
+		assertEquals("Must return GMT when given an invalid TimeZone time GMT-8.45.",
+                             "GMT", TimeZone.getTimeZone("GMT-8.45").getID());
+		assertEquals("Must return GMT when given an invalid TimeZone time GMT-123:23.",
+                             "GMT", TimeZone.getTimeZone("GMT-123:23").getID());
+		assertEquals("Must return proper GMT formatted string for GMT+8:30 (eg. GMT+08:20).",
+                             "GMT+08:30", TimeZone.getTimeZone("GMT+8:30").getID());
+		assertEquals("Must return proper GMT formatted string for GMT+3 (eg. GMT+08:20).",
+                             "GMT+03:00", TimeZone.getTimeZone("GMT+3").getID());
+		assertEquals("Must return proper GMT formatted string for GMT+3:02 (eg. GMT+08:20).",
+                             "GMT+03:02", TimeZone.getTimeZone("GMT+3:02").getID());
+		assertEquals("Must return proper GMT formatted string for GMT+2359 (eg. GMT+08:20).",
+                             "GMT+23:59", TimeZone.getTimeZone("GMT+2359").getID());
+		assertEquals("Must return proper GMT formatted string for GMT+520 (eg. GMT+08:20).",
+                             "GMT+05:20", TimeZone.getTimeZone("GMT+520").getID());
+		assertEquals("Must return proper GMT formatted string for GMT+052 (eg. GMT+08:20).",
+                             "GMT+00:52", TimeZone.getTimeZone("GMT+052").getID());
+		assertEquals("Must return proper GMT formatted string for GMT-0 (eg. GMT+08:20).",
+                             "GMT-00:00", TimeZone.getTimeZone("GMT-0").getID());
 	}
 
 	/**
@@ -176,10 +156,10 @@
 		TimeZone oldDefault = TimeZone.getDefault();
 		TimeZone zone = new SimpleTimeZone(45, "TEST");
 		TimeZone.setDefault(zone);
-		assertTrue("timezone not set", TimeZone.getDefault().equals(zone));
+		assertEquals("timezone not set", zone, TimeZone.getDefault());
 		TimeZone.setDefault(null);
-		assertTrue("default not restored", TimeZone.getDefault().equals(
-				oldDefault));
+		assertEquals("default not restored",
+                             oldDefault, TimeZone.getDefault());
 	}
 
 	protected void setUp() {



Mime
View raw message