|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.google.appengine.tools.development.testing.LocalBasementServiceTestConfig
public class LocalBasementServiceTestConfig
Config for accessing the LocalBasementService in tests. In order to verify that the expected
data is being written, you will first need to provide an OutputStream for the
data to be written to:
{@code
private ByteArrayOutputStream out = new ByteArrayOutputStream();
LocalServiceTestHelper helper;
| Constructor Summary | |
|---|---|
LocalBasementServiceTestConfig()
|
|
| Method Summary | |
|---|---|
static LocalBasementService |
getLocalBasementService()
|
LocalBasementServiceTestConfig |
setEnable(boolean b)
Configure the LocalBasementServiceTestConfig to create the LocalBasementService
with the specified enable state. |
LocalBasementServiceTestConfig |
setIgnore(boolean b)
Configure the LocalBasementServiceTestConfig to create the LocalBasementService
with the specified ignore state. |
LocalBasementServiceTestConfig |
setLogEveryCall(boolean b)
Configure the LocalBasementServiceTestConfig to create the LocalBasementService
so that it will log every call to LogToSawmillService#log(byte[]) with Logger. |
LocalBasementServiceTestConfig |
setProtoStream(java.io.OutputStream out)
Configure the LocalBasementServiceTestConfig to create the LocalBasementService
so that it will write a request's final merged proto to the specified OutputStream. |
void |
setUp()
Set up the local service. |
void |
tearDown()
Tear down the local service. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public LocalBasementServiceTestConfig()
| Method Detail |
|---|
public void setUp()
LocalServiceTestConfig
setUp in interface LocalServiceTestConfigpublic void tearDown()
LocalServiceTestConfig
tearDown in interface LocalServiceTestConfigpublic static LocalBasementService getLocalBasementService()
public LocalBasementServiceTestConfig setProtoStream(java.io.OutputStream out)
LocalBasementServiceTestConfig to create the LocalBasementService
so that it will write a request's final merged proto to the specified OutputStream. If
this method is not called or is called with null, the final merged proto will not
be written. Defaults to null and must be called (note: only applies to unit tests, in
the Dev App Server defaults to writing to the filesystem).
The final merged proto is only written once the request is over. You can indicate this
to the unit test by either calling LocalServiceTestHelper.endRequest() or LocalServiceTestHelper.tearDown().
This method must be called prior to calling LocalServiceTestHelper.setUp().
out - A non-closed OutputStream.
public LocalBasementServiceTestConfig setEnable(boolean b)
LocalBasementServiceTestConfig to create the LocalBasementService
with the specified enable state. When disabled, the entry points will
throw just like the production environment when the app is missing the
SAWMILL_APP_EXTENSIONS_ENABLE permission. Defaults to true.
This method must be called prior to calling LocalServiceTestHelper.setUp().
b - True to allow the service to log.
public LocalBasementServiceTestConfig setIgnore(boolean b)
LocalBasementServiceTestConfig to create the LocalBasementService
with the specified ignore state. When ignored, LogToSawmillService#log(byte[]) will
drop all date and the the entry points will indicate this in their
return value. Defaults to false.
This method must be called prior to calling LocalServiceTestHelper.setUp().
b - False to allow the service to log.
public LocalBasementServiceTestConfig setLogEveryCall(boolean b)
LocalBasementServiceTestConfig to create the LocalBasementService
so that it will log every call to LogToSawmillService#log(byte[]) with Logger.
Defaults to false (note: only applies to unit tests; in the Dev App Server defaults
to true).
This method must be called prior to calling LocalServiceTestHelper.setUp().
b - True to have the local service log each call.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||