I didn't think of that idea, what I did in the end was to create a custom Rule. Not exactly what I was looking for in the beginning, but it allowed me to create a rather flexible, customizable a reusable piece of logic.
On Thu, Aug 27, 2015 at 11:31 PM, Justin Ransom Dallas < [email protected]> wrote: > Your tests can extend a base class which can contain highly reused code. > The biggest issue is going to be your async setup code, and making sure > that subclasses of the parent test wait for the superclass. I've got some > code that does that, I just have to find it. > > On Wednesday, August 26, 2015, Héctor A <[email protected]> wrote: > > > I know about test suites, but it's not exactly what I'm looking for, I'm > > talking about reusing logic in several tests, also allowing them to be > run > > "individually" (at least in an automatized way) at any time, think of > > setting up and connecting to a database, several tests use it, and you > > don't want to do it for all of them, but there is also a test to check > that > > the logic used for connection is working properly (well, in this case > it's > > more complicated than that). Would be nice to get the connection from the > > connection test and reuse it for the other tests. > > > > Maybe not running the test itself, but move part of the logic to another > > class that can be shared between multiple tests could be nice as well, I > > guess in this case we'd use a BeforeClass statement, but I'm not really > > sure as in my case it's an asynchronous operation, I'll have to check the > > documentation. > > > > > > > > On Wed, Aug 26, 2015 at 11:23 AM, Justin Mclean < > [email protected] > > <javascript:;>> > > wrote: > > > > > Hi, > > > > > > While the order of the tests are not specified within a single test > > class, > > > you can have multiple tests classes in a test suite and run those. I > > think > > > that does what you are asking. [1] It’s also possible with ant. [2] It > > may > > > be that Mocks (e.g. [3]) would also help you. > > > > > > Thanks, > > > Justin > > > > > > 1. https://cwiki.apache.org/confluence/display/FLEX/FlexUnit+TestSuite > < > > > https://cwiki.apache.org/confluence/display/FLEX/FlexUnit+TestSuite> > > > 2. https://cwiki.apache.org/confluence/display/FLEX/FlexUnit+Ant+Task > < > > > https://cwiki.apache.org/confluence/display/FLEX/FlexUnit+Ant+Task> > > > 3. https://github.com/drewbourne/mockolate > > > > > -- > Justin Dallas > Phone:814-880-5637 >
