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

Set ERExtensions as the EOModelGroup class delegate #27

Closed kierankelleher closed 12 years ago

kierankelleher commented 12 years ago

When ERXExtensions (principal class) loads in a Wonder app, it sets itself as the class delegate for EOModelGroup such that EOModelGroup.defaultGroup() method is delegated to ERXExtensions. This in turn will enable the use of Extended Prototypes.

Along with this change, properties need to be set before the model loads for a test: er.extensions.ERXModelGroup.modelClassName = com.webobjects.eoaccess.ERXModel er.extensions.ERXModel.useExtendedPrototypes = true er.extensions.ERXModelGroup.flattenPrototypes = false

Without this patch, entities depending on the use of extended prototypes will not be initialized properly.

Henrique, if you think this should be implemented some other way, then by all means do so.

hprange commented 12 years ago

Thanks for sharing the patch. I didn't know Wonder had an extension mechanism for prototypes. I watched your screen cast about that, and I've written some tests to make sure this feature doesn't break in the future. Additionally, I've removed some tests for the TemporaryEditingContext since they make no sense anymore. Thanks again and apologies for taking so long to answer.