FuYouJ commented on PR #4841: URL: https://github.com/apache/seatunnel/pull/4841#issuecomment-1584522020
> please add e2e testcase check this change https://github.com/apache/seatunnel/tree/dev/seatunnel-e2e/seatunnel-connector-v2-e2e/connector-neo4j-e2e I have added additional tests, please review `@TestTemplate public void testBatchWrite(TestContainer container) throws IOException, InterruptedException { // clean test data before test final Result checkExists = neo4jSession.run("MATCH (n:BatchLabel) RETURN n limit 1"); if (checkExists.hasNext()) { neo4jSession.run("MATCH (n:BatchLabel) delete n"); } // unwind $ttt as row create(n:BatchLabel) set n.name = row.name,n.age = row.age Container.ExecResult execResult = container.executeJob("/neo4j/fake_to_neo4j_batch_write.conf"); // then Assertions.assertEquals(0, execResult.getExitCode()); final Result result = neo4jSession.run("MATCH (n:BatchLabel) RETURN n"); // nodes assertTrue(result.hasNext()); // verify the attributes of the node result.stream() .forEach( r -> { String name = r.get("n").get("name").asString(); assertNotNull(name); Object age = r.get("n").get("age").asObject(); assertNotNull(age); }); }` and the testConf is `# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use this file except in compliance with # the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # ###### ###### This config file is a demonstration of streaming processing in seatunnel config ###### env { # You can set engine configuration here execution.parallelism = 1 job.mode = "BATCH" checkpoint.interval = 5000 #execution.checkpoint.data-uri = "hdfs://localhost:9000/checkpoint" } source { # This is a example source plugin **only for test and demonstrate the feature source plugin** FakeSource { result_table_name = "fake" parallelism = 1 schema = { fields { name = "string" age = "int" } } } } transform { } sink { Neo4j { uri = "neo4j://neo4j-host:7687" username = "neo4j" password = "Test@12343" database = "neo4j" batch_data_variable = "ttt" max_batch_size = 3 write_mode = "Batch" max_transaction_retry_time = 3 max_connection_timeout = 1 query = "unwind $ttt as row create(n:BatchLabel) set n.name = row.name,n.age = row.age" } }` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
