Ok, I've been searching the forums here and looking at online docs.
I'm stumped now on things.
First off, what I want:
"I'll have some tests that will need access to a static member - and
EntityManager, while other test classes will need access to a
different static EntityManager"
To accomplish this I thought it made sense to:
1) For simplicity in this example, two groups created "group1"
"group2"
2) classes that are in group1 need to have a class initialized that
runs before any tests in group1 are run
3) classes that are in group2 need to have a class initialized that
runs before any tests in group2 are run
I thought it would make sense to use @BeforeGroups for this.
I also need a @BeforeClass to run for each class.
What I notice happening is that the @BeforeClass method (even if
assigned groups) is always running BEFORE the @BeforeGroups.
Why is this? (I'm running this from Maven2 if it matters?)
Here is the current code (not much)
http://pastie.org/294673
When the test run the order in the logs is
UsersTest runBeforeClass
BaseTest setUp
UsersTest getUsers
BaseTest tearDown
I'm not sure why the BaseTest setUp isn't run first?
Lastly, is there a better way to do things then using BeforeGroups? I
thought about BeoreSuite but I think BeforeGroups would be good in my
case, since I could assign different classes to different groups
easily (which could happen if a different EntityManager is neeeed.)
Also do I need to use 'value" like I have it in the @BeforeGroups? The
docs don't seem to be too clear on it, yet I've read on some posts
that you do need it?
Thanks for any help