Commit 31c7df72 authored by npedot's avatar npedot
Browse files

upgrade to kotlin 4.10 and jackson 2.12.2

parent ab64cfac
......@@ -15,12 +15,13 @@
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<java.version>11</java.version>
<kotlin.version>1.3.30</kotlin.version>
<kotlin.version>1.4.10</kotlin.version>
<junit.version>4.12</junit.version>
<jackson.version>2.6.7</jackson.version>
<jackson.databind.version>2.6.7.1</jackson.databind.version>
<jackson.kotlin.version>2.6.7</jackson.kotlin.version>
<jackson.version>2.12.2</jackson.version>
<jackson.databind.version>2.12.2</jackson.databind.version>
<jackson.kotlin.version>2.12.2</jackson.kotlin.version>
<slf4j.version>1.7.28</slf4j.version>
<log4j.version>2.13.3</log4j.version>
<woodstox.version>5.1.0</woodstox.version>
......@@ -40,8 +41,14 @@
<artifactId>kotlin-stdlib</artifactId>
<version>${kotlin.version}</version>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-reflect</artifactId>
<version>${kotlin.version}</version>
<scope>runtime</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-core -->
<!-- json xml -->
<dependency>
<groupId>com.fasterxml.jackson.module</groupId>
<artifactId>jackson-module-kotlin</artifactId>
......@@ -72,16 +79,21 @@
<artifactId>jackson-dataformat-yaml</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.woodstox</groupId>
<artifactId>woodstox-core</artifactId>
<version>${woodstox.version}</version>
</dependency>
<dependency>
<groupId>com.thoughtworks.xstream</groupId>
<artifactId>xstream</artifactId>
<version>${xstream.version}</version>
</dependency>
<!-- database -->
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
......
......@@ -55,13 +55,13 @@ class XMLSerializerJacksonAdapter : SerializerServiceI {
override fun prettyDatabase(db: Database): String {
val mapper = XmlMapper().registerModule(KotlinModule())
val writer = mapper.writerWithDefaultPrettyPrinter()
return writer.writeValueAsString(db)
return writer.writeValueAsString(db).trimEnd()
}
override fun prettyJsonDatabase(db: Database): String {
val mapper = ObjectMapper().registerModule(KotlinModule())
val writer = mapper.writerWithDefaultPrettyPrinter()
return writer.writeValueAsString(db)
return writer.writeValueAsString(db).trimEnd()
}
override fun deepclone(database: Database): Database {
......@@ -97,7 +97,7 @@ class XMLSerializerJacksonAdapter : SerializerServiceI {
override fun prettyChangeSet(table: ChangeSet): String {
val mapper = XmlMapper().registerModule(KotlinModule())
val writer = mapper.writerWithDefaultPrettyPrinter()
return writer.writeValueAsString(table)
return writer.writeValueAsString(table).trimEnd()
}
override fun serializeTransfomer(transformer: Transformer): String {
......@@ -119,7 +119,7 @@ class XMLSerializerJacksonAdapter : SerializerServiceI {
fun prettyQuery(query: Query): String {
val mapper = XmlMapper().registerModule(KotlinModule())
val writer = mapper.writerWithDefaultPrettyPrinter()
return writer.writeValueAsString(query)
return writer.writeValueAsString(query).trimEnd()
}
}
\ No newline at end of file
......@@ -73,7 +73,6 @@ class QueryTest {
FROM Table1
WHERE Name='Gigi' LIMIT 10
""".trimIndent(),querySql)
}
@Test
......
......@@ -29,7 +29,8 @@ class TransfomerTest {
</xman>
<template filename=""/>
</splitter>
</transformer>, ko=kotlin.Unit)
</transformer>
, ko=kotlin.Unit)
""".trimIndent(),serializedTransformer.toString())
}
......@@ -63,7 +64,8 @@ class TransfomerTest {
</xman>
<template filename=""/>
</splitter>
</transformer>, ko=kotlin.Unit)
</transformer>
, ko=kotlin.Unit)
""".trimIndent(),serializedTransformer.toString())
}
......
......@@ -17,7 +17,7 @@ class JacksonTest {
// when
val mapper = XmlMapper().registerModule(KotlinModule())
val writer = mapper.writerWithDefaultPrettyPrinter()
val result = writer.writeValueAsString(map)
val result = writer.writeValueAsString(map).trimEnd()
// then
assertEquals("""
<LinkedHashMap>
......@@ -34,7 +34,7 @@ class JacksonTest {
// when
val mapper = XmlMapper().registerModule(KotlinModule())
val writer = mapper.writerWithDefaultPrettyPrinter()
val result = writer.writeValueAsString(db)
val result = writer.writeValueAsString(db).trimEnd()
// then
assertEquals("""
<database name="" id="" source="">
......@@ -68,15 +68,18 @@ class JacksonTest {
val mapper2 = XmlMapper().registerModule(KotlinModule())
mapper2.setSerializationInclusion(JsonInclude.Include.NON_NULL)
val writer = mapper2.writerWithDefaultPrettyPrinter()
val result = writer.writeValueAsString(newdb)
val result = writer.writeValueAsString(newdb).trimEnd()
// then
assertEquals(0,newdb.schema.tables().size)
assertEquals("""
<database name="" id="" source="">
<schema name="" id=""/>
<schema name="" id="">
<tables/>
<constraints/>
</schema>
<mappings/>
</database>
""".trimIndent(),result)
""".trimIndent(),result)
}
}
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment