当前位置: 首页>>代码示例>>Java>>正文


Java SimpleTimeZone.setDSTSavings方法代码示例

本文整理汇总了Java中java.util.SimpleTimeZone.setDSTSavings方法的典型用法代码示例。如果您正苦于以下问题:Java SimpleTimeZone.setDSTSavings方法的具体用法?Java SimpleTimeZone.setDSTSavings怎么用?Java SimpleTimeZone.setDSTSavings使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在java.util.SimpleTimeZone的用法示例。


在下文中一共展示了SimpleTimeZone.setDSTSavings方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: test_setDSTSavingsI

import java.util.SimpleTimeZone; //导入方法依赖的package包/类
/**
 * @tests java.util.SimpleTimeZone#setDSTSavings(int)
 */
@TestTargetNew(
    level = TestLevel.COMPLETE,
    notes = "",
    method = "setDSTSavings",
    args = {int.class}
)
public void test_setDSTSavingsI() {
    // Test for method void java.util.SimpleTimeZone.setDSTSavings(int)
    SimpleTimeZone st = new SimpleTimeZone(1000, "Test_TZ");
    st.setStartRule(0, 1, 1, 1);
    st.setEndRule(11, 1, 1, 1);
    st.setDSTSavings(1);
    assertEquals("Daylight savings amount not set", 1, st.getDSTSavings());
}
 
开发者ID:keplersj,项目名称:In-the-Box-Fork,代码行数:18,代码来源:SimpleTimeZoneTest.java

示例2: test_setDSTSavingsI

import java.util.SimpleTimeZone; //导入方法依赖的package包/类
/**
 * @tests java.util.SimpleTimeZone#setDSTSavings(int)
 */
public void test_setDSTSavingsI() {
	// Test for method void java.util.SimpleTimeZone.setDSTSavings(int)
	SimpleTimeZone st = new SimpleTimeZone(1000, "Test_TZ");
	st.setStartRule(0, 1, 1, 1);
	st.setEndRule(11, 1, 1, 1);
	st.setDSTSavings(1);
	assertEquals("Daylight savings amount not set", 1, st.getDSTSavings());
}
 
开发者ID:shannah,项目名称:cn1,代码行数:12,代码来源:SimpleTimeZoneTest.java

示例3: TODO

import java.util.SimpleTimeZone; //导入方法依赖的package包/类
/**
 * @tests java.util.SimpleTimeZone#inDaylightTime(java.util.Date)
 *
TODO(tball): enable when in daylight time tables are added.
public void test_inDaylightTimeLjava_util_Date() {
	// Test for method boolean
	// java.util.SimpleTimeZone.inDaylightTime(java.util.Date)
       TimeZone zone = TimeZone.getTimeZone("EST");
	GregorianCalendar gc = new GregorianCalendar(1998, Calendar.JUNE, 11);
	assertFalse("Returned incorrect daylight value1", zone.inDaylightTime(gc
			.getTime()));
	gc = new GregorianCalendar(1998, Calendar.NOVEMBER, 11);
       assertFalse("Returned incorrect daylight value1", zone.inDaylightTime(gc
               .getTime()));
	gc = new GregorianCalendar(zone);
	gc.set(1999, Calendar.APRIL, 4, 1, 59, 59);
	assertTrue("Returned incorrect daylight value3", !(zone
			.inDaylightTime(gc.getTime())));
	Date date = new Date(gc.getTime().getTime() + 1000);
	assertFalse("Returned incorrect daylight value4", zone
			.inDaylightTime(date));
	gc.set(1999, Calendar.OCTOBER, 31, 1, 0, 0);
	assertTrue("Returned incorrect daylight value5", !(zone
			.inDaylightTime(gc.getTime())));
	date = new Date(gc.getTime().getTime() - 1000);
	assertFalse("Returned incorrect daylight value6", zone
			.inDaylightTime(date));

	assertTrue("Returned incorrect daylight value7", !zone
			.inDaylightTime(new Date(891752400000L + 7200000 - 1)));
	assertFalse("Returned incorrect daylight value8", zone
			.inDaylightTime(new Date(891752400000L + 7200000)));
	assertFalse("Returned incorrect daylight value9", zone
			.inDaylightTime(new Date(909288000000L + 7200000 - 1)));
	assertTrue("Returned incorrect daylight value10", !zone
			.inDaylightTime(new Date(909288000000L + 7200000)));
}

/**
 * @tests java.util.SimpleTimeZone#setDSTSavings(int)
 */
public void test_setDSTSavingsI() {
	// Test for method void java.util.SimpleTimeZone.setDSTSavings(int)
	SimpleTimeZone st = new SimpleTimeZone(1000, "Test_TZ");
	st.setStartRule(0, 1, 1, 1);
	st.setEndRule(11, 1, 1, 1);
	st.setDSTSavings(1);
	assertEquals("Daylight savings amount not set", 1, st.getDSTSavings());
}
 
开发者ID:Sellegit,项目名称:j2objc,代码行数:50,代码来源:SimpleTimeZoneTest.java


注:本文中的java.util.SimpleTimeZone.setDSTSavings方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。