NoSQLUnit 0.6.0 发布了,NoSQLUnit 是一个 JUnit 的扩展,用来为那些使用了 NoSQL 后端的应用提供单元测试和集成测试的工具。
该版本主要是增加对 HBase 的支持,示例测试代码:[code]public class WhenPersonWantsToKnowItsCar {
@ClassRule
public static EmbeddedHBase embeddedHBase = newEmbeddedHBaseRule().build();
@Rule
public HBaseRule hBaseRule = newHBaseRule().defaultEmbeddedHBase(this);
@Inject
private Configuration configuration;
@Test
@UsingDataSet(locations="persons.json", loadStrategy=LoadStrategyEnum.CLEAN_INSERT)
public void car_should_be_returned() throws IOException {
PersonManager personManager = new PersonManager(configuration);
String car = personManager.getCarByPersonName("john");
assertThat(car, is("toyota"));
}
}[/code]主页:https://github.com/lordofthejars/nosql-unit
下载:https://github.com/lordofthejars/nosql-unit/tags
来自:开源中国社区