Author: chris.laprun(a)jboss.com
Date: 2007-09-24 19:34:54 -0400 (Mon, 24 Sep 2007)
New Revision: 8479
Modified:
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/MarkupTestCase.java
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/consumer/InvocationHandler.java
Log:
- JBPORTAL-1717:
+ Properly update retry count if response is null and return an ErrorResponse if it
reaches the max number of retries.
+ Updated test case.
Modified:
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/MarkupTestCase.java
===================================================================
---
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/MarkupTestCase.java 2007-09-24
23:19:27 UTC (rev 8478)
+++
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/MarkupTestCase.java 2007-09-24
23:34:54 UTC (rev 8479)
@@ -79,6 +79,11 @@
checkRenderResult(consumer.invoke(createRenderInvocation(EmptyMarkupBehavior.PORTLET_HANDLE)),
"");
}
+ public void testNullAction() throws Exception
+ {
+
ExtendedAssert.assertTrue(consumer.invoke(createActionInvocation(NullMarkupBehavior.PORTLET_HANDLE))
instanceof ErrorResponse);
+ }
+
public void testNullRender() throws Exception
{
ExtendedAssert.assertTrue(consumer.invoke(createRenderInvocation(NullMarkupBehavior.PORTLET_HANDLE))
instanceof ErrorResponse);
Modified:
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/consumer/InvocationHandler.java
===================================================================
---
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/consumer/InvocationHandler.java 2007-09-24
23:19:27 UTC (rev 8478)
+++
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/consumer/InvocationHandler.java 2007-09-24
23:34:54 UTC (rev 8479)
@@ -135,10 +135,23 @@
}
finally
{
+ if (response == null)
+ {
+ retryCount++;
+ }
+
// we're done: reset currently held information
sessionHandler.resetCurrentlyHeldInformation();
}
}
+
+ if (retryCount == MAXIMUM_RETRY_NUMBER)
+ {
+ return new ErrorResponse("Tried to perform request " +
MAXIMUM_RETRY_NUMBER
+ + " times before giving up. This usually happens if an error in the WS
stack prevented the messages to be " +
+ "properly transmitted. Look at server.log for clues as to what
happened...");
+ }
+
log.debug("performRequest finished. Response is " + (response != null ?
response.getClass().getName() : null));
return response;
}