So I’m been struggling all afternoon with figuring out why this unit test isn’t working, and I wanted to see if anyone has any bright ideas.
To set the background, there is a hibernate interceptor we define called “AuditableInceptor” that is set to interceptor any hibernate “dirty flushes” and then set the “date changed” and “changed by” properties of all objects before flushing. But the “onDirtyFlush” method in this interceptor is never being called during the savePersonAttribute call that made during this unit test… and therefore the date changed and changed by are not being updated and the unit test is failing. The strange thing is that the onDirtyFlush *is* called successfully when I save a person attribute on my 1.6.x development environment—in fact, the AuditableInceptor seems to work fine when I test it on a dev server. The unit test also passes successfully in 1.7.x, with the identical AuditableInceptor, HibernateSessionFactoryBean, and bean configuration. The only time it fails in the 1.6 unit test. I thought it might be a problem with the autowiring (because there was an earlier autowiring error), but, after spending some time this afternoon with the debugger it appears that the HibernateSessionFactoryBean is wired the same way in the 1.6.x junit, 1.7.x junit, and 1.6.x dev server environments. Which leads me to assume that for some reason either 1) the sessions created by the factory aren’t picking up the interceptor when instantiated in the 1.6.x junit environment, or 2) the Hibernate interceptor just doesn’t plain work in the 1.6.x junit environment, 3) for some reason in the 1.6.x junit environment we aren’t correctly mocking hibernate dirty flushes. Does anyone know if anything changed in our junit test environment between 1.6.x and 1.7.x? I tried updating the 1.6.x test codebase so that it used the BaseContextSensitiveTest from 1.7.x, but this didn’t help. I also know that we upgraded Spring to 3.0… could this have made a difference in some way? Any ideas? Thanks, Mark From: [email protected] [mailto:[email protected]] On Behalf Of OpenMRS Continuous Integration Server Sent: Thursday, September 08, 2011 12:10 PM To: [email protected] Subject: [OPENMRS-DEV] [OPENMRS-CI] JUnit > 1.6.x > #100 has FAILED (1 times). [cid:[email protected]] JUnit<http://ci.openmrs.org/browse/JUNIT/> > 1.6.x<http://ci.openmrs.org/browse/JUNIT-16X/> > #100<http://ci.openmrs.org/browse/JUNIT-16X-100/> has failed 1 time. Code has been updated by mogoodrich<http://ci.openmrs.org/browse/author/mogoodrich>. 1/1225 tests failed. This plan has been failing since JUNIT-16X-100<http://ci.openmrs.org/browse/JUNIT-16X-100> (Updated by mogoodrich<http://ci.openmrs.org/browse/JUNIT-16X-100/commit>, < 1 second before). Failing Jobs<http://ci.openmrs.org/browse/JUNIT-16X-100/> [cid:[email protected]] Default Job<http://ci.openmrs.org/browse/JUNIT-16X-JOB1-100/> (Default Stage) Duration: 2 minutes Tests: 1 of 1225 failed Logs<http://ci.openmrs.org/browse/JUNIT-16X-JOB1-100/log> | Artifacts<http://ci.openmrs.org/browse/JUNIT-16X-JOB1-100/artifact> Code Changes<http://ci.openmrs.org/browse/JUNIT-16X-100/commit/> See full change details<http://ci.openmrs.org/browse/JUNIT-16X-100/commit/>[cid:[email protected]] [cid:[email protected]] mogoodrich<http://ci.openmrs.org/browse/author/mogoodrich> TRUNK-2640<https://tickets.openmrs.org/browse/TRUNK-2640?page=com.atlassian.jira.plugin.ext.bamboo%3Abamboo-build-results-tabpanel>: Problem with Audit handling in 1.6.x (23210) JIRA Issues<http://ci.openmrs.org/browse/JUNIT-16X-100/issues> See full issue details<http://ci.openmrs.org/browse/JUNIT-16X-100/issues>[cid:[email protected]] [cid:[email protected]] TRUNK-2640<https://tickets.openmrs.org/browse/TRUNK-2640?page=com.atlassian.jira.plugin.ext.bamboo%3Abamboo-build-results-tabpanel> (Related) Problem with Audit handling in 1.6.x Tests<http://ci.openmrs.org/browse/JUNIT-16X-100/test> See full test details<http://ci.openmrs.org/browse/JUNIT-16X-100/test>[cid:[email protected]] New Test Failures (1) [cid:[email protected]] PersonServiceTest : Save person attribute type should set the date changed and changed by on update<http://ci.openmrs.org/browse/JUNIT-16X-JOB1-100/test/case/15468775> (Default Job)<http://ci.openmrs.org/browse/JUNIT-16X-JOB1-100/test> Email generated by Atlassian Bamboo<http://ci.openmrs.org> - if you wish to stop receiving these emails edit your user profile<http://ci.openmrs.org/profile/userNotifications.action> or notify your administrator<http://ci.openmrs.org/viewAdministrators.action> Actions View Online<http://ci.openmrs.org/browse/JUNIT-16X-100/> Add Comments<http://ci.openmrs.org/browse/JUNIT-16X-100?commentMode=true> Link to JIRA issue<http://ci.openmrs.org/build/addJiraIssue!default.action?buildKey=JUNIT-16X&buildNumber=100> ________________________________ Click here to unsubscribe<mailto:[email protected]?body=SIGNOFF%20openmrs-devel-l> from OpenMRS Developers' mailing list
<<inline: image001.jpg>>

