Add a line like one of the following so the test will skip when not run against a katello server...
// if the candlepin server does not support environments, then skip it

if (!CandlepinTasks.isEnvironmentsSupported(sm_serverAdminUsername,sm_serverAdminPassword, sm_serverUrl)) throw new SkipException("This test is only applicable against a server that supports environments.");

OR

if (!CandlepinType.katello.equals(sm_serverType)) throw new SkipException("This test is only applicable against a server that supports environments.");