From ef86bdea135ee4bc3457a1ed34426841562b7ec4 Mon Sep 17 00:00:00 2001 From: Steffen Pingel Date: Mon, 7 Oct 2013 21:52:45 -0700 Subject: 326119: fix failing repository settings page test for Bugzilla Change-Id: Ie1651b8e82d3fe2ee59e93537170d16533c86ed9 Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=326119 --- .../tests/ui/BugzillaRepositorySettingsPageTest.java | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/ui/BugzillaRepositorySettingsPageTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/ui/BugzillaRepositorySettingsPageTest.java index 3af709b9a..484219efd 100644 --- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/ui/BugzillaRepositorySettingsPageTest.java +++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/ui/BugzillaRepositorySettingsPageTest.java @@ -165,7 +165,7 @@ public class BugzillaRepositorySettingsPageTest extends TestCase { assertEquals(tempPass, repositoryTest.getPassword()); } - public void testPersistChangeUserId() throws Exception { + public void testValidateOnFinishInvalidUserId() throws Exception { assertEquals(1, manager.getAllRepositories().size()); EditRepositoryWizard wizard = new EditRepositoryWizard(repository); WizardDialog dialog = new WizardDialog(PlatformUI.getWorkbench().getDisplay().getActiveShell(), wizard); @@ -174,24 +174,14 @@ public class BugzillaRepositorySettingsPageTest extends TestCase { BugzillaClient client = createClient(page.getRepositoryUrl(), page.getUserName(), page.getPassword(), page.getHttpAuthUserId(), page.getHttpAuthPassword(), page.getCharacterEncoding()); client.validate(null); + String oldUserId = page.getUserName(); page.setUserId("bogus"); - wizard.performFinish(); + boolean finished = wizard.performFinish(); + assertFalse(finished); assertEquals(1, manager.getAllRepositories().size()); TaskRepository repositoryTest = manager.getRepository(BugzillaCorePlugin.CONNECTOR_KIND, BugzillaFixture.current().getRepositoryUrl()); - assertNotNull(repositoryTest); - wizard = new EditRepositoryWizard(repositoryTest); - dialog = new WizardDialog(PlatformUI.getWorkbench().getDisplay().getActiveShell(), wizard); - dialog.create(); - page = (BugzillaRepositorySettingsPage) wizard.getSettingsPage(); - try { - client = createClient(page.getRepositoryUrl(), page.getUserName(), page.getPassword(), - page.getHttpAuthUserId(), page.getHttpAuthPassword(), page.getCharacterEncoding()); - client.validate(null); - } catch (CoreException e) { - return; - } - fail("LoginException didn't occur!"); + assertEquals(oldUserId, repositoryTest.getCredentials(AuthenticationType.REPOSITORY).getUserName()); } } -- cgit v1.2.3