测试

Northwind 数据库脚本可从以下链接下载:https://code.google.com/archive/p/northwindextended/downloads

集成测试

您可以使用以下方式运行测试:

  • 本地实例,

  • Docker 实例,

  • Vagrant

  • 或在 AWS 中运行。

您需要一个 RDBMS 用户 neo4j,密码为 neo4j,并具有管理员权限才能运行测试。

要在 AWS 中运行测试,您需要一个 AWS IAM 用户。

使用本地实例运行测试

将所有权限授予用户 neo4j,密码为 neo4j

MySQL

CREATE USER 'neo4j'@'localhost' IDENTIFIED BY 'neo4j';
GRANT ALL PRIVILEGES ON *.* TO 'neo4j'@'localhost' WITH GRANT OPTION;
FLUSH PRIVILEGES;

PostgreSQL

CREATE USER neo4j WITH SUPERUSER ENCRYPTED PASSWORD 'neo4j';

Oracle

CREATE USER neo4j IDENTIFIED BY neo4j;
GRANT DBA TO neo4j;

对于 Oracle,您需要手动将 Oracle 驱动程序添加到本地 Maven 仓库中

mvn install:install-file -Dfile={Path/to/your/ojdbc7.jar} \
      -DgroupId=com.oracle -DartifactId=ojdbc7 -Dversion=12.1.0.2 -Dpackaging=jar

Microsoft SQL

目前,集成测试使用默认用户 "sa"。

在本地运行测试

mvn -P integration-test clean test

使用 Vagrant 运行测试

mvn -P integration-test -D PLATFORM=vagrant clean test

使用 AWS 运行测试

注意:您需要创建 AWS 密钥对并生成凭证文件才能执行此操作

mvn -P integration-test -D PLATFORM=aws -D EC2_SSH_KEY=<name of your EC2 SSH key> clean test

性能测试

是 neo4j-etl-it 模块的一部分测试集。

然而,默认情况下,当您运行 integration-test 目标时,这些测试通常会被跳过。您可以将它们作为测试套件的一部分单独运行。

在本地运行性能测试

mvn -P performance-test clean dependency:copy-dependencies test -D failIfNoTests=false -D EC2_SSH_KEY=<name of your EC2 SSH key>

在 AWS 中运行性能测试

mvn -P performance-test clean dependency:copy-dependencies test -D PLATFORM=aws -D failIfNoTests=false -D EC2_SSH_KEY=<name of your EC2 SSH key>

© . All rights reserved.