Default order of inherited [Before] functions
If I extend a class with [Before] and [After] functions, the default behavior appears to be to execute the inherited functions last. Could I make a plug for having the default behavior "nest" the before and after functions such that the base class functions are the first in and last out? I know I can add ordering metadata (and have tested that this works through inheritance), but maintaining ordering numbers through more than a few levels of inheritance will be a pain.
I'm looking to write basic test code once - any test that needs a document could extend a document-making test class, and any test that required a particular document content setup could extend a base class that made that content (and that base class would have extended the document-making class).
The code below gives this trace order for the testBeforeAfterInheritance test:
before actual
before base
after actual
after base
What I'd like to see is:
before base
before actual
after actual
after base
public class BaseTestClass
{
[Before]
public function beforeBase():void
{
// this might make a document, for example
trace ("before base");
}
[After]
public function afterBase():void
{
trace ("after base");
}
}
import com.adobe.muse.testing.framework.BaseTestClass;
public class ActualTestClass extends BaseTestClass
{
[Before]
public function beforeActual():void
{
// this might add an item to the document
trace ("before actual");
}
[After]
public function afterActual():void
{
trace ("after actual");
}
[Test]
public function testBeforeAfterInheritance():void
{
}
}
