سؤال

I need to compare table contents described in xml file to actual database table contents.

What I have so far is

ITable actualTable = Iconnection.createQueryTable("query for actual contents here!");
    IDataSet expectedDataSet = builder.build(file.xml"));
    expectedReplacementDataSet = new ReplacementDataSet(expectedDataSet);
    expectedReplacementDataSet.addReplacementObject("[variable_the test_puts_to_database]", variable);
    ITable expectedTable = expectedReplacementDataSet.getTable("table");

Asserting the two Itables fail, because expectedTable does not hold table metadata. The contents match. I don't want to set dtd metadata to builder object. Any way to get though this?

هل كانت مفيدة؟

المحلول

Found the answer myself. The assertion needs to be dbunit Assertion.assertEquals, not junit Assert.AssertEquals

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top