Quantcast
Channel: Adobe Community : Popular Discussions - FlexUnit
Viewing all articles
Browse latest Browse all 25673

FlexUnit 0.9 to FlexUnit 4 question

$
0
0

Hi me again with a question.

 

Our Flex applications have a back-end to retrieve and set information from/to. This back-end server requires a login (and logout when done). Now every bit of functionality that is tested via this back-end has seperate cases based on groups of functionality (there are about 150 - 200 different calls grouped in about 20 test cases).

 

In FlexUnit 0.9 the suite was setup as follows:

 

 

public class EIBTestSuite extends TestSuite     {          public function EIBTestSuite()          {               // Verify that the servers are online               this.addTest(new EibCase("VerifyEuroportTest"));               this.addTest(new EibCase("VerifyServiceTest"));                             // Login               this.addTest(new UserCase("LoginTest"));                             // Payment               this.addTest(new PaymentCase("paymentStart"));               this.addTest(new PaymentCase("paymentEntry"));               this.addTest(new PaymentCase("removePaymentEntry"));               this.addTest(new PaymentCase("loadStandingPayments"));                             // Other cases                             // Logoff               this.addTest(new UserCase("LogoutTest"));          }         }

 

 

As you can see the Login and Logout test are in the same case but are called not directly after eachother. This way we don't need to do the login / logout calls for every case we have.

 

Now I'm trying to convert our tests to FlexUnit 4 but I have a problem with converting the above code to FlexUnit 4. Because when I would change the above code to the following all cases after the UserCase would fail because there is no user logged in.

 

 

[Suite]     [RunWith("org.flexunit.runners.Suite")]     public class EIBTestSuite     {          public var eibCase:EibCase;          public var userCase:UserCase;          public var paymentCase:PaymentCase;          // Other cases     }

 

 

 

What we could do is add the login and logout calls to each seperate case and ensure the order in which the tests are executed. But first of all this is a lot of repetition for the same piece of code and second if the login procedure would ever change it would have to be changed in all the cases. Neither is desirable.

 

Is there a best-practices way for changing the described situation to FlexUnit 4?

 

Thanks for the help,

Rick Veenstra


Viewing all articles
Browse latest Browse all 25673

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>