I have two JUnit4 Test classes say MyTest1, MyTest2 each having a couple of test methods. Actually these are Selenium JUnit TestCases.
In MyTest1.someMethodInsertingDate() i will insert some data into DB and it will take some time to process.
In MyTest2.validateProcessedData() I need to verify that the processed data inserted in the first test method is valid or not.
I know coupling between test methods/cases is not a good practice. But I am writing SeleniumTests to automate User Actions on UI, so I have to do this.
I am executing these two TestCases using MyTestSuite with @RunWith & @SuiteClasses.
Now How can I tell JUnit to execute MyTest2 TestCase with some delay,say 1 minute.
I think you're not getting an answer (at least not one you want) to this question because it is generally considered bad practice to rely upon these mechanics in a test suite. Your tests will become very difficult to maintain if you have these types of reliance upon each other, and can (most likely will) cause you difficulty in debugging them later.
You could possibly abstract this first test out, and this second test could perhaps extend it. This second test will then use the common functionality in its setup (perhaps with different data). This should allow you to run the tests concurrently since each will then be an atomic entity.