Skip to main content
aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2023-04-30Use maven artifacts and bump baseline to Eclipse 4.26Thomas Wolf2-4/+10
Eclipse platform has switched away from the Orbit rebundling of Bouncy Castle a while ago, so EGit may do so, too. Note that this requires * an up-to-date CBI TPD >= 3.0.0.202301061314, * a modern PDE * a modern tycho >= 2.7.5 JGit has already also switched to consume Jetty from maven directly, so do this, too. Installing BC maven bundles in an Eclipse that has the Orbit bundles may lead to problems, since then two different bcprov bundles will be present, and it will be indeterminate which one installs the "BC" security provider. Therefore, bump the EGit baseline to the first Eclipse version that shipped with the BC maven bundles: Eclipse 4.26 (2022-12). Enforce this baseline by bumping all "Require-Bundle" specifications in all MANIFEST.MF to the versions that shipped with Eclipse 4.26. Drop all target platforms for earlier Eclipse versions. Tests also run against the Eclipse 4.26 baseline. Eclipse 4.26 will automatically enforce the character set of a project to be UTF-8 if not set explicitly. This mandates some minor adaptations in tests. We set the character set explicitly to avoid surprises if the platform sets it at an unspecified moment. Bug: 581854 Change-Id: I7f27e9827a757a192255c53d034312b875f9bf0e Signed-off-by: Thomas Wolf <twolf@apache.org>
2021-09-29Remove TestUtil.processUIEvents()Thomas Wolf1-3/+2
SWTBot tests must not run their own event loops: this may block a test if an asyncExec is queued that opens a modal dialog. The parent commit changed processUIEvents() to a no-op; now it is completely removed. Bug: 576238 Change-Id: I13c2f7e41c256fc68783a4f6207493cf021db21d Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2021-07-14Change singletons to enumeration literalsThomas Wolf1-1/+1
Use enumeration literals for the RepositoryCache, IndexDiffCache, RepositoryUtil, and RepositoryGroups singletons to ensure their initialization is thread-safe. Bug: 574806 Change-Id: I54def946ec3b708366c1f4b73f5aead531f0142b Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2021-03-11[osgi] Disperse the EGit core Activator into OSGi dynamic servicesThomas Wolf1-2/+2
Use OSGi DS to perform most of the setup formerly done in the Activator. Because of interdependencies it's not possible to do this step-by-step. The Activator did a number of unrelated things: * setting up the internal EGit caches (RepositoryCache, IndexDiffCache, RepositoryUtil). * setting up a number of IResourceChangeListeners for auto-sharing projects, auto-ignoring derived resources, and similar things. * setting up HTTP and SSH, and proxy support. * handling debug tracing options. * migrating preferences. * tracking merge strategies contributed via an extension point. Each of these have now become an OSGi DS component: * RepositoryInitializer: EGit caches * WorkspaceConnector: IResourceChangeListeners * TransportConfigurator: HTTP, SSH, and proxies * DebugOptionsHandler: debug tracing options * PreferencesMigrator: preferences migrations; runs as a Job * MergeStrategies: merge strategy tracking; runs a Job to initialize The activator is no longer the central hub from which other classes can obtain the RepositoryCache, IndexDiffCache, or RepositoryUtil. This change was necessary because otherwise an early component activation causes the Activator to run, which then might cause trying to activate org.eclipse.core.resources before the instance location is set, which breaks Eclipse start-up. These central singletons are newly managed in these three classes directly, and are accessible via getInstance() static methods. Likewise, the EGitSecureStore is now such a singleton that will be created on first access to the EGitSecureStore class. The RepositoryInitializer publishes the RepositoryCache as a service, which is consumed by the WorkspaceConnector OSGi component. This ensures correct initialization order. The changes outside the Activator and the six new OSGi components are all simple replacements for using the new instance getters instead of the Activator. Bug: 560412 Change-Id: Id5c7440213ae25a573e84720db7dfcc83a8f5d0a Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2020-01-27Replace deprecated junit assertion methods with hamcrestMatthias Sohn3-3/+3
Change-Id: I512ebc8c5de591d2e3fe0f4bf74a3ef594122d49 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-12-28Remove redundant type informationMichael Keppler1-1/+1
Execute only the cleanup "Remove redundant type information" on the egit projects. The number of Java error/warning markers is the same before and after this change. The cleanup preference was already enabled on all projects, but probably we did not execute the cleanup when enabling it. Change-Id: I638e47b1cb4826adb3843dc143e84a3a110eb4c7 Signed-off-by: Michael Keppler <Michael.Keppler@gmx.de>
2019-12-26Fix typo in testsMichael Keppler2-8/+8
Change-Id: I7c91f36a166b371e688c2c598393da87d3299f85 Signed-off-by: Michael Keppler <Michael.Keppler@gmx.de>
2019-05-15Use try-with-resourcesCarsten Hammer2-17/+16
Convert try finally block to try-with-resources Change-Id: I29a482e2bbfe5e9029b41c1fe7a5bf45308905c2 Signed-off-by: Carsten Hammer <carsten.hammer@t-online.de>
2019-05-01Get display instance from workbenchMichael Keppler1-3/+3
org.eclipse.ui.IWorkbench.getDisplay() recommends to always use that method instead of Display.getDefault(). Change-Id: I0d7512aa9b40ad26e0b71356aa90bebd5b7611f7 Signed-off-by: Michael Keppler <Michael.Keppler@gmx.de>
2019-02-05Close resourcesMichael Keppler1-4/+4
Found running deepcode.ai on the egit repository. Many of the other suggestions by the tool are not that good and just don't fit to our situation. Change-Id: Ib934a0bcfeda7285824c41fc5ede29dbc847ca9a Signed-off-by: Michael Keppler <Michael.Keppler@gmx.de>
2019-01-04Replace FileInputStream and FileOutputStream with static Files methodsMatthias Sohn2-6/+6
FileInputStream and FileOutputStream rely on finalize() method to ensure resources are closed. This implies they are added to the finalizer queue which causes additional work for the JVM GC process. This is an open bug on the OpenJDK [1] and the recommended workaround is to use the Files.newInputStream and Files.newOutputStream static methods instead. [1] https://bugs.openjdk.java.net/browse/JDK-8080225 Change-Id: I59e72d0a12d70396a5cf558029c13e2a1b0d5741 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com> Signed-off-by: Michael Keppler <Michael.Keppler@gmx.de>
2018-08-13refactor: simplify collection.toArray()Michael Keppler1-1/+1
On recent VMs, collection.toArray(new T[0]) is faster than collection.toArray(new T[collection.size()]). Since it is also more readable, it should now be the preferred way of collection to array conversion. https://shipilev.net/blog/2016/arrays-wisdom-ancients/ Change-Id: If0c3202aa3ebb2d4e4ea68da8fe431cd8f363826 Signed-off-by: Michael Keppler <Michael.Keppler@gmx.de>
2018-05-29Update license to EPL-2.0Matthias Sohn7-14/+28
Bug: 530393 Change-Id: Iea3b247253a97c28043187df0e35daecf518011e Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2017-03-16Open Git instances in try-with-resource in testsDavid Pursehouse2-10/+16
Change-Id: I881cab412475d692f02e2d5bf76677c08fb3ac54 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2016-12-06Introduce GitSynchronizer for logical model supportLaurent Delaigue3-0/+385
This allows providing distinct implementations when doing synchronizations depending on whether or not the user is interested in logical models. The default synchronizer implementation does not deal with logical models at all and thus provides the best performance. The ModelAwareGitSynchronizer consults the logical model providers to determine the set of resources involved in synchronization operations and thus can have important performance impact especially on large repositories. It uses a 'lazy' implementation of subscriber to load additional resource revisions lazily when needed. Bug: 501990 Change-Id: I9322cef70c037e0b2c270a7c2bab7d2ffd278f60 Signed-off-by: Laurent Delaigue <laurent.delaigue@obeo.fr> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2016-09-21Revert "Provide a remote mapping context to ModelProviders"Andrey Loskutov3-363/+0
This reverts commit 218f8cec2b7ceb5b9b6d64bb037e8f875521e27a. Bug: 501886 Change-Id: Iafff598257b9774253d95ea5f97cfcf83ae6a400 Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
2016-08-30Provide a remote mapping context to ModelProvidersLaurent Delaigue3-0/+363
Allow model providers to use remote information when trying to determine whether a file is a part of a logical model or not. When a file has been deleted locally, or when a file has been created on one of the remote sides, the local side is not sufficient to compute a full model. ModelProviders will need access to the remote file data to take these locally unknown files into account. Add an interface to allow ModelProviders to be ignored in synchronizations has been added. Change-Id: I956dfb13093781accca36142cd87cf01b479fe1a Also-by: Laurent Goubet <laurent.goubet@obeo.fr> Also-by: Axel Richard <axel.richard@obeo.fr> Also-by: Alexandra Buzila <abuzila@eclipsesource.com> Signed-off-by: Laurent Delaigue <laurent.delaigue@obeo.fr> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2016-07-15Test stability: force display of result dialog of background jobsThomas Wolf1-1/+2
Change-Id: Ia930bf0c9b391f6fd41869693166ed211ce1c2e1 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2016-05-03Test stability: avoid asynchronous SWTBotTreeItem.expand()Thomas Wolf2-7/+8
Sometimes tests do not find children of expanded tree nodes. The root cause appears to be that expand() expands the node in an asyncExec.[1] Add a utility operation that after expanding waits until the desired node exists, and replace all calls to expand() that do expect children by that. [1] https://wiki.eclipse.org/Linux_Tools_Project/SWTBot_Workarounds#Tree_Item_Expansion_Failure Change-Id: I23ea6a7bc519692c0e9dbe480bb2eb8dfb96adc1 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2016-04-03When running "Commit" action open staging view instead of commit dialogMatthias Sohn1-0/+4
Add a preference to allow switching back to the old behavior of the commit action to open the commit dialog. By default it now opens the staging view. After opening the staging view auto-select and set focus on unstaged files if there are any, otherwise set focus on the commit message. The commit dialog is still used by CleanupUncomittedChangesDialog. Bug: 490121 Change-Id: I604f31268f83ab11c3f3a869edf3c7121f0e6478 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2016-02-17Test stability: SynchronizeViewGitChangeSetModelTestThomas Wolf1-3/+5
The test was looking for a tree node with label "GeneralProject". As the screenshot from unstable build 8131[1] clearly shows, the node is labeled "> GeneralProject". Looks like there's some asynchronous decoration going on, and depending on whether the test tried to get the node before or after the decorator ran it would succeed or fail. Remedy by using TestUtil.getNode(), which only requires a substring match, instead of SWTBotTreeItem.getNode(), which requires an exact match. Also relax the assertion on the "<working tree>" node (same as in the following test method). There may be more similar problem spots lurking in here. [1] https://hudson.eclipse.org/egit/job/egit.gerrit/8131/artifact/org.eclipse.egit.ui.test/target/screenshots/shouldRefreshSyncResultAfterWorkspaceChange%28org.eclipse.egit.ui.view.synchronize.SynchronizeViewGitChangeSetModelTest%29.jpeg Change-Id: If0051411196ac0148f2a6289d1dfba1e3d69f61d Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2015-09-17Add missing @Override annotations to all EGit bundlesLars Vogel1-0/+2
Bug: 477689 Change-Id: I490e6558db5133a60caf00af2b996feae0e2e832 Signed-off-by: Lars Vogel <Lars.Vogel@vogella.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2015-07-25Test stability: log real stack traces before failing testAndrey Loskutov1-2/+5
ConnectProviderOperation seems to be unstable and permanent reason for sporadic test failures. Catch the errors reported by the operation and log them, so that we can at least try to analyze the root cause. Change-Id: Ie522136bef18787405f1189c3ec8f49388a1503d Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
2015-07-01Use bot.viewById instead of bot.viewByTitleAndrey Loskutov4-20/+26
View title can change if it contains some context information, like "Synchronize" -> "Synchronize (Git (GeneralProject))". To make the tests more stable we should never use bot.viewByTitle. Change-Id: Ifc731c7be4e4f6ff5d2d654f5c793bbfa5d0bd70 Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
2015-06-30Test fixes: ReplaceActionsTest, SynchronizeViewWorkspaceModelTestAndrey Loskutov1-1/+1
Still trying to fix unstable tests... Change-Id: I92aa2168c8d9d652eb37da6f189c401d0733989b Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
2015-06-30Test fixes: CommitSearchDialogTest, SynchronizeViewWorkspaceModelTestAndrey Loskutov1-3/+6
Still trying to fix unstable tests... Change-Id: I5e665b677d741b13f76f5be9ad2d958f0c00ba2e Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
2015-06-29Test stability fixes related to job scheduling/resource changes etcAndrey Loskutov1-3/+5
Trying to fix instabilities in recently failed unstable tests: Job.join() can immediately return if expected job is not yet scheduled. So let TestUtil.joinJobs() wait before joining. Many git operations may trigger resource changes, resource changes can trigger jobs via listeners, so make sure we proceed eventually triggered jobs after such events. Change-Id: If8017ab14dca8e1d5422ae2b024195601d334e31 Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
2015-06-28More test stability fixes after resource changesAndrey Loskutov1-5/+9
Trying to fix instabilities in AbstractSynchronizeViewTest and LocalRepositoryTestCase, probably caused by inconsistent or not up-to-date resource model after resource modifications. Change-Id: I2003bcc7259623020adc5a6214ce36664e69aacc Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
2014-08-04Add UI test for resolving merge conflict in staging viewRobin Stocker1-14/+1
Bug: 440758 Change-Id: I1cb97f1534a6f7003175930e1a5798fea5e23b63 Signed-off-by: Robin Stocker <robin@nibor.org>
2014-08-03Use TestUtil for getting Package Explorer treeRobin Stocker1-2/+1
Change-Id: Idcc3d52ba511e12d45d731c1ace3177e4586d505 Signed-off-by: Robin Stocker <robin@nibor.org>
2013-11-20Don't switch perspective in UI testsRobin Stocker1-6/+6
It should not be necessary and I suspect it may be responsible for occasional UI test instability. Change-Id: I70b44ed1f66957ffe71db256773e3ec3c5222878 Signed-off-by: Robin Stocker <robin@nibor.org>
2013-11-06[findBugs] Use UTF-8 instead of relying on default encodingMatthias Sohn2-6/+13
Change-Id: Ie0e74aa6e1b47290a1b283ae92db18f04f449ac5 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2013-10-22Fix UI tests interfering with each other because of shared test setupRobin Stocker1-9/+0
The most common cause of unstable UI tests was that the test data (repositories and projects) was set up once per class, and then each test method used the same data. When one test method only reads the data but another modifies it, the test may fail depending on the order of execution. This is an attempt to fix this by changing the test setup so that it's done once per test method (@Before instead of @BeforeClass). To make it easier (and possibly faster) to clean up and reduce the possibility of accidentally sharing the data, the data for each test method is created in a separate directory. Change-Id: I2d7ae4e86c08483a1e8a2824a31648f9d6827bf8 Signed-off-by: Robin Stocker <robin@nibor.org>
2013-08-11Remove unused messages from UIText and CoreTextRobin Stocker1-2/+1
Found using the UCDetector plugin. It also removes a message that was only used from the tests (defined in plugin.properties). Change-Id: I67aaae01fc582930fa22cc585ec22c831a71605e Signed-off-by: Robin Stocker <robin@nibor.org> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2013-08-11Use assertThat of JUnit instead of hamcrestRobin Stocker1-1/+1
This makes it the same as in other tests and MatcherAssert seems to cause problems with hamcrest 1.3. Change-Id: Id77131bca225b61e72edf469aa5b219f506e25f4 Signed-off-by: Robin Stocker <robin@nibor.org> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2013-08-09Fix instability in MergeToolTestRobin Stocker4-90/+39
It recently failed here: https://hudson.eclipse.org/sandbox/job/egit.gerrit/4746/ The problem was that the "ancestor" text editor was sometimes shown and returned as the first text editor, where the code expected to get the "left" editor. As the sync view tests also use the compare editor, abstract this in a new CompareEditorTester which handles this. Change-Id: I82e731f4166c5cf060a8f441b02a6067961630bf Signed-off-by: Robin Stocker <robin@nibor.org> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2013-07-14Rename ResultDialog_* message keys to PushResultDialog_*Robin Stocker1-1/+1
The practice is to name them the same as the class, which helps with finding them e.g. in test code. Change-Id: If74c9b2d9d37cd6a20d27c26678269303d02c264 Signed-off-by: Robin Stocker <robin@nibor.org>
2013-04-24Remove unnecessary usage of the internal FileRepository classRobin Rosenberg3-12/+12
Change-Id: Iae7b4e550d75798dc66edf6c9e03ea826f072f33 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2013-03-22Eliminate file handle leaksLaurent Goubet1-0/+8
Running the SWTBot test suite on a Windows environment highlights insidious file handle leaks caused by JGit's WindowCache which keeps ".pack" files open for reading and thus locked for deletion until the repository is properly closed, but EGit might not keep a reference towards this repository in its cache, "forgetting" to close it when needed. This is mostly true for sub-modules. This patch also gets rid of other random errors, sometimes due to a .project not properly removed. Bug: 404121 Change-Id: I3a596fcabdb5225e9042e1ffae6b054c48d72d54 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2013-03-19Bump EGit version to 3.0.0 and require JGit 3.0.0Robin Rosenberg3-3/+3
JGit changed version, change EGit too since it's soo heavily dependet on JGit. Change-Id: I4927823ff3cd499246b5b85534116cb70015cb9d
2013-03-07Move UIText and UIIcons to the internal packageRobin Rosenberg3-7/+7
These are not part of the API and should therefore not be in a public package and also not checked for API compatibility. Change-Id: I8439adce61515177d36227c844d6284de700964f Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2013-01-20[syncView] Use JobJoiner in test to ensure synchronize is doneRobin Stocker1-8/+8
By adding a sleep in the job of GitModelSynchronize, I could reproduce some test failures. These are fixed by using JobJoiner. Bug: 371633 Change-Id: Idf3bf4b8944c0c22127b9dfa67063b98e23c59e0 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2013-01-18[syncView] Improve message when tree item is not found in testsRobin Stocker1-3/+10
Bug: 371633 Change-Id: Ib1dc70692db8bd610e32c142492d3d1c57e9d2b5
2013-01-07Make Synchronize view UI tests stableRobin Stocker4-232/+163
There were a few things contributing to the instability: - The test setup was only done once in @BeforeClass and then "cleaned up" by doing a reset twice and waiting. Setup is now done in @Before and a complete cleanup is done in @After, so that test execution order does not affect the outcome. - Switching between "Git Commits" and "Workspace" models was done by clicking on the drop down in the Synchronize view toolbar, which is very fragile. The desired model is now enabled via team API once for each test class. With this, 2 tests no longer need to be ignored and all tests succeed reliably on my machine. Bug: 371633 Change-Id: I9270868e7ce8a599b7c42f3b9b7b3df37eff2c93 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2012-12-08[sync] Update tracking branch when pushingRobin Stocker2-2/+90
Pushing a branch to a remote for which there is a tracking branch should update the tracking branch. This was not the case when using the "Push" action in the Synchronize view. The solution involves two parts. First, PushOperation did not consider fetch refspecs while calculating RemoteRefUpdates. Changing that caused the RemoteRefUpdates to correctly include a TrackingRefUpdate. Second, PushOperationUI used to take the passed RemoteRefUpdates and then create RefSpecs for passing to the PushCommand. In this conversion, tracking ref updates are lost. By using the transport API we can directly pass the RemoteRefUpdates. Another solution would have been to pass the remote name to the PushCommand instead of a bare URIsh, but that would have involved changing PushOperationSpecification (which only uses URIish). Bug: 317411 Change-Id: I0e43f8b4e0b525a5cf35de9fdc135e2e539d03b6
2012-12-05[sync] Fix usage of activeShell() in testsRobin Stocker1-5/+4
With these changes, the tests now run successfully on my machine. Change-Id: Iea292482973d21e8a276126cdc992c55c64c924d
2012-11-04Suppress discouraged access warnings in testsRobin Stocker1-0/+1
There's not much we can do about them there. Change-Id: I6ffb05d1629974b8d8bf64dfff4b2505d519210f
2012-08-17Speed up building of the sync cache using dircacheiteratorRobin Rosenberg1-0/+6
By using the dircache we can usually avoid actually reading the file most of the time. The most obvious effect is the amount of time it takes before the git decorations appear. It also affects the synchronization view. JGit-Change-Id: Iff768422cba140a5d6a776e2c627b852f079c1da Change-Id: Ia80d62607cc808fcb857316713045b9a9fec6914 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2012-05-21Use JGit ResetCommandKevin Sawicki1-1/+1
This replaces the local EGit reset command logic with calls to the JGit ResetCommand class. Change-Id: Ie91f999eca66de2a773f6143d758364f2e0e96fc Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
2012-04-03Close Synchronize View after each synchronize testMatthias Sohn1-4/+9
We frequently observe failing synchronize tests timing out when looking for some widget, typically re-running the failed test separately without repeating all the tests in the test suite succeeds. Closing the synchronize view between tests seems to reduce the chance of interferences between synchronize tests when they are all run in one test run. Change-Id: I107b6d06b307d238195f1a6f429bca7fd075a010 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>

Back to the top