hprange / wounit

The WOUnit framework contains a set of utilities for testing WebObjects applications using JUnit 4.7 or later capabilities.
http://hprange.github.io/wounit/
Apache License 2.0
19 stars 18 forks source link

Testing validateForInsert() #47

Closed paulhoadley closed 6 years ago

paulhoadley commented 8 years ago

I have an EO that splits some save-time validation logic between validateForSave() and validateForInsert(), with the latter method being called just for new objects. I can't test this using something like confirm(eo, canBeSaved()), because CanBeSavedMatcher.matchesWithPossibleException() only calls validateForSave(). Obviously I could test it directly by calling validateForInsert(), but could we get WOUnit to do this for us? I see a couple of possibilities:

Would either of these approaches be suitable, and which would be preferred? I am happy to do the work and open a PR, though it's not clear whether WOUnit development is ongoing—let me know!

hprange commented 8 years ago

Hi Paul,

Not calling validateForInsert when the object is new is certainly a bug. The second option sounds like the correct fix.

I've been very busy lately, but I'm planning to make a revamped WOUnit version compatible with JUnit 5 in the future. Anyway, I'm glad to make new releases of WOUnit with bug fixes if required.

paulhoadley commented 8 years ago

I'm planning to make a revamped WOUnit version compatible with JUnit 5 in the future.

Sounds great! Any chance of bumping up to Wonder 7 at the same time? I currently run a custom build of WOUnit because of a binary incompatibility issue there, but it would be great to come back to a mainline release.

hprange commented 8 years ago

Certainly, I'll make a release of WOUnit compatible with Wonder 7. We just need to make a release of Wonder 7 before that. :)