Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #5 from iulukaya/AZK-97-DoNothingJob-NPE

AZK-97: DoNothingJob returns null for generated props, causes NPE.
  • Loading branch information...
commit 2de565e831ddef75daec290a8a62c4a3d9526c40 2 parents 5c4b6ae + 2250e2b
@rbpark rbpark authored
View
3  azkaban-common/src/java/azkaban/common/jobs/DoNothingJob.java
@@ -40,8 +40,7 @@ public void run() {
@Override
public Props getJobGeneratedProperties() {
- // TODO Auto-generated method stub
- return null;
+ return new Props();
}
}
View
41 azkaban-common/src/unit/azkaban/common/jobs/DoNothingJobTest.java
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2011 Adconion, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package azkaban.common.jobs;
+
+import junit.framework.Assert;
+
+import org.junit.Test;
+
+import azkaban.common.utils.Props;
+
+/**
+ * @author Ibrahim Ulukaya
+ *
+ */
+public class DoNothingJobTest {
+
+ @Test
+ public void testDoNothingJob() {
+ // Start a fictitious job.
+ String wfId = "23";
+ String job1Name = "Job1";
+ Props job1Props = new Props();
+ job1Props.put("azkaban.flow.id", wfId);
+ DoNothingJob job1 = new DoNothingJob(job1Name, job1Props);
+
+ Assert.assertNotNull(job1.getJobGeneratedProperties());
+ }
+}
Please sign in to comment.
Something went wrong with that request. Please try again.