mirror of
https://github.com/elastic/logstash.git
synced 2025-04-23 22:27:21 -04:00
check versions.yml for correct project version (#5882)
- and fix a test
This commit is contained in:
parent
ce0c5e2bf2
commit
f78da5ffe0
2 changed files with 18 additions and 4 deletions
|
@ -1,17 +1,30 @@
|
|||
import java.nio.file.Files
|
||||
import org.yaml.snakeyaml.Yaml
|
||||
import static java.nio.file.StandardCopyOption.REPLACE_EXISTING
|
||||
|
||||
apply plugin: 'java'
|
||||
apply plugin: 'idea'
|
||||
|
||||
group = 'org.logstash'
|
||||
version = '6.0.0-alpha1'
|
||||
|
||||
description = """Logstash Core Java"""
|
||||
|
||||
sourceCompatibility = 1.8
|
||||
targetCompatibility = 1.8
|
||||
|
||||
// fetch version from Logstash's master versions.yml file
|
||||
def versionMap = (Map) (new Yaml()).load(new File("$projectDir/../versions.yml").text)
|
||||
version = versionMap['logstash-core']
|
||||
|
||||
buildscript {
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
classpath 'org.yaml:snakeyaml:1.17'
|
||||
}
|
||||
}
|
||||
|
||||
configurations {
|
||||
provided
|
||||
}
|
||||
|
|
|
@ -33,6 +33,7 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
|
||||
import static junit.framework.TestCase.assertEquals;
|
||||
import static junit.framework.TestCase.assertNotNull;
|
||||
|
||||
public class CustomLogEventTests {
|
||||
private static final ObjectMapper mapper = new ObjectMapper();
|
||||
|
@ -78,7 +79,7 @@ public class CustomLogEventTests {
|
|||
assertEquals(5, firstMessage.size());
|
||||
assertEquals("INFO", firstMessage.get("level"));
|
||||
assertEquals("JSONEventLogger", firstMessage.get("loggerName"));
|
||||
assertEquals("main", firstMessage.get("thread"));
|
||||
assertNotNull(firstMessage.get("thread"));
|
||||
assertEquals(Collections.singletonMap("message", "simple message"), firstMessage.get("logEvent"));
|
||||
|
||||
Map<String, Object> secondMessage = mapper.readValue(messages.get(1), Map.class);
|
||||
|
@ -86,7 +87,7 @@ public class CustomLogEventTests {
|
|||
assertEquals(5, secondMessage.size());
|
||||
assertEquals("WARN", secondMessage.get("level"));
|
||||
assertEquals("JSONEventLogger", secondMessage.get("loggerName"));
|
||||
assertEquals("main", secondMessage.get("thread"));
|
||||
assertNotNull(secondMessage.get("thread"));
|
||||
Map<String, Object> logEvent = new HashMap<>();
|
||||
logEvent.put("message", "complex message");
|
||||
logEvent.put("foo", "bar");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue