cbeust/testng — pull request #273 by pfichtner (2012-09-03 19:51:06+00:00)
Title: warn when setting attributes already set

Changes as described in issue-270 (https://github.com/cbeust/testng/issues/270)

Warn when trying to set an AnnotationProcessor if another AnnotationProcessor has been already set.
Same behaviour added for IConfigurable, IHookable and IMethodInterceptor

My first approach was to throw a RuntimeException but setting one of the attributes more than once should be possible because they can be configured at multiple places (service file, testng.xml, annotations, ...) so throwing RTEs would change the existing behavior. Because of the possibility to define Listeners at different places the logging is really useful for all people because now you see when defining a MethodInterceptor at place A and one at place B (perhaps this is a place not used by all but just some tests) where people asked thereself why their MethodInterceptor defined at place A "does not work" in all cases. Now they will see that they are redefining an attribute of TestNG.