Introduction
For correct testing you should use correctly created LocalServiceTestHelper. Here example.
Details
private final LocalServiceTestHelper helper =
(new LocalServiceTestHelper(new LocalDatastoreServiceTestConfig(),
new LocalTaskQueueTestConfig(),
new LocalMemcacheServiceTestConfig())
{
@Override
protected LocalServerEnvironment newLocalServerEnvironment() {
final LocalServerEnvironment lse =
super.newLocalServerEnvironment();
return new LocalServerEnvironment() {
public File getAppDir() {
return new File("C:\\pathtoprojectfolder\\war\\");
}
public String getAddress() {
return lse.getAddress();
}
public int getPort() {
return lse.getPort();
}
public void waitForServerToStart() throws InterruptedException
{
lse.waitForServerToStart();
}
};
}
}).setEnvIsAdmin(true).setEnvIsLoggedIn(true);