I haven't thought about how to do this. Maybe some tricky maven configuration in the module you want to test against sync, to include sync as a scope=test dependency, under a certain profile?
Maybe you can put the tests in another module (or just a simple maven project) that includes OpenMRS core, sync, and the other module? -Darius On Tue, Dec 13, 2011 at 4:43 AM, Mark Goodrich <[email protected]> wrote: > Nope, I didn't know about the @StartModule annotation... thanks... > Mark > ________________________________________ > From: [email protected] [[email protected]] On Behalf Of Michael Seaton [ > [email protected]] > Sent: Monday, December 12, 2011 10:02 PM > To: [email protected] > Subject: Re: [OPENMRS-DEV] Testing module interoperability > > Mark, > > You probably already know this, but there is an @StartModule annotation > you can put on your unit test class which will ensure that the given > module(s) are started before the unit tests are run. You need to put the > omod for the module in your test resources and then reference it. You can > see an example of this in the ModuleInteroperabilityTest in core. > > Not sure this will actually meet your needs are not. I can imagine that > you may run into classpath and classloading issues (and access to the test > classes in the other module) trying to do what you want below. Hopefully > someone else will respond that has some experience with this. > > Mike > > > On 12/12/2011 10:19 AM, Mark Goodrich wrote: > Hello all— > > Has anyone had experience configuring a OpenMRS module so unit tests can > be written to test its interoperability with another module? > > Specifically, I’d like to be able to write tests to test how other modules > work with the Sync module. From a unit test within a second module I’d > like to be able to: > > > - Fire up the sync module (and the Sync Hibernate interceptor) > > - Use the SyncBaseTest and SyncTestHelper classes from within the > second module to write unit tests the mock synchronization > > I figure it’s just a matter of getting the configuration correct, but I > was wondering if anyone else had done something similar and could point me > to an example. > > Thanks, > Mark > > > > > ________________________________ > Click here to > unsubscribe<mailto:[email protected]?body=SIGNOFF%20openmrs-devel-l> > from OpenMRS Developers' mailing list > ________________________________ > Click here to > unsubscribe<mailto:[email protected]?body=SIGNOFF%20openmrs-devel-l> > from OpenMRS Developers' mailing list > > _________________________________________ > > To unsubscribe from OpenMRS Developers' mailing list, send an e-mail to > [email protected] with "SIGNOFF openmrs-devel-l" in the body > (not the subject) of your e-mail. > > [mailto:[email protected]?body=SIGNOFF%20openmrs-devel-l] > _________________________________________ To unsubscribe from OpenMRS Developers' mailing list, send an e-mail to [email protected] with "SIGNOFF openmrs-devel-l" in the body (not the subject) of your e-mail. [mailto:[email protected]?body=SIGNOFF%20openmrs-devel-l]

