Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJaxsun McCarthy Huggan2016-03-31 13:42:31 -0400
committerJaxsun McCarthy Huggan2016-03-31 14:27:21 -0400
commit01e7acc03a53809081fa23e4e3255ff5eb920582 (patch)
tree8fae061ac47eb461d6c4d5d7c760fc82d2b0481e /org.eclipse.mylyn.tasks.ui.tests
parentf76a87b4d57bc7f4cbc17fba249ac1040b7ba18c (diff)
downloadorg.eclipse.mylyn.tasks-01e7acc03a53809081fa23e4e3255ff5eb920582.tar.gz
org.eclipse.mylyn.tasks-01e7acc03a53809081fa23e4e3255ff5eb920582.tar.xz
org.eclipse.mylyn.tasks-01e7acc03a53809081fa23e4e3255ff5eb920582.zip
490820: always set password field echo character if possible
Change-Id: Idac6aec404f7dfaeec89935e4f13cc0b56990940 Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=490820 Signed-off-by: Jaxsun McCarthy Huggan <jaxsun.mccarthy@tasktop.com>
Diffstat (limited to 'org.eclipse.mylyn.tasks.ui.tests')
-rw-r--r--org.eclipse.mylyn.tasks.ui.tests/src/org/eclipse/mylyn/tasks/ui/wizards/RepositorySettingsPageTest.java14
1 files changed, 14 insertions, 0 deletions
diff --git a/org.eclipse.mylyn.tasks.ui.tests/src/org/eclipse/mylyn/tasks/ui/wizards/RepositorySettingsPageTest.java b/org.eclipse.mylyn.tasks.ui.tests/src/org/eclipse/mylyn/tasks/ui/wizards/RepositorySettingsPageTest.java
index 82880e2af..6c35ee5fa 100644
--- a/org.eclipse.mylyn.tasks.ui.tests/src/org/eclipse/mylyn/tasks/ui/wizards/RepositorySettingsPageTest.java
+++ b/org.eclipse.mylyn.tasks.ui.tests/src/org/eclipse/mylyn/tasks/ui/wizards/RepositorySettingsPageTest.java
@@ -25,6 +25,7 @@ import static org.mockito.Mockito.when;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.preference.StringFieldEditor;
import org.eclipse.jface.wizard.IWizard;
import org.eclipse.jface.wizard.IWizardContainer;
import org.eclipse.mylyn.internal.tasks.core.ITasksCoreConstants;
@@ -225,6 +226,7 @@ public class RepositorySettingsPageTest {
assertTrue(page.needsRepositoryCredentials());
assertCredentialsEnabled(page);
+ assertPasswordIsSecret(page);
}
@Test
@@ -233,10 +235,12 @@ public class RepositorySettingsPageTest {
page.setNeedsRepositoryCredentials(true);
page.createControl(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell());
assertCredentialsEnabled(page);
+ assertPasswordIsSecret(page);
page.setNeedsRepositoryCredentials(false);
assertCredentialsDisabled(page);
+ assertPasswordIsSecret(page);
}
@Test
@@ -246,9 +250,11 @@ public class RepositorySettingsPageTest {
page.createControl(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell());
page.setNeedsRepositoryCredentials(false);
assertCredentialsDisabled(page);
+ assertPasswordIsSecret(page);
page.setNeedsRepositoryCredentials(true);
assertCredentialsEnabled(page);
+ assertPasswordIsSecret(page);
}
@Test
@@ -261,15 +267,18 @@ public class RepositorySettingsPageTest {
assertTrue(page.needsRepositoryCredentials());
assertTrue(page.isAnonymousAccess());
assertCredentialsDisabled(page);
+ assertPasswordIsSecret(page);
page.setAnonymous(false);
page.setNeedsRepositoryCredentials(false);
assertCredentialsDisabled(page);
+ assertPasswordIsSecret(page);
page.setNeedsRepositoryCredentials(true);
assertCredentialsEnabled(page);
+ assertPasswordIsSecret(page);
}
@Test
@@ -312,4 +321,9 @@ public class RepositorySettingsPageTest {
assertFalse(page.repositoryUserNameEditor.getTextControl(page.compositeContainer).isEnabled());
assertFalse(page.repositoryPasswordEditor.getTextControl(page.compositeContainer).isEnabled());
}
+
+ private void assertPasswordIsSecret(TestRepositorySettingsPage page) {
+ StringFieldEditor passwordEditor = page.repositoryPasswordEditor;
+ assertEquals('*', passwordEditor.getTextControl(page.compositeContainer).getEchoChar());
+ }
}

Back to the top