/src/test/java/com/google/ie/test/ServiceTest.java
http://thoughtsite.googlecode.com/ · Java · 38 lines · 19 code · 8 blank · 11 comment · 0 complexity · 95dccb35c7df0ba020f7da89a334b832 MD5 · raw file
- // Copyright 2009 Google Inc. All Rights Reserved.
-
- package com.google.ie.test;
-
- import com.google.appengine.tools.development.ApiProxyLocalImpl;
- import com.google.apphosting.api.ApiProxy;
-
- import org.junit.After;
- import org.junit.Before;
-
- import java.io.File;
-
- /**
- * Base class for testing all non transactional service classes. The setUp() and
- * tearDown() methods defined below are responsible for creating and resetting
- * the test environment.
- *
- * @author asirohi
- *
- */
- public class ServiceTest {
-
- @Before
- public void setUp() {
- // Set environment as test environment
- ApiProxy.setEnvironmentForCurrentThread(new TestEnvironment());
- ApiProxy.setDelegate(new ApiProxyLocalImpl(new File(".")) {
- });
- }
-
- @After
- public void tearDown() {
- // Setting api proxy to null. Not necessary but a good practice.
- ApiProxy.setDelegate(null);
- ApiProxy.setEnvironmentForCurrentThread(null);
- }
-
- }