I was thinking it would be handy to have a custom annotation for junit methods and classes that contain integration tests. This annotation would effectively act like the @Ignore junit annotation when the tests are being executed on our CI (Jenkins) server and the test would run as normal on local dev machines. To determine if the machine running the tests should allow integration test execution I would check System.getenv("WORKSPACE") to see if it exists/contains "jenkins".
I haven't written annotations before and am not familiar with junit's implementation details. Is what I'm describing possible? If so, how would I go about this?