Mongo Context varibale - Is it possible to use it throughout the test suite
Greetings, While working with MondoDB using gmongo (groovy wrapper), we open connection using mongoDB context, something like this: def mongoClient = new MongoClient( new ServerAddress(dbServer), Arrays.asList(credentials) ) context.gmongo = new GMongo( mongoClient ) context.mongoDB = context.gmongo.getDB(dbDatabase) In my current framework, I open connection and close it everytime I need to do something with mongodb. I am trying to somehow define the context once globally and use the variable to access mongodb throughout the test suite. Is there any way to do it ? Any help would be much appreciated.Solved3KViews0likes8Comments