Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomasz Zarna2013-08-23 15:28:44 +0000
committerGerrit Code Review @ Eclipse.org2013-08-23 16:39:08 +0000
commiteca01884c8c6ecbaf2d3104d896cac846f0ef256 (patch)
treea64eec1fa9fa98ba6a21057bbcee64819efedf4b /org.eclipse.mylyn.bugzilla.tests/src
parente7fe0a9a130215f70da651ace0d21640d9a93e25 (diff)
downloadorg.eclipse.mylyn.tasks-eca01884c8c6ecbaf2d3104d896cac846f0ef256.tar.gz
org.eclipse.mylyn.tasks-eca01884c8c6ecbaf2d3104d896cac846f0ef256.tar.xz
org.eclipse.mylyn.tasks-eca01884c8c6ecbaf2d3104d896cac846f0ef256.zip
415263: NPE initializing Bugzilla 4.x task data with product absent from
local configuration -- tests Change-Id: I75b669a155b7e0f8536c93a3365807061d206fe5 Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=415263 Signed-off-by: Tomasz Zarna <tomasz.zarna@tasktop.com>
Diffstat (limited to 'org.eclipse.mylyn.bugzilla.tests/src')
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/AllBugzillaHeadlessStandaloneTests.java2
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/RepositoryConfigurationTest.java52
2 files changed, 54 insertions, 0 deletions
diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/AllBugzillaHeadlessStandaloneTests.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/AllBugzillaHeadlessStandaloneTests.java
index e581fa1c7..23ab85a31 100644
--- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/AllBugzillaHeadlessStandaloneTests.java
+++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/AllBugzillaHeadlessStandaloneTests.java
@@ -27,6 +27,7 @@ import org.eclipse.mylyn.bugzilla.tests.core.BugzillaRepositoryConnectorConfigur
import org.eclipse.mylyn.bugzilla.tests.core.BugzillaRepositoryConnectorStandaloneTest;
import org.eclipse.mylyn.bugzilla.tests.core.BugzillaTaskCompletionTest;
import org.eclipse.mylyn.bugzilla.tests.core.BugzillaVersionTest;
+import org.eclipse.mylyn.bugzilla.tests.core.RepositoryConfigurationTest;
import org.eclipse.mylyn.bugzilla.tests.support.BugzillaFixture;
import org.eclipse.mylyn.commons.sdk.util.TestConfiguration;
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaVersion;
@@ -49,6 +50,7 @@ public class AllBugzillaHeadlessStandaloneTests {
suite.addTestSuite(BugzillaDateTimeTests.class);
suite.addTestSuite(BugzillaAttributeMapperTest.class);
suite.addTestSuite(BugzillaAttributeTest.class);
+ suite.addTestSuite(RepositoryConfigurationTest.class);
if (!configuration.isLocalOnly()) {
// network tests
suite.addTestSuite(BugzillaTaskCompletionTest.class);
diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/RepositoryConfigurationTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/RepositoryConfigurationTest.java
new file mode 100644
index 000000000..f2404c129
--- /dev/null
+++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/RepositoryConfigurationTest.java
@@ -0,0 +1,52 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Tasktop Technologies 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:
+ * Tasktop Technologies - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.mylyn.bugzilla.tests.core;
+
+import junit.framework.TestCase;
+
+import org.eclipse.mylyn.internal.bugzilla.core.RepositoryConfiguration;
+
+public class RepositoryConfigurationTest extends TestCase {
+
+ private final static String PRODUCT = "product";
+
+ RepositoryConfiguration cfg;
+
+ @Override
+ protected void setUp() throws Exception {
+ cfg = new RepositoryConfiguration();
+ cfg.addProduct(PRODUCT);
+ }
+
+ public void testGetUnconfirmedAllowed_product() throws Exception {
+ assertFalse(cfg.getUnconfirmedAllowed(PRODUCT));
+ }
+
+ public void testGetUnconfirmedAllowed_productFalse() throws Exception {
+ cfg.addUnconfirmedAllowed(PRODUCT, Boolean.FALSE);
+ assertFalse(cfg.getUnconfirmedAllowed(PRODUCT));
+ }
+
+ public void testGetUnconfirmedAllowed_productNull() throws Exception {
+ cfg.addUnconfirmedAllowed(PRODUCT, null);
+ assertFalse(cfg.getUnconfirmedAllowed(PRODUCT));
+ }
+
+ public void testGetUnconfirmedAllowed_productTrue() throws Exception {
+ cfg.addUnconfirmedAllowed(PRODUCT, Boolean.TRUE);
+ assertTrue(cfg.getUnconfirmedAllowed(PRODUCT));
+ }
+
+ public void testGetUnconfirmedAllowed_noProduct() throws Exception {
+ assertFalse(cfg.getUnconfirmedAllowed("no-product"));
+ }
+}

Back to the top