[Mifos-developer] Different tests order on different machines

1 view
Skip to first unread message

Jakub Sławiński

unread,
May 24, 2010, 11:13:08 AM5/24/10
to Mifos software development

Hi,

I have seen another error during tests on my local machine.

This time it was an acceptance test:

createHoliday(org.mifos.test.acceptance.holiday.HolidayTest) Time
elapsed: 4.488 sec <<< FAILURE!
java.lang.AssertionError: expected:<Review_holidayCreation> but
was:<create_officeHoliday>
at org.testng.Assert.fail(Assert.java:86)
at org.testng.Assert.failNotEquals(Assert.java:440)
at org.testng.Assert.assertEquals(Assert.java:110)
at org.testng.Assert.assertEquals(Assert.java:131)
at org.testng.Assert.assertEquals(Assert.java:141)
at
org.mifos.test.acceptance.framework.AbstractPage.verifyPage(AbstractPage.java:65)
at
org.mifos.test.acceptance.framework.holiday.CreateHolidayConfirmationPage.verifyPage(CreateHolidayConfirmationPage.java:33)
at
org.mifos.test.acceptance.holiday.HolidayTest.createHoliday(HolidayTest.java:84)


I fixed this by loading proper dataset at the beginning of the test:

dbUnitUtilities.loadDataFromFile("acceptance_default_003_dbunit.xml.zip", dataSource);

Do we have any consistent policy regarding preparing/cleaning test data
in integration/acceptance tests? Such mysterious test failures can be
really frustrating ;)


Yours sincerely,
Jakub.


--
Jakub Sławiński
SolDevelo
Gdynia, Poland.

------------------------------------------------------------------------------

--
You received this message because you are subscribed to the Google Groups "Mifos Developer" group.
To post to this group, send email to mifosde...@googlegroups.com.
To unsubscribe from this group, send email to mifosdevelope...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/mifosdeveloper?hl=en.

Keith Woodlock

unread,
May 24, 2010, 12:21:56 PM5/24/10
to Mifos software development
Jakub,

> Do we have any consistent policy regarding preparing/cleaning test data
> in integration/acceptance tests? Such mysterious test failures can be
> really frustrating ;)

Yes the current test suite certainly can be frustrating and there are
a number of existing problems
(http://www.mifos.org/developers/wiki/DeveloperTesting#existing-problems).

With regards preparing/cleaning test data for 'integrated tests' such
as 'acceptance level' and 'sub system level' the way i've being
pushing the new 'integration tests' we write/refactor towards the
following:

for preparing data: Use existing application services for getting the
data into the database rather than using something like 'dbunit'. When
using 'creational patterns' to keep the use of these services within
test code decoupled from production code, we get a clean easy way of
getting accurate data into the database that is sheilded from
production implementation.

for cleaning: should be as simple as DatabaseCleaner and should happen
before each individual test to ensure 'test independence'

see examples at CenterCreationUsingCustomerServiceIntegrationTest

Regards,
KeithW.

2010/5/24 Jakub Sławiński <jslaw...@soldevelo.com>:
Reply all
Reply to author
Forward
0 new messages