@Override
 public void beforeClientResponse(boolean initial) {
   super.beforeClientResponse(initial);
   DDUtil.onBeforeClientResponse(this, getState());
 }
  @Override
  public String[] getClasspathAdditions(TestServerConfiguration config) {
    List<String> entries = new ArrayList<String>(2);
    String entry =
        ClasspathUtil.getClasspathEntry("org.eclipse.edt.ide.deployment.core"); // $NON-NLS-1$
    if (entry != null) {
      entries.add(entry);
    }

    entry =
        ClasspathUtil.getClasspathEntry("org.eclipse.edt.ide.deployment.services"); // $NON-NLS-1$
    if (entry != null) {
      entries.add(entry);
    }

    entry = ClasspathUtil.getClasspathEntry("org.eclipse.edt.runtime.java"); // $NON-NLS-1$
    if (entry != null) {
      entries.add(entry);
    }

    entry = ClasspathUtil.getClasspathEntry("com.ibm.icu"); // $NON-NLS-1$
    if (entry != null) {
      entries.add(entry);
    }

    DDUtil.addJDBCJars(
        config.getProject(), new HashSet<IProject>(), new HashSet<IResource>(), entries);

    // Add a Tomcat runtime if one's available, so that JNDI can use connection pooling.
    IRuntime bestTomcat = null;
    for (IRuntime rt : ServerUtil.getRuntimes(null, null)) {
      if (rt.getRuntimeType().getName().toLowerCase().contains("tomcat")) { // $NON-NLS-1$
        if (bestTomcat == null) {
          bestTomcat = rt;
        } else if (bestTomcat
                .getRuntimeType()
                .getVersion()
                .compareTo(rt.getRuntimeType().getVersion())
            < 0) {
          bestTomcat = rt;
        }
      }
    }

    if (bestTomcat != null) {
      RuntimeClasspathProviderWrapper rcpw =
          JavaServerPlugin.findRuntimeClasspathProvider(bestTomcat.getRuntimeType());
      if (rcpw != null) {
        entries.add(
            "<?xml version=\"1.0\" encoding=\"UTF-8\"?><runtimeClasspathEntry containerPath=\"" //$NON-NLS-1$
                + RuntimeClasspathContainer.SERVER_CONTAINER
                + "/"
                + rcpw.getId()
                + "/"
                + bestTomcat.getId() // $NON-NLS-1$ //$NON-NLS-2$
                + "\" path=\"3\" type=\"4\"/>"); //$NON-NLS-1$
      }
    }

    return entries.toArray(new String[entries.size()]);
  }