@@ -0,0 +1,2258 @@
+// Copyright (C) 2014 The Android Open Source Project%0A//%0A// Licensed under the Apache License, Version 2.0 (the %22License%22);%0A// you may not use this file except in compliance with the License.%0A// 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, software%0A// distributed under the License is distributed on an %22AS IS%22 BASIS,%0A// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A// See the License for the specific language governing permissions and%0A// limitations under the License.%0A%0Apackage com.google.gerrit.acceptance.rest.config;%0A%0Aimport static org.junit.Assert.assertEquals;%0Aimport static org.junit.Assert.assertNotNull;%0Aimport static org.junit.Assert.assertTrue;%0A%0Aimport com.google.gerrit.acceptance.AbstractDaemonTest;%0Aimport com.google.gerrit.acceptance.RestResponse;%0Aimport com.google.gerrit.server.config.ListTasks.TaskInfo;%0Aimport com.google.gson.reflect.TypeToken;%0A%0Aimport org.apache.http.HttpStatus;%0Aimport org.junit.Test;%0A%0Aimport java.io.IOException;%0Aimport java.util.List;%0A%0Apublic class ListTasksIT extends AbstractDaemonTest %7B%0A%0A  @Test%0A  public void listTasks() throws IOException %7B%0A    RestResponse r = adminSession.get(%22/config/server/tasks/%22);%0A    assertEquals(HttpStatus.SC_OK, r.getStatusCode());%0A    List%3CTaskInfo%3E result =%0A        newGson().fromJson(r.getReader(),%0A            new TypeToken%3CList%3CTaskInfo%3E%3E() %7B%7D.getType());%0A    assertTrue(result.size() %3E 0);%0A    boolean foundLogFileCompressorTask = false;%0A    for (TaskInfo info : result) %7B%0A      if (%22Log File Compressor%22.equals(info.command)) %7B%0A        foundLogFileCompressorTask = true;%0A      %7D%0A      assertNotNull(info.id);%0A      Long.parseLong(info.id, 16);%0A      assertNotNull(info.command);%0A      assertNotNull(info.startTime);%0A    %7D%0A    assertTrue(foundLogFileCompressorTask);%0A  %7D%0A%0A  @Test%0A  public void listTasksWithoutViewQueueCapability() throws IOException %7B%0A    RestResponse r = userSession.get(%22/config/server/tasks/%22);%0A    assertEquals(HttpStatus.SC_OK, r.getStatusCode());%0A    List%3CTaskInfo%3E result =%0A        newGson().fromJson(r.getReader(),%0A            new TypeToken%3CList%3CTaskInfo%3E%3E() %7B%7D.getType());%0A%0A    assertTrue(result.isEmpty());%0A  %7D%0A%7D%0A

Add test for list tasks REST endpoint