KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I have a test suite class: @RunWith(Suite.class) @Suite.SuiteClasses({ GameMasterTest.class, PlayerTest.class, }) public class BananaTestSuite { What annotation do I need to use to make a function in this class run before any of the classes containing actual tests? Right now, I'm doing this, and it works, but it's not as readable as it could be: static { try { submitPeelAction = new Player(new GameMaster(1)).getClass().getDeclaredMethod("submitPeelAction"); } catch (SecurityException e) { e.printStackTrace(); } catch (NoSuchMethodException e) { e.printStackTrace(); } submitPeelAction.setAccessible(true); } I tried @BeforeClass but it didn't work.
Tags (comma-separated)
Save Edits
Cancel