Testing Sync module interoperability with other modules

classic Classic list List threaded Threaded
12 messages Options
Mark Goodrich-2 Mark Goodrich-2
Reply | Threaded
Open this post in threaded view
|

Testing Sync module interoperability with other modules

I’ve been thinking for a while about configuring module testing so it is possible to test if another module plays nicely with the Sync module.  I was actually working on this last week and put it aside for a bit, but the current Metadata Sharing/Sync issue has put it forefront in my mind again.

 

Has anybody written any unit tests for a module that fire up another omod?  We can package up a sync test jar and make it available to other modules so they can use it’s mock-sync testing framework… we did a similar thing with the Html Form Entry test framework for use in the HFE 1.9 ext module.  I’m not an expert with Spring configuration, and what I don’t know how to do is to start the sync module (and register it’s Hibernate interceptor) within a unit test for another module.  I played around with adding references to the Sync hibernate mapping files to the other module’s test-hibernate.cfg.xml, as well as adding the sync service and interceptor beans to the other module’s TestingApplicationContext.xml, but have had no luck so far.  Any ideas?

 

Take care,

Mark

 

 

 


[hidden email] from OpenMRS Developers' mailing list
Darius Jazayeri-2 Darius Jazayeri-2
Reply | Threaded
Open this post in threaded view
|

Re: Testing Sync module interoperability with other modules

I believe there's a start module annotation that you can use in a unit test. I don't know how completely it starts the module so you would need to test that out.

-Darius (by phone)

On Apr 14, 2012 1:39 PM, "Mark Goodrich" <[hidden email]> wrote:

I’ve been thinking for a while about configuring module testing so it is possible to test if another module plays nicely with the Sync module.  I was actually working on this last week and put it aside for a bit, but the current Metadata Sharing/Sync issue has put it forefront in my mind again.

 

Has anybody written any unit tests for a module that fire up another omod?  We can package up a sync test jar and make it available to other modules so they can use it’s mock-sync testing framework… we did a similar thing with the Html Form Entry test framework for use in the HFE 1.9 ext module.  I’m not an expert with Spring configuration, and what I don’t know how to do is to start the sync module (and register it’s Hibernate interceptor) within a unit test for another module.  I played around with adding references to the Sync hibernate mapping files to the other module’s test-hibernate.cfg.xml, as well as adding the sync service and interceptor beans to the other module’s TestingApplicationContext.xml, but have had no luck so far.  Any ideas?

 

Take care,

Mark

 

 

 


[hidden email] from OpenMRS Developers' mailing list

[hidden email] from OpenMRS Developers' mailing list
Mark Goodrich-2 Mark Goodrich-2
Reply | Threaded
Open this post in threaded view
|

Re: Testing Sync module interoperability with other modules

I having been playing around with the @StartModule annotation today and run into a few issues…  has anyone else successfully used this annotation?

 

One problem I’m running into is that when the module starts, it attempts to run the sqldiffs and fails.

 

Mark

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Darius Jazayeri
Sent: Saturday, April 14, 2012 5:31 PM
To: [hidden email]
Subject: Re: [OPENMRS-DEV] Testing Sync module interoperability with other modules

 

I believe there's a start module annotation that you can use in a unit test. I don't know how completely it starts the module so you would need to test that out.

-Darius (by phone)

On Apr 14, 2012 1:39 PM, "Mark Goodrich" <[hidden email]> wrote:

I’ve been thinking for a while about configuring module testing so it is possible to test if another module plays nicely with the Sync module.  I was actually working on this last week and put it aside for a bit, but the current Metadata Sharing/Sync issue has put it forefront in my mind again.

 

Has anybody written any unit tests for a module that fire up another omod?  We can package up a sync test jar and make it available to other modules so they can use it’s mock-sync testing framework… we did a similar thing with the Html Form Entry test framework for use in the HFE 1.9 ext module.  I’m not an expert with Spring configuration, and what I don’t know how to do is to start the sync module (and register it’s Hibernate interceptor) within a unit test for another module.  I played around with adding references to the Sync hibernate mapping files to the other module’s test-hibernate.cfg.xml, as well as adding the sync service and interceptor beans to the other module’s TestingApplicationContext.xml, but have had no luck so far.  Any ideas?

 

Take care,

Mark

 

 

 


[hidden email] from OpenMRS Developers' mailing list


[hidden email] from OpenMRS Developers' mailing list


[hidden email] from OpenMRS Developers' mailing list
Ben Wolfe (openmrs) Ben Wolfe (openmrs)
Reply | Threaded
Open this post in threaded view
|

Re: Testing Sync module interoperability with other modules

I thought the javadoc for @StartModule or StartModuleExecutionListener.java had this, but apparently not. :-( 

When the annotation is used in core the sqldiffs are deleted from the omods.  I never looked into have StartModuleExecutionListener somehow ignore the sqldiffs.

Ben

On Mon, Apr 16, 2012 at 3:55 PM, Mark Goodrich <[hidden email]> wrote:

I having been playing around with the @StartModule annotation today and run into a few issues…  has anyone else successfully used this annotation?

 

One problem I’m running into is that when the module starts, it attempts to run the sqldiffs and fails.

 

Mark

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Darius Jazayeri
Sent: Saturday, April 14, 2012 5:31 PM
To: [hidden email]
Subject: Re: [OPENMRS-DEV] Testing Sync module interoperability with other modules

 

I believe there's a start module annotation that you can use in a unit test. I don't know how completely it starts the module so you would need to test that out.

-Darius (by phone)

On Apr 14, 2012 1:39 PM, "Mark Goodrich" <[hidden email]> wrote:

I’ve been thinking for a while about configuring module testing so it is possible to test if another module plays nicely with the Sync module.  I was actually working on this last week and put it aside for a bit, but the current Metadata Sharing/Sync issue has put it forefront in my mind again.

 

Has anybody written any unit tests for a module that fire up another omod?  We can package up a sync test jar and make it available to other modules so they can use it’s mock-sync testing framework… we did a similar thing with the Html Form Entry test framework for use in the HFE 1.9 ext module.  I’m not an expert with Spring configuration, and what I don’t know how to do is to start the sync module (and register it’s Hibernate interceptor) within a unit test for another module.  I played around with adding references to the Sync hibernate mapping files to the other module’s test-hibernate.cfg.xml, as well as adding the sync service and interceptor beans to the other module’s TestingApplicationContext.xml, but have had no luck so far.  Any ideas?

 

Take care,

Mark

 

 

 


[hidden email] from OpenMRS Developers' mailing list


[hidden email] from OpenMRS Developers' mailing list


[hidden email] from OpenMRS Developers' mailing list


[hidden email] from OpenMRS Developers' mailing list
Mark Goodrich-2 Mark Goodrich-2
Reply | Threaded
Open this post in threaded view
|

Re: Testing Sync module interoperability with other modules

Thanks Ben—

 

Where is the annotation used in core, and how does it delete sqldiffs from the omod there?

 

Mark

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Ben Wolfe
Sent: Monday, April 16, 2012 4:12 PM
To: [hidden email]
Subject: Re: [OPENMRS-DEV] Testing Sync module interoperability with other modules

 

I thought the javadoc for @StartModule or StartModuleExecutionListener.java had this, but apparently not. :-( 

When the annotation is used in core the sqldiffs are deleted from the omods.  I never looked into have StartModuleExecutionListener somehow ignore the sqldiffs.

Ben

On Mon, Apr 16, 2012 at 3:55 PM, Mark Goodrich <[hidden email]> wrote:

I having been playing around with the @StartModule annotation today and run into a few issues…  has anyone else successfully used this annotation?

 

One problem I’m running into is that when the module starts, it attempts to run the sqldiffs and fails.

 

Mark

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Darius Jazayeri
Sent: Saturday, April 14, 2012 5:31 PM
To: [hidden email]
Subject: Re: [OPENMRS-DEV] Testing Sync module interoperability with other modules

 

I believe there's a start module annotation that you can use in a unit test. I don't know how completely it starts the module so you would need to test that out.

-Darius (by phone)

On Apr 14, 2012 1:39 PM, "Mark Goodrich" <[hidden email]> wrote:

I’ve been thinking for a while about configuring module testing so it is possible to test if another module plays nicely with the Sync module.  I was actually working on this last week and put it aside for a bit, but the current Metadata Sharing/Sync issue has put it forefront in my mind again.

 

Has anybody written any unit tests for a module that fire up another omod?  We can package up a sync test jar and make it available to other modules so they can use it’s mock-sync testing framework… we did a similar thing with the Html Form Entry test framework for use in the HFE 1.9 ext module.  I’m not an expert with Spring configuration, and what I don’t know how to do is to start the sync module (and register it’s Hibernate interceptor) within a unit test for another module.  I played around with adding references to the Sync hibernate mapping files to the other module’s test-hibernate.cfg.xml, as well as adding the sync service and interceptor beans to the other module’s TestingApplicationContext.xml, but have had no luck so far.  Any ideas?

 

Take care,

Mark

 

 

 


[hidden email] from OpenMRS Developers' mailing list


[hidden email] from OpenMRS Developers' mailing list


[hidden email] from OpenMRS Developers' mailing list

 


[hidden email] from OpenMRS Developers' mailing list


[hidden email] from OpenMRS Developers' mailing list
Ben Wolfe (openmrs) Ben Wolfe (openmrs)
Reply | Threaded
Open this post in threaded view
|

Re: Testing Sync module interoperability with other modules

The omods referenced in core in the testing package simply have the sqldiffs deleted out of them.  In linux you can simply open the omod as a zip file and delete the file.  It will prompt you to update the compiled zip.

Ben

On Mon, Apr 16, 2012 at 4:45 PM, Mark Goodrich <[hidden email]> wrote:

Thanks Ben—

 

Where is the annotation used in core, and how does it delete sqldiffs from the omod there?

 

Mark

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Ben Wolfe
Sent: Monday, April 16, 2012 4:12 PM


To: [hidden email]
Subject: Re: [OPENMRS-DEV] Testing Sync module interoperability with other modules

 

I thought the javadoc for @StartModule or StartModuleExecutionListener.java had this, but apparently not. :-( 

When the annotation is used in core the sqldiffs are deleted from the omods.  I never looked into have StartModuleExecutionListener somehow ignore the sqldiffs.

Ben

On Mon, Apr 16, 2012 at 3:55 PM, Mark Goodrich <[hidden email]> wrote:

I having been playing around with the @StartModule annotation today and run into a few issues…  has anyone else successfully used this annotation?

 

One problem I’m running into is that when the module starts, it attempts to run the sqldiffs and fails.

 

Mark

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Darius Jazayeri
Sent: Saturday, April 14, 2012 5:31 PM
To: [hidden email]
Subject: Re: [OPENMRS-DEV] Testing Sync module interoperability with other modules

 

I believe there's a start module annotation that you can use in a unit test. I don't know how completely it starts the module so you would need to test that out.

-Darius (by phone)

On Apr 14, 2012 1:39 PM, "Mark Goodrich" <[hidden email]> wrote:

I’ve been thinking for a while about configuring module testing so it is possible to test if another module plays nicely with the Sync module.  I was actually working on this last week and put it aside for a bit, but the current Metadata Sharing/Sync issue has put it forefront in my mind again.

 

Has anybody written any unit tests for a module that fire up another omod?  We can package up a sync test jar and make it available to other modules so they can use it’s mock-sync testing framework… we did a similar thing with the Html Form Entry test framework for use in the HFE 1.9 ext module.  I’m not an expert with Spring configuration, and what I don’t know how to do is to start the sync module (and register it’s Hibernate interceptor) within a unit test for another module.  I played around with adding references to the Sync hibernate mapping files to the other module’s test-hibernate.cfg.xml, as well as adding the sync service and interceptor beans to the other module’s TestingApplicationContext.xml, but have had no luck so far.  Any ideas?

 

Take care,

Mark

 

 

 


[hidden email] from OpenMRS Developers' mailing list


[hidden email] from OpenMRS Developers' mailing list


[hidden email] from OpenMRS Developers' mailing list

 


[hidden email] from OpenMRS Developers' mailing list


[hidden email] from OpenMRS Developers' mailing list


[hidden email] from OpenMRS Developers' mailing list
Mark Goodrich-2 Mark Goodrich-2
Reply | Threaded
Open this post in threaded view
|

Re: Testing Sync module interoperability with other modules

Oh, they are just manually, deleted, got it…

Mark

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Ben Wolfe
Sent: Monday, April 16, 2012 4:49 PM
To: [hidden email]
Subject: Re: [OPENMRS-DEV] Testing Sync module interoperability with other modules

 

The omods referenced in core in the testing package simply have the sqldiffs deleted out of them.  In linux you can simply open the omod as a zip file and delete the file.  It will prompt you to update the compiled zip.

Ben

On Mon, Apr 16, 2012 at 4:45 PM, Mark Goodrich <[hidden email]> wrote:

Thanks Ben—

 

Where is the annotation used in core, and how does it delete sqldiffs from the omod there?

 

Mark

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Ben Wolfe
Sent: Monday, April 16, 2012 4:12 PM


To: [hidden email]
Subject: Re: [OPENMRS-DEV] Testing Sync module interoperability with other modules

 

I thought the javadoc for @StartModule or StartModuleExecutionListener.java had this, but apparently not. :-( 

When the annotation is used in core the sqldiffs are deleted from the omods.  I never looked into have StartModuleExecutionListener somehow ignore the sqldiffs.

Ben

On Mon, Apr 16, 2012 at 3:55 PM, Mark Goodrich <[hidden email]> wrote:

I having been playing around with the @StartModule annotation today and run into a few issues…  has anyone else successfully used this annotation?

 

One problem I’m running into is that when the module starts, it attempts to run the sqldiffs and fails.

 

Mark

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Darius Jazayeri
Sent: Saturday, April 14, 2012 5:31 PM
To: [hidden email]
Subject: Re: [OPENMRS-DEV] Testing Sync module interoperability with other modules

 

I believe there's a start module annotation that you can use in a unit test. I don't know how completely it starts the module so you would need to test that out.

-Darius (by phone)

On Apr 14, 2012 1:39 PM, "Mark Goodrich" <[hidden email]> wrote:

I’ve been thinking for a while about configuring module testing so it is possible to test if another module plays nicely with the Sync module.  I was actually working on this last week and put it aside for a bit, but the current Metadata Sharing/Sync issue has put it forefront in my mind again.

 

Has anybody written any unit tests for a module that fire up another omod?  We can package up a sync test jar and make it available to other modules so they can use it’s mock-sync testing framework… we did a similar thing with the Html Form Entry test framework for use in the HFE 1.9 ext module.  I’m not an expert with Spring configuration, and what I don’t know how to do is to start the sync module (and register it’s Hibernate interceptor) within a unit test for another module.  I played around with adding references to the Sync hibernate mapping files to the other module’s test-hibernate.cfg.xml, as well as adding the sync service and interceptor beans to the other module’s TestingApplicationContext.xml, but have had no luck so far.  Any ideas?

 

Take care,

Mark

 

 

 


[hidden email] from OpenMRS Developers' mailing list


[hidden email] from OpenMRS Developers' mailing list


[hidden email] from OpenMRS Developers' mailing list

 


[hidden email] from OpenMRS Developers' mailing list


[hidden email] from OpenMRS Developers' mailing list

 


[hidden email] from OpenMRS Developers' mailing list


[hidden email] from OpenMRS Developers' mailing list
Mark Goodrich-2 Mark Goodrich-2
Reply | Threaded
Open this post in threaded view
|

Re: Testing Sync module interoperability with other modules

In reply to this post by Ben Wolfe (openmrs)

I’m not quite where/how we are testing modules in core, but adding MDS to the list of modules tested in core would be helpful… assumedly if you simply started the MDS module and then ran all the core unit tests, the AuditableInterceptor test would have failed, and we would have discovered the MDS bug earlier…

 

Mark

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Ben Wolfe
Sent: Monday, April 16, 2012 4:49 PM
To: [hidden email]
Subject: Re: [OPENMRS-DEV] Testing Sync module interoperability with other modules

 

The omods referenced in core in the testing package simply have the sqldiffs deleted out of them.  In linux you can simply open the omod as a zip file and delete the file.  It will prompt you to update the compiled zip.

Ben

On Mon, Apr 16, 2012 at 4:45 PM, Mark Goodrich <[hidden email]> wrote:

Thanks Ben—

 

Where is the annotation used in core, and how does it delete sqldiffs from the omod there?

 

Mark

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Ben Wolfe
Sent: Monday, April 16, 2012 4:12 PM


To: [hidden email]
Subject: Re: [OPENMRS-DEV] Testing Sync module interoperability with other modules

 

I thought the javadoc for @StartModule or StartModuleExecutionListener.java had this, but apparently not. :-( 

When the annotation is used in core the sqldiffs are deleted from the omods.  I never looked into have StartModuleExecutionListener somehow ignore the sqldiffs.

Ben

On Mon, Apr 16, 2012 at 3:55 PM, Mark Goodrich <[hidden email]> wrote:

I having been playing around with the @StartModule annotation today and run into a few issues…  has anyone else successfully used this annotation?

 

One problem I’m running into is that when the module starts, it attempts to run the sqldiffs and fails.

 

Mark

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Darius Jazayeri
Sent: Saturday, April 14, 2012 5:31 PM
To: [hidden email]
Subject: Re: [OPENMRS-DEV] Testing Sync module interoperability with other modules

 

I believe there's a start module annotation that you can use in a unit test. I don't know how completely it starts the module so you would need to test that out.

-Darius (by phone)

On Apr 14, 2012 1:39 PM, "Mark Goodrich" <[hidden email]> wrote:

I’ve been thinking for a while about configuring module testing so it is possible to test if another module plays nicely with the Sync module.  I was actually working on this last week and put it aside for a bit, but the current Metadata Sharing/Sync issue has put it forefront in my mind again.

 

Has anybody written any unit tests for a module that fire up another omod?  We can package up a sync test jar and make it available to other modules so they can use it’s mock-sync testing framework… we did a similar thing with the Html Form Entry test framework for use in the HFE 1.9 ext module.  I’m not an expert with Spring configuration, and what I don’t know how to do is to start the sync module (and register it’s Hibernate interceptor) within a unit test for another module.  I played around with adding references to the Sync hibernate mapping files to the other module’s test-hibernate.cfg.xml, as well as adding the sync service and interceptor beans to the other module’s TestingApplicationContext.xml, but have had no luck so far.  Any ideas?

 

Take care,

Mark

 

 

 


[hidden email] from OpenMRS Developers' mailing list


[hidden email] from OpenMRS Developers' mailing list


[hidden email] from OpenMRS Developers' mailing list

 


[hidden email] from OpenMRS Developers' mailing list


[hidden email] from OpenMRS Developers' mailing list

 


[hidden email] from OpenMRS Developers' mailing list


[hidden email] from OpenMRS Developers' mailing list
Darius Jazayeri-3 Darius Jazayeri-3
Reply | Threaded
Open this post in threaded view
|

Re: Testing Sync module interoperability with other modules

I don't think we're actually doing this at all, for any modules.

But it sounds like finding a way to load up all bundled modules, and then run the core unit tests, would be very useful if we could put it in CI.

-Darius

On Tue, Apr 17, 2012 at 10:24 AM, Mark Goodrich <[hidden email]> wrote:

I’m not quite where/how we are testing modules in core, but adding MDS to the list of modules tested in core would be helpful… assumedly if you simply started the MDS module and then ran all the core unit tests, the AuditableInterceptor test would have failed, and we would have discovered the MDS bug earlier…

 

Mark

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Ben Wolfe
Sent: Monday, April 16, 2012 4:49 PM


To: [hidden email]
Subject: Re: [OPENMRS-DEV] Testing Sync module interoperability with other modules

 

The omods referenced in core in the testing package simply have the sqldiffs deleted out of them.  In linux you can simply open the omod as a zip file and delete the file.  It will prompt you to update the compiled zip.

Ben

On Mon, Apr 16, 2012 at 4:45 PM, Mark Goodrich <[hidden email]> wrote:

Thanks Ben—

 

Where is the annotation used in core, and how does it delete sqldiffs from the omod there?

 

Mark

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Ben Wolfe
Sent: Monday, April 16, 2012 4:12 PM


To: [hidden email]
Subject: Re: [OPENMRS-DEV] Testing Sync module interoperability with other modules

 

I thought the javadoc for @StartModule or StartModuleExecutionListener.java had this, but apparently not. :-( 

When the annotation is used in core the sqldiffs are deleted from the omods.  I never looked into have StartModuleExecutionListener somehow ignore the sqldiffs.

Ben

On Mon, Apr 16, 2012 at 3:55 PM, Mark Goodrich <[hidden email]> wrote:

I having been playing around with the @StartModule annotation today and run into a few issues…  has anyone else successfully used this annotation?

 

One problem I’m running into is that when the module starts, it attempts to run the sqldiffs and fails.

 

Mark

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Darius Jazayeri
Sent: Saturday, April 14, 2012 5:31 PM
To: [hidden email]
Subject: Re: [OPENMRS-DEV] Testing Sync module interoperability with other modules

 

I believe there's a start module annotation that you can use in a unit test. I don't know how completely it starts the module so you would need to test that out.

-Darius (by phone)

On Apr 14, 2012 1:39 PM, "Mark Goodrich" <[hidden email]> wrote:

I’ve been thinking for a while about configuring module testing so it is possible to test if another module plays nicely with the Sync module.  I was actually working on this last week and put it aside for a bit, but the current Metadata Sharing/Sync issue has put it forefront in my mind again.

 

Has anybody written any unit tests for a module that fire up another omod?  We can package up a sync test jar and make it available to other modules so they can use it’s mock-sync testing framework… we did a similar thing with the Html Form Entry test framework for use in the HFE 1.9 ext module.  I’m not an expert with Spring configuration, and what I don’t know how to do is to start the sync module (and register it’s Hibernate interceptor) within a unit test for another module.  I played around with adding references to the Sync hibernate mapping files to the other module’s test-hibernate.cfg.xml, as well as adding the sync service and interceptor beans to the other module’s TestingApplicationContext.xml, but have had no luck so far.  Any ideas?

 

Take care,

Mark

 

 

 


[hidden email] from OpenMRS Developers' mailing list


[hidden email] from OpenMRS Developers' mailing list


[hidden email] from OpenMRS Developers' mailing list

 


[hidden email] from OpenMRS Developers' mailing list


[hidden email] from OpenMRS Developers' mailing list

 


[hidden email] from OpenMRS Developers' mailing list


[hidden email] from OpenMRS Developers' mailing list


[hidden email] from OpenMRS Developers' mailing list
Jeremy Keiper-3 Jeremy Keiper-3
Reply | Threaded
Open this post in threaded view
|

Re: Testing Sync module interoperability with other modules

I think I have the same kind of problem, or maybe I'm just delirious.  I need to load the HouseholdService in a BaseModuleContextSensitiveTest in the AMRS Mobile Forms Module.  When I run the test that tries to access that service, I get notification that the Context can't find it.  Does this belong in this thread or should it be a separate question?

Jeremy Keiper
OpenMRS Core Developer
AMPATH / IU-Kenya Support


On Tue, Apr 17, 2012 at 3:07 PM, Darius Jazayeri <[hidden email]> wrote:
I don't think we're actually doing this at all, for any modules.

But it sounds like finding a way to load up all bundled modules, and then run the core unit tests, would be very useful if we could put it in CI.

-Darius


On Tue, Apr 17, 2012 at 10:24 AM, Mark Goodrich <[hidden email]> wrote:

I’m not quite where/how we are testing modules in core, but adding MDS to the list of modules tested in core would be helpful… assumedly if you simply started the MDS module and then ran all the core unit tests, the AuditableInterceptor test would have failed, and we would have discovered the MDS bug earlier…

 

Mark

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Ben Wolfe
Sent: Monday, April 16, 2012 4:49 PM


To: [hidden email]
Subject: Re: [OPENMRS-DEV] Testing Sync module interoperability with other modules

 

The omods referenced in core in the testing package simply have the sqldiffs deleted out of them.  In linux you can simply open the omod as a zip file and delete the file.  It will prompt you to update the compiled zip.

Ben

On Mon, Apr 16, 2012 at 4:45 PM, Mark Goodrich <[hidden email]> wrote:

Thanks Ben—

 

Where is the annotation used in core, and how does it delete sqldiffs from the omod there?

 

Mark

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Ben Wolfe
Sent: Monday, April 16, 2012 4:12 PM


To: [hidden email]
Subject: Re: [OPENMRS-DEV] Testing Sync module interoperability with other modules

 

I thought the javadoc for @StartModule or StartModuleExecutionListener.java had this, but apparently not. :-( 

When the annotation is used in core the sqldiffs are deleted from the omods.  I never looked into have StartModuleExecutionListener somehow ignore the sqldiffs.

Ben

On Mon, Apr 16, 2012 at 3:55 PM, Mark Goodrich <[hidden email]> wrote:

I having been playing around with the @StartModule annotation today and run into a few issues…  has anyone else successfully used this annotation?

 

One problem I’m running into is that when the module starts, it attempts to run the sqldiffs and fails.

 

Mark

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Darius Jazayeri
Sent: Saturday, April 14, 2012 5:31 PM
To: [hidden email]
Subject: Re: [OPENMRS-DEV] Testing Sync module interoperability with other modules

 

I believe there's a start module annotation that you can use in a unit test. I don't know how completely it starts the module so you would need to test that out.

-Darius (by phone)

On Apr 14, 2012 1:39 PM, "Mark Goodrich" <[hidden email]> wrote:

I’ve been thinking for a while about configuring module testing so it is possible to test if another module plays nicely with the Sync module.  I was actually working on this last week and put it aside for a bit, but the current Metadata Sharing/Sync issue has put it forefront in my mind again.

 

Has anybody written any unit tests for a module that fire up another omod?  We can package up a sync test jar and make it available to other modules so they can use it’s mock-sync testing framework… we did a similar thing with the Html Form Entry test framework for use in the HFE 1.9 ext module.  I’m not an expert with Spring configuration, and what I don’t know how to do is to start the sync module (and register it’s Hibernate interceptor) within a unit test for another module.  I played around with adding references to the Sync hibernate mapping files to the other module’s test-hibernate.cfg.xml, as well as adding the sync service and interceptor beans to the other module’s TestingApplicationContext.xml, but have had no luck so far.  Any ideas?

 

Take care,

Mark

 

 

 


[hidden email] from OpenMRS Developers' mailing list


[hidden email] from OpenMRS Developers' mailing list


[hidden email] from OpenMRS Developers' mailing list

 


[hidden email] from OpenMRS Developers' mailing list


[hidden email] from OpenMRS Developers' mailing list

 


[hidden email] from OpenMRS Developers' mailing list


[hidden email] from OpenMRS Developers' mailing list


[hidden email] from OpenMRS Developers' mailing list


[hidden email] from OpenMRS Developers' mailing list
Mark Goodrich-2 Mark Goodrich-2
Reply | Threaded
Open this post in threaded view
|

Re: Testing Sync module interoperability with other modules

Jeremy—

 

I more or less got it to work using the following steps:

 

1)      You’ll need to include the omod you want to test within the module you are testing (I just added it to a top-level lib folder in the project)

2)      Manually remove sqldiff.xml (or liquibase stuff I’d assume) from the omod

3)      Use @StartModule annotation on the test class that needs the omod to be started

4)      You may also need to add the references to the hibernate mapping files for the other module within your test application context.

 

I was hoping to try to find a way to include the omod via Maven, instead of just dumping it in a lib folder, but haven’t got it to work yet.  And once/if I do I’d have to find a way to automatically remove the sqldiff file from the omod.

 

Hope this helps…

Mark

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Jeremy Keiper
Sent: Wednesday, April 18, 2012 8:42 AM
To: [hidden email]
Subject: Re: [OPENMRS-DEV] Testing Sync module interoperability with other modules

 

I think I have the same kind of problem, or maybe I'm just delirious.  I need to load the HouseholdService in a BaseModuleContextSensitiveTest in the AMRS Mobile Forms Module.  When I run the test that tries to access that service, I get notification that the Context can't find it.  Does this belong in this thread or should it be a separate question?

Jeremy Keiper
OpenMRS Core Developer
AMPATH / IU-Kenya Support

On Tue, Apr 17, 2012 at 3:07 PM, Darius Jazayeri <[hidden email]> wrote:

I don't think we're actually doing this at all, for any modules.

 

But it sounds like finding a way to load up all bundled modules, and then run the core unit tests, would be very useful if we could put it in CI.

 

-Darius

 

On Tue, Apr 17, 2012 at 10:24 AM, Mark Goodrich <[hidden email]> wrote:

I’m not quite where/how we are testing modules in core, but adding MDS to the list of modules tested in core would be helpful… assumedly if you simply started the MDS module and then ran all the core unit tests, the AuditableInterceptor test would have failed, and we would have discovered the MDS bug earlier…

 

Mark

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Ben Wolfe
Sent: Monday, April 16, 2012 4:49 PM


To: [hidden email]
Subject: Re: [OPENMRS-DEV] Testing Sync module interoperability with other modules

 

The omods referenced in core in the testing package simply have the sqldiffs deleted out of them.  In linux you can simply open the omod as a zip file and delete the file.  It will prompt you to update the compiled zip.

Ben

On Mon, Apr 16, 2012 at 4:45 PM, Mark Goodrich <[hidden email]> wrote:

Thanks Ben—

 

Where is the annotation used in core, and how does it delete sqldiffs from the omod there?

 

Mark

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Ben Wolfe
Sent: Monday, April 16, 2012 4:12 PM


To: [hidden email]
Subject: Re: [OPENMRS-DEV] Testing Sync module interoperability with other modules

 

I thought the javadoc for @StartModule or StartModuleExecutionListener.java had this, but apparently not. :-( 

When the annotation is used in core the sqldiffs are deleted from the omods.  I never looked into have StartModuleExecutionListener somehow ignore the sqldiffs.

Ben

On Mon, Apr 16, 2012 at 3:55 PM, Mark Goodrich <[hidden email]> wrote:

I having been playing around with the @StartModule annotation today and run into a few issues…  has anyone else successfully used this annotation?

 

One problem I’m running into is that when the module starts, it attempts to run the sqldiffs and fails.

 

Mark

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Darius Jazayeri
Sent: Saturday, April 14, 2012 5:31 PM
To: [hidden email]
Subject: Re: [OPENMRS-DEV] Testing Sync module interoperability with other modules

 

I believe there's a start module annotation that you can use in a unit test. I don't know how completely it starts the module so you would need to test that out.

-Darius (by phone)

On Apr 14, 2012 1:39 PM, "Mark Goodrich" <[hidden email]> wrote:

I’ve been thinking for a while about configuring module testing so it is possible to test if another module plays nicely with the Sync module.  I was actually working on this last week and put it aside for a bit, but the current Metadata Sharing/Sync issue has put it forefront in my mind again.

 

Has anybody written any unit tests for a module that fire up another omod?  We can package up a sync test jar and make it available to other modules so they can use it’s mock-sync testing framework… we did a similar thing with the Html Form Entry test framework for use in the HFE 1.9 ext module.  I’m not an expert with Spring configuration, and what I don’t know how to do is to start the sync module (and register it’s Hibernate interceptor) within a unit test for another module.  I played around with adding references to the Sync hibernate mapping files to the other module’s test-hibernate.cfg.xml, as well as adding the sync service and interceptor beans to the other module’s TestingApplicationContext.xml, but have had no luck so far.  Any ideas?

 

Take care,

Mark

 

 

 


[hidden email] from OpenMRS Developers' mailing list


[hidden email] from OpenMRS Developers' mailing list


[hidden email] from OpenMRS Developers' mailing list

 


[hidden email] from OpenMRS Developers' mailing list


[hidden email] from OpenMRS Developers' mailing list

 


[hidden email] from OpenMRS Developers' mailing list


[hidden email] from OpenMRS Developers' mailing list

 


[hidden email] from OpenMRS Developers' mailing list

 


[hidden email] from OpenMRS Developers' mailing list


[hidden email] from OpenMRS Developers' mailing list
Jeremy Keiper-3 Jeremy Keiper-3
Reply | Threaded
Open this post in threaded view
|

Re: Testing Sync module interoperability with other modules

Thanks Mark, it does ... I'll mess with it later today (hopefully).

Jeremy Keiper
OpenMRS Core Developer
AMPATH / IU-Kenya Support


On Wed, Apr 18, 2012 at 10:25 AM, Mark Goodrich <[hidden email]> wrote:

Jeremy—

 

I more or less got it to work using the following steps:

 

1)      You’ll need to include the omod you want to test within the module you are testing (I just added it to a top-level lib folder in the project)

2)      Manually remove sqldiff.xml (or liquibase stuff I’d assume) from the omod

3)      Use @StartModule annotation on the test class that needs the omod to be started

4)      You may also need to add the references to the hibernate mapping files for the other module within your test application context.

 

I was hoping to try to find a way to include the omod via Maven, instead of just dumping it in a lib folder, but haven’t got it to work yet.  And once/if I do I’d have to find a way to automatically remove the sqldiff file from the omod.

 

Hope this helps…

Mark

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Jeremy Keiper
Sent: Wednesday, April 18, 2012 8:42 AM


To: [hidden email]
Subject: Re: [OPENMRS-DEV] Testing Sync module interoperability with other modules

 

I think I have the same kind of problem, or maybe I'm just delirious.  I need to load the HouseholdService in a BaseModuleContextSensitiveTest in the AMRS Mobile Forms Module.  When I run the test that tries to access that service, I get notification that the Context can't find it.  Does this belong in this thread or should it be a separate question?

Jeremy Keiper
OpenMRS Core Developer
AMPATH / IU-Kenya Support

On Tue, Apr 17, 2012 at 3:07 PM, Darius Jazayeri <[hidden email]> wrote:

I don't think we're actually doing this at all, for any modules.

 

But it sounds like finding a way to load up all bundled modules, and then run the core unit tests, would be very useful if we could put it in CI.

 

-Darius

 

On Tue, Apr 17, 2012 at 10:24 AM, Mark Goodrich <[hidden email]> wrote:

I’m not quite where/how we are testing modules in core, but adding MDS to the list of modules tested in core would be helpful… assumedly if you simply started the MDS module and then ran all the core unit tests, the AuditableInterceptor test would have failed, and we would have discovered the MDS bug earlier…

 

Mark

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Ben Wolfe
Sent: Monday, April 16, 2012 4:49 PM


To: [hidden email]
Subject: Re: [OPENMRS-DEV] Testing Sync module interoperability with other modules

 

The omods referenced in core in the testing package simply have the sqldiffs deleted out of them.  In linux you can simply open the omod as a zip file and delete the file.  It will prompt you to update the compiled zip.

Ben

On Mon, Apr 16, 2012 at 4:45 PM, Mark Goodrich <[hidden email]> wrote:

Thanks Ben—

 

Where is the annotation used in core, and how does it delete sqldiffs from the omod there?

 

Mark

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Ben Wolfe
Sent: Monday, April 16, 2012 4:12 PM


To: [hidden email]
Subject: Re: [OPENMRS-DEV] Testing Sync module interoperability with other modules

 

I thought the javadoc for @StartModule or StartModuleExecutionListener.java had this, but apparently not. :-( 

When the annotation is used in core the sqldiffs are deleted from the omods.  I never looked into have StartModuleExecutionListener somehow ignore the sqldiffs.

Ben

On Mon, Apr 16, 2012 at 3:55 PM, Mark Goodrich <[hidden email]> wrote:

I having been playing around with the @StartModule annotation today and run into a few issues…  has anyone else successfully used this annotation?

 

One problem I’m running into is that when the module starts, it attempts to run the sqldiffs and fails.

 

Mark

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Darius Jazayeri
Sent: Saturday, April 14, 2012 5:31 PM
To: [hidden email]
Subject: Re: [OPENMRS-DEV] Testing Sync module interoperability with other modules

 

I believe there's a start module annotation that you can use in a unit test. I don't know how completely it starts the module so you would need to test that out.

-Darius (by phone)

On Apr 14, 2012 1:39 PM, "Mark Goodrich" <[hidden email]> wrote:

I’ve been thinking for a while about configuring module testing so it is possible to test if another module plays nicely with the Sync module.  I was actually working on this last week and put it aside for a bit, but the current Metadata Sharing/Sync issue has put it forefront in my mind again.

 

Has anybody written any unit tests for a module that fire up another omod?  We can package up a sync test jar and make it available to other modules so they can use it’s mock-sync testing framework… we did a similar thing with the Html Form Entry test framework for use in the HFE 1.9 ext module.  I’m not an expert with Spring configuration, and what I don’t know how to do is to start the sync module (and register it’s Hibernate interceptor) within a unit test for another module.  I played around with adding references to the Sync hibernate mapping files to the other module’s test-hibernate.cfg.xml, as well as adding the sync service and interceptor beans to the other module’s TestingApplicationContext.xml, but have had no luck so far.  Any ideas?

 

Take care,

Mark

 

 

 


[hidden email] from OpenMRS Developers' mailing list


[hidden email] from OpenMRS Developers' mailing list


[hidden email] from OpenMRS Developers' mailing list

 


[hidden email] from OpenMRS Developers' mailing list


[hidden email] from OpenMRS Developers' mailing list

 


[hidden email] from OpenMRS Developers' mailing list


[hidden email] from OpenMRS Developers' mailing list

 


[hidden email] from OpenMRS Developers' mailing list

 


[hidden email] from OpenMRS Developers' mailing list


[hidden email] from OpenMRS Developers' mailing list


[hidden email] from OpenMRS Developers' mailing list