diff options
author | Dariusz Luksza | 2011-03-14 00:27:05 +0000 |
---|---|---|
committer | Dariusz Luksza | 2011-03-14 00:27:05 +0000 |
commit | 6c5e2ea0ec6ac72c38b6a2a0529ece510d571dde (patch) | |
tree | c78f6a776a4bdaffd77aaa161aaffdf191354df5 /org.eclipse.egit.ui.test/src/org/eclipse/egit | |
parent | 82f705cb86a9249cd377ba8354b6b61f2f5c11c0 (diff) | |
download | egit-6c5e2ea0ec6ac72c38b6a2a0529ece510d571dde.tar.gz egit-6c5e2ea0ec6ac72c38b6a2a0529ece510d571dde.tar.xz egit-6c5e2ea0ec6ac72c38b6a2a0529ece510d571dde.zip |
[sync] Don't show ignored files in Workspace model
It appears that after performance improvements in synchronize view
ignored files was shown in Workspace model.
This change adds also an test case for checking that ignored files
doesn't show in Git Change Set and Workspace models.
Bug: 322454
Change-Id: Iecd37a15ddf5eb04303f4daa6d6016112b9eea43
Signed-off-by: Dariusz Luksza <dariusz@luksza.org>
Diffstat (limited to 'org.eclipse.egit.ui.test/src/org/eclipse/egit')
-rw-r--r-- | org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/synchronize/SynchronizeViewTest.java | 45 |
1 files changed, 43 insertions, 2 deletions
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/synchronize/SynchronizeViewTest.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/synchronize/SynchronizeViewTest.java index bf84872f3c..5024e997a8 100644 --- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/synchronize/SynchronizeViewTest.java +++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/synchronize/SynchronizeViewTest.java @@ -31,6 +31,7 @@ import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IFolder; import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IProjectDescription; +import org.eclipse.core.resources.IResource; import org.eclipse.core.resources.ResourcesPlugin; import org.eclipse.core.runtime.NullProgressMonitor; import org.eclipse.core.runtime.Path; @@ -287,6 +288,45 @@ public class SynchronizeViewTest extends LocalRepositoryTestCase { assertThat(outgoingRight, equalTo(incomingLeft)); } + @Test public void shouldNotShowIgnoredFilesInGitChangeSetModel() + throws Exception { + // given + resetRepositoryToCreateInitialTag(); + String ignoredName = "to-be-ignored.txt"; + + IProject proj = ResourcesPlugin.getWorkspace().getRoot() + .getProject(PROJ1); + + IFile ignoredFile = proj.getFile(ignoredName); + ignoredFile.create(new ByteArrayInputStream("content of ignored file" + .getBytes(proj.getDefaultCharset())), false, null); + + IFile gitignore = proj.getFile(".gitignore"); + gitignore.create( + new ByteArrayInputStream(ignoredName.getBytes(proj + .getDefaultCharset())), false, null); + proj.refreshLocal(IResource.DEPTH_INFINITE, null); + + // when + launchSynchronization(SynchronizeWithAction_tagsName, INITIAL_TAG, + SynchronizeWithAction_localRepoName, HEAD, true); + + // then + // asserts for Git Change Set model + SWTBotTree syncViewTree = bot.viewByTitle("Synchronize").bot().tree(); + syncViewTree.expandNode(UIText.GitModelWorkingTree_workingTree); + assertEquals(1, syncViewTree.getAllItems().length); + SWTBotTreeItem proj1Node = syncViewTree.getAllItems()[0]; + proj1Node.getItems()[0].expand(); + assertEquals(1, proj1Node.getItems()[0].getItems().length); + + // asserts for Workspace model + syncViewTree = setPresentationModel("Workspace").tree(); + SWTBotTreeItem projectTree = waitForNodeWithText(syncViewTree, PROJ1); + projectTree.expand(); + assertEquals(1, projectTree.getItems().length); + } + // this test always fails with cause: // Timeout after: 5000 ms.: Could not find context menu with text: // Synchronize @@ -332,6 +372,7 @@ public class SynchronizeViewTest extends LocalRepositoryTestCase { SWTBotRadio syncPerspectiveCheck = bot.radio("Never"); if (!syncPerspectiveCheck.isSelected()) syncPerspectiveCheck.click(); + bot.comboBox(0).setSelection("None"); bot.comboBox().setSelection("None"); @@ -463,10 +504,10 @@ public class SynchronizeViewTest extends LocalRepositoryTestCase { UIText.SelectSynchronizeResourceDialog_includeUncommitedChanges) .click(); - if (srcRepo != null) + if (!includeLocal && srcRepo != null) bot.comboBox(0) .setSelection(srcRepo); - if (srcRef != null) + if (!includeLocal && srcRef != null) bot.comboBox(1).setSelection(srcRef); if (dstRepo != null) |