update to Jackson 2.11.1
This commit is contained in:
parent
4151667da8
commit
3ee81143b0
4 changed files with 12 additions and 8 deletions
|
@ -5,6 +5,7 @@ import java.io.IOException;
|
||||||
import java.io.InputStreamReader;
|
import java.io.InputStreamReader;
|
||||||
import java.io.Reader;
|
import java.io.Reader;
|
||||||
import java.io.StringReader;
|
import java.io.StringReader;
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
|
@ -40,7 +41,7 @@ public class PropertiesSettingsLoader implements SettingsLoader {
|
||||||
@Override
|
@Override
|
||||||
public Map<String, String> load(BytesReference ref) throws IOException {
|
public Map<String, String> load(BytesReference ref) throws IOException {
|
||||||
Properties props = new Properties();
|
Properties props = new Properties();
|
||||||
try (Reader reader = new InputStreamReader(ref.streamInput())) {
|
try (Reader reader = new InputStreamReader(ref.streamInput(), StandardCharsets.UTF_8)) {
|
||||||
props.load(reader);
|
props.load(reader);
|
||||||
Map<String, String> result = new HashMap<>();
|
Map<String, String> result = new HashMap<>();
|
||||||
for (Map.Entry<Object, Object> entry : props.entrySet()) {
|
for (Map.Entry<Object, Object> entry : props.entrySet()) {
|
||||||
|
|
|
@ -2,6 +2,7 @@ package org.xbib.content.settings;
|
||||||
|
|
||||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
import static org.junit.jupiter.api.Assertions.assertFalse;
|
import static org.junit.jupiter.api.Assertions.assertFalse;
|
||||||
|
import static org.junit.jupiter.api.Assertions.assertNull;
|
||||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.xbib.content.XContentHelper;
|
import org.xbib.content.XContentHelper;
|
||||||
|
@ -180,10 +181,12 @@ public class SettingsTest {
|
||||||
@Test
|
@Test
|
||||||
public void testRefresher() throws Exception {
|
public void testRefresher() throws Exception {
|
||||||
Settings settings = Settings.settingsBuilder()
|
Settings settings = Settings.settingsBuilder()
|
||||||
.setRefresh(Paths.get("src/test/resources/settings.json"), 0L, 1L, TimeUnit.DAYS)
|
.put("name", "hello")
|
||||||
|
.setRefresh(Paths.get("src/test/resources/settings.json"), 1L, 1L, TimeUnit.SECONDS)
|
||||||
.build();
|
.build();
|
||||||
Thread.sleep(1000L);
|
assertEquals("hello", settings.get("name"));
|
||||||
assertEquals("Jörg Prante", settings.get("name"));
|
Thread.sleep(2000L);
|
||||||
|
assertEquals("world", settings.get("name"));
|
||||||
settings.close();
|
settings.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
{
|
{
|
||||||
"name": "Jörg Prante"
|
"name": "world"
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
group = org.xbib
|
group = org.xbib
|
||||||
name = content
|
name = content
|
||||||
version = 2.3.1
|
version = 2.3.2
|
||||||
|
|
||||||
gradle.wrapper.version = 6.4.1
|
gradle.wrapper.version = 6.4.1
|
||||||
xbib.net.version = 2.1.0
|
xbib.net.version = 2.1.0
|
||||||
jackson.version = 2.11.0
|
jackson.version = 2.11.1
|
||||||
jackson.databind.version = 2.11.0
|
jackson.databind.version = 2.11.1
|
||||||
woodstox.version = 6.2.1
|
woodstox.version = 6.2.1
|
||||||
snakeyaml.version = 1.26
|
snakeyaml.version = 1.26
|
||||||
mockito.version = 3.3.3
|
mockito.version = 3.3.3
|
||||||
|
|
Loading…
Reference in a new issue