Code example for Date

Methods: getMinutes

0
     * Test of the (deprecated) int Date.getMinutes() method - which always 
     * throws an IllegalArgumentException 
     */ 
    @SuppressWarnings("deprecation") 
    public void testGetMinutes() { 
        Date theDate = new Date(TIME_TESTDATE1);
        try { 
            theDate.getMinutes();
            fail("Should throw IllegalArgumentException.");
        } catch (IllegalArgumentException ie) {
            // expected 
        } // end try 
    } // end method testGetMinutes() 
 
    /* 
     * Test of the (deprecated) int Date.getSeconds() method - which always 
     * throws an IllegalArgumentException 
     */ 
    @SuppressWarnings("deprecation") 
    public void testGetSeconds() { 
        Date theDate = new Date(TIME_TESTDATE1);