<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"><base href="x-msg://1929/"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>That would actually work quite well, but you need to be sure to tear down your connections etc. in end_per_group (otherwise you'll end up w/ duplicated connections, errors, etc.)</div><div>In general, we tend to do this somewhat hierarchically, i.e.</div><div> * init_per_suite : "Global" setup/initializations, that are done just once for the entire test run</div><div> * init_per_group : Any additional setup/initializations necessary for the specific group of testcases being run</div><div> * init_per_testcase : Any setup/initialization necessary for this (and only this!) testcase</div><div><br></div><div>Do remember to tear down pretty much everything you setup/initialized in the init_per_*.  Yes, the temptation is always there to say "yeah, the process is going to get killed so what do I care", but trust me, it *will* come back to bite you.</div><div><br></div><div>Cheers</div><div><br><div>
<div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div style="margin: 0in 0in 0.0001pt; "><font class="Apple-style-span" color="#1f497d" face="Calibri, sans-serif"><span class="Apple-style-span" style="font-size: 15px; "><b><i><div style="margin: 0px; font-style: normal; font-weight: normal; font-family: Calibri; "><a href="http://www.gravatar.com/avatar/204a87f81a0d9764c1f3364f53e8facf.png"><b><i>Mahesh Paolini-Subramanya</i></b></a></div></i></b></span></font></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; "><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); ">That Tall Bald Indian Guy...</span></div></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; "><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); "><div style="margin: 0px; font-family: Calibri; color: rgb(1, 108, 226); "><span style="text-decoration: underline; "><a href="https://plus.google.com/u/0/108074935470209044442/posts">Google+</a></span><span style="color: rgb(31, 73, 125); ">  | <a href="http://dieswaytoofast.blogspot.com/"><span style="color: rgb(1, 108, 226); ">Blog</span></a></span><span style="text-decoration: underline; "> </span><span style="color: rgb(31, 73, 125); ">  | <span style="color: rgb(1, 108, 226); "><a href="https://twitter.com/dieswaytoofast">Twitter</a></span></span><span style="color: rgb(31, 73, 125); ">  | </span><a href="http://www.linkedin.com/in/dieswaytoofast">LinkedIn</a></div></span></div></div>
</div>
<br><div><div>On Jul 17, 2013, at 11:46 AM, Maruthavanan Subbarayan <<a href="mailto:maruthavanan_s@hotmail.com">maruthavanan_s@hotmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div class="hmmessage" style="font-size: 12pt; font-family: Calibri; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div dir="ltr">HI All,<div><br></div><div>I am new to common test in erlang, I just wanted to know how to approach the below scenario in common test.</div><div><br></div><div>I have an application that would send group of multiple messages to RMQ, and expects response in back and I have to validate in testcase, so I thought of doing the below.</div><div><br></div><div>all() -> </div><div>[{group,general_test_group}, {group,rmq_test_group}]</div><div><br></div><div>groups() -></div><div>[{general_group_test, [sequence], GeneralTestList}</div><div>,{<span style="font-size: 12pt; ">rmq_test_group, </span><span style="font-size: 12pt; ">[sequence], RmqTestList}</span><span style="font-size: 12pt; ">].</span></div><div><span style="font-size: 12pt; "><br></span></div><div><span style="font-size: 12pt; ">so I thought I can have init_per_group function doing all initialization stuff like queue/exchange creation and bindings and subscribings.</span></div><div><span style="font-size: 12pt; "><br></span></div><div><span style="font-size: 12pt; ">But I would not be getting the RMQ messages to my test case process, or I would endup in duplication by writing the above in all testcases. </span></div><div><span style="font-size: 12pt; "><br></span></div><div><span style="font-size: 12pt; ">Thanks in advance,</span></div><div><span style="font-size: 12pt; ">Marutha</span></div></div>_______________________________________________<br>erlang-questions mailing list<br><a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br><a href="http://erlang.org/mailman/listinfo/erlang-questions">http://erlang.org/mailman/listinfo/erlang-questions</a><br></div></blockquote></div><br></div></body></html>