From f75f6e8a1948e3e1ffc4e8468d63ab4bdd811dcb Mon Sep 17 00:00:00 2001 From: Qi Xi Date: Sun, 30 Apr 2017 23:44:48 +0800 Subject: [PATCH 1/3] ignore test MocoProxyTest.should_proxy_with_request_method try to fix build --- .../src/test/java/com/github/dreamhead/moco/MocoProxyTest.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/moco-core/src/test/java/com/github/dreamhead/moco/MocoProxyTest.java b/moco-core/src/test/java/com/github/dreamhead/moco/MocoProxyTest.java index b8c63ef13..83c33d329 100644 --- a/moco-core/src/test/java/com/github/dreamhead/moco/MocoProxyTest.java +++ b/moco-core/src/test/java/com/github/dreamhead/moco/MocoProxyTest.java @@ -9,6 +9,7 @@ import org.apache.http.entity.ContentType; import org.hamcrest.Matcher; import org.hamcrest.core.SubstringMatcher; +import org.junit.Ignore; import org.junit.Rule; import org.junit.Test; import org.junit.rules.TemporaryFolder; @@ -70,6 +71,7 @@ public void run() throws IOException { } @Test + @Ignore public void should_proxy_with_request_method() throws Exception { server.get(by(uri("/target"))).response("get_proxy"); server.post(and(by(uri("/target")), by("proxy"))).response("post_proxy"); From ed958423ebe7a5d24369a057b95ae832b90f9b29 Mon Sep 17 00:00:00 2001 From: Qi Xi Date: Mon, 1 May 2017 00:08:06 +0800 Subject: [PATCH 2/3] remove openjdk6 from travis because 'Gradle 3.5 requires Java 7 or later to run' --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 14c7a6628..31f140105 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,7 +3,6 @@ jdk: - oraclejdk8 - oraclejdk7 - openjdk7 - - openjdk6 script: "./gradlew check -i" \ No newline at end of file From 18ce40b4cf68f57ccb0491dd870d5b86c50546f0 Mon Sep 17 00:00:00 2001 From: Qi Xi Date: Mon, 1 May 2017 23:56:12 +0800 Subject: [PATCH 3/3] enable test should_proxy_with_request_method to split it into 3 pieces --- .../com/github/dreamhead/moco/MocoProxyTest.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/moco-core/src/test/java/com/github/dreamhead/moco/MocoProxyTest.java b/moco-core/src/test/java/com/github/dreamhead/moco/MocoProxyTest.java index 83c33d329..d4d0985aa 100644 --- a/moco-core/src/test/java/com/github/dreamhead/moco/MocoProxyTest.java +++ b/moco-core/src/test/java/com/github/dreamhead/moco/MocoProxyTest.java @@ -9,7 +9,6 @@ import org.apache.http.entity.ContentType; import org.hamcrest.Matcher; import org.hamcrest.core.SubstringMatcher; -import org.junit.Ignore; import org.junit.Rule; import org.junit.Test; import org.junit.rules.TemporaryFolder; @@ -71,7 +70,6 @@ public void run() throws IOException { } @Test - @Ignore public void should_proxy_with_request_method() throws Exception { server.get(by(uri("/target"))).response("get_proxy"); server.post(and(by(uri("/target")), by("proxy"))).response("post_proxy"); @@ -91,7 +89,11 @@ public void run() throws IOException { Request putRequest = Request.Put(remoteUrl("/proxy")).bodyString("proxy", ContentType.DEFAULT_TEXT); assertThat(helper.executeAsString(putRequest), is("put_proxy")); - + } + }); + running(server, new Runnable() { + @Override + public void run() throws IOException { Request deleteRequest = Request.Delete(remoteUrl("/proxy")); assertThat(helper.executeAsString(deleteRequest), is("delete_proxy")); @@ -101,7 +103,11 @@ public void run() throws IOException { Request optionsRequest = Request.Options(remoteUrl("/proxy")); assertThat(helper.executeAsString(optionsRequest), is("options_proxy")); - + } + }); + running(server, new Runnable() { + @Override + public void run() throws IOException { Request traceRequest = Request.Trace(remoteUrl("/proxy")); assertThat(helper.executeAsString(traceRequest), is("trace_proxy")); }