本文整理汇总了Java中org.joda.time.IllegalFieldValueException类的典型用法代码示例。如果您正苦于以下问题:Java IllegalFieldValueException类的具体用法?Java IllegalFieldValueException怎么用?Java IllegalFieldValueException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IllegalFieldValueException类属于org.joda.time包,在下文中一共展示了IllegalFieldValueException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: parse
import org.joda.time.IllegalFieldValueException; //导入依赖的package包/类
public static Changed parse(final String value) {
if (value.length() > MAX_LENGTH) {
throw new AttributeParseException("Too long", value);
}
final Matcher matcher = CHANGED_PATTERN.matcher(value);
if (!matcher.matches()) {
throw new AttributeParseException("Invalid syntax", value);
}
final String email = matcher.group(1).trim();
final String dateString = matcher.group(2);
final LocalDate date;
if (dateString == null) {
date = null;
} else {
try {
date = CHANGED_ATTRIBUTE_DATE_FORMAT.parseLocalDate(dateString);
} catch (IllegalFieldValueException e) {
throw new AttributeParseException("Invalid date: " + dateString, value);
}
}
return new Changed(email, date);
}
示例2: getUnderflowDate
import org.joda.time.IllegalFieldValueException; //导入依赖的package包/类
@Test
public void getUnderflowDate() throws Exception {
try {
client.datetimes().getUnderflow();
Assert.assertTrue(false);
} catch (Exception exception) {
// expected
Assert.assertEquals(IllegalFieldValueException.class, exception.getClass());
}
}
示例3: getUnderflowDate
import org.joda.time.IllegalFieldValueException; //导入依赖的package包/类
@Test
public void getUnderflowDate() throws Exception {
try {
client.dates().getUnderflowDate();
Assert.assertTrue(false);
} catch (Exception exception) {
// expected
Assert.assertEquals(IllegalFieldValueException.class, exception.getClass());
}
}
示例4: testIssue233JodaTimeLimit
import org.joda.time.IllegalFieldValueException; //导入依赖的package包/类
@Test(expected=IllegalFieldValueException.class)
public void testIssue233JodaTimeLimit() throws ParseException {
// https://github.com/aws/aws-sdk-java/issues/233
String s = DateUtils.iso8601DateFormat.print(Long.MAX_VALUE);
System.out.println("s: " + s);
try {
DateTime dt = DateUtils.iso8601DateFormat.parseDateTime(s);
fail("Unexpected success: " + dt);
} catch(IllegalFieldValueException ex) {
// expected
throw ex;
}
}
示例5: creationDateHourFalhaAll
import org.joda.time.IllegalFieldValueException; //导入依赖的package包/类
@Test( expected = IllegalFieldValueException.class )
public void creationDateHourFalhaAll()
{
// Fixture Setup, DateTime(int year, int monthOfYear, int dayOfMonth, int hourOfDay, int minuteOfHour)
// Exercise SUT
final DateTime DateHour = new DateTime( 0, 0, 0, 0, 0 );
// Result Verification
// Fixture Teardown
}
示例6: creationDateHourFalhaDayHourMinute
import org.joda.time.IllegalFieldValueException; //导入依赖的package包/类
@Test( expected = IllegalFieldValueException.class )
public void creationDateHourFalhaDayHourMinute()
{
// Fixture Setup, DateTime(int year, int monthOfYear, int dayOfMonth, int hourOfDay, int minuteOfHour)
// Exercise SUT
final DateTime DateHour = new DateTime( 1, 1, -1, -1, -1 );
// Result Verification
// Fixture Teardown
}
示例7: creationDateHourFalhaHourMinute
import org.joda.time.IllegalFieldValueException; //导入依赖的package包/类
@Test( expected = IllegalFieldValueException.class )
public void creationDateHourFalhaHourMinute()
{
// Fixture Setup, DateTime(int year, int monthOfYear, int dayOfMonth, int hourOfDay, int minuteOfHour)
// Exercise SUT
final DateTime DateHour = new DateTime( 1, 1, 1, -1, -1 );
// Result Verification
// Fixture Teardown
}
示例8: creationDateHourFalhaMinute
import org.joda.time.IllegalFieldValueException; //导入依赖的package包/类
@Test( expected = IllegalFieldValueException.class )
public void creationDateHourFalhaMinute()
{
// Fixture Setup, DateTime(int year, int monthOfYear, int dayOfMonth, int hourOfDay, int minuteOfHour)
// Exercise SUT
final DateTime DateHour = new DateTime( 1, 1, 1, 1, -1 );
// Result Verification
// Fixture Teardown
}
示例9: creationDateHourFalhaMonthDayHourMinute
import org.joda.time.IllegalFieldValueException; //导入依赖的package包/类
@Test( expected = IllegalFieldValueException.class )
public void creationDateHourFalhaMonthDayHourMinute()
{
// Fixture Setup, DateTime(int year, int monthOfYear, int dayOfMonth, int hourOfDay, int minuteOfHour)
// Exercise SUT
final DateTime DateHour = new DateTime( 1, -1, -1, -1, -1 );
// Result Verification
// Fixture Teardown
}
示例10: creationDateHourFalhaYear
import org.joda.time.IllegalFieldValueException; //导入依赖的package包/类
@Test( expected = IllegalFieldValueException.class )
public void creationDateHourFalhaYear()
{
// Fixture Setup, DateTime(int year, int monthOfYear, int dayOfMonth, int hourOfDay, int minuteOfHour)
// Exercise SUT
final DateTime DateHour = new DateTime( -1, 0, 0, 0, 0 );
// Result Verification
// Fixture Teardown
}
示例11: creationDateHourFalhaYearMonth
import org.joda.time.IllegalFieldValueException; //导入依赖的package包/类
@Test( expected = IllegalFieldValueException.class )
public void creationDateHourFalhaYearMonth()
{
// Fixture Setup, DateTime(int year, int monthOfYear, int dayOfMonth, int hourOfDay, int minuteOfHour)
// Exercise SUT
final DateTime DateHour = new DateTime( -1, -1, 0, 0, 0 );
// Result Verification
// Fixture Teardown
}
示例12: creationDateHourFalhaYearMonthDay
import org.joda.time.IllegalFieldValueException; //导入依赖的package包/类
@Test( expected = IllegalFieldValueException.class )
public void creationDateHourFalhaYearMonthDay()
{
// Fixture Setup, DateTime(int year, int monthOfYear, int dayOfMonth, int hourOfDay, int minuteOfHour)
// Exercise SUT
final DateTime DateHour = new DateTime( -1, -1, -1, 0, 0 );
// Result Verification
// Fixture Teardown
}
示例13: creationDateHourFalhaYearMonthDayHour
import org.joda.time.IllegalFieldValueException; //导入依赖的package包/类
@Test( expected = IllegalFieldValueException.class )
public void creationDateHourFalhaYearMonthDayHour()
{
// Fixture Setup, DateTime(int year, int monthOfYear, int dayOfMonth, int hourOfDay, int minuteOfHour)
// Exercise SUT
final DateTime DateHour = new DateTime( -1, -1, -1, -1, 0 );
// Result Verification
// Fixture Teardown
}
示例14: creationDateHourFalhaYearMonthDayHourMinute
import org.joda.time.IllegalFieldValueException; //导入依赖的package包/类
@Test( expected = IllegalFieldValueException.class )
public void creationDateHourFalhaYearMonthDayHourMinute()
{
// Fixture Setup, DateTime(int year, int monthOfYear, int dayOfMonth, int hourOfDay, int minuteOfHour)
// Exercise SUT
final DateTime DateHour = new DateTime( -1, -1, -1, -1, -1 );
// Result Verification
// Fixture Teardown
}
示例15: creationDeDateFalhaDayNegative
import org.joda.time.IllegalFieldValueException; //导入依赖的package包/类
@Test( expected = IllegalFieldValueException.class )
public void creationDeDateFalhaDayNegative()
{
// Fixture Setup
// Exercise SUT
final LocalDate natal2017 = new LocalDate( 2017, 12, -1 );
// Result Verification
// Fixture Teardown
}