oasp / oasp4j

The Open Application Standard Platform for Java
Apache License 2.0
60 stars 303 forks source link

improve test infrastructure for testing equals, hashCode and negative tests #296

Open hohwille opened 9 years ago

hohwille commented 9 years ago

In m-m-m I was looking for coverage and also tested some equals and hashCode methods as well as covered more negative tests with expected exceptions in more combinations.

As this quickly turned out to be boring and I am lazy, I created a little helper to extend tests from or to use via static methods:

https://github.com/m-m-m/music/blob/master/mmm-music-core/src/test/java/net/sf/mmm/music/AbstractTest.java

We could copy the same to oasp4j-test with my friendly permission and extend ModuleTest and the like from it.

hohwille commented 9 years ago

Feedback is most welcome. I would like to get some thoughts from others. If this looks good, I can quickly commit and push.

Max-Goebel commented 9 years ago

Can we have an example for the usage of this abstract class?

hohwille commented 9 years ago

Can we have an example for the usage of this abstract class?

Sure, just look at the test-cases inheriting from it: https://github.com/m-m-m/music/blob/master/mmm-music-core/src/test/java/net/sf/mmm/music/datatype/api/ChordTest.java#L20 https://github.com/m-m-m/music/blob/master/mmm-music-core/src/test/java/net/sf/mmm/music/datatype/api/ChordTest.java#L38

jomora commented 7 years ago

@hohwille I assume this issue is obsolete? The links are broken ...