Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [swordfish-dev] Refactor org.eclipse.swordfish.internal.core.util.smx.ServiceMixSupport class to improve testability


 Go for it!

Am 12.01.2010 um 15:05 schrieb Jürgen Kindler:

Hi all,

As nobody has reacted up to now, I take the opportunity to once again draw your attention on testability:

I have stumbled several times over it now and it’s a pain in the neck to have to satisfy the requirements of the
ServiceMixSupport class when testing with mock objects ... apart from the fact that it has a bad smell, consisting of static methods only.

Being able to mock the functions of ServiceMixSupport will significantly simplify tests of existing code that depends on this class, because we can cut of levels of mocks required by the static implementation.

As there are quite a few references to ServiceMixSupport, I propose that we create an internal OSGi (singleton) service that offers the functionality that is currently offered by this class and (for now) redirect from this service to the old implementation. As soon as all references to the old implementation are gone, we can move all the logic to the service class and remove the old one.

Awaiting your comments ...



Jürgen Kindler

Back to the top