diff --git a/CHANGELOG.md b/CHANGELOG.md index c1266b9f..a344bc77 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## [0.3.7] - [Unreleased] + +### Fixed +- `TigerGraphDriver` bug where empty strings for intentional properties would be unintentionally excluded. +- `Member.name` and `FieldIdentifier.code` properly handled + ## [0.3.6] - 2021-03-18 ### Added diff --git a/VERSION.md b/VERSION.md index 53b61ecf..ce4f5af9 100644 --- a/VERSION.md +++ b/VERSION.md @@ -1 +1 @@ -0.3.6 \ No newline at end of file +0.3.7 \ No newline at end of file diff --git a/plume/src/main/kotlin/io/github/plume/oss/drivers/TigerGraphDriver.kt b/plume/src/main/kotlin/io/github/plume/oss/drivers/TigerGraphDriver.kt index ac92d85a..7c7f3d0d 100644 --- a/plume/src/main/kotlin/io/github/plume/oss/drivers/TigerGraphDriver.kt +++ b/plume/src/main/kotlin/io/github/plume/oss/drivers/TigerGraphDriver.kt @@ -420,8 +420,8 @@ class TigerGraphDriver internal constructor() : IOverridenIdDriver, ISchemaSafeD private fun vertexPayloadToNode(o: JSONObject): NewNodeBuilder { val attributes = o["attributes"] as JSONObject - val vertexMap = HashMap() - attributes.keySet().filter { attributes[it] != "" } + val vertexMap = mutableMapOf() + attributes.keySet() .map { if (it == "id") Pair(it, attributes[it].toString().toLong()) else Pair(it.removePrefix("_"), attributes[it]) @@ -556,7 +556,7 @@ class TigerGraphDriver internal constructor() : IOverridenIdDriver, ISchemaSafeD ) val codeControl = CodeControl() runCatching { - logger.debug("Posting payload \"${payload.replace("\\s".toRegex(), " ").subSequence(0, 40)}...\"") + logger.debug("Posting payload:\n$payload") codeControl.disableSystemExit() val output = executeGsqlClient(args) logger.debug(output) diff --git a/plume/src/test/kotlin/io/github/plume/oss/drivers/JanusGraphDriverIntTest.kt b/plume/src/test/kotlin/io/github/plume/oss/drivers/JanusGraphDriverIntTest.kt index 0bc72700..c9259893 100644 --- a/plume/src/test/kotlin/io/github/plume/oss/drivers/JanusGraphDriverIntTest.kt +++ b/plume/src/test/kotlin/io/github/plume/oss/drivers/JanusGraphDriverIntTest.kt @@ -655,7 +655,7 @@ class JanusGraphDriverIntTest { } @Test - fun testGetNoneExistentProperty() { + fun testGetNonExistentProperty() { assertEquals(emptyList(), driver.getPropertyFromVertices("")) } @@ -669,6 +669,14 @@ class JanusGraphDriverIntTest { assertTrue(driver.getVerticesByProperty(FULL_NAME, STRING_1, TYPE_DECL).size == 1) } + @Test + fun getNonExistentVertexByProperty() { + val r1 = driver.getVerticesByProperty(FULL_NAME, "") + assertTrue(r1.isEmpty()) + val r2 = driver.getVerticesByProperty(FULL_NAME, "", NAMESPACE_BLOCK) + assertTrue(r2.isEmpty()) + } + @Test fun getVertexByIsExternalAndType() { val r = driver.getVerticesByProperty(IS_EXTERNAL, BOOL_1) diff --git a/plume/src/test/kotlin/io/github/plume/oss/drivers/Neo4jDriverIntTest.kt b/plume/src/test/kotlin/io/github/plume/oss/drivers/Neo4jDriverIntTest.kt index d01cfe36..8e079880 100644 --- a/plume/src/test/kotlin/io/github/plume/oss/drivers/Neo4jDriverIntTest.kt +++ b/plume/src/test/kotlin/io/github/plume/oss/drivers/Neo4jDriverIntTest.kt @@ -647,7 +647,7 @@ class Neo4jDriverIntTest { } @Test - fun testGetNoneExistentProperty() { + fun testGetNonExistentProperty() { assertEquals(emptyList(), driver.getPropertyFromVertices("")) } @@ -661,6 +661,14 @@ class Neo4jDriverIntTest { assertTrue(driver.getVerticesByProperty(FULL_NAME, STRING_1, TYPE_DECL).size == 1) } + @Test + fun getNonExistentVertexByProperty() { + val r1 = driver.getVerticesByProperty(FULL_NAME, "") + assertTrue(r1.isEmpty()) + val r2 = driver.getVerticesByProperty(FULL_NAME, "", NAMESPACE_BLOCK) + assertTrue(r2.isEmpty()) + } + @Test fun getVertexByIsExternalAndType() { val r = driver.getVerticesByProperty(IS_EXTERNAL, BOOL_1) diff --git a/plume/src/test/kotlin/io/github/plume/oss/drivers/NeptuneDriverIntTest.kt b/plume/src/test/kotlin/io/github/plume/oss/drivers/NeptuneDriverIntTest.kt index 51a5591d..3ed30cb6 100644 --- a/plume/src/test/kotlin/io/github/plume/oss/drivers/NeptuneDriverIntTest.kt +++ b/plume/src/test/kotlin/io/github/plume/oss/drivers/NeptuneDriverIntTest.kt @@ -677,7 +677,7 @@ class NeptuneDriverIntTest { } @Test - fun testGetNoneExistentProperty() { + fun testGetNonExistentProperty() { assertEquals(emptyList(), driver.getPropertyFromVertices("")) } @@ -691,6 +691,14 @@ class NeptuneDriverIntTest { assertTrue(driver.getVerticesByProperty(FULL_NAME, STRING_1, TYPE_DECL).size == 1) } + @Test + fun getNonExistentVertexByProperty() { + val r1 = driver.getVerticesByProperty(FULL_NAME, "") + assertTrue(r1.isEmpty()) + val r2 = driver.getVerticesByProperty(FULL_NAME, "", NAMESPACE_BLOCK) + assertTrue(r2.isEmpty()) + } + @Test fun getVertexByIsExternalAndType() { val r = driver.getVerticesByProperty(IS_EXTERNAL, BOOL_1) diff --git a/plume/src/test/kotlin/io/github/plume/oss/drivers/OverflowDbDriverIntTest.kt b/plume/src/test/kotlin/io/github/plume/oss/drivers/OverflowDbDriverIntTest.kt index f5a02a4b..7d9e3076 100644 --- a/plume/src/test/kotlin/io/github/plume/oss/drivers/OverflowDbDriverIntTest.kt +++ b/plume/src/test/kotlin/io/github/plume/oss/drivers/OverflowDbDriverIntTest.kt @@ -656,7 +656,7 @@ class OverflowDbDriverIntTest { } @Test - fun testGetNoneExistentProperty() { + fun testGetNonExistentProperty() { assertEquals(emptyList(), driver.getPropertyFromVertices("")) } @@ -670,6 +670,14 @@ class OverflowDbDriverIntTest { assertTrue(driver.getVerticesByProperty(FULL_NAME, STRING_1, TYPE_DECL).size == 1) } + @Test + fun getNonExistentVertexByProperty() { + val r1 = driver.getVerticesByProperty(FULL_NAME, "") + assertTrue(r1.isEmpty()) + val r2 = driver.getVerticesByProperty(FULL_NAME, "", NAMESPACE_BLOCK) + assertTrue(r2.isEmpty()) + } + @Test fun getVertexByIsExternalAndType() { val r = driver.getVerticesByProperty(IS_EXTERNAL, BOOL_1) diff --git a/plume/src/test/kotlin/io/github/plume/oss/drivers/TigerGraphDriverIntTest.kt b/plume/src/test/kotlin/io/github/plume/oss/drivers/TigerGraphDriverIntTest.kt index db5cde39..fa0acd02 100644 --- a/plume/src/test/kotlin/io/github/plume/oss/drivers/TigerGraphDriverIntTest.kt +++ b/plume/src/test/kotlin/io/github/plume/oss/drivers/TigerGraphDriverIntTest.kt @@ -687,7 +687,7 @@ class TigerGraphDriverIntTest { } @Test - fun testGetNoneExistentProperty() { + fun testGetNonExistentProperty() { assertEquals(emptyList(), driver.getPropertyFromVertices("")) } @@ -701,6 +701,14 @@ class TigerGraphDriverIntTest { assertTrue(driver.getVerticesByProperty(FULL_NAME, STRING_1, TYPE_DECL).size == 1) } + @Test + fun getNonExistentVertexByProperty() { + val r1 = driver.getVerticesByProperty(FULL_NAME, "") + assertTrue(r1.isEmpty()) + val r2 = driver.getVerticesByProperty(FULL_NAME, "", NAMESPACE_BLOCK) + assertTrue(r2.isEmpty()) + } + @Test fun getVertexByIsExternalAndType() { val r = driver.getVerticesByProperty(IS_EXTERNAL, BOOL_1) diff --git a/plume/src/test/kotlin/io/github/plume/oss/drivers/TinkerGraphDriverIntTest.kt b/plume/src/test/kotlin/io/github/plume/oss/drivers/TinkerGraphDriverIntTest.kt index 336df2b0..47ee8977 100644 --- a/plume/src/test/kotlin/io/github/plume/oss/drivers/TinkerGraphDriverIntTest.kt +++ b/plume/src/test/kotlin/io/github/plume/oss/drivers/TinkerGraphDriverIntTest.kt @@ -707,7 +707,7 @@ class TinkerGraphDriverIntTest { } @Test - fun testGetNoneExistentProperty() { + fun testGetNonExistentProperty() { assertEquals(emptyList(), driver.getPropertyFromVertices("")) } @@ -721,6 +721,14 @@ class TinkerGraphDriverIntTest { assertTrue(driver.getVerticesByProperty(FULL_NAME, STRING_1, TYPE_DECL).size == 1) } + @Test + fun getNonExistentVertexByProperty() { + val r1 = driver.getVerticesByProperty(FULL_NAME, "") + assertTrue(r1.isEmpty()) + val r2 = driver.getVerticesByProperty(FULL_NAME, "", NAMESPACE_BLOCK) + assertTrue(r2.isEmpty()) + } + @Test fun getVertexByIsExternalAndType() { val r = driver.getVerticesByProperty(IS_EXTERNAL, BOOL_1)