You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@metamodel.apache.org by ar...@apache.org on 2019/12/13 10:40:19 UTC
[metamodel] branch dependabot/maven/jackson.version-2.10.1 updated
(3f7b0e5 -> 1ad00e3)
This is an automated email from the ASF dual-hosted git repository.
arjansh pushed a change to branch dependabot/maven/jackson.version-2.10.1
in repository https://gitbox.apache.org/repos/asf/metamodel.git.
from 3f7b0e5 Bump jackson.version from 2.6.7 to 2.10.1
add a58159a MM-82 Detect Column Types
add 5c04994 MM-82 Detect Column Types - Updated javadoc and applied formating and cleanup
add efeb295 MM-82 Detect Column Types - Actual javadoc update
add da01168 MM-82 Detect Column Types - Refactoring based on comments in PR and better formatting
add 6008e54 MM-82 Detect Column Types - Refactoring based on comments in PR 2
add a94f8dc MM-82 Detect Column Types - Changed 2 methods back to static
add f65d06f MM-82 Detect Column Types - Refactoring based on comments in PR 3
add b40bc5a MM-82 Detect Column Types - Refactoring based on comments in PR 4
add 8c58fe1 MM-82 Detect Column Types - Refactoring based on comments in PR 4 formatting
add 2f3f0d7 MM-82 Detect Column Types - Refactoring based on comments in PR 5
add 740fa13 METAMODEL-82 - Fix integers in double columns
add b8d193a MM-82 Detect Column Types - Update CHANGES.md
add 6a7b7c1 Bump spring.version from 4.2.6.RELEASE to 5.2.2.RELEASE
add 1913598 Merge branch 'dependabot/maven/spring.version-5.2.2.RELEASE'
new 38b6224 Merge branch 'master' into dependabot/maven/jackson.version-2.10.1
new 1ad00e3 Refactored Neo4j integrationtest, so it uses the "optString" method when getting values from a JSON object which may not be a String and changed the logic of two test cases which depended on results being returned in a default order by Neo4j, without specifying that order.
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
CHANGES.md | 1 +
excel/pom.xml | 2 +-
.../excel/DefaultSpreadsheetReaderDelegate.java | 222 +++++++++++++++++++--
.../apache/metamodel/excel/ExcelConfiguration.java | 56 +++++-
.../apache/metamodel/excel/ExcelDataContext.java | 2 +-
.../org/apache/metamodel/excel/ExcelUtils.java | 212 ++++++++++++++------
.../metamodel/excel/ExcelConfigurationTest.java | 15 +-
.../metamodel/excel/ExcelDataContextTest.java | 160 +++++++++++++++
excel/src/test/resources/different_datatypes.xls | Bin 0 -> 35840 bytes
excel/src/test/resources/different_datatypes.xlsx | Bin 0 -> 9870 bytes
.../metamodel/neo4j/Neo4jDataContextTest.java | 55 +++--
pom.xml | 2 +-
12 files changed, 616 insertions(+), 111 deletions(-)
create mode 100644 excel/src/test/resources/different_datatypes.xls
create mode 100644 excel/src/test/resources/different_datatypes.xlsx
[metamodel] 02/02: Refactored Neo4j integrationtest,
so it uses the "optString" method when getting values from a JSON
object which may not be a String and changed the logic of two test cases
which depended on results being returned in a default order by Neo4j,
without specifying that order.
Posted by ar...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
arjansh pushed a commit to branch dependabot/maven/jackson.version-2.10.1
in repository https://gitbox.apache.org/repos/asf/metamodel.git
commit 1ad00e3a1dbe529b4a53c99f0ae7173a66738333
Author: Arjan Seijkens <a....@quadient.com>
AuthorDate: Fri Dec 13 11:40:14 2019 +0100
Refactored Neo4j integrationtest, so it uses the "optString" method when getting values from a JSON object which may not be a String and changed the logic of two test cases which depended on results being returned in a default order by Neo4j, without specifying that order.
---
.../metamodel/neo4j/Neo4jDataContextTest.java | 55 +++++++++++++++++-----
1 file changed, 42 insertions(+), 13 deletions(-)
diff --git a/neo4j/src/test/java/org/apache/metamodel/neo4j/Neo4jDataContextTest.java b/neo4j/src/test/java/org/apache/metamodel/neo4j/Neo4jDataContextTest.java
index 1ac7fa2..1cf9b40 100644
--- a/neo4j/src/test/java/org/apache/metamodel/neo4j/Neo4jDataContextTest.java
+++ b/neo4j/src/test/java/org/apache/metamodel/neo4j/Neo4jDataContextTest.java
@@ -21,7 +21,9 @@ package org.apache.metamodel.neo4j;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
import org.apache.http.HttpHost;
import org.apache.http.impl.client.CloseableHttpClient;
@@ -217,7 +219,7 @@ public class Neo4jDataContextTest extends Neo4jTestCase {
String bookNodeIdJSONObject = requestWrapper.executeCypherQuery("MATCH (n:JUnitBook)"
+ " WHERE n.title = 'Introduction to algorithms'" + " RETURN id(n);");
String bookNodeId = new JSONObject(bookNodeIdJSONObject).getJSONArray("results").getJSONObject(0)
- .getJSONArray("data").getJSONObject(0).getJSONArray("row").getString(0);
+ .getJSONArray("data").getJSONObject(0).getJSONArray("row").optString(0);
Neo4jDataContext strategy = new Neo4jDataContext(getHostname(), getPort(), getUsername(), getPassword());
@@ -288,22 +290,22 @@ public class Neo4jDataContextTest extends Neo4jTestCase {
String bookNodeIdJSONObject = requestWrapper.executeCypherQuery("MATCH (n:JUnitBook)"
+ " WHERE n.title = 'Introduction to algorithms'" + " RETURN id(n);");
String bookNodeId = new JSONObject(bookNodeIdJSONObject).getJSONArray("results").getJSONObject(0)
- .getJSONArray("data").getJSONObject(0).getJSONArray("row").getString(0);
+ .getJSONArray("data").getJSONObject(0).getJSONArray("row").optString(0);
String helenaNodeIdJSONObject = requestWrapper.executeCypherQuery("MATCH (n:JUnitPerson)"
+ " WHERE n.name = 'Helena'" + " RETURN id(n);");
String helenaNodeId = new JSONObject(helenaNodeIdJSONObject).getJSONArray("results").getJSONObject(0)
- .getJSONArray("data").getJSONObject(0).getJSONArray("row").getString(0);
+ .getJSONArray("data").getJSONObject(0).getJSONArray("row").optString(0);
String tomaszNodeIdJSONObject = requestWrapper.executeCypherQuery("MATCH (n:JUnitPerson)"
+ " WHERE n.name = 'Tomasz'" + " RETURN id(n);");
String tomaszNodeId = new JSONObject(tomaszNodeIdJSONObject).getJSONArray("results").getJSONObject(0)
- .getJSONArray("data").getJSONObject(0).getJSONArray("row").getString(0);
+ .getJSONArray("data").getJSONObject(0).getJSONArray("row").optString(0);
String philomeenaNodeIdJSONObject = requestWrapper.executeCypherQuery("MATCH (n:JUnitPerson)"
+ " WHERE n.name = 'Philomeena'" + " RETURN id(n);");
String philomeenaNodeId = new JSONObject(philomeenaNodeIdJSONObject).getJSONArray("results").getJSONObject(0)
- .getJSONArray("data").getJSONObject(0).getJSONArray("row").getString(0);
+ .getJSONArray("data").getJSONObject(0).getJSONArray("row").optString(0);
Neo4jDataContext strategy = new Neo4jDataContext(getHostname(), getPort(), getUsername(), getPassword());
@@ -322,14 +324,31 @@ public class Neo4jDataContextTest extends Neo4jTestCase {
}
});
assertEquals(3, rows.size());
- assertEquals("Row[values=[" + helenaNodeId + ", Helena, 100, null, null, null]]", rows.get(0).toString());
- assertEquals("Row[values=[" + philomeenaNodeId + ", Philomeena, 18, null, null, " + bookNodeId + "]]", rows
- .get(1).toString());
- assertEquals("Row[values=[" + tomaszNodeId + ", Tomasz, 26, " + bookNodeId + ", 5, null]]", rows.get(2)
- .toString());
+
+ validateRow(rows.get(0), helenaNodeId, "Helena", "100", "null", "null", "null");
+ validateRow(rows.get(1), philomeenaNodeId, "Philomeena", "18", "null", "null", bookNodeId);
+ validateRow(rows.get(2), tomaszNodeId, "Tomasz", "26", bookNodeId, "5", "null");
}
}
+ void validateRow(final Row row, String... expectedValues) {
+ // Because the order of columns can vary over different test runs, we have to determine at which index the
+ // columns are.
+ final Map<String, Integer> columnNameMap = new HashMap<>();
+ for (int i = 0; i < 6; i++) {
+ String columnName = row.getSelectItems().get(i).getColumn().getName();
+
+ columnNameMap.put(columnName, i);
+ }
+
+ assertEquals(expectedValues[0], row.getValue(columnNameMap.get("_id")).toString());
+ assertEquals(expectedValues[1], row.getValue(columnNameMap.get("name")).toString());
+ assertEquals(expectedValues[2], row.getValue(columnNameMap.get("age")).toString());
+ assertEquals(expectedValues[3], row.getValue(columnNameMap.get("rel_HAS_READ")).toString());
+ assertEquals(expectedValues[4], row.getValue(columnNameMap.get("rel_HAS_READ#rating")).toString());
+ assertEquals(expectedValues[5], row.getValue(columnNameMap.get("rel_HAS_BROWSED")).toString());
+ }
+
@Test
public void testWhereClause() throws Exception {
if (!isConfigured()) {
@@ -445,7 +464,7 @@ public class Neo4jDataContextTest extends Neo4jTestCase {
String bookNodeIdJSONObject = requestWrapper.executeCypherQuery("MATCH (n:JUnitBook)"
+ " WHERE n.title = 'Introduction to algorithms'" + " RETURN id(n);");
String bookNodeId = new JSONObject(bookNodeIdJSONObject).getJSONArray("results").getJSONObject(0)
- .getJSONArray("data").getJSONObject(0).getJSONArray("row").getString(0);
+ .getJSONArray("data").getJSONObject(0).getJSONArray("row").optString(0);
Neo4jDataContext strategy = new Neo4jDataContext(getHostname(), getPort(), getUsername(), getPassword());
@@ -486,11 +505,21 @@ public class Neo4jDataContextTest extends Neo4jTestCase {
// create datacontext using detected schema
final DataContext dc = new Neo4jDataContext(getHostname(), getPort(), getUsername(), getPassword());
+ final String expectedFirstResult;
try (final DataSet ds = dc.query().from("JUnitLabel").select("name").and("age").firstRow(2).execute()) {
assertTrue("Class: " + ds.getClass().getName(), ds instanceof Neo4jDataSet);
assertTrue(ds.next());
final Row row = ds.getRow();
- assertEquals("Row[values=[Jane Doe, null]]", row.toString());
+
+ // Because the select query doesn't return results in an ordered manner, we can't be sure which result will
+ // be returned first and which second, but we do know that the one expected here (the second) shouldn't be
+ // the one returned first by the second query.
+ if (row.toString().equals("Row[values=[Jane Doe, null]]")) {
+ expectedFirstResult = "Row[values=[John Doe, 30]]";
+ } else {
+ assertEquals("Row[values=[John Doe, 30]]", row.toString());
+ expectedFirstResult = "Row[values=[Jane Doe, null]]";
+ }
assertFalse(ds.next());
}
@@ -498,7 +527,7 @@ public class Neo4jDataContextTest extends Neo4jTestCase {
assertTrue("Class: " + ds.getClass().getName(), ds instanceof Neo4jDataSet);
assertTrue(ds.next());
final Row row = ds.getRow();
- assertEquals("Row[values=[John Doe, 30]]", row.toString());
+ assertEquals(expectedFirstResult, row.toString());
assertFalse(ds.next());
}
}
[metamodel] 01/02: Merge branch 'master' into
dependabot/maven/jackson.version-2.10.1
Posted by ar...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
arjansh pushed a commit to branch dependabot/maven/jackson.version-2.10.1
in repository https://gitbox.apache.org/repos/asf/metamodel.git
commit 38b6224855b6ba758f9ae6554b8e5e8d28e6f99c
Merge: 3f7b0e5 1913598
Author: Arjan Seijkens <a....@quadient.com>
AuthorDate: Thu Dec 12 14:43:27 2019 +0100
Merge branch 'master' into dependabot/maven/jackson.version-2.10.1
CHANGES.md | 1 +
excel/pom.xml | 2 +-
.../excel/DefaultSpreadsheetReaderDelegate.java | 222 +++++++++++++++++++--
.../apache/metamodel/excel/ExcelConfiguration.java | 56 +++++-
.../apache/metamodel/excel/ExcelDataContext.java | 2 +-
.../org/apache/metamodel/excel/ExcelUtils.java | 212 ++++++++++++++------
.../metamodel/excel/ExcelConfigurationTest.java | 15 +-
.../metamodel/excel/ExcelDataContextTest.java | 160 +++++++++++++++
excel/src/test/resources/different_datatypes.xls | Bin 0 -> 35840 bytes
excel/src/test/resources/different_datatypes.xlsx | Bin 0 -> 9870 bytes
pom.xml | 2 +-
11 files changed, 574 insertions(+), 98 deletions(-)
diff --cc pom.xml
index 5524f00,22a9233..ced6266
--- a/pom.xml
+++ b/pom.xml
@@@ -27,9 -27,9 +27,9 @@@ under the License
<junit.version>4.12</junit.version>
<guava.version>27.0.1-jre</guava.version>
<hadoop.version>3.1.1</hadoop.version>
- <jackson.version>2.6.7</jackson.version>
+ <jackson.version>2.10.1</jackson.version>
<easymock.version>3.2</easymock.version>
- <spring.version>4.2.6.RELEASE</spring.version>
+ <spring.version>5.2.2.RELEASE</spring.version>
<httpcomponents.version>4.4.1</httpcomponents.version>
<docker-maven-plugin.version>0.23.0</docker-maven-plugin.version>
<skipTests>false</skipTests>