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


Java IllegalFieldValueException类代码示例

本文整理汇总了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);
}
 
开发者ID:rpsl4j,项目名称:rpsl4j-parser,代码行数:27,代码来源:Changed.java

示例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());
     }
}
 
开发者ID:Azure,项目名称:autorest.java,代码行数:11,代码来源:DatetimeOperationsTests.java

示例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());
    }
}
 
开发者ID:Azure,项目名称:autorest.java,代码行数:11,代码来源:DateOperationsTests.java

示例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;
    }
}
 
开发者ID:IBM,项目名称:ibm-cos-sdk-java,代码行数:14,代码来源:DateUtilsTest.java

示例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
}
 
开发者ID:evandrocoan,项目名称:ComputerScienceGraduation,代码行数:13,代码来源:FirstClassJunitIndroduction.java

示例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
}
 
开发者ID:evandrocoan,项目名称:ComputerScienceGraduation,代码行数:13,代码来源:FirstClassJunitIndroduction.java

示例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
}
 
开发者ID:evandrocoan,项目名称:ComputerScienceGraduation,代码行数:13,代码来源:FirstClassJunitIndroduction.java

示例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
}
 
开发者ID:evandrocoan,项目名称:ComputerScienceGraduation,代码行数:13,代码来源:FirstClassJunitIndroduction.java

示例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
}
 
开发者ID:evandrocoan,项目名称:ComputerScienceGraduation,代码行数:13,代码来源:FirstClassJunitIndroduction.java

示例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
}
 
开发者ID:evandrocoan,项目名称:ComputerScienceGraduation,代码行数:13,代码来源:FirstClassJunitIndroduction.java

示例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
}
 
开发者ID:evandrocoan,项目名称:ComputerScienceGraduation,代码行数:13,代码来源:FirstClassJunitIndroduction.java

示例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
}
 
开发者ID:evandrocoan,项目名称:ComputerScienceGraduation,代码行数:13,代码来源:FirstClassJunitIndroduction.java

示例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
}
 
开发者ID:evandrocoan,项目名称:ComputerScienceGraduation,代码行数:13,代码来源:FirstClassJunitIndroduction.java

示例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
}
 
开发者ID:evandrocoan,项目名称:ComputerScienceGraduation,代码行数:13,代码来源:FirstClassJunitIndroduction.java

示例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
}
 
开发者ID:evandrocoan,项目名称:ComputerScienceGraduation,代码行数:13,代码来源:FirstClassJunitIndroduction.java


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