<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!--NewPage--> <HTML> <HEAD> <!-- Generated by javadoc (build 1.6.0-google-v4) on Fri Sep 09 16:41:31 CDT 2011 --> <TITLE> LocalServiceTestHelper </TITLE> <META NAME="date" CONTENT="2011-09-09"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../dev_javadoc.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="LocalServiceTestHelper"; } } </SCRIPT> <NOSCRIPT> </NOSCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <HR> <!-- ========= START OF TOP NAVBAR ======= --> <A NAME="navbar_top"><!-- --></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../../com/google/appengine/tools/development/testing/LocalServiceTestConfig.html" title="interface in com.google.appengine.tools.development.testing"><B>PREV CLASS</B></A> <A HREF="../../../../../../com/google/appengine/tools/development/testing/LocalTaskQueueTestConfig.html" title="class in com.google.appengine.tools.development.testing"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../../index.html?com/google/appengine/tools/development/testing/LocalServiceTestHelper.html" target="_top"><B>FRAMES</B></A> <A HREF="LocalServiceTestHelper.html" target="_top"><B>NO FRAMES</B></A> <SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_top"></A> <!-- ========= END OF TOP NAVBAR ========= --> <HR> <!-- ======== START OF CLASS DATA ======== --> <H2> <FONT SIZE="-1"> com.google.appengine.tools.development.testing</FONT> <BR> Class LocalServiceTestHelper</H2> <PRE> java.lang.Object <IMG SRC="../../../../../../resources/inherit.gif" ALT="extended by "><B>com.google.appengine.tools.development.testing.LocalServiceTestHelper</B> </PRE> <HR> <DL> <DT><PRE>public class <B>LocalServiceTestHelper</B><DT>extends java.lang.Object</DL> </PRE> <P> Helper class for testing against local app engine services. Construct the helper with one <A HREF="../../../../../../com/google/appengine/tools/development/testing/LocalServiceTestConfig.html" title="interface in com.google.appengine.tools.development.testing"><CODE>LocalServiceTestConfig</CODE></A> instance for each service that you wish to access as part of your test. Then call <A HREF="../../../../../../com/google/appengine/tools/development/testing/LocalServiceTestHelper.html#setUp()"><CODE>setUp()</CODE></A> before each test executes and <A HREF="../../../../../../com/google/appengine/tools/development/testing/LocalServiceTestHelper.html#tearDown()"><CODE>tearDown()</CODE></A> after each test executes. No specific test-harness is assumed, but here's a JUnit 3 example that uses task queues and the datastore. <blockquote> <pre> public void MyTest extends TestCase { private final LocalServiceTestHelper helper = new LocalServiceTestHelper( new LocalTaskQueueTestConfig(), new LocalDatastoreServiceTestConfig()); @Override public void setUp() { super.setUp(); helper.setUp(); } @Override public void tearDown() { helper.tearDown(); super.tearDown(); } } </pre> </blockquote> <P> <P> <HR> <P> <!-- ======== CONSTRUCTOR SUMMARY ======== --> <A NAME="constructor_summary"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Constructor Summary</B></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><B><A HREF="../../../../../../com/google/appengine/tools/development/testing/LocalServiceTestHelper.html#LocalServiceTestHelper(com.google.appengine.tools.development.testing.LocalServiceTestConfig...)">LocalServiceTestHelper</A></B>(<A HREF="../../../../../../com/google/appengine/tools/development/testing/LocalServiceTestConfig.html" title="interface in com.google.appengine.tools.development.testing">LocalServiceTestConfig</A>... configs)</CODE> <BR> Constructs a LocalServiceTestHelper with the provided configurations.</TD> </TR> </TABLE> <!-- ========== METHOD SUMMARY =========== --> <A NAME="method_summary"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Method Summary</B></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static ApiProxyLocal</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../../com/google/appengine/tools/development/testing/LocalServiceTestHelper.html#getApiProxyLocal()">getApiProxyLocal</A></B>()</CODE> <BR> Convenience function for getting ahold of the currently registered <CODE>ApiProxyLocal</CODE>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static LocalRpcService</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../../com/google/appengine/tools/development/testing/LocalServiceTestHelper.html#getLocalService(java.lang.String)">getLocalService</A></B>(java.lang.String serviceName)</CODE> <BR> Convenience function for getting ahold of a specific local service.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>protected com.google.apphosting.api.ApiProxy.Environment</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../../com/google/appengine/tools/development/testing/LocalServiceTestHelper.html#newEnvironment()">newEnvironment</A></B>()</CODE> <BR> Constructs the <CODE>ApiProxy.Environment</CODE> that will be installed.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>protected LocalServerEnvironment</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../../com/google/appengine/tools/development/testing/LocalServiceTestHelper.html#newLocalServerEnvironment()">newLocalServerEnvironment</A></B>()</CODE> <BR> Constructs the <CODE>LocalServerEnvironment</CODE> that will be installed.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="../../../../../../com/google/appengine/tools/development/testing/LocalServiceTestHelper.html" title="class in com.google.appengine.tools.development.testing">LocalServiceTestHelper</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../../com/google/appengine/tools/development/testing/LocalServiceTestHelper.html#setClock(Clock)">setClock</A></B>(Clock clock)</CODE> <BR> Sets the clock with which all local services will be initialized.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="../../../../../../com/google/appengine/tools/development/testing/LocalServiceTestHelper.html" title="class in com.google.appengine.tools.development.testing">LocalServiceTestHelper</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../../com/google/appengine/tools/development/testing/LocalServiceTestHelper.html#setEnforceApiDeadlines(boolean)">setEnforceApiDeadlines</A></B>(boolean val)</CODE> <BR> Determines whether or not API calls should be subject to the same deadlines as in production.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="../../../../../../com/google/appengine/tools/development/testing/LocalServiceTestHelper.html" title="class in com.google.appengine.tools.development.testing">LocalServiceTestHelper</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../../com/google/appengine/tools/development/testing/LocalServiceTestHelper.html#setEnvAppId(java.lang.String)">setEnvAppId</A></B>(java.lang.String envAppId)</CODE> <BR> The value to be returned by <code>ApiProxy.getCurrentEnvironment().getAppId()</code></TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="../../../../../../com/google/appengine/tools/development/testing/LocalServiceTestHelper.html" title="class in com.google.appengine.tools.development.testing">LocalServiceTestHelper</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../../com/google/appengine/tools/development/testing/LocalServiceTestHelper.html#setEnvAttributes(java.util.Map)">setEnvAttributes</A></B>(java.util.Map<java.lang.String,java.lang.Object> envAttributes)</CODE> <BR> The value to be returned by <code>ApiProxy.getCurrentEnvironment().getAttributes()</code></TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="../../../../../../com/google/appengine/tools/development/testing/LocalServiceTestHelper.html" title="class in com.google.appengine.tools.development.testing">LocalServiceTestHelper</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../../com/google/appengine/tools/development/testing/LocalServiceTestHelper.html#setEnvAuthDomain(java.lang.String)">setEnvAuthDomain</A></B>(java.lang.String envAuthDomain)</CODE> <BR> The value to be returned by <code>ApiProxy.getCurrentEnvironment().getAuthDomain()</code></TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="../../../../../../com/google/appengine/tools/development/testing/LocalServiceTestHelper.html" title="class in com.google.appengine.tools.development.testing">LocalServiceTestHelper</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../../com/google/appengine/tools/development/testing/LocalServiceTestHelper.html#setEnvEmail(java.lang.String)">setEnvEmail</A></B>(java.lang.String envEmail)</CODE> <BR> The value to be returned by <code>ApiProxy.getCurrentEnvironment().getEmail()</code></TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="../../../../../../com/google/appengine/tools/development/testing/LocalServiceTestHelper.html" title="class in com.google.appengine.tools.development.testing">LocalServiceTestHelper</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../../com/google/appengine/tools/development/testing/LocalServiceTestHelper.html#setEnvIsAdmin(boolean)">setEnvIsAdmin</A></B>(boolean envIsAdmin)</CODE> <BR> The value to be returned by <code>ApiProxy.getCurrentEnvironment().isAdmin()</code></TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="../../../../../../com/google/appengine/tools/development/testing/LocalServiceTestHelper.html" title="class in com.google.appengine.tools.development.testing">LocalServiceTestHelper</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../../com/google/appengine/tools/development/testing/LocalServiceTestHelper.html#setEnvIsLoggedIn(boolean)">setEnvIsLoggedIn</A></B>(boolean envIsLoggedIn)</CODE> <BR> The value to be returned by <code>ApiProxy.getCurrentEnvironment().isLoggedIn()</code></TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="../../../../../../com/google/appengine/tools/development/testing/LocalServiceTestHelper.html" title="class in com.google.appengine.tools.development.testing">LocalServiceTestHelper</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../../com/google/appengine/tools/development/testing/LocalServiceTestHelper.html#setEnvRequestNamespace(java.lang.String)">setEnvRequestNamespace</A></B>(java.lang.String envRequestNamespace)</CODE> <BR> The value to be returned by <code>ApiProxy.getCurrentEnvironment().getRequestNamespace()</code></TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="../../../../../../com/google/appengine/tools/development/testing/LocalServiceTestHelper.html" title="class in com.google.appengine.tools.development.testing">LocalServiceTestHelper</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../../com/google/appengine/tools/development/testing/LocalServiceTestHelper.html#setEnvVersionId(java.lang.String)">setEnvVersionId</A></B>(java.lang.String envVersionId)</CODE> <BR> The value to be returned by <code>ApiProxy.getCurrentEnvironment().getVersionId()</code></TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="../../../../../../com/google/appengine/tools/development/testing/LocalServiceTestHelper.html" title="class in com.google.appengine.tools.development.testing">LocalServiceTestHelper</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../../com/google/appengine/tools/development/testing/LocalServiceTestHelper.html#setSimulateProdLatencies(boolean)">setSimulateProdLatencies</A></B>(boolean val)</CODE> <BR> Determines whether or not local services should simulate production latencies.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="../../../../../../com/google/appengine/tools/development/testing/LocalServiceTestHelper.html" title="class in com.google.appengine.tools.development.testing">LocalServiceTestHelper</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../../com/google/appengine/tools/development/testing/LocalServiceTestHelper.html#setTimeZone(java.util.TimeZone)">setTimeZone</A></B>(java.util.TimeZone timeZone)</CODE> <BR> Sets the time zone in which tests will execute.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="../../../../../../com/google/appengine/tools/development/testing/LocalServiceTestHelper.html" title="class in com.google.appengine.tools.development.testing">LocalServiceTestHelper</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../../com/google/appengine/tools/development/testing/LocalServiceTestHelper.html#setUp()">setUp</A></B>()</CODE> <BR> Set up an environment in which tests that use local services can execute.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../../com/google/appengine/tools/development/testing/LocalServiceTestHelper.html#tearDown()">tearDown</A></B>()</CODE> <BR> Tear down the environment in which tests that use local services can execute.</TD> </TR> </TABLE> <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD> </TR> </TABLE> <P> <!-- ========= CONSTRUCTOR DETAIL ======== --> <A NAME="constructor_detail"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> <B>Constructor Detail</B></FONT></TH> </TR> </TABLE> <A NAME="LocalServiceTestHelper(com.google.appengine.tools.development.testing.LocalServiceTestConfig...)"><!-- --></A><H3> LocalServiceTestHelper</H3> <PRE> public <B>LocalServiceTestHelper</B>(<A HREF="../../../../../../com/google/appengine/tools/development/testing/LocalServiceTestConfig.html" title="interface in com.google.appengine.tools.development.testing">LocalServiceTestConfig</A>... configs)</PRE> <DL> <DD>Constructs a LocalServiceTestHelper with the provided configurations. <P> <DL> <DT><B>Parameters:</B><DD><CODE>configs</CODE> - for the local services that need to be set up and torn down.</DL> </DL> <!-- ============ METHOD DETAIL ========== --> <A NAME="method_detail"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> <B>Method Detail</B></FONT></TH> </TR> </TABLE> <A NAME="setEnvAppId(java.lang.String)"><!-- --></A><H3> setEnvAppId</H3> <PRE> public <A HREF="../../../../../../com/google/appengine/tools/development/testing/LocalServiceTestHelper.html" title="class in com.google.appengine.tools.development.testing">LocalServiceTestHelper</A> <B>setEnvAppId</B>(java.lang.String envAppId)</PRE> <DL> <DD>The value to be returned by <code>ApiProxy.getCurrentEnvironment().getAppId()</code> <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>envAppId</CODE> - <DT><B>Returns:</B><DD><code>this</code> (for chaining)</DL> </DD> </DL> <HR> <A NAME="setEnvVersionId(java.lang.String)"><!-- --></A><H3> setEnvVersionId</H3> <PRE> public <A HREF="../../../../../../com/google/appengine/tools/development/testing/LocalServiceTestHelper.html" title="class in com.google.appengine.tools.development.testing">LocalServiceTestHelper</A> <B>setEnvVersionId</B>(java.lang.String envVersionId)</PRE> <DL> <DD>The value to be returned by <code>ApiProxy.getCurrentEnvironment().getVersionId()</code> <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>envVersionId</CODE> - <DT><B>Returns:</B><DD><code>this</code> (for chaining)</DL> </DD> </DL> <HR> <A NAME="setEnvEmail(java.lang.String)"><!-- --></A><H3> setEnvEmail</H3> <PRE> public <A HREF="../../../../../../com/google/appengine/tools/development/testing/LocalServiceTestHelper.html" title="class in com.google.appengine.tools.development.testing">LocalServiceTestHelper</A> <B>setEnvEmail</B>(java.lang.String envEmail)</PRE> <DL> <DD>The value to be returned by <code>ApiProxy.getCurrentEnvironment().getEmail()</code> <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>envEmail</CODE> - <DT><B>Returns:</B><DD><code>this</code> (for chaining)</DL> </DD> </DL> <HR> <A NAME="setEnvIsLoggedIn(boolean)"><!-- --></A><H3> setEnvIsLoggedIn</H3> <PRE> public <A HREF="../../../../../../com/google/appengine/tools/development/testing/LocalServiceTestHelper.html" title="class in com.google.appengine.tools.development.testing">LocalServiceTestHelper</A> <B>setEnvIsLoggedIn</B>(boolean envIsLoggedIn)</PRE> <DL> <DD>The value to be returned by <code>ApiProxy.getCurrentEnvironment().isLoggedIn()</code> <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>envIsLoggedIn</CODE> - <DT><B>Returns:</B><DD><code>this</code> (for chaining)</DL> </DD> </DL> <HR> <A NAME="setEnvIsAdmin(boolean)"><!-- --></A><H3> setEnvIsAdmin</H3> <PRE> public <A HREF="../../../../../../com/google/appengine/tools/development/testing/LocalServiceTestHelper.html" title="class in com.google.appengine.tools.development.testing">LocalServiceTestHelper</A> <B>setEnvIsAdmin</B>(boolean envIsAdmin)</PRE> <DL> <DD>The value to be returned by <code>ApiProxy.getCurrentEnvironment().isAdmin()</code> <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>envIsAdmin</CODE> - <DT><B>Returns:</B><DD><code>this</code> (for chaining)</DL> </DD> </DL> <HR> <A NAME="setEnvAuthDomain(java.lang.String)"><!-- --></A><H3> setEnvAuthDomain</H3> <PRE> public <A HREF="../../../../../../com/google/appengine/tools/development/testing/LocalServiceTestHelper.html" title="class in com.google.appengine.tools.development.testing">LocalServiceTestHelper</A> <B>setEnvAuthDomain</B>(java.lang.String envAuthDomain)</PRE> <DL> <DD>The value to be returned by <code>ApiProxy.getCurrentEnvironment().getAuthDomain()</code> <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>envAuthDomain</CODE> - <DT><B>Returns:</B><DD><code>this</code> (for chaining)</DL> </DD> </DL> <HR> <A NAME="setEnvRequestNamespace(java.lang.String)"><!-- --></A><H3> setEnvRequestNamespace</H3> <PRE> public <A HREF="../../../../../../com/google/appengine/tools/development/testing/LocalServiceTestHelper.html" title="class in com.google.appengine.tools.development.testing">LocalServiceTestHelper</A> <B>setEnvRequestNamespace</B>(java.lang.String envRequestNamespace)</PRE> <DL> <DD>The value to be returned by <code>ApiProxy.getCurrentEnvironment().getRequestNamespace()</code> <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>envRequestNamespace</CODE> - <DT><B>Returns:</B><DD><code>this</code> (for chaining)</DL> </DD> </DL> <HR> <A NAME="setEnvAttributes(java.util.Map)"><!-- --></A><H3> setEnvAttributes</H3> <PRE> public <A HREF="../../../../../../com/google/appengine/tools/development/testing/LocalServiceTestHelper.html" title="class in com.google.appengine.tools.development.testing">LocalServiceTestHelper</A> <B>setEnvAttributes</B>(java.util.Map<java.lang.String,java.lang.Object> envAttributes)</PRE> <DL> <DD>The value to be returned by <code>ApiProxy.getCurrentEnvironment().getAttributes()</code> <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>envAttributes</CODE> - <DT><B>Returns:</B><DD><code>this</code> (for chaining)</DL> </DD> </DL> <HR> <A NAME="setClock(Clock)"><!-- --></A><H3> setClock</H3> <PRE> public <A HREF="../../../../../../com/google/appengine/tools/development/testing/LocalServiceTestHelper.html" title="class in com.google.appengine.tools.development.testing">LocalServiceTestHelper</A> <B>setClock</B>(Clock clock)</PRE> <DL> <DD>Sets the clock with which all local services will be initialized. Note that once a local service is initialized its clock cannot be altered. <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>clock</CODE> - <DT><B>Returns:</B><DD><code>this</code> (for chaining)</DL> </DD> </DL> <HR> <A NAME="setEnforceApiDeadlines(boolean)"><!-- --></A><H3> setEnforceApiDeadlines</H3> <PRE> public <A HREF="../../../../../../com/google/appengine/tools/development/testing/LocalServiceTestHelper.html" title="class in com.google.appengine.tools.development.testing">LocalServiceTestHelper</A> <B>setEnforceApiDeadlines</B>(boolean val)</PRE> <DL> <DD>Determines whether or not API calls should be subject to the same deadlines as in production. The default is <code>false</code>. <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>val</CODE> - <DT><B>Returns:</B><DD><code>this</code> (for chaining)</DL> </DD> </DL> <HR> <A NAME="setSimulateProdLatencies(boolean)"><!-- --></A><H3> setSimulateProdLatencies</H3> <PRE> public <A HREF="../../../../../../com/google/appengine/tools/development/testing/LocalServiceTestHelper.html" title="class in com.google.appengine.tools.development.testing">LocalServiceTestHelper</A> <B>setSimulateProdLatencies</B>(boolean val)</PRE> <DL> <DD>Determines whether or not local services should simulate production latencies. The default is <code>false</code>. <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>val</CODE> - <DT><B>Returns:</B><DD><code>this</code> (for chaining)</DL> </DD> </DL> <HR> <A NAME="setTimeZone(java.util.TimeZone)"><!-- --></A><H3> setTimeZone</H3> <PRE> public <A HREF="../../../../../../com/google/appengine/tools/development/testing/LocalServiceTestHelper.html" title="class in com.google.appengine.tools.development.testing">LocalServiceTestHelper</A> <B>setTimeZone</B>(java.util.TimeZone timeZone)</PRE> <DL> <DD>Sets the time zone in which tests will execute. If not set we use the same timezone that we use in production and the dev appserver: UTC. Note that if your code has permission to modify the <code>user.timezone</code> system property, this will change the default timezone for the JVM. However, if your code does not have this permission, the timezone will only be altered for the current thread. <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>timeZone</CODE> - the time zone <DT><B>Returns:</B><DD><code>this</code> (for chaining)</DL> </DD> </DL> <HR> <A NAME="setUp()"><!-- --></A><H3> setUp</H3> <PRE> public final <A HREF="../../../../../../com/google/appengine/tools/development/testing/LocalServiceTestHelper.html" title="class in com.google.appengine.tools.development.testing">LocalServiceTestHelper</A> <B>setUp</B>()</PRE> <DL> <DD>Set up an environment in which tests that use local services can execute. <P> <DD><DL> <DT><B>Returns:</B><DD><code>this</code> (for chaining)</DL> </DD> </DL> <HR> <A NAME="newEnvironment()"><!-- --></A><H3> newEnvironment</H3> <PRE> protected com.google.apphosting.api.ApiProxy.Environment <B>newEnvironment</B>()</PRE> <DL> <DD>Constructs the <CODE>ApiProxy.Environment</CODE> that will be installed. Subclass and override to provide your own implementation. <P> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="newLocalServerEnvironment()"><!-- --></A><H3> newLocalServerEnvironment</H3> <PRE> protected LocalServerEnvironment <B>newLocalServerEnvironment</B>()</PRE> <DL> <DD>Constructs the <CODE>LocalServerEnvironment</CODE> that will be installed. Subclass and override to provide your own implementation. <P> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="tearDown()"><!-- --></A><H3> tearDown</H3> <PRE> public final void <B>tearDown</B>()</PRE> <DL> <DD>Tear down the environment in which tests that use local services can execute. <P> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="getApiProxyLocal()"><!-- --></A><H3> getApiProxyLocal</H3> <PRE> public static ApiProxyLocal <B>getApiProxyLocal</B>()</PRE> <DL> <DD>Convenience function for getting ahold of the currently registered <CODE>ApiProxyLocal</CODE>. <P> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="getLocalService(java.lang.String)"><!-- --></A><H3> getLocalService</H3> <PRE> public static LocalRpcService <B>getLocalService</B>(java.lang.String serviceName)</PRE> <DL> <DD>Convenience function for getting ahold of a specific local service. For example, to get ahold of the LocalDatastoreService you would call <code>getLocalService(LocalDatastoreService.PACKAGE)</code>. <P> <DD><DL> </DL> </DD> </DL> <!-- ========= END OF CLASS DATA ========= --> <HR> <!-- ======= START OF BOTTOM NAVBAR ====== --> <A NAME="navbar_bottom"><!-- --></A> <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_bottom_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../../com/google/appengine/tools/development/testing/LocalServiceTestConfig.html" title="interface in com.google.appengine.tools.development.testing"><B>PREV CLASS</B></A> <A HREF="../../../../../../com/google/appengine/tools/development/testing/LocalTaskQueueTestConfig.html" title="class in com.google.appengine.tools.development.testing"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../../index.html?com/google/appengine/tools/development/testing/LocalServiceTestHelper.html" target="_top"><B>FRAMES</B></A> <A HREF="LocalServiceTestHelper.html" target="_top"><B>NO FRAMES</B></A> <SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <!-- ======== END OF BOTTOM NAVBAR ======= --> <HR> </BODY> </HTML>