Created
November 12, 2010 14:33
-
-
Save fbenevides/674154 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.benevides.shop.infra; | |
import org.junit.After; | |
import org.junit.Before; | |
import com.google.appengine.api.datastore.dev.LocalDatastoreService; | |
import com.google.appengine.tools.development.ApiProxyLocal; | |
import com.google.appengine.tools.development.testing.LocalDatastoreServiceTestConfig; | |
import com.google.appengine.tools.development.testing.LocalServiceTestHelper; | |
import com.google.apphosting.api.ApiProxy; | |
public class DaoHelper { | |
protected LocalServiceTestHelper helper; | |
@Before | |
public void setup() { | |
LocalDatastoreServiceTestConfig config = new LocalDatastoreServiceTestConfig(); | |
config.setNoStorage(false); | |
helper = new LocalServiceTestHelper(config); | |
helper.setUp(); | |
ApiProxyLocal proxy = (ApiProxyLocal) ApiProxy.getDelegate(); | |
proxy.setProperty(LocalDatastoreService.NO_STORAGE_PROPERTY, Boolean.TRUE.toString()); | |
} | |
@After | |
public void tearDown() { | |
ApiProxyLocal proxy = (ApiProxyLocal) ApiProxy.getDelegate(); | |
LocalDatastoreService datastoreService = (LocalDatastoreService) proxy.getService("datastore_v3"); | |
datastoreService.clearProfiles(); | |
helper.tearDown(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment