0.1.7 release

This commit is contained in:
Alexander Nozik 2020-04-07 12:53:00 +03:00
parent 6450696157
commit b0950f8415
5 changed files with 17 additions and 14 deletions

View File

@ -1,12 +1,12 @@
plugins { plugins {
val toolsVersion = "0.4.1" val toolsVersion = "0.4.2"
id("scientifik.mpp") version toolsVersion apply false id("scientifik.mpp") version toolsVersion apply false
id("scientifik.jvm") version toolsVersion apply false id("scientifik.jvm") version toolsVersion apply false
id("scientifik.publish") version toolsVersion apply false id("scientifik.publish") version toolsVersion apply false
} }
val dataforgeVersion by extra("0.1.6-dev-2") val dataforgeVersion by extra("0.1.7")
val bintrayRepo by extra("dataforge") val bintrayRepo by extra("dataforge")
val githubProject by extra("dataforge-core") val githubProject by extra("dataforge-core")

View File

@ -1,6 +1,7 @@
package hep.dataforge.io package hep.dataforge.io
import hep.dataforge.context.Global import hep.dataforge.context.Global
import hep.dataforge.meta.DFExperimental
import kotlinx.io.asBinary import kotlinx.io.asBinary
import kotlinx.io.toByteArray import kotlinx.io.toByteArray
import kotlinx.io.writeDouble import kotlinx.io.writeDouble
@ -46,6 +47,7 @@ class FileBinaryTest {
} }
@DFExperimental
@Test @Test
fun testFileDataSizeRewriting() { fun testFileDataSizeRewriting() {
println(System.getProperty("user.dir")) println(System.getProperty("user.dir"))
@ -53,6 +55,6 @@ class FileBinaryTest {
Global.io.writeEnvelopeFile(tmpPath, envelope) Global.io.writeEnvelopeFile(tmpPath, envelope)
val binary = Global.io.readEnvelopeFile(tmpPath)?.data!! val binary = Global.io.readEnvelopeFile(tmpPath)?.data!!
assertEquals(binary.size.toInt(), binary.toByteArray().size) assertEquals(binary.size, binary.toByteArray().size)
} }
} }

View File

@ -8,8 +8,9 @@ import hep.dataforge.io.toByteArray
import kotlinx.coroutines.GlobalScope import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.runBlocking import kotlinx.coroutines.runBlocking
import kotlinx.io.writeDouble import kotlinx.io.writeDouble
import org.junit.AfterClass import org.junit.jupiter.api.AfterAll
import org.junit.BeforeClass import org.junit.jupiter.api.BeforeAll
import org.junit.jupiter.api.Timeout
import kotlin.test.Test import kotlin.test.Test
import kotlin.test.assertEquals import kotlin.test.assertEquals
import kotlin.time.ExperimentalTime import kotlin.time.ExperimentalTime
@ -31,20 +32,21 @@ class EnvelopeServerTest {
@JvmStatic @JvmStatic
val echoEnvelopeServer = EnvelopeServer(Global, 7778, EchoResponder, GlobalScope) val echoEnvelopeServer = EnvelopeServer(Global, 7778, EchoResponder, GlobalScope)
@BeforeClass @BeforeAll
@JvmStatic @JvmStatic
fun start() { fun start() {
echoEnvelopeServer.start() echoEnvelopeServer.start()
} }
@AfterClass @AfterAll
@JvmStatic @JvmStatic
fun close() { fun close() {
echoEnvelopeServer.stop() echoEnvelopeServer.stop()
} }
} }
@Test(timeout = 1000) @Test
@Timeout(1)
fun doEchoTest() { fun doEchoTest() {
val request = Envelope { val request = Envelope {
type = "test.echo" type = "test.echo"

View File

@ -98,7 +98,9 @@ interface Meta : MetaRepr {
*/ */
const val VALUE_KEY = "@value" const val VALUE_KEY = "@value"
val EMPTY = EmptyMeta val EMPTY: Meta = object: MetaBase() {
override val items: Map<NameToken, MetaItem<*>> = emptyMap()
}
} }
} }
@ -216,11 +218,6 @@ fun MetaItem<*>.seal(): MetaItem<SealedMeta> = when (this) {
is NodeItem -> NodeItem(node.seal()) is NodeItem -> NodeItem(node.seal())
} }
@Deprecated("Use Meta.EMPTY instead", replaceWith = ReplaceWith("Meta.EMPTY"))
object EmptyMeta : MetaBase() {
override val items: Map<NameToken, MetaItem<*>> = emptyMap()
}
/** /**
* Unsafe methods to access values and nodes directly from [MetaItem] * Unsafe methods to access values and nodes directly from [MetaItem]
*/ */

View File

@ -66,5 +66,7 @@ inline fun Encoder.encodeStructure(
encoder.endStructure(desc) encoder.endStructure(desc)
} }
@OptIn(UnstableDefault::class)
val JSON_PRETTY = Json(JsonConfiguration(prettyPrint = true, useArrayPolymorphism = true)) val JSON_PRETTY = Json(JsonConfiguration(prettyPrint = true, useArrayPolymorphism = true))
@OptIn(UnstableDefault::class)
val JSON_PLAIN = Json(JsonConfiguration(prettyPrint = true, useArrayPolymorphism = true)) val JSON_PLAIN = Json(JsonConfiguration(prettyPrint = true, useArrayPolymorphism = true))