本文整理汇总了Java中java.util.SimpleTimeZone.setRawOffset方法的典型用法代码示例。如果您正苦于以下问题:Java SimpleTimeZone.setRawOffset方法的具体用法?Java SimpleTimeZone.setRawOffset怎么用?Java SimpleTimeZone.setRawOffset使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.util.SimpleTimeZone
的用法示例。
在下文中一共展示了SimpleTimeZone.setRawOffset方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: test_equalsLjava_lang_Object
import java.util.SimpleTimeZone; //导入方法依赖的package包/类
/**
* @tests java.util.SimpleTimeZone#equals(java.lang.Object)
*/
@TestTargetNew(
level = TestLevel.COMPLETE,
notes = "",
method = "equals",
args = {java.lang.Object.class}
)
public void test_equalsLjava_lang_Object() {
// Test for method boolean
// java.util.SimpleTimeZone.equals(java.lang.Object)
TimeZone tz = TimeZone.getTimeZone("EST");
st1 = new SimpleTimeZone(tz.getRawOffset(), "EST");
st2 = new SimpleTimeZone(0, "EST");
assertFalse(st1.equals(st2));
st1.setRawOffset(st2.getRawOffset());
assertTrue(st1.equals(st2));
}
示例2: test_setRawOffsetI
import java.util.SimpleTimeZone; //导入方法依赖的package包/类
/**
* @tests java.util.SimpleTimeZone#setRawOffset(int)
*/
@TestTargetNew(
level = TestLevel.COMPLETE,
notes = "",
method = "setRawOffset",
args = {int.class}
)
public void test_setRawOffsetI() {
// Test for method void java.util.SimpleTimeZone.setRawOffset(int)
st1 = new SimpleTimeZone(TimeZone.getTimeZone("EST").getRawOffset(), "EST");
int off = st1.getRawOffset();
st1.setRawOffset(1000);
boolean val = st1.getRawOffset() == 1000;
st1.setRawOffset(off);
assertTrue("Incorrect offset set", val);
}
示例3: test_setRawOffsetI
import java.util.SimpleTimeZone; //导入方法依赖的package包/类
/**
* @tests java.util.SimpleTimeZone#setRawOffset(int)
*/
public void test_setRawOffsetI() {
// Test for method void java.util.SimpleTimeZone.setRawOffset(int)
st1 = (SimpleTimeZone) TimeZone.getTimeZone("EST");
int off = st1.getRawOffset();
st1.setRawOffset(1000);
boolean val = st1.getRawOffset() == 1000;
st1.setRawOffset(off);
assertTrue("Incorrect offset set", val);
}