Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrank Becker2013-10-18 17:45:29 +0000
committerSteffen Pingel2013-10-23 20:55:49 +0000
commitd0f959c177635edd9c5c4805c7b3d4ace3b400f7 (patch)
tree95e00a96d7b60f4a13d40b6a34000474bdffc718 /org.eclipse.mylyn.bugzilla.tests
parent83f1a9c1db69b251c68a40a81eac2cc5dd1f8bc4 (diff)
downloadorg.eclipse.mylyn.tasks-d0f959c177635edd9c5c4805c7b3d4ace3b400f7.tar.gz
org.eclipse.mylyn.tasks-d0f959c177635edd9c5c4805c7b3d4ace3b400f7.tar.xz
org.eclipse.mylyn.tasks-d0f959c177635edd9c5c4805c7b3d4ace3b400f7.zip
419869: Bugzilla Version update 4.5.1, 4.4.1, 4.2.7, and 4.0.11
Change-Id: I40bdc470325accc55908566f9a1573fbe6d6fabc Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=419869
Diffstat (limited to 'org.eclipse.mylyn.bugzilla.tests')
-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/BugzillaUtilTest.java38
2 files changed, 40 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 23ab85a31..892e04fc0 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
@@ -26,6 +26,7 @@ import org.eclipse.mylyn.bugzilla.tests.core.BugzillaFlagsTest;
import org.eclipse.mylyn.bugzilla.tests.core.BugzillaRepositoryConnectorConfigurationTest;
import org.eclipse.mylyn.bugzilla.tests.core.BugzillaRepositoryConnectorStandaloneTest;
import org.eclipse.mylyn.bugzilla.tests.core.BugzillaTaskCompletionTest;
+import org.eclipse.mylyn.bugzilla.tests.core.BugzillaUtilTest;
import org.eclipse.mylyn.bugzilla.tests.core.BugzillaVersionTest;
import org.eclipse.mylyn.bugzilla.tests.core.RepositoryConfigurationTest;
import org.eclipse.mylyn.bugzilla.tests.support.BugzillaFixture;
@@ -74,6 +75,7 @@ public class AllBugzillaHeadlessStandaloneTests {
fixture.add(BugzillaRepositoryConnectorStandaloneTest.class);
fixture.add(BugzillaRepositoryConnectorConfigurationTest.class);
fixture.add(BugzillaClientTest.class);
+ fixture.add(BugzillaUtilTest.class);
// Only run these tests on > 3.2 repositories
if (!fixture.getBugzillaVersion().isSmallerOrEquals(BugzillaVersion.BUGZILLA_3_2)) {
diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaUtilTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaUtilTest.java
new file mode 100644
index 000000000..44f4f809d
--- /dev/null
+++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaUtilTest.java
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * Copyright (c) 2013 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.tests.core;
+
+import junit.framework.TestCase;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.mylyn.internal.bugzilla.core.BugzillaUtil;
+import org.junit.Test;
+
+public class BugzillaUtilTest extends TestCase {
+
+ @Test
+ public void testValidTimezoneRemove() throws CoreException {
+ assertEquals("2013-10-21 18:50:29", BugzillaUtil.removeTimezone("2013-10-21 18:50:29 +0000"));
+ assertEquals("2013-10-21 18:50:29", BugzillaUtil.removeTimezone("2013-10-21 18:50:29 CEST"));
+ assertEquals("2013-10-21 18:50:29", BugzillaUtil.removeTimezone("2013-10-21 18:50:29 GMT+02:00"));
+ }
+
+ @Test
+ public void testInvalidTimezoneRemove() {
+ try {
+ BugzillaUtil.removeTimezone("2013-10-21T18:50:29");
+ fail("Expected CoreException");
+ } catch (CoreException e) {
+ assertEquals("2013-10-21T18:50:29 is not a valid time", e.getMessage());
+ }
+ }
+}

Back to the top