@@ -0,0 +1,2932 @@
+package org.apache.helix.integration.task;%0A%0A/*%0A * Licensed to the Apache Software Foundation (ASF) under one%0A * or more contributor license agreements.  See the NOTICE file%0A * distributed with this work for additional information%0A * regarding copyright ownership.  The ASF licenses this file%0A * to you under the Apache License, Version 2.0 (the%0A * %22License%22); you may not use this file except in compliance%0A * with the License.  You may obtain a copy of the License at%0A *%0A *   http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing,%0A * software distributed under the License is distributed on an%0A * %22AS IS%22 BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY%0A * KIND, either express or implied.  See the License for the%0A * specific language governing permissions and limitations%0A * under the License.%0A */%0Aimport org.apache.helix.HelixManagerFactory;%0Aimport org.apache.helix.InstanceType;%0Aimport org.apache.helix.TestHelper;%0Aimport org.apache.helix.manager.zk.ZkClient;%0Aimport org.apache.helix.task.JobConfig;%0Aimport org.apache.helix.task.JobContext;%0Aimport org.apache.helix.task.TaskDriver;%0Aimport org.apache.helix.task.Workflow;%0Aimport org.apache.helix.task.WorkflowConfig;%0Aimport org.apache.helix.task.WorkflowContext;%0Aimport org.testng.Assert;%0Aimport org.testng.annotations.Test;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.List;%0Aimport java.util.Map;%0A%0Apublic class TestRetrieveWorkflows extends TaskTestBase %7B%0A  @Test%0A  public void testGetAllWorkflows() throws Exception %7B%0A    List%3CWorkflow%3E workflowList = new ArrayList%3CWorkflow%3E();%0A    for (int i = 0; i %3C 4; i++) %7B%0A      Workflow workflow = WorkflowGenerator.generateDefaultRepeatedJobWorkflowBuilder(TestHelper.getTestMethodName() + i).build();%0A      _driver.start(workflow);%0A      workflowList.add(workflow);%0A    %7D%0A%0A    for (Workflow workflow : workflowList) %7B%0A      //TaskTestUtil.pollForWorkflowState(_driver, workflow.getName(), TaskState.COMPLETED);%0A    %7D%0A%0A    _manager = HelixManagerFactory%0A        .getZKHelixManager(%22ESPRESSO_TEST_NUAGE%22, %22Admin%22, InstanceType.ADMINISTRATOR, %22zk-ei1-espresso.stg.linkedin.com:12913%22);%0A    _manager.connect();%0A    TaskDriver taskDriver = new TaskDriver(_manager);%0A%0A    Map%3CString, WorkflowConfig%3E workflowConfigMap = taskDriver.getWorkflows();%0A    Assert.assertEquals(workflowConfigMap.size(), workflowList.size());%0A%0A    for(Map.Entry%3CString, WorkflowConfig%3E workflow :  workflowConfigMap.entrySet()) %7B%0A      WorkflowConfig workflowConfig = workflow.getValue();%0A      WorkflowContext workflowContext = _driver.getWorkflowContext(workflow.getKey());%0A      Assert.assertNotNull(workflowContext);%0A%0A      for(String job : workflowConfig.getJobDag().getAllNodes()) %7B%0A        JobConfig jobConfig = _driver.getJobConfig(job);%0A        JobContext jobContext = _driver.getJobContext(job);%0A%0A        Assert.assertNotNull(jobConfig);%0A        Assert.assertNotNull(jobContext);%0A      %7D%0A    %7D%0A  %7D%0A%7D%0A%0A

Add unit test to retrieve workflow and job configurations.