aurora-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wfar...@apache.org
Subject git commit: Kill code to serve ApiBeta help pages that's no longer used now that the content is served directly.
Date Fri, 10 Oct 2014 22:26:43 GMT
Repository: incubator-aurora
Updated Branches:
  refs/heads/master 47fe9fc93 -> add3d4d65


Kill code to serve ApiBeta help pages that's no longer used now that the content is served
directly.

Reviewed at https://reviews.apache.org/r/26469/


Project: http://git-wip-us.apache.org/repos/asf/incubator-aurora/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-aurora/commit/add3d4d6
Tree: http://git-wip-us.apache.org/repos/asf/incubator-aurora/tree/add3d4d6
Diff: http://git-wip-us.apache.org/repos/asf/incubator-aurora/diff/add3d4d6

Branch: refs/heads/master
Commit: add3d4d651e411ecb94d64e7b29e3a9a1ac39375
Parents: 47fe9fc
Author: Joshua Cohen <jcohen@twopensource.com>
Authored: Fri Oct 10 15:15:47 2014 -0700
Committer: Bill Farner <wfarner@apache.org>
Committed: Fri Oct 10 15:15:47 2014 -0700

----------------------------------------------------------------------
 build.gradle                                    |  1 -
 .../aurora/scheduler/http/api/ApiBeta.java      | 27 --------------------
 .../aurora/scheduler/http/api/ApiBetaTest.java  | 14 ----------
 3 files changed, 42 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/add3d4d6/build.gradle
----------------------------------------------------------------------
diff --git a/build.gradle b/build.gradle
index de6097f..c200746 100644
--- a/build.gradle
+++ b/build.gradle
@@ -512,7 +512,6 @@ def legacyClassesWithoutCoverage = [
     'org/apache/aurora/scheduler/base/Conversions$4',
     'org/apache/aurora/scheduler/cron/quartz/CronSchedulerImpl$1',
     'org/apache/aurora/scheduler/cron/quartz/CronSchedulerImpl',
-    'org/apache/aurora/scheduler/http/api/ApiBeta$2',
     'org/apache/aurora/scheduler/http/JerseyTemplateServlet',
     'org/apache/aurora/scheduler/http/JettyServerModule$1',
     'org/apache/aurora/scheduler/http/Maintenance$1',

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/add3d4d6/src/main/java/org/apache/aurora/scheduler/http/api/ApiBeta.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/http/api/ApiBeta.java b/src/main/java/org/apache/aurora/scheduler/http/api/ApiBeta.java
index eaf6338..c072010 100644
--- a/src/main/java/org/apache/aurora/scheduler/http/api/ApiBeta.java
+++ b/src/main/java/org/apache/aurora/scheduler/http/api/ApiBeta.java
@@ -41,9 +41,6 @@ import javax.ws.rs.core.StreamingOutput;
 
 import com.google.common.base.Throwables;
 import com.google.common.collect.Lists;
-import com.google.common.io.ByteSource;
-import com.google.common.io.ByteStreams;
-import com.google.common.io.Resources;
 import com.google.gson.JsonElement;
 import com.google.gson.JsonObject;
 import com.google.gson.JsonParseException;
@@ -53,7 +50,6 @@ import org.apache.aurora.gen.AuroraAdmin;
 import org.apache.aurora.gen.AuroraAdmin.Iface;
 import org.apache.aurora.gen.ResponseCode;
 import org.apache.aurora.scheduler.storage.entities.AuroraAdminMetadata;
-import org.apache.aurora.scheduler.storage.entities.ITaskConfig;
 import org.apache.aurora.scheduler.thrift.Util;
 
 import static org.apache.aurora.scheduler.http.api.GsonMessageBodyHandler.GSON;
@@ -174,27 +170,4 @@ public class ApiBeta {
   public Response getIndex() {
     return Response.seeOther(URI.create("/apibeta/help/index.html")).build();
   }
-
-  @GET
-  @Path("help/{resourcePath: .*\\.html}")
-  @Produces(MediaType.TEXT_HTML)
-  public Response getApiHelp(@PathParam("resourcePath") final String resourcePath) {
-    final ByteSource data;
-    try {
-      data = Resources.asByteSource(Resources.getResource(ITaskConfig.class, resourcePath));
-    } catch (IllegalArgumentException e) {
-      return Response.status(Status.NOT_FOUND).entity("Page does not exist.").build();
-    }
-
-    return Response.ok(new StreamingOutput() {
-      @Override
-      public void write(OutputStream output) throws IOException {
-        try {
-          ByteStreams.copy(data.openStream(), output);
-        } finally {
-          output.close();
-        }
-      }
-    }).build();
-  }
 }

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/add3d4d6/src/test/java/org/apache/aurora/scheduler/http/api/ApiBetaTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/aurora/scheduler/http/api/ApiBetaTest.java b/src/test/java/org/apache/aurora/scheduler/http/api/ApiBetaTest.java
index 6215404..5019094 100644
--- a/src/test/java/org/apache/aurora/scheduler/http/api/ApiBetaTest.java
+++ b/src/test/java/org/apache/aurora/scheduler/http/api/ApiBetaTest.java
@@ -13,10 +13,8 @@
  */
 package org.apache.aurora.scheduler.http.api;
 
-import java.net.URI;
 import java.nio.charset.StandardCharsets;
 
-import javax.ws.rs.core.HttpHeaders;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response.Status;
 
@@ -59,7 +57,6 @@ import static org.apache.aurora.gen.ResponseCode.OK;
 import static org.apache.aurora.gen.ScheduleStatus.RUNNING;
 import static org.easymock.EasyMock.expect;
 import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
 
 public class ApiBetaTest extends JettyServerModuleTest {
 
@@ -180,17 +177,6 @@ public class ApiBetaTest extends JettyServerModuleTest {
         .accept(MediaType.TEXT_HTML)
         .get(ClientResponse.class);
     assertEquals(Status.SEE_OTHER.getStatusCode(), response.getStatus());
-
-    String redirect = URI.create(response.getHeaders().getFirst(HttpHeaders.LOCATION)).getPath();
-    String helpPage = getRequestBuilder(redirect)
-        .accept(MediaType.TEXT_HTML)
-        .get(String.class);
-    assertNotNull(helpPage);
-
-    ClientResponse notFound = getRequestBuilder("/apibeta/help/notHere.html")
-        .accept(MediaType.TEXT_HTML)
-        .get(ClientResponse.class);
-    assertEquals(Status.NOT_FOUND.getStatusCode(), notFound.getStatus());
   }
 
   @Test


Mime
View raw message