forked from eclipse/microprofile-config
-
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.
Signed-off-by: Gunnar Morling <[email protected]>
- Loading branch information
1 parent
36cb090
commit 402c04b
Showing
3 changed files
with
110 additions
and
3 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
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 |
---|---|---|
|
@@ -59,6 +59,7 @@ | |
* @author <a href="mailto:[email protected]">Mark Struberg</a> | ||
* @author <a href="mailto:[email protected]">Emily Jiang</a> | ||
* @author <a href="mailto:[email protected]">John D. Ament</a> | ||
* @author <a href="mailto:[email protected]">Gunnar Morling</a> | ||
*/ | ||
public class ConverterTest extends Arquillian { | ||
|
||
|
@@ -128,6 +129,40 @@ public void testDonaldConversionWithMultipleLambdaConverters() { | |
"The converter with the highest priority (using upper case) must be used."); | ||
} | ||
|
||
@Test | ||
public void testByte() { | ||
Byte value = config.getValue("tck.config.test.javaconfig.converter.bytevalue", Byte.class); | ||
Assert.assertEquals(value, Byte.valueOf((byte)123)); | ||
} | ||
|
||
@Test | ||
public void testbyte() { | ||
byte value = config.getValue("tck.config.test.javaconfig.converter.bytevalue", byte.class); | ||
Assert.assertEquals(value, (byte)123); | ||
} | ||
|
||
@Test(expectedExceptions = IllegalArgumentException.class) | ||
public void testByte_Broken() { | ||
Byte value = config.getValue("tck.config.test.javaconfig.converter.bytevalue.broken", Byte.class); | ||
} | ||
|
||
@Test | ||
public void testShort() { | ||
Short value = config.getValue("tck.config.test.javaconfig.converter.shortvalue", Short.class); | ||
Assert.assertEquals(value, Short.valueOf((short)1234)); | ||
} | ||
|
||
@Test | ||
public void testshort() { | ||
short value = config.getValue("tck.config.test.javaconfig.converter.shortvalue", short.class); | ||
Assert.assertEquals(value, (short)1234); | ||
} | ||
|
||
@Test(expectedExceptions = IllegalArgumentException.class) | ||
public void testShort_Broken() { | ||
Short value = config.getValue("tck.config.test.javaconfig.converter.shortvalue.broken", Short.class); | ||
} | ||
|
||
@Test | ||
public void testInteger() { | ||
Integer value = config.getValue("tck.config.test.javaconfig.converter.integervalue", Integer.class); | ||
|
@@ -196,6 +231,23 @@ public void testDouble_Broken() { | |
Double value = config.getValue("tck.config.test.javaconfig.converter.doublevalue.broken", Double.class); | ||
} | ||
|
||
@Test | ||
public void testChar() { | ||
Character value = config.getValue("tck.config.test.javaconfig.converter.charvalue", Character.class); | ||
Assert.assertEquals(value, Character.valueOf('c')); | ||
} | ||
|
||
@Test | ||
public void testchar() { | ||
char value = config.getValue("tck.config.test.javaconfig.converter.charvalue", char.class); | ||
Assert.assertEquals(value, 'c'); | ||
} | ||
|
||
@Test(expectedExceptions = IllegalArgumentException.class) | ||
public void testChar_Broken() { | ||
Character value = config.getValue("tck.config.test.javaconfig.converter.charvalue.broken", Character.class); | ||
} | ||
|
||
@Test | ||
public void testDuration() { | ||
Duration value = config.getValue("tck.config.test.javaconfig.converter.durationvalue", Duration.class); | ||
|
@@ -257,7 +309,7 @@ public void testOffsetTime() { | |
OffsetTime parsed = OffsetTime.parse("13:45:30.123456789+02:00"); | ||
Assert.assertEquals(value, parsed); | ||
} | ||
|
||
|
||
|
||
@Test(expectedExceptions = IllegalArgumentException.class) | ||
|
@@ -271,12 +323,12 @@ public void testZoneOffset() { | |
ZoneOffset parsed = ZoneOffset.of("+02:00"); | ||
Assert.assertEquals(value, parsed); | ||
} | ||
|
||
@Test(expectedExceptions = IllegalArgumentException.class) | ||
public void testZoneOffset_Broken() { | ||
ZoneOffset value = config.getValue("tck.config.test.javaconfig.converter.zoneoffsetvalue.broken", ZoneOffset.class); | ||
} | ||
|
||
@Test | ||
public void testInstant() { | ||
Instant value = config.getValue("tck.config.test.javaconfig.converter.instantvalue", Instant.class); | ||
|
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