mardi 5 juillet 2016

Can we parallelize maven method level tests where variables are shared and framework is Spring based?

I have been trying to parallelize my test scenarios where the build env is maven, language used in java with junit and also want to leverage Spring framework. All the examples that I found are based on class level or method level where there is no Spring framework backbone.

@RunWith(SpringJUnit4ClassRunner.class)

@ContextConfiguration(classes = {AutomationApplicationConfigration.class}) public class Trial {

 private DBConnector dbConnector;

 @BeforeClass
 public static void setup() { ... }

 @Test
 public void checkScenario1(){ ...  uses dbConnector instance to connect to database 1 }

 @Test
 public void checkScenario2(){ ...  uses dbConnector instance to connect to database 2 }

}

Idea is able to run both the tests in parallel without redeclaring variables and using maven build configs.

Would appreciate any help.

Thanks! Suman

Aucun commentaire:

Enregistrer un commentaire