+-
春季-EmbedMongo用于集成测试
在测试用 Spring RESt Mongo 2.4编写的应用程序时,我一直在寻找事务支持以回滚更改.但这是不可能的,因为我们不能为mongodb使用事务.在搜索集成测试时,我发现很少有embedMongo链接用于进行集成测试.您还可以通过在某个地方运行专用的mongo数据库实例来进行集成测试. mongo嵌入有什么特殊功能?我找不到很好的文档,它是否在Apache许可下?
最佳答案

I was looking for transaction support to rollback the changes while doing testing my app written in Spring+RESt+Mongo 2.4. But its not possible since we cant use transaction for mongodb.

不支持事务,但是您确实有一些替代方法可以在测试时回滚更改:

>在单元测试的设置或拆除过程中根据需要创建/重置数据
>在测试期间为初始数据集设定种子并以–syncdelay = 0开始mongod,这样就不会将新数据写入磁盘(嵌入式MongoDB建议将此作为“snapshot”方法)

While searching about integration testing I found few links about embedMongo for doing integration testing. You can also do integration testing by having dedicated mongo db instance running somewhere. What special feature that embed mongo provides?

Embedded MongoDB是标准MongoDB Server二进制文件的包装,旨在帮助进行单元测试.包装器的“特殊功能”仅是通过单元测试启动/停止MongoDB实例的功能.

另请参见以下注释:Embedded MongoDB when running integration tests.

I didn’t find great documentation for it, Is it under Apache license?

GitHub上的“Embedded MongoDB”源文件建议使用Apache 2.0许可证.

MongoDB服务器二进制文件将使用standard MongoDB Server community license(AGPL v3.0).

点击查看更多相关文章

转载注明原文:春季-EmbedMongo用于集成测试 - 乐贴网