Skip to content
This repository has been archived by the owner on Apr 4, 2021. It is now read-only.

FALCON-1930 : testProcessInstanceRerunFailedWorkflowAction failed with NULLPOINTEREXCEPTION #122

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

muraliramasami
Copy link
Contributor

@muraliramasami muraliramasami commented May 3, 2016

testProcessInstanceRerunFailedWorkflowAction tests execute the oozie workflow and when executes, the parent workflow returns null for getExternalStatus during the initial function call and the test failing with Null Pointer Exception. Added the condition to handle that case.

@muraliramasami muraliramasami changed the title FALCON - 1930 : testProcessInstanceRerunFailedWorkflowAction failed with NULLPOINTEREXCEPTION FALCON-1930 : testProcessInstanceRerunFailedWorkflowAction failed with NULLPOINTEREXCEPTION May 3, 2016
@@ -714,7 +714,9 @@ public static String getActionStatus(OozieClient oozieClient, String workflowId,
List<WorkflowAction> wfAction = oozieClient.getJobInfo(workflowId).getActions();
for (WorkflowAction wf : wfAction) {
if (wf.getName().contains(actionName)) {
return wf.getExternalStatus();
if (wf.getExternalStatus() != null) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please use 'and' operator in if condition and combine both the if statements for better readability.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@PraveenAdlakha Thanks for the review. I have modified the code.

@@ -713,7 +713,7 @@ public static String getActionStatus(OozieClient oozieClient, String workflowId,
throws OozieClientException {
List<WorkflowAction> wfAction = oozieClient.getJobInfo(workflowId).getActions();
for (WorkflowAction wf : wfAction) {
if (wf.getName().contains(actionName)) {
if ((wf.getName().contains(actionName)) && (wf.getExternalStatus() != null)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we know why we got null in the first place ?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants