Skip to content

Instantly share code, notes, and snippets.

@shin1ogawa
Created October 14, 2010 14:56
Show Gist options
  • Save shin1ogawa/626306 to your computer and use it in GitHub Desktop.
Save shin1ogawa/626306 to your computer and use it in GitHub Desktop.
import java.lang.reflect.Method;
import org.slim3.tester.AppEngineTester;
import org.slim3.util.AppEngineUtil;
import com.google.apphosting.api.ApiProxy;
public class CustomizedAppEngineTester extends AppEngineTester {
@Override
public void tearDown() throws Exception {
ClassLoader loader = loadLibraries();
Class<?> apiProxyLocalImplClass = loader.loadClass(API_PROXY_LOCAL_IMPL_CLASS_NAME);
Method stopMethod = apiProxyLocalImplClass.getMethod("stop");
stopMethod.setAccessible(true);
stopMethod.invoke(apiProxyLocalImpl);
ApiProxy.setDelegate(originalDelegate);
if (!AppEngineUtil.isProduction()) {
ApiProxy.setEnvironmentForCurrentThread(originalEnvironment);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment