@@ -0,0 +1,2264 @@
+package org.jsconf.core.test;%0A%0Aimport java.io.File;%0Aimport java.io.FileWriter;%0Aimport java.io.IOException;%0A%0Aimport org.jsconf.core.ConfigurationFactory;%0Aimport org.jsconf.core.sample.bean.ConfigBean;%0Aimport org.junit.Assert;%0Aimport org.junit.BeforeClass;%0Aimport org.junit.Test;%0Aimport org.junit.runner.RunWith;%0Aimport org.springframework.beans.factory.annotation.Autowired;%0Aimport org.springframework.context.annotation.Bean;%0Aimport org.springframework.context.annotation.Configuration;%0Aimport org.springframework.test.annotation.Repeat;%0Aimport org.springframework.test.context.ContextConfiguration;%0Aimport org.springframework.test.context.junit4.SpringJUnit4ClassRunner;%0Aimport org.springframework.test.context.support.AnnotationConfigContextLoader;%0A%0A//Required to put $%7Bjava.io.tmpdir%7D on classpath%0A@RunWith(SpringJUnit4ClassRunner.class)%0A@ContextConfiguration(loader = AnnotationConfigContextLoader.class)%0Apublic class RealReloadingTest %7B%0A%09private static final String TIC = %22Tic%22;%0A%0A%09private static final String TAC = %22Tac%22;%0A%0A%09private static File createTempFile;%0A%0A%09@Autowired%0A%09private ConfigBean conf;%0A%0A%09@Autowired%0A%09private ConfigurationFactory factory;%0A%0A%09@BeforeClass%0A%09public static void init() throws IOException, InterruptedException %7B%0A%09%09String prefix = Long.toString(System.nanoTime());%0A%09%09createTempFile = File.createTempFile(prefix, %22_app.conf%22);%0A%09%09createTempFile.deleteOnExit();%0A%09%09write(TIC);%0A%09%7D%0A%0A%09@Test%0A%09@Repeat%0A%09public void test() throws IOException, InterruptedException %7B%0A%09%09final Object ref = this.conf;%0A%09%09Assert.assertNotNull(this.conf);%0A%09%09Assert.assertEquals(TIC, this.conf.getUrl());%0A%0A%09%09write(TAC);%0A%0A%09%09Assert.assertTrue(ref == this.conf);%0A%09%09Assert.assertEquals(TAC, this.conf.getUrl());%0A%09%7D%0A%0A%09private static void write(String value) throws IOException, InterruptedException %7B%0A%09%09createTempFile.delete();%0A%09%09createTempFile.createNewFile();%0A%09%09try (FileWriter fw = new FileWriter(createTempFile)) %7B%0A%09%09%09fw.append(%22simpleConf : %7B  url : %5C%22%22 + value + %22%5C%22 %7D%22);%0A%09%09%7D%0A%09%09Thread.sleep(1000);%0A%09%7D%0A%0A%09@Configuration%0A%09static class ContextConfiguration %7B%0A%09%09@Bean%0A%09%09public ConfigurationFactory configurationFactory() %7B%0A%09%09%09return new ConfigurationFactory().withResourceName(createTempFile.getName())//%0A%09%09%09%09%09.withBean(%22simpleConf%22, ConfigBean.class, null, true);%0A%09%09%7D%0A%09%7D%0A%7D%0A

Add new true reloading test