summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.junit
Commit message (Collapse)AuthorAgeFilesLines
* JGit v5.4.0.201905081430-m2v5.4.0.201905081430-m2Matthias Sohn2019-05-083-4/+4
| | | | | Change-Id: I535a98d8ef507d3c8cda7b0f042a2ae835da1279 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Use jdk 5 for loopCarsten Hammer2019-04-131-8/+9
| | | | | | | | Replace simple uses of Iterator with a corresponding for-loop. Also add missing braces on loops as necessary. Change-Id: I708d82acdf194787e3353699c07244c5ac3de189 Signed-off-by: Carsten Hammer <carsten.hammer@t-online.de> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Join catch sections using multicatchCarsten Hammer2019-04-132-10/+2
| | | | | Change-Id: I1a9112e6a4f938638c599b489cb0858eca27ab91 Signed-off-by: Carsten Hammer <carsten.hammer@t-online.de> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Use String.isEmpty() instead of comparing to ""Carsten Hammer2019-04-111-1/+1
| | | | | | | | | Use of String.equals("") can be replaced with with String.length() == 0 (for JDK5 and lower) or String.isEmpty() (for JDK6 and higher) Change-Id: Id1462d22c5d249485d87993263a9239809e73c55 Signed-off-by: Carsten Hammer <carsten.hammer@t-online.de> Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* LocalDiskRepositoryTestCase: Clarify semantics of repository creation methodsDavid Pursehouse2019-04-081-3/+9
| | | | | | | | | Several of the utility methods create a Repository without setting the 'autoClose' flag, which means that the caller is responsible for closing it. Update the Javadoc to explicitly mention this. Change-Id: I2410dd8d230cd4519f756c38b17141d0daa6c314 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* Add missing source bundles and add them to a single source featureMatthias Sohn2019-04-022-0/+50
| | | | | | | | | | | | | | | | | | | | | | Add missing source bundles for - org.eclipse.jgit.ant - org.eclipse.jgit.archive - org.eclipse.jgit.http.apache - org.eclipse.jgit.http.server - org.eclipse.jgit.junit - org.eclipse.jgit.junit.http - org.eclipse.jgit.junit.ssh - org.eclipse.jgit.lfs - org.eclipse.jgit.lfs.server - org.eclipse.jgit.ui Combine all source bundles into a single source feature org.eclipse.jgit.source and delete the other source features. Ensure all bundles are added to the jgit p2 repository. Change-Id: I56785f49c940b79f41f763c26e63a4a820ed7cce Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Prepare 5.4.0-SNAPSHOT buildsMatthias Sohn2019-03-072-21/+21
| | | | | Change-Id: I90a4791f63d0eba23da744c720e869f1830b86e7 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* LocalDiskRepositoryTestCase#createRepository: Default auto-close to falseDavid Pursehouse2019-01-201-3/+6
| | | | | | | | | | | | | | | | | | | | | | Since 8ed59c5 ("Make TestRepository AutoCloseable", Jan 11, 2019) the TestRepository class is auto-closeable, but instantiations of it were not converted to use try-with-resource. Converting to try-with-resource results, in several cases, in the repository being closed twice because LocalDiskRepositoryTestCase has logic to close created repositories in the tearDown method. This results in several tests emitting a warning to the console: close() called when useCnt is already zero Change the default behavior of the createRepository method to not use the auto-close logic in LocalDiskRepositoryTestCase, so that thy will instead be closed (only once) using the AutoCloseable implementation. Deprecate the method that has the autoClose parameter. Change-Id: I63d62c9913f9b61271667861dae144e551d358c1 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* Make TestRepository AutoCloseableJackson Toeniskoetter2019-01-101-1/+18
| | | | | | | | | | | | | Currently, unit tests need to either close the Repository underlying a TestRepository manually, or not close it at all. Both are error prone. The TestRepository holds a reference to 4 AutoCloseable objects: Repository, ObjectInserter, Git, and RevWalk. The last two can escape the TestRepository scope, so they are not closed when TestRepository is closed. Change-Id: I4461bb9104d517bd6bef09c38507c7c2ef5c31d4 Signed-off-by: Jackson Toeniskoetter <jackdt@google.com>
* Prepare 5.3.0-SNAPSHOT buildsMatthias Sohn2018-12-032-21/+21
| | | | | Change-Id: I8951c2cf650cc3e41d2baa0b330b94468cfed5c2 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Move SshTestGitServer to new bundle org.eclipse.jgit.junit.sshThomas Wolf2018-11-174-365/+1
| | | | | | | | | | | | | | | Create the bundle and move the SshTestGitServer there. Verified that the Eclipse build still works and ran JSchSshTest and ApacheSshTest as junit tests inside Eclipse. Update maven build and features to account for that. Verified by running full maven build including packaging. Update bazel build files to account for that. Verified by a clean-slate bazel build :all, followed by running the JSchSshTest and the ApacheSshTest via bazel. Change-Id: Ia084942f4425b454529de148e00417e7da786a90 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
* Apache MINA sshd client: properly handle HostKeyAlgorithms configThomas Wolf2018-11-131-7/+37
| | | | | | | | | | | | | | | | | | | By default sshd will use its default built-in list, which matches the one of openssh (as far as the algorithms exist in sshd at all). But it doesn't handle HostKeyAlgorithms from the ssh config at all. Implement this as in openssh, including the '+' and '-' modifiers and reordering the default if there are known host keys for a server already. Add tests for the reordering. Also use a more robust reader for the known hosts file. The default aborts on the first error. Bug: 520927 Change-Id: Ib1684440bfe2e96140536aa1a93c4bd4a0d35916 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
* Apache MINA sshd client: add gssapi-with-mic authenticationThomas Wolf2018-11-132-2/+60
| | | | | | | | | | | | | | | | | | | sshd does support gssapi-with-mic on the server side, but has no built-in client-side support for this authentication mechanism. Add our own implementation for it, following RFC 4462.[1] To avoid needlessly re-trying mechanisms that aren't even configured on the client, we disable mechanisms that fail on the very first attempt to use them. Since we have no real Kerberos5 test setup, this cannot be fully tested in CI. The disabling of the authentication mechanism and that it is skipped when not successful _is_ tested. [1] https://www.ietf.org/rfc/rfc4462.txt Bug: 520927 Change-Id: I5d0cdb14103588a57c52f927df541b589ab88d88 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
* Add more ssh tests: pushing, known_host file handling, etc.Thomas Wolf2018-11-131-7/+38
| | | | | | | | | | | | | | | | | | | | | | | | Add support for git-receive-pack to the ssh git server and add two new tests for pushing. This actually uncovered an undocumented requirement in TransportSftp: the FTP rename operation assumes POSIX semantics, i.e., that the target is removed. This works as written only for servers that support and advertise the "posix-rename@openssh.com" FTP extension. Our little Apache MINA server does not advertise this extension. Fix the FtpChannel implementation for Jsch to handle this case in a meaningful way so that it can pass the new "push over sftp" test. Add more tests to test the behavior of server host key checking. Also refactor the tests generally to separate better the test framework from the actual tests. Bug: 520927 Change-Id: Ia4bb85e17ddacde7b36ee8c2d5d454bbfa66dfc3 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
* Ssh tests with an Apache MINA sshd test git serverThomas Wolf2018-11-064-4/+256
| | | | | | | | | | | | | | | | Add a simple ssh git server based on Apache MINA sshd, and use it in new tests that verify ssh operations and in particular a number of bugs that had cropped up over time in JSch. The git server supports fetching only, and sftp access. The tests are all in an abstract base class; the concrete JschSshTest class only provides ssh-specific test setup. So the same tests could be run easily also with some other ssh client. Bug: 520927 Change-Id: Ide6687b717fb497a29fc83f22b07390a26dfce1d Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
* Fix test setup for Eclipse Photon and greaterThomas Wolf2018-11-021-5/+1
| | | | | | | | | | | | | | When a source folder is marked as a test folder, JDT requires that it has an output folder different from the one used for regular sources. Therefore give the test folders in org.eclipse.jgit.test a separate output folder "bin-tst". Moreover JDT reports errors if non-test classes have dependencies on test classes. Therefore remove the "test" annotation from org.eclipse.jgit.junit. Change-Id: Ib527439ff5b7d7b570b8a60819ecaa70f59c63a3 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
* Configure classpath for separate test sources in EclipseMichael Keppler2018-10-171-1/+5
| | | | | | | | | | | | | | | Eclipse Photon supports separating sources and test sources. There are no functional changes in the IDE, except for test source folders having a different icon color. Users of different IDEs than Eclipse are not affected, since the attribute on the classpath entries will be ignored by their IDE. Bug: 539933 Change-Id: Iac6dcdf0c0730ca775bae90df6a685303dc95380 Signed-off-by: Michael Keppler <Michael.Keppler@gmx.de> Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* Disable Eclipse warning about unrecognized @SuppressWarnings valueDavid Pursehouse2018-10-171-1/+1
| | | | | | | | | | | | | The code base has several @SuppressWarnings annotations to suppress warnings raised by Error Prone, but those are not recognized by Eclipse and there is currently no way to tell it about them [1]. Suppress them for now. [1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=392045 Change-Id: I3de7cfa8ad4370ca5be71e1303879c73ab6829c1 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* Merge branch 'stable-5.1'Matthias Sohn2018-10-061-35/+0
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-5.1: Prepare 5.1.3-SNAPSHOT builds JGit v5.1.2.201810061102-r Prepare 4.11.5-SNAPSHOT builds JGit v4.11.4.201810060650-r Fix configuration of maven-javadoc-plugin Prepare 4.9.7-SNAPSHOT builds JGit v4.9.6.201810051924-r Prepare 4.7.6-SNAPSHOT builds JGit v4.7.5.201810051826-r BaseReceivePack: Validate incoming .gitmodules files ObjectChecker: Report .gitmodules files found in the pack SubmoduleAddCommand: Reject submodule URIs that look like cli options Revert "Configure WindowCache settings to use in JGit CLI" Change-Id: I833d30d6de75b097377872c000b2ef5a1b96cf89 Signed-off-by: Jonathan Nieder <jrn@google.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * Prepare 5.1.3-SNAPSHOT buildsMatthias Sohn2018-10-062-19/+19
| | | | | | | | | | Change-Id: I75c1a01885115fc709ab37f181234264c3f7423a Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * JGit v5.1.2.201810061102-rv5.1.2.201810061102-rMatthias Sohn2018-10-062-2/+2
| | | | | | | | | | Change-Id: Id34e4ae12a796460862edc37c5eb072314199bf4 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * Prepare 5.1.2-SNAPSHOT buildsMatthias Sohn2018-09-182-19/+19
| | | | | | | | | | Change-Id: I095d246e27de747a234bc058725454c222be51ce Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * JGit v5.1.1.201809181055-rv5.1.1.201809181055-rMatthias Sohn2018-09-182-2/+2
| | | | | | | | | | Change-Id: I2366444fca125139eadb6d513be721167a266d70 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * Prepare 5.1.1-SNAPSHOT buildsMatthias Sohn2018-09-112-19/+19
| | | | | | | | | | Change-Id: Ie220dd95fae18f894e2a04a5ae6d29a1e5a6d76b Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * JGit v5.1.0.201809111528-rv5.1.0.201809111528-rMatthias Sohn2018-09-112-2/+2
| | | | | | | | | | Change-Id: I583bf7d60bccc876156be1f605bfda32b89cd08b Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * Prepare 5.1.0-SNAPSHOT buildsMatthias Sohn2018-09-052-2/+2
| | | | | | | | | | Change-Id: I3d06c5237edae54b09f465f415f5a308b5e7ceff Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * JGit v5.1.0.201809051400-rc1v5.1.0.201809051400-rc1Matthias Sohn2018-09-052-2/+2
| | | | | | | | | | Change-Id: I0b53f95ee51d94da8b029c9bb10eb854ff9dd4f6 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | Make inner classes static where possibleDavid Pursehouse2018-09-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | As reported by Error Prone: An inner class should be static unless it references members of its enclosing class. An inner class that is made non-static unnecessarily uses more memory and does not make the intent of the class clear. See https://errorprone.info/bugpattern/ClassCanBeStatic Change-Id: Ib99d120532630dba63cf400cc1c61c318286fc41 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* | Fix Mylyn commit message templateMichael Keppler2018-09-231-1/+1
| | | | | | | | | | | | | | | | The commit message template contains a superfluous blank at the end of the first line, which is deleted by this change. This is only relevant for jgit contributors using Eclipse, not for jgit users. Change-Id: I462deb49c26fb64b3dc2d1d75f1e40ef302b0fc9 Signed-off-by: Michael Keppler <Michael.Keppler@gmx.de>
* | Prepare 5.2.0-SNAPSHOT buildsMatthias Sohn2018-09-062-19/+19
|/ | | | | Change-Id: If8e8ca20e745901a5e0239c16cb4acc7934b4ec8 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Deprecate Constants.CHARSET in favor of StandardCharsets.UTF_8David Pursehouse2018-09-044-9/+9
| | | | | Change-Id: I3b748620f067582afef20f144feebe40d0332be2 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* Return parsed objects from TestRepository.commit/tree/blob()Terry Parker2018-06-281-12/+13
| | | | | | | | | | | | | It is convenient for TestRepository to return fully parsed objects from its commit()/tree()/blob() methods, so that test code doesn't have to remember to parse them before making assertions about them. Update TestRepostiory to return fully parsed objects. Adjust the tests that are affected by this change in behavior. Change-Id: I09d03d0c80ad22cb7092f4a2eaed99d40a10af63 Signed-off-by: Terry Parker <tparker@google.com>
* Prepare 5.1.0-SNAPSHOT buildsMatthias Sohn2018-05-232-19/+19
| | | | | Change-Id: I8523a993ae1f7b62573d7547273bc1356bf64fa7 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Fix trivial usages of deprecated Repository#getAllRefsDavid Pursehouse2018-05-231-3/+3
| | | | | | | | | | | | Callers of getAllRefs that only iterate over the `values()` of the returned map can be trivially fixed to call getRefDatabase().getRefs() instead. Only fix those where the calling method is already declared to throw IOException, to avoid potential API changes. Change-Id: I2b05f785077a1713953cfd42df7bf915f889f90b Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* Remove further unnecessary 'final' keywordsHan-Wen Nienhuys2018-05-181-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove it from * package private functions. * try blocks * for loops this was done with the following python script: $ cat f.py import sys import re import os def replaceFinal(m): return m.group(1) + "(" + m.group(2).replace('final ', '') + ")" methodDecl = re.compile(r"^([\t ]*[a-zA-Z_ ]+)\(([^)]*)\)") def subst(fn): input = open(fn) os.rename(fn, fn + "~") dest = open(fn, 'w') for l in input: l = methodDecl.sub(replaceFinal, l) dest.write(l) dest.close() for root, dirs, files in os.walk(".", topdown=False): for f in files: if not f.endswith('.java'): continue full = os.path.join(root, f) print full subst(full) Change-Id: If533a75a417594fc893e7c669d2c1f0f6caeb7ca Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
* Remove 'final' in parameter listsHan-Wen Nienhuys2018-05-156-36/+36
| | | | | Change-Id: Id924f79c8b2c720297ebc49bf9c5d4ddd6d52547 Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
* Add API filter for "non-API type FileRepository" in testsDavid Pursehouse2018-05-061-0/+35
| | | | | Change-Id: If805ad4a962e48dd16fbc7eff915fd6539839933 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* Open auto-closeable resources in try-with-resourceDavid Pursehouse2018-03-131-19/+14
| | | | | | | | | | | | | | | | | | | | When an auto-closeable resources is not opened in try-with-resource, the warning "should be managed by try-with-resource" is emitted by Eclipse. Fix the ones that can be silenced simply by moving the declaration of the variable into a try-with-resource. In cases where we explicitly call the close() method, for example in tests where we are testing specific behavior caused by the close(), suppress the warning. Leave the ones that will require more significant refcactoring to fix. They can be done in separate commits that can be reviewed and tested in isolation. Change-Id: I9682cd20fb15167d3c7f9027cecdc82bc50b83c4 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* Consistently use Constants.CHARSET rather than StandardCharsets.UTF_8David Pursehouse2018-03-114-9/+9
| | | | | Change-Id: I6714fc3666e1bced22abba94ceb700477349586e Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* Prepare 5.0.0-SNAPSHOT buildsMatthias Sohn2018-03-082-19/+19
| | | | | Change-Id: I2d2f50ed8a12f310e7cac68eed5536bd460c403f Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Prepare 4.11.1-SNAPSHOT buildsMatthias Sohn2018-03-082-19/+19
| | | | | Change-Id: Id9aa6b7e8f56de5183b6cd57ef0e790ec9debd4d Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* JGit v4.11.0.201803080745-rv4.11.0.201803080745-rMatthias Sohn2018-03-082-2/+2
| | | | | Change-Id: Ie24a33bc8a24c30db06fe7b175f405efb95776ec Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* JGitTestUtil: Open auto-closeable resources in try-with-resourceDavid Pursehouse2018-03-071-16/+7
| | | | | Change-Id: Ibc8dd8509109708628e5189888fa528add486452 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* Use StandardCharsets.UTF_8 in testsDavid Pursehouse2018-03-073-4/+8
| | | | | | | Replace hard-coded "UTF-8" string with the constant. Change-Id: Ie812add2df28e984090563ec7c6e2c0366616424 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* Enable warning for resources not managed by try-with-resourceDavid Pursehouse2018-03-031-1/+1
| | | | | Change-Id: Iefe97de6bdb62af558f1b0e77c9205a9186f9b4c Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* Honor CRLF settings when writing merge resultsThomas Wolf2018-02-021-8/+8
| | | | | | | | | | | Merges are performed using the raw text as stored in the git repository. When we write the merge result, we must apply the correct CRLF settings. Otherwise the line endings in the result will be wrong. Bug: 499615 Change-Id: I37a9b987e9404c97645d2720cd1c7c04c076a96b Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Prepare 4.11.0-SNAPSHOT buildsMatthias Sohn2017-12-312-19/+19
| | | | | Change-Id: I5d5e2befcf530d93457d44684bd9e4fc2392e5eb Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Add header Automatic-Module-Name for Java 9Karsten Thoms2017-12-231-0/+1
| | | | | | Bug: 529075 Change-Id: I4532ce2c80eb91531d46026676502d636ccda706 Signed-off-by: Karsten Thoms <karsten.thoms@itemis.de> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Repeat: Fix javadoc to say 'annotation' instead of 'interface'David Pursehouse2017-12-181-1/+1
| | | | | Change-Id: Ib0c4ec28d6b7e2fc0fe71f7dc53dd12ccd6e8a2f Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* Fix javadoc in org.eclipse.jgit.junitMatthias Sohn2017-12-1711-22/+323
| | | | | Change-Id: I1107e6a82849ac329361baabb5c481d86ea6dc9e Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>