summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.http.test
Commit message (Collapse)AuthorAgeFilesLines
* Add support to follow HTTP redirectsThomas Wolf2017-08-175-65/+635
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git-core follows HTTP redirects so JGit should also provide this. Implement config setting http.followRedirects with possible values "false" (= never), "true" (= always), and "initial" (only on GET, but not on POST).[1] We must do our own redirect handling and cannot rely on the support that the underlying real connection may offer. At least the JDK's HttpURLConnection has two features that get in the way: * it does not allow cross-protocol redirects and thus fails on http->https redirects (for instance, on Github). * it translates a redirect after a POST to a GET unless the system property "http.strictPostRedirect" is set to true. We don't want to manipulate that system setting nor require it. Additionally, git has its own rules about what redirects it accepts;[2] for instance, it does not allow a redirect that adds query arguments. We handle response codes 301, 302, 303, and 307 as per RFC 2616.[3] On POST we do not handle 303, and we follow redirects only if http.followRedirects == true. Redirects are followed only a certain number of times. There are two ways to control that limit: * by default, the limit is given by the http.maxRedirects system property that is also used by the JDK. If the system property is not set, the default is 5. (This is much lower than the JDK default of 20, but I don't see the value of following so many redirects.) * this can be overwritten by a http.maxRedirects git config setting. The JGit http.* git config settings are currently all global; JGit has no support yet for URI-specific settings "http.<pattern>.name". Adding support for that is well beyond the scope of this change. Like git-core, we log every redirect attempt (LOG.info) so that users may know about the redirection having occurred. Extends the test framework to configure an AppServer with HTTPS support so that we can test cloning via HTTPS and redirections involving HTTPS. [1] https://git-scm.com/docs/git-config [2] https://kernel.googlesource.com/pub/scm/git/git/+/6628eb41db5189c0cdfdced6d8697e7c813c5f0f [3] https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html CQ: 13987 Bug: 465167 Change-Id: I86518cb76842f7d326b51f8715e3bbf8ada89859 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com> Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
* Prepare 4.9.0-SNAPSHOT buildsMatthias Sohn2017-05-302-20/+20
| | | | | Change-Id: I52a4153d573799e861ab104939f51fac1aceb9ee Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Update jetty to 9.4.5Mat Booth2017-05-111-14/+14
| | | | | | | | | | * Adapt to API removals in jetty 9.4+ * Manifests changed to restrict jetty to [9.4.5,10.0.0) Bug: 514336 Bug: 516514 Change-Id: Ifcfd968084dfa6db0ae07cf541d33a6cdedc1ee2 Signed-off-by: Mat Booth <mat.booth@redhat.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Prepare 4.8.0-SNAPSHOT buildsMatthias Sohn2017-04-052-20/+20
| | | | | Change-Id: Ifea6750e79d417a8a2a891b3b5f96d68c7200011 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Merge branch 'stable-4.6'Matthias Sohn2017-04-021-14/+14
|\ | | | | | | | | | | | | | | | | * stable-4.6: Update Jetty to 9.3.17.v20170317 Revert "Update Jetty to 9.4.1.v20170120 in buck build" Revert "Update Jetty to 9.4.1.v20170120" Change-Id: I9193b568cce9c72da899a8f3eaaf833956438e13 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * Update Jetty to 9.3.17.v20170317Matthias Sohn2017-04-023-18/+18
| | | | | | | | | | | | | | | | Update to the latest 9.3 version until we have a solution for bug 514336 we face with 9.4.x versions. Change-Id: I6d8d476abe8677ce865a08099bb77330effc700a Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * Revert "Update Jetty to 9.4.1.v20170120"David Pursehouse2017-03-312-4/+4
| | | | | | | | | | | | This reverts commit e05caf91f1df86a95d3e0454000d345bb90a415e. Change-Id: Ia4287f130034a790759b5035505a093b4616a05a
| * Prepare 4.6.2-SNAPSHOT buildsMatthias Sohn2017-03-072-20/+20
| | | | | | | | | | Change-Id: I8835f79145e6a989787d47322c3d8cb9baf0624a Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * JGit v4.6.1.201703071140-rv4.6.1.201703071140-rMatthias Sohn2017-03-072-2/+2
| | | | | | | | | | Change-Id: I842dc95313e5b47b0b7ec983c4a0a91915ed4183 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * Update Jetty to 9.4.1.v20170120Matthias Sohn2017-03-062-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | MappedLoginService is no longer available in Jetty 9.4 therefore base TestLoginService on AbstractLoginService. Apparently Jetty now uses slf4j hence adapt RecordingLogger accordingly so we can log error messages containing slf4j style formatting anchors "{}". Change-Id: Ibb36aba8782882936849b6102001a88b699bb65c Signed-off-by: Matthias Sohn <matthias.sohn@sap.com> (cherry picked from commit 5e8e2179b218ede7d14b69dc5149b0691b5859cf)
* | Downgrade jetty to 9.3.9.v20160517Matthias Sohn2017-03-311-14/+14
| | | | | | | | | | | | | | This works around the problems we faced with jetty 9.4.3.v20170317. Bug: 514336 Change-Id: I7e9dd539414624d71587c55cb436b843949aa296 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | Require jetty 9.4.0 consistentlyMatthias Sohn2017-03-301-12/+12
| | | | | | | | Change-Id: If9de4c0e43850dec46858bd58e9692a7e099cbc3
* | Raise minimum version of o.e.jetty.security to 9.4.0Matthias Sohn2017-03-251-2/+2
| | | | | | | | | | | | | | This is required since we now use AbstractLoginService which was introduced in Jetty 9.4.0. Change-Id: Iee6e4ae456123099f7a99cc53c5ae02fd43bfa46 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | Remove Buck buildDavid Pursehouse2017-03-221-41/+0
| | | | | | | | | | | | Buck will be replaced with Bazel Change-Id: I3cf07d7aaaa2a58bac34e16c50af5416693254ac Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | Add remaining parts of the bazel buildDavid Ostrovsky2017-03-211-0/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add bazel build for ui and junit.http, and the test packages. A number of different test labels are supported: api attributes dfs diff http lfs lfs-server nls notes pack patch pgm reftree revplot revwalk storage submodule symlinks transport treewalk util To run all tests: bazel test //... To run specific tests, using labels: bazel test --test_tag_filters=api,dfs,revplot,treewalk //... Change-Id: Ic41b05a79d855212e67b1b4707e9c6b4dc9ea70d Signed-off-by: David Ostrovsky <david@ostrovsky.org> Signed-off-by: Jonathan Nieder <jrn@google.com>
* | Enable and fix warnings about redundant specification of type argumentsDavid Pursehouse2017-02-206-12/+12
| | | | | | | | | | | | | | | | | | | | Since the introduction of generic type parameter inference in Java 7, it's not necessary to explicitly specify the type of generic parameters. Enable the warning in Eclipse, and fix all occurrences. Change-Id: I9158caf1beca5e4980b6240ac401f3868520aad0 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* | Fix bad test fix from 0bff481 "Limit receive commands"Shawn Pearce2017-02-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In 0bff481d45db74db81a3b1b86f7401443a60d970 to accurately use the two limits it was necessary to move the LimitedInputStream out of the PacketLineIn and further down to the PackParser. Unfortuantely this didn't survive review, as a buggy test failed and the "fix" was to drop this part of the code. The maxPackSizeLimit should apply to the pack stream, not the pkt-line framing used to send commands to control the ReceivePack instance. The commands are controlled using a different limit. The failing test allowed too many bytes in the pack and was only failing because it was including the command framing. The correct fix for the test was simply to drop the limit lower, to more closely match the actual pack size. Change-Id: I47d3885b9d7d527e153df7ac9c62fc2865ceecf4
* | Enable and fix 'Should be tagged with @Override' warningDavid Pursehouse2017-02-1915-1/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Set missingOverrideAnnotation=warning in Eclipse compiler preferences which enables the warning: The method <method> of type <type> should be tagged with @Override since it actually overrides a superclass method Justification for this warning is described in: http://stackoverflow.com/a/94411/381622 Enabling this causes in excess of 1000 warnings across the entire code-base. They are very easy to fix automatically with Eclipse's "Quick Fix" tool. Fix all of them except 2 which cause compilation failure when the project is built with mvn; add TODO comments on those for further investigation. Change-Id: I5772061041fd361fe93137fd8b0ad356e748a29c Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* | Update Jetty to 9.4.1.v20170120Matthias Sohn2017-02-192-4/+4
| | | | | | | | | | | | | | | | | | | | | | MappedLoginService is no longer available in Jetty 9.4 therefore base TestLoginService on AbstractLoginService. Apparently Jetty now uses slf4j hence adapt RecordingLogger accordingly so we can log error messages containing slf4j style formatting anchors "{}". Change-Id: Ibb36aba8782882936849b6102001a88b699bb65c Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | Follow redirects in transportBo Zhang2017-02-021-13/+117
| | | | | | | | | | | | Bug: 465167 Change-Id: I6da19c8106201c2a1ac69002bd633b7387f25d96 Signed-off-by: Bo Zhang <zhangbodut@gmail.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | Prepare 4.7.0-SNAPSHOT buildsMatthias Sohn2016-12-272-20/+20
|/ | | | | Change-Id: I20754d13007e6591d36aae5766f3a9a82b24e120 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Skip javadoc generation for org.eclipse.jgit.http.testMatthias Sohn2016-12-241-1/+3
| | | | | | | This fixes the error the javadoc plugin raises when generating the maven site for this bundle. Change-Id: I72026aa33be86960747a246af4a70f6a91b40102 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Prepare 4.6.1-SNAPSHOT buildsMatthias Sohn2016-12-242-20/+20
| | | | | Change-Id: I6b05a6f6c3f92365c272e1bdaf76093ca01f2d58 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* JGit v4.6.0.201612231935-rv4.6.0.201612231935-rMatthias Sohn2016-12-242-2/+2
| | | | | Change-Id: Iaa88fe1b195dfe6be99a7b4cb064684e75563715 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Organize importsDavid Pursehouse2016-11-141-2/+2
| | | | | Change-Id: I7c545d06b1bced678c020fab9af1382bc4416b6e Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* Upgrade buck to 7b7817c48f30687781040b2b82ac9218d5c4eaa4David Pursehouse2016-10-181-1/+1
| | | | | | | | | | | | | | | | | Upgrade to match the version used on Gerrit's master branch. Requires a couple of modifications to make the tests work: - Remove source_under_test parameters from java_test calls. - Add vm_args with explicit setting of tmpdir location for http tests. This is needed due to upstream changes in temporary directory handling [1]. [1] https://github.com/facebook/buck/issues/946 Change-Id: I5d5dd5edc335d44b118e8587f69ba89b83fc7fbb Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* Change JGit minimum execution environment to JavaSE-1.8Matthias Sohn2016-09-203-5/+5
| | | | | Bug: 500059 Change-Id: I47f3f6749a67da52029f84e002d9b155ed56d2b7 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Prepare 4.6.0-SNAPSHOT buildsMatthias Sohn2016-09-192-20/+20
| | | | | Change-Id: Id2eafc331ee32c332c2a9b867b05c260beb0d10f Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Add path src/ to source path in build.propertiesMatthias Sohn2016-08-061-1/+2
| | | | | | This fixes the warning "src/ is missing from source.." Change-Id: I166e3a6a3d5230e4110d3283ec4dbc7d1dfe6732 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Ignore 'The value of exception parameter is not used' warningDavid Pursehouse2016-07-261-0/+1
| | | | | Change-Id: I50407e4a33e35b718ca40503fdd436f1f9f70fba Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* Fix assertion in SmartClientSmartServerTest.testPush_CreateBranch()Matthias Sohn2016-07-071-1/+1
| | | | | | This assertion only defined a message but didn't assert anything. Change-Id: I0914642b64b69dc4e3ec24acbf8052f9171613d8 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Prepare 4.5.0-SNAPSHOT buildsMatthias Sohn2016-06-012-20/+20
| | | | | Change-Id: I572fe9fea0e5ca0bec4648c916ae95a5b1ccf125 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Fix RefsUnreadableInMemoryRepositoryMatthias Sohn2016-04-162-1/+43
| | | | | | | | - fix classpath for Eclipse - add missing license header - remove unused import Change-Id: If491fe60678f050f86319388170ac789085fcf5f Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Fix Buck build broken by 4812fda.Mike Edgar2016-04-142-1/+1
| | | | | | | | Creates a source directory under org.eclipse.jgit.http.test for the new support class. Signed-off-by: Michael Edgar <adgar@google.com> Change-Id: Ie49492c2bbe5c1db96ceb0dc06fa7cb9f927431a
* Make UploadPack observe exceptions reading refsMike Edgar2016-04-143-12/+125
| | | | | | | | | | | | | Now if refs are unreadable when serving an upload pack the handler will fail due to the actual underlying failure. Previously all wants would be rejected as invalid because Repository.getAllRefs() returned an empty map. Testing this required a new subclass of InMemoryRepository so that an IOException could be injected at the correct time. Signed-off-by: Michael Edgar <adgar@google.com> Change-Id: Iac708b1db9d0ccce08c4ef5ace599ea0b57afdc0
* Prepare 4.4.0-SNAPSHOT buildsMatthias Sohn2016-04-082-19/+19
| | | | | Change-Id: If3162f4cc4ae6319b9f1e3293549485b039cfe7f Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Prepare 4.3.1-SNAPSHOT versionsMatthias Sohn2016-04-082-19/+19
| | | | | Change-Id: I52c98ba8fb3a303269a1f9380af114b6dd8c5009 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* JGit v4.3.0.201604071810-rv4.3.0.201604071810-rMatthias Sohn2016-04-082-2/+2
| | | | | Change-Id: I902cdf1ff92ce8c6e9d80c4965d8d5bd8b9ac6c1 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* JGit v4.3.0.201604071045-rMatthias Sohn2016-04-072-2/+2
| | | | | Change-Id: Iafab78d6be34d31a13f979b7be67611135c0f8bd Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Prepare 4.3-SNAPSHOT buildsMatthias Sohn2016-04-052-2/+2
| | | | | Change-Id: Ib831f8870938113bd5338763f90a07d5c108b1de Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* JGit v4.3.0.201603230630-rc1v4.3.0.201603230630-rc1Matthias Sohn2016-03-232-2/+2
| | | | | Change-Id: I10835e5aa3618e5033424595942cc1649152cb24 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* smart HTTP server: Pass along "want X not valid" to clientShawn Pearce2016-02-161-0/+22
| | | | | | | | | | | | | If the client sends a SHA-1 that the server does not recognize echo this back to the client with an explicit error message instead of the generic "internal server error". This was always the intent of the implementation but it was being dropped on smart HTTP due to the UploadPackServlet catching the PackProtocolException, discarding the buffered message UploadPack meant to send, and sending along a generic message instead. Change-Id: I8d96b064ec655aef64ac2ef3e01853625af32cd1
* Merge branch 'stable-4.2'Matthias Sohn2016-02-152-0/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-4.2: Don't use deprecated LockFile constructor Fix warnings about unchecked conversion of MergeResult MockServletConfig: Fix warning about unchecked conversion of Enumeration HugeFileTest: Make Git a class member and open in try-with-resource Suppress "unchecked cast" warnings related to UploadPackFactory.DISABLED DiffAlgorithms: Fix warnings about variable hiding DirCacheBasicTest: Open ObjectInserter.Formatter in try-with-resource DirCacheBuilderIteratorTest: Open TreeWalk in try-with-resource DirCacheCGitCompatabilityTest: Open TreeWalk in try-with-resource DirCacheCheckoutMaliciousPathTest: Open Git and RevWalk in t-w-r DirCacheIteratorTest: Open TreeWalk instances in try-with-resource ForPathTest: Open TreeWalk in try-with-resource GitConstructionTest: Open Git instance in try-with-resource IndexDiffTest: Open Git instances in try-with-resources ManifestParserTest: Don't use deprecated StringBufferInputStream InMemoryRepository: Remove unused RevWalk from batch method signature IndexModificationTimesTest: Open Git instances in try-with-resource InterIndexDiffFilterTest: Open TreeWalk in try-with-resource LockFileTest: Open Git instance in try-with-resource JGit v4.1.2.201602141800-r MergeCommandTest: Use JUnit's assume to check preconditions MergeCommandTest: Open Git instances in try-with-resource Change-Id: Ie5dba6b9132a29e86958a04fa2b76465bcd2c6b5 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * Suppress "unchecked cast" warnings related to UploadPackFactory.DISABLEDDavid Pursehouse2016-02-152-0/+2
| | | | | | | | | | Change-Id: Id74694e18fec326df2b04eb796b46ccc6484b23f Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
| * Prepare 4.2.1-SNAPSHOT buildsMatthias Sohn2016-01-222-19/+19
| | | | | | | | | | Change-Id: Ic9eac53b10ac97b2038b334d388ae3d21393f993 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * JGit v4.2.0.201601211800-rv4.2.0.201601211800-rMatthias Sohn2016-01-212-2/+2
| | | | | | | | | | Change-Id: I89f33b0da81ff499315baa5311f95f31724fa510 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | Fix buck classpath for testsSaša Živkov2016-02-121-0/+1
| | | | | | | | Change-Id: Idd2c22bbd2c81311c87a205fe707770300ec8f0c
* | Prepare 4.3.0-SNAPSHOT buildsMatthias Sohn2016-01-212-19/+19
|/ | | | | Change-Id: Idcf0479529693b023042becd96698f9afd344bd4 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Transport: Implement AutoCloseableShawn Pearce2016-01-193-151/+50
| | | | | | | | After creating a Transport instance callers should always call its close() method. Use AutoCloseable to document this idiom and allow use of try-with-resources. Change-Id: I0c6ff3e39ebecdd7a028dbcae1856a818937b186
* GitServletResponseTest: Fix testObjectCheckerExceptionShawn Pearce2016-01-061-2/+4
| | | | | | | | The recent ObjectChecker changes to pass in AnyObjectId as part of the checkCommit method signature meant the override here was no longer throwing an exception as expected. Change-Id: I0383018b48426e25a0bc562387e8cd73cbe13129