Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.mylyn.tasks.tests')
-rw-r--r--org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/RepositorySettingsPageTest.java31
1 files changed, 31 insertions, 0 deletions
diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/RepositorySettingsPageTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/RepositorySettingsPageTest.java
index efaba798c..815eca7c8 100644
--- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/RepositorySettingsPageTest.java
+++ b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/RepositorySettingsPageTest.java
@@ -236,6 +236,37 @@ public class RepositorySettingsPageTest extends TestCase {
assertSame(page.getConnector(), connector);
}
+ public void testNeedsRepositoryCredentialsDefaultsToTrue() {
+ TaskRepository repository = new TaskRepository(MockRepositoryConnector.CONNECTOR_KIND, "http://localhost/");
+ MockRepositorySettingsPage page = new MockRepositorySettingsPage(repository);
+ assertTrue(page.needsRepositoryCredentials());
+ }
+
+ public void testNeedsRepositoryCredentialsCanBeSetToFalse() {
+ TaskRepository repository = new TaskRepository(MockRepositoryConnector.CONNECTOR_KIND, "http://localhost/");
+ MockRepositorySettingsPage page = new MockRepositorySettingsPage(repository);
+ page.setNeedsRepositoryCredentials(false);
+ assertFalse(page.needsRepositoryCredentials());
+ }
+
+ public void testNeedsRepositoryCredentialsPageCompletesWithoutCredentials() {
+ TaskRepository repository = new TaskRepository(MockRepositoryConnector.CONNECTOR_KIND, "http://localhost/");
+ MockRepositorySettingsPage page = new MockRepositorySettingsPage(repository);
+ page.setNeedsRepositoryCredentials(false);
+
+ try {
+ Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
+ page.createControl(shell);
+ page.setUrl("http://example.com");
+ assertTrue(page.isPageComplete());
+ assertNull(page.getMessage());
+ assertNotNull(page.createTaskRepository());
+ } finally {
+ page.dispose();
+ }
+
+ }
+
private class MockRepositorySettingsPage extends AbstractRepositorySettingsPage {
public MockRepositorySettingsPage(TaskRepository taskRepository) {

Back to the top