OpenPojo / openpojo

POJO Testing & Identity Management Made Trivial
http://openpojo.com
Apache License 2.0
156 stars 40 forks source link

Rule and @Rule junit clashes #11

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Using both com.openpojo.validation.rule.Rule from openpojo in a test and the 
@Rule provided by JUnit will cause clashes on the import.

If you want to use both in a test you are forced to use @org.junit.Rule

The @Rule is a very powerfull utility from JUnit and I expect it to gain a lot 
of interrest comming months and years.

A little refactor from Rule to e.g. PojoRule would come in handy.

Original issue reported on code.google.com by thomasi....@gmail.com on 24 Sep 2010 at 8:37

GoogleCodeExporter commented 9 years ago
Couple of things, Rule interface isn't expected to show up inside your Test 
classes (unless you're creating implementations of it named or unnammed inside 
your tests, if so, you can do com.openpojo.validation.rule.Rule instead of 
using it through the imports, that way you can keep the @Rule simple.

I am not sure I would rename Rule and the whole structure just to prevent 
simple class name collision, that is why Java has packages so you can have 
collision without any problem.

Thank you,

Osman

Original comment by oshou...@gmail.com on 25 Sep 2010 at 9:49