Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrank Becker2014-01-19 16:23:31 -0500
committerFrank Becker2014-02-12 15:48:21 -0500
commit73aca745728a52143df46137519f68e63889926c (patch)
tree98bc75eb5ef43498fb48e5270ac3bdcf178765d5 /connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.tests
parent36670c42232938eb07abff1bab488a4bcaa7a3f8 (diff)
downloadorg.eclipse.mylyn.tasks-73aca745728a52143df46137519f68e63889926c.tar.gz
org.eclipse.mylyn.tasks-73aca745728a52143df46137519f68e63889926c.tar.xz
org.eclipse.mylyn.tasks-73aca745728a52143df46137519f68e63889926c.zip
414360: add BugzillaRestRepositorySettingsPage to Rest Connector
Change-Id: I54d39dfbb2d85b189550215e8da234f2f56116dc Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=414360
Diffstat (limited to 'connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.tests')
-rw-r--r--connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.tests/META-INF/MANIFEST.MF12
-rw-r--r--connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.tests/src/org/eclipse/mylyn/bugzilla/rest/tests/tck/AbstractRepositoryConnectorTest.java39
-rw-r--r--connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.tests/src/org/eclipse/mylyn/bugzilla/rest/tests/tck/ui/AbstractRepositorySettingsPageTest.java57
3 files changed, 104 insertions, 4 deletions
diff --git a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.tests/META-INF/MANIFEST.MF b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.tests/META-INF/MANIFEST.MF
index 155b54d02..524afa81f 100644
--- a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.tests/META-INF/MANIFEST.MF
+++ b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.tests/META-INF/MANIFEST.MF
@@ -6,13 +6,17 @@ Bundle-Version: 1.0.0.qualifier
Bundle-Vendor: Eclipse Mylyn
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Require-Bundle: org.junit;bundle-version="4.8.2",
- org.eclipse.mylyn.commons.sdk.util;bundle-version="3.11.0",
- org.eclipse.mylyn.tasks.core;bundle-version="3.11.0",
org.eclipse.equinox.common,
- org.eclipse.mylyn.bugzilla.rest.core,
+ org.eclipse.jface,
+ org.eclipse.ui.workbench,
+ org.eclipse.mylyn.commons.sdk.util;bundle-version="3.11.0",
org.eclipse.mylyn.commons.net,
org.eclipse.mylyn.commons.repositories.core,
org.eclipse.mylyn.commons.core,
- org.eclipse.mylyn.commons.repositories.http.core;bundle-version="1.3.0"
+ org.eclipse.mylyn.commons.repositories.http.core;bundle-version="1.3.0",
+ org.eclipse.mylyn.tasks.ui,
+ org.eclipse.mylyn.tasks.core;bundle-version="3.11.0",
+ org.eclipse.mylyn.bugzilla.rest.core,
+ org.eclipse.mylyn.bugzilla.rest.ui
Export-Package: org.eclipse.mylyn.bugzilla.rest.tests;x-internal:=true,
org.eclipse.mylyn.bugzilla.rest.tests.tck;x-internal:=true
diff --git a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.tests/src/org/eclipse/mylyn/bugzilla/rest/tests/tck/AbstractRepositoryConnectorTest.java b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.tests/src/org/eclipse/mylyn/bugzilla/rest/tests/tck/AbstractRepositoryConnectorTest.java
new file mode 100644
index 000000000..ff5825ee5
--- /dev/null
+++ b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.tests/src/org/eclipse/mylyn/bugzilla/rest/tests/tck/AbstractRepositoryConnectorTest.java
@@ -0,0 +1,39 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Frank Becker and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Frank Becker - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.mylyn.bugzilla.rest.tests.tck;
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+
+import org.eclipse.mylyn.bugzilla.rest.tests.AbstractTckTest;
+import org.eclipse.mylyn.bugzilla.rest.tests.TckFixture;
+import org.eclipse.mylyn.commons.sdk.util.Junit4TestFixtureRunner.FixtureDefinition;
+import org.eclipse.mylyn.commons.sdk.util.Junit4TestFixtureRunner.RunOnlyWhenProperty;
+import org.eclipse.mylyn.tasks.core.TaskRepository;
+import org.junit.Test;
+
+@FixtureDefinition(fixtureClass = TckFixture.class, fixtureType = "bugzillaREST")
+@RunOnlyWhenProperty(property = "default", value = "1")
+public class AbstractRepositoryConnectorTest extends AbstractTckTest {
+
+ public AbstractRepositoryConnectorTest(TckFixture fixture) {
+ super(fixture);
+ }
+
+ @Test
+ public void testApplyDefaultCategory() throws Exception {
+ TaskRepository repository = fixture().repository();
+ assertNull("repository.getCategory() should be null", repository.getCategory());
+ fixture().connector().applyDefaultCategory(repository);
+ assertNotNull("repository.getCategory() should not be null", repository.getCategory());
+ }
+}
diff --git a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.tests/src/org/eclipse/mylyn/bugzilla/rest/tests/tck/ui/AbstractRepositorySettingsPageTest.java b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.tests/src/org/eclipse/mylyn/bugzilla/rest/tests/tck/ui/AbstractRepositorySettingsPageTest.java
new file mode 100644
index 000000000..d76e46f22
--- /dev/null
+++ b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.tests/src/org/eclipse/mylyn/bugzilla/rest/tests/tck/ui/AbstractRepositorySettingsPageTest.java
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Frank Becker and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Frank Becker - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.mylyn.bugzilla.rest.tests.tck.ui;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
+
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.mylyn.bugzilla.rest.tests.AbstractTckTest;
+import org.eclipse.mylyn.bugzilla.rest.tests.TckFixture;
+import org.eclipse.mylyn.commons.sdk.util.Junit4TestFixtureRunner.FixtureDefinition;
+import org.eclipse.mylyn.commons.sdk.util.Junit4TestFixtureRunner.RunOnlyWhenProperty;
+import org.eclipse.mylyn.internal.tasks.ui.wizards.EditRepositoryWizard;
+import org.eclipse.mylyn.tasks.core.TaskRepository;
+import org.eclipse.mylyn.tasks.ui.wizards.ITaskRepositoryPage;
+import org.eclipse.swt.widgets.Shell;
+import org.junit.After;
+import org.junit.Test;
+
+@FixtureDefinition(fixtureClass = TckFixture.class, fixtureType = "bugzillaREST")
+@RunOnlyWhenProperty(property = "default", value = "1")
+public class AbstractRepositorySettingsPageTest extends AbstractTckTest {
+ private WizardDialog dialog;
+
+ public AbstractRepositorySettingsPageTest(TckFixture fixture) {
+ super(fixture);
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ if (dialog != null) {
+ dialog.close();
+ }
+ }
+
+ @Test
+ public void testApplyTo() {
+ TaskRepository repository = fixture().repository();
+ EditRepositoryWizard wizard = new EditRepositoryWizard(repository);
+ dialog = new WizardDialog(new Shell(), wizard);
+ dialog.create();
+ ITaskRepositoryPage page = wizard.getSettingsPage();
+ assertNull("repository.getCategory() should be null", repository.getCategory());
+ page.applyTo(repository);
+ assertEquals(TaskRepository.CATEGORY_BUGS, repository.getCategory());
+ }
+
+}

Back to the top