Closed morningstar84 closed 9 years ago
No exception is being thrown because no request is sent in the test, as explained in the forum.
The problem still persist in my application although I invoke the service. Also the working version of the application has been affected and also by changing the test as you can see below, the result is always the same.
No exception
// -- new Test case public void testTimeout() throws Exception{
Logger.e("Test timeout");
BasicAuthentication basicAuthentication = new BasicAuthentication("user", "password");
Session session = new SessionImpl("http://domain.com", basicAuthentication);
session.setConnectionTimeout(1);
ClassNameService classNameService = new ClassNameService(session);
GroupService groupService = new GroupService(session);
JSONObject nameArray = classNameService.fetchClassName(CLASS_NAME_RESOURCE);
long portalInstance = Long.parseLong("10364");
JSONArray groupJsonArray = groupService.getGroups(portalInstance, 0l, true);
}
I write because I'm developing an Android App that uses Liferay as a backend. I am experiencing the anomalous behavior in the management of timeout while invoking Liferay's journal article service. In detail, I've setup the session in this two methods described in "SettingsUtils.java". But while I perform the request no exception is raised even if the timeout is arbitrarily low. I wrote a test case "TestCase.java" is completed successfully without exception.
My development environment is Mac OS X (10.10.2) and I'm using Android Studio with Java [ java version "1.8.0_40", Java(TM) SE Runtime Environment (build 1.8.0_40-b27) ].
Thanks for your help
// ------------------ "SettingsUtils.java"
// ------------------ "TestCase.java"
public class TestCase extends InstrumentationTestCase {
}