001: /*
002: * $Id: org.eclipse.jdt.ui.prefs 5004 2006-03-17 20:47:08 -0800 (Fri, 17 Mar
003: * 2006) eelco12 $ $Revision: 5004 $ $Date: 2006-03-17 20:47:08 -0800 (Fri, 17
004: * Mar 2006) $
005: *
006: * ==============================================================================
007: * Licensed under the Apache License, Version 2.0 (the "License"); you may not
008: * use this file except in compliance with the License. You may obtain a copy of
009: * the License at
010: *
011: * http://www.apache.org/licenses/LICENSE-2.0
012: *
013: * Unless required by applicable law or agreed to in writing, software
014: * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
015: * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
016: * License for the specific language governing permissions and limitations under
017: * the License.
018: */
019: package wicket.protocol.http;
020:
021: import java.util.TimeZone;
022:
023: import junit.framework.TestCase;
024:
025: /**
026: * Tests for ClientProperties that failed on Mac OS X Java platform.
027: *
028: * @author Martijn Dashorst
029: */
030: public class ClientPropertiesTest extends TestCase {
031: /**
032: * Tests GMT-2:00
033: */
034: public void testTimezoneMinus2() {
035: String utc = "-2.0";
036: ClientProperties props = new ClientProperties();
037: props.setProperty(ClientProperties.UTC_OFFSET, utc);
038:
039: assertEquals(TimeZone.getTimeZone("GMT-2:00"), props
040: .getTimeZone());
041: }
042:
043: /**
044: * Tests GMT+2:00
045: */
046: public void testTimezonePlus2() {
047: String utc = "+2.0";
048: ClientProperties props = new ClientProperties();
049: props.setProperty(ClientProperties.UTC_OFFSET, utc);
050:
051: assertEquals(TimeZone.getTimeZone("GMT+2:00"), props
052: .getTimeZone());
053: }
054:
055: /**
056: * Tests GMT+11:00
057: */
058: public void testTimezonePlus10() {
059: String utc = "+11.0";
060: ClientProperties props = new ClientProperties();
061: props.setProperty(ClientProperties.UTC_OFFSET, utc);
062:
063: assertEquals(TimeZone.getTimeZone("GMT+11:00"), props
064: .getTimeZone());
065: }
066:
067: /**
068: * Tests GMT+2:30
069: */
070: public void testTimezonePlus2andAHalf() {
071: String utc = "+2.5";
072: ClientProperties props = new ClientProperties();
073: props.setProperty(ClientProperties.UTC_OFFSET, utc);
074:
075: assertEquals(TimeZone.getTimeZone("GMT+2:30"), props
076: .getTimeZone());
077: }
078:
079: /**
080: * Tests GMT-2:30
081: */
082: public void testTimezoneMinus2andAHalf() {
083: String utc = "-2.5";
084: ClientProperties props = new ClientProperties();
085: props.setProperty(ClientProperties.UTC_OFFSET, utc);
086:
087: assertEquals(TimeZone.getTimeZone("GMT-2:30"), props
088: .getTimeZone());
089: }
090:
091: /**
092: * Tests GMT+3:00
093: */
094: public void testTimezonePlus3() {
095: String utc = "3";
096: ClientProperties props = new ClientProperties();
097: props.setProperty(ClientProperties.UTC_OFFSET, utc);
098:
099: assertEquals(TimeZone.getTimeZone("GMT+3:00"), props
100: .getTimeZone());
101: }
102:
103: /**
104: * Tests GMT-3:00
105: */
106: public void testTimezoneMinus3() {
107: String utc = "-3";
108: ClientProperties props = new ClientProperties();
109: props.setProperty(ClientProperties.UTC_OFFSET, utc);
110:
111: assertEquals(TimeZone.getTimeZone("GMT-3:00"), props
112: .getTimeZone());
113: }
114: }
|