Just noticed what I missed in ConfigurationContextBuilder to pass the test
above.
Sorry for the inconvenience.

Regards,
Jean-Noel

2017-10-18 7:39 GMT+02:00 Jean-Noel Charpin <[email protected]>:

> Hi tamaya team,
>
> I would like to subscribe to your dev. list. I got interested in the
> project last year by attending Anatole's presentation at java one.
>
> I'm currently working on a JDBC property source, to store / update in a
> the table a configuration.
>
> Either from an injected Data source or through a lookup or even raw
> connection (my project is not making use of JPA).
>
> What I observed since I need to create my own context to have this
> property source considered is that I then miss the default property
> converters.
> e.g. the second test below is failing.
>
> Do I need to reference all default converters when using a context builder
> ?
> Could you let me know what is the suggested approach, appologize if I miss
> something in your documentation ?
>
> Thanks and regards,
> Jean-Noel
>
>     @Test
>     public void testDefaultTamayaConfiguration() {
>
>         Configuration config = ConfigurationProvider.getConfiguration();
>         assertNotNull(config);
>
>         assertEquals("1.8", config.get("java.specification.version"));
>         assertEquals(Double.valueOf(1.8), 
> config.get("java.specification.version",
> double.class));
>
>     }
>
>     @Test
>     public void testCustomTamayaConfiguration() {
>
>         ConfigurationContextBuilder configBuilder = new
> DefaultConfigurationContextBuilder();
>         configBuilder.addPropertySources(new SystemPropertySource());
>         ConfigurationContext context = configBuilder.build();
>         Configuration config = ConfigurationProvider.
> createConfiguration(context);
>         assertNotNull(config);
>
>         assertEquals("1.8", config.get("java.specification.version"));
>         assertEquals(Double.valueOf(1.8), 
> config.get("java.specification.version",
> double.class));
>
>     }
>

Reply via email to