我在为我编写的neo4j非托管扩展编写单元测试时遇到了困难。
我正在遵循http://neo4j.com/docs/stable/server-unmanaged-extensions-testing.html的示例
问题是,这个示例使用了一个HTTP对象,而我似乎无法从任何地方导入它。
官方的例子表明一切都将在ne4j-harness依赖中,然而HTTP似乎在ne4j-server中。没有构建not 4j-server项目的新克隆。
与其想出一个替代方案,谁能给我指出一个可以在我的pom中包含为依赖项的新4j-server的工作版本?
在发出mvn clean install -U时,我没有遇到任何类似http://search.maven.org/#artifactdetails%7Ccontent.org.neo4j.app%7Cneo4j-server%7C2.2.3%7Cjar的问题,相反,我得到了一个依赖项解析错误。
发布于 2015-09-19 18:29:09
这些是我在最后运行的依赖项。据我所知,在任何地方都没有文档记录,我相信还有改进的空间,所以我没有标记为正确,但它们似乎是有效的。
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-all</artifactId>
</dependency>
<dependency>
<groupId>org.neo4j.app</groupId>
<artifactId>neo4j-server</artifactId>
<version>2.2.2</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.neo4j.app</groupId>
<artifactId>neo4j-server</artifactId>
<version>2.2.2</version>
</dependency>
<dependency>
<groupId>org.neo4j.test</groupId>
<artifactId>neo4j-harness</artifactId>
<scope>test</scope>
</dependency>
</dependencies>发布于 2015-09-21 13:54:20
是的,这是正确的,因为官方文档遗漏了一些内容。
另外,我建议您使用另一个库来测试非托管扩展。它是开源的- https://github.com/graphaware/neo4j-framework/tree/master/tests#graphunit
https://stackoverflow.com/questions/32662336
复制相似问题