Ejemplo n.º 1
0
 /**
  * Test conversion. The value are provided by {@link
  * org.apache.tamaya.core.internal.converters.ConverterTestsPropertySource}.
  *
  * @throws Exception
  */
 @Test
 public void testConvert_Byte_Hex() throws Exception {
   Configuration config = ConfigurationProvider.getConfiguration();
   Optional<Byte> valueRead = config.getOptional("tests.converter.byte.hex.lowerX", Byte.class);
   assertTrue(valueRead.isPresent());
   assertEquals(valueRead.get().byteValue(), Byte.decode("0x2F").byteValue());
   valueRead = config.getOptional("tests.converter.byte.hex.upperX", Byte.class);
   assertTrue(valueRead.isPresent());
   assertEquals(valueRead.get().byteValue(), Byte.decode("0X3F").byteValue());
 }
Ejemplo n.º 2
0
 /**
  * Test conversion. The value are provided by {@link
  * org.apache.tamaya.core.internal.converters.ConverterTestsPropertySource}.
  *
  * @throws Exception
  */
 @Test
 public void testConvert_Byte_Octal() throws Exception {
   Configuration config = ConfigurationProvider.getConfiguration();
   Optional<Byte> valueRead = config.getOptional("tests.converter.byte.octal", Byte.class);
   assertTrue(valueRead.isPresent());
   assertEquals(valueRead.get().byteValue(), Byte.decode("02").byteValue());
 }