forked from eclipse/ConfigJSR
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #191 from eclipse/emily_may
eclipse#55 add tck to cover other date format
- Loading branch information
Showing
2 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,9 +20,12 @@ | |
package org.eclipse.microprofile.config.tck; | ||
|
||
import java.time.Duration; | ||
import java.time.Instant; | ||
import java.time.LocalDate; | ||
import java.time.LocalDateTime; | ||
import java.time.LocalTime; | ||
import java.time.OffsetDateTime; | ||
import java.time.OffsetTime; | ||
|
||
import javax.inject.Inject; | ||
|
||
|
@@ -47,6 +50,7 @@ | |
|
||
/** | ||
* @author <a href="mailto:[email protected]">Mark Struberg</a> | ||
* @author <a href="mailto:[email protected]">Emily Jiang</a> | ||
*/ | ||
public class ConverterTest extends Arquillian { | ||
|
||
|
@@ -167,6 +171,38 @@ public void testLocalDateTime_Broken() { | |
LocalDateTime value = config.getValue("tck.config.test.javaconfig.converter.localdatetimevalue.broken", LocalDateTime.class); | ||
} | ||
|
||
@Test | ||
public void testOffsetDateTime() { | ||
OffsetDateTime value = config.getValue("tck.config.test.javaconfig.converter.offsetdatetimevalue", OffsetDateTime.class); | ||
Assert.assertEquals(value, OffsetDateTime.parse("2007-12-03T10:15:30+01:00")); | ||
} | ||
|
||
@Test(expectedExceptions = IllegalArgumentException.class) | ||
public void testOffsetDateTime_Broken() { | ||
OffsetDateTime value = config.getValue("tck.config.test.javaconfig.converter.offsetdatetimevalue.broken", OffsetDateTime.class); | ||
} | ||
|
||
@Test | ||
public void testOffsetTime() { | ||
OffsetTime value = config.getValue("tck.config.test.javaconfig.converter.offsettimevalue", OffsetTime.class); | ||
Assert.assertEquals(value, OffsetTime.parse("13:45.30.123456789+02:00")); | ||
} | ||
|
||
@Test(expectedExceptions = IllegalArgumentException.class) | ||
public void testOffsetTime_Broken() { | ||
OffsetTime value = config.getValue("tck.config.test.javaconfig.converter.offsettimevalue.broken", OffsetTime.class); | ||
} | ||
|
||
@Test | ||
public void testInstant() { | ||
Instant value = config.getValue("tck.config.test.javaconfig.converter.instantvalue", Instant.class); | ||
Assert.assertEquals(value, Instant.parse("2015-06-02T21:34:33.616Z")); | ||
} | ||
|
||
@Test(expectedExceptions = IllegalArgumentException.class) | ||
public void testInstant_Broken() { | ||
Instant value = config.getValue("tck.config.test.javaconfig.converter.instantvalue.broken", Instant.class); | ||
} | ||
|
||
@Test | ||
public void testBoolean() { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters