/** * Do nothing on grinder context initialization. */ @Override protected void initializeGrinderContext() { noOp(); }
/** * Do nothing. * * @param notifier notifier */ @Override protected void registerRunNotifierListener(RunNotifier notifier) { noOp(); }
public static List<String> getDnsServers() throws NamingException { Hashtable<String, String> env = new Hashtable<String, String>(); env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.dns.DnsContextFactory"); DirContext ctx = null; List<String> dnsServers = new ArrayList<String>(); try { ctx = new InitialDirContext(env); String dnsString = (String) ctx.getEnvironment().get("java.naming.provider.url"); for (String each : dnsString.split(" ")) { dnsServers.add(each.replace("dns://", "")); } } catch (Exception e) { NoOp.noOp(); } finally { if (ctx != null) { ctx.close(); } } return dnsServers; } }
@Override public void testFailure(Failure failure) throws Exception { // Skip Generic Shutdown... It's not failure. Throwable rootCause = exceptionProcessor.getRootCause(failure.getException()); if (exceptionProcessor.isGenericShutdown(rootCause)) { return; } Grinder.grinder.getLogger().error(failure.getMessage(), exceptionProcessor.filterException(rootCause)); // In case of exception, set test failed. try { StatisticsForTest forLastTest = Grinder.grinder.getStatistics().getForLastTest(); if (forLastTest != null) { forLastTest.setSuccess(false); } } catch (Throwable t) { noOp(); } } });