1

我需要在以下场景中编写测试

- I have a ruby script to read xml data and store the resultant data in MongoDB.
- I want to write a test, which compares the xml and the imported content in the db and make sure the data in xml and imported data are similar.

考虑以下示例 xml 文件:

<employees>
    <employee>
        <name>xxx</name>
    </employee>
    <employee>
        <name>yyy</name>
    </employee>
</employees>

employees (table)
-----------------
name
xxx
yyy

how do i write test for this case?
4

1 回答 1

0

如果您使用 Java,您可以确保您的 MongoDB 文档与您的 Java 对象匹配,然后使用 JAXB 转换为 XML。

于 2012-11-27T14:33:39.763 回答