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

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
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.

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