jgit/org.eclipse.jgit.http.apache
Thomas Wolf 308bdb5d1b Apache HTTP: run more tests
Factor out the test parameterization to use both connection factories
into a common super class and use it in more tests.

This made HttpClientTests.testV2HttpSubsequentResponse() fail for
Apache HTTP. The test used the pattern

  - create POST connection
  - setDoOutput(true)
  - connect()
  - write output stream
  - get & read input stream

This pattern is never used in JGit, which actually calls connect() only
in one case in LFS, and that's on a HEAD request.

The above pattern works on JDK, but fails on Apache HTTP because with
Apache HTTP a connect() actually executes the full request including
writing the entity. To work with Apache HTTP, the pattern would need
to be

  - create POST connection
  - setDoOutput(true)
  - write output stream
  - connect()
  - get & read input stream

which is fine for both. JDK connects implicitly in getOutputStream()
and treats the later explicit connect() as a no-op, and Apache works
because the entity is written when connect() is called.

Because JDK connects implicitly on getOutputStream(), the following
pattern also works with JDK:

  - create POST connection
  - setDoOutput(true)
  - write output stream
  - get & read input stream

Support this with Apache HTTP too: let getInputStream() execute
the request if it wasn't executed already.

Remove explicit connect() calls from test code, since JGit doesn't do
those either.

Change-Id: Ica038c00a7b8edcc01d5660d18e961146305b87f
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2019-08-26 22:53:10 +02:00
..
.settings Disable Eclipse warning about unrecognized @SuppressWarnings value 2018-10-17 10:40:36 +09:00
META-INF Fix bundle localization of Apache SSH bundle 2019-06-21 17:54:06 +02:00
resources/org/eclipse/jgit/transport/http/apache/internal Move Apache httpclient based HTTP support to a separate bundle 2014-02-20 23:57:21 +01:00
src/org/eclipse/jgit/transport/http/apache Apache HTTP: run more tests 2019-08-26 22:53:10 +02:00
.classpath Change JGit minimum execution environment to JavaSE-1.8 2016-09-20 11:32:36 +02:00
.gitignore Move Apache httpclient based HTTP support to a separate bundle 2014-02-20 23:57:21 +01:00
.project Move Apache httpclient based HTTP support to a separate bundle 2014-02-20 23:57:21 +01:00
BUILD Bazel: Restrict src globs to Java source files 2017-04-13 14:14:55 +09:00
about.html Move Apache httpclient based HTTP support to a separate bundle 2014-02-20 23:57:21 +01:00
build.properties Move Apache httpclient based HTTP support to a separate bundle 2014-02-20 23:57:21 +01:00
plugin.properties Fix bundle localization of Apache SSH bundle 2019-06-21 17:54:06 +02:00
pom.xml Prepare 5.5.0-SNAPSHOT builds 2019-06-13 03:01:15 +02:00