tests/libjava-mauve/src/gnu/testlet/java/util/SimpleTimeZone/clone.java
branchjk_new_structure
changeset 1541 75c2e24dea9a
parent 1540 92ac284961c1
child 1542 be11db817bcf
equal deleted inserted replaced
1540:92ac284961c1 1541:75c2e24dea9a
     1 // Tags: JDK1.4
       
     2 
       
     3 // Copyright (C) 2004 David Gilbert <david.gilbert@object-refinery.com>
       
     4 
       
     5 // Mauve is free software; you can redistribute it and/or modify
       
     6 // it under the terms of the GNU General Public License as published by
       
     7 // the Free Software Foundation; either version 2, or (at your option)
       
     8 // any later version.
       
     9 
       
    10 // Mauve is distributed in the hope that it will be useful,
       
    11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
       
    12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
       
    13 // GNU General Public License for more details. 
       
    14 
       
    15 // You should have received a copy of the GNU General Public License
       
    16 // along with Mauve; see the file COPYING.  If not, write to
       
    17 // the Free Software Foundation, 59 Temple Place - Suite 330,
       
    18 // Boston, MA 02111-1307, USA.  */
       
    19 
       
    20 package gnu.testlet.java.util.SimpleTimeZone;
       
    21 
       
    22 import gnu.testlet.TestHarness;
       
    23 import gnu.testlet.Testlet;
       
    24 
       
    25 import java.util.Calendar;
       
    26 import java.util.SimpleTimeZone;
       
    27 
       
    28 /**
       
    29  * Some checks for the clone() method in the SimpleTimeZone class.
       
    30  */
       
    31 public class clone implements Testlet {
       
    32 
       
    33   /**
       
    34    * Runs the test using the specified harness.
       
    35    * 
       
    36    * @param harness  the test harness (<code>null</code> not permitted).
       
    37    */
       
    38   public void test(TestHarness harness) 
       
    39   {
       
    40     int t = 2 * 60 * 60 * 1000;
       
    41     SimpleTimeZone z1 = new SimpleTimeZone(5 * 60 * 60 * 1000, "Zone 1", 
       
    42       Calendar.JANUARY, 15, 0, t,
       
    43       Calendar.NOVEMBER, 11, 0, t, 
       
    44       60 * 60 * 1000);
       
    45     SimpleTimeZone z2 = (SimpleTimeZone) z1.clone();
       
    46     harness.check(z1.equals(z2));
       
    47   }
       
    48 
       
    49 }