summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteffen Pingel2013-07-05 13:24:33 (EDT)
committer Steffen Pingel2013-07-12 04:54:44 (EDT)
commitaed46f10dc9d5f0b55c6872404b8ecf4cb02b1be (patch)
tree04d5dbd2f7400b0b755f9035bd8690d8f50a601a
parentbf84d4172d0336587513377471bb12a86eb9966e (diff)
downloadorg.eclipse.mylyn.tasks-aed46f10dc9d5f0b55c6872404b8ecf4cb02b1be.zip
org.eclipse.mylyn.tasks-aed46f10dc9d5f0b55c6872404b8ecf4cb02b1be.tar.gz
org.eclipse.mylyn.tasks-aed46f10dc9d5f0b55c6872404b8ecf4cb02b1be.tar.bz2
386764: return null instead of throwing exception for getTaskData()refs/changes/25/14325/4
Change-Id: Iad409821c9fd799e704b831f8006a136724cf144 Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=386764 Also-By: Frank Becker <frank@frank-becker.de>
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/AllBugzillaTests.java5
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TaskInitializationData.java44
-rw-r--r--org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/core/TaskInitializationDataTest.java64
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/AllTracTests.java4
4 files changed, 42 insertions, 75 deletions
diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/AllBugzillaTests.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/AllBugzillaTests.java
index fa47376..1f26f87 100644
--- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/AllBugzillaTests.java
+++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/AllBugzillaTests.java
@@ -24,6 +24,7 @@ import org.eclipse.mylyn.bugzilla.tests.ui.BugzillaRepositorySettingsPageTest;
import org.eclipse.mylyn.bugzilla.tests.ui.BugzillaSearchPageTest;
import org.eclipse.mylyn.bugzilla.tests.ui.BugzillaTaskEditorTest;
import org.eclipse.mylyn.bugzilla.tests.ui.BugzillaTaskHyperlinkDetectorTest;
+import org.eclipse.mylyn.commons.sdk.util.CommonTestUtil;
import org.eclipse.mylyn.commons.sdk.util.ManagedTestSuite;
import org.eclipse.mylyn.commons.sdk.util.TestConfiguration;
@@ -35,6 +36,10 @@ import org.eclipse.mylyn.commons.sdk.util.TestConfiguration;
public class AllBugzillaTests {
public static Test suite() {
+ if (CommonTestUtil.fixProxyConfiguration()) {
+ CommonTestUtil.dumpSystemInfo(System.err);
+ }
+
TestSuite suite = new ManagedTestSuite(AllBugzillaTests.class.getName());
addTests(suite, TestConfiguration.getDefault());
return suite;
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TaskInitializationData.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TaskInitializationData.java
index 6f8e4ea..39c3f1f 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TaskInitializationData.java
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TaskInitializationData.java
@@ -7,6 +7,7 @@
*
* Contributors:
* Tasktop Technologies - initial API and implementation
+ * Frank Becker - improvements
*******************************************************************************/
package org.eclipse.mylyn.tasks.core;
@@ -42,19 +43,19 @@ public class TaskInitializationData implements ITaskMapping {
}
/**
- * Throws {@link UnsupportedOperationException}.
+ * Returns <code>null</code>.
*/
@Nullable
public List<String> getCc() {
- throw new UnsupportedOperationException();
+ return null;
}
/**
- * Throws {@link UnsupportedOperationException}.
+ * Returns <code>null</code>.
*/
@Nullable
public Date getCompletionDate() {
- throw new UnsupportedOperationException();
+ return null;
}
@Nullable
@@ -63,11 +64,11 @@ public class TaskInitializationData implements ITaskMapping {
}
/**
- * Throws {@link UnsupportedOperationException}.
+ * Returns <code>null</code>.
*/
@Nullable
public Date getCreationDate() {
- throw new UnsupportedOperationException();
+ return null;
}
@Nullable
@@ -76,35 +77,36 @@ public class TaskInitializationData implements ITaskMapping {
}
/**
- * Throws {@link UnsupportedOperationException}.
+ * Returns <code>null</code>.
*/
@Nullable
public Date getDueDate() {
- throw new UnsupportedOperationException();
+ return null;
}
/**
- * Throws {@link UnsupportedOperationException}.
+ * Returns <code>null</code>.
*/
@Nullable
public List<String> getKeywords() {
- throw new UnsupportedOperationException();
+ return null;
}
/**
- * Throws {@link UnsupportedOperationException}.
+ * Returns <code>null</code>.
*/
@Nullable
public Date getModificationDate() {
- throw new UnsupportedOperationException();
+ return null;
}
/**
- * Throws {@link UnsupportedOperationException}.
+ * Returns <code>null</code>.
*/
@Nullable
public String getOwner() {
- throw new UnsupportedOperationException();
+ return null;
+
}
@Nullable
@@ -113,11 +115,11 @@ public class TaskInitializationData implements ITaskMapping {
}
/**
- * Throws {@link UnsupportedOperationException}.
+ * Returns <code>null</code>.
*/
@Nullable
public PriorityLevel getPriorityLevel() {
- throw new UnsupportedOperationException();
+ return null;
}
@Nullable
@@ -151,11 +153,11 @@ public class TaskInitializationData implements ITaskMapping {
}
/**
- * Throws {@link UnsupportedOperationException}.
+ * Returns <code>null</code>.
*/
@Nullable
public TaskData getTaskData() {
- throw new UnsupportedOperationException();
+ return null;
}
@Nullable
@@ -169,11 +171,11 @@ public class TaskInitializationData implements ITaskMapping {
}
/**
- * Does not map to a common attribute and hence throws {@link UnsupportedOperationException}.
+ * Does not map to a common attribute and hence Returns <code>null</code>.
*/
@Nullable
public String getTaskStatus() {
- throw new UnsupportedOperationException();
+ return null;
}
@Nullable
@@ -246,4 +248,4 @@ public class TaskInitializationData implements ITaskMapping {
attributesById.setAttribute(TaskAttribute.VERSION, version);
}
-}
+} \ No newline at end of file
diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/core/TaskInitializationDataTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/core/TaskInitializationDataTest.java
index 3da37a2..1fbe25c 100644
--- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/core/TaskInitializationDataTest.java
+++ b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/core/TaskInitializationDataTest.java
@@ -7,6 +7,7 @@
*
* Contributors:
* Tasktop Technologies - initial API and implementation
+ * Frank Becker - improvements
*******************************************************************************/
package org.eclipse.mylyn.tasks.tests.core;
@@ -35,60 +36,15 @@ public class TaskInitializationDataTest extends TestCase {
} catch (UnsupportedOperationException e) {
// expected
}
- try {
- data.getTaskStatus();
- fail("Should not be supported");
- } catch (UnsupportedOperationException e) {
- // expected
- }
- try {
- data.getTaskData();
- fail("Should not be supported");
- } catch (UnsupportedOperationException e) {
- // expected
- }
- try {
- data.getPriorityLevel();
- fail("Should not be supported");
- } catch (UnsupportedOperationException e) {
- // expected
- }
- try {
- data.getModificationDate();
- fail("Should not be supported");
- } catch (UnsupportedOperationException e) {
- // expected
- }
- try {
- data.getKeywords();
- fail("Should not be supported");
- } catch (UnsupportedOperationException e) {
- // expected
- }
- try {
- data.getDueDate();
- fail("Should not be supported");
- } catch (UnsupportedOperationException e) {
- // expected
- }
- try {
- data.getCreationDate();
- fail("Should not be supported");
- } catch (UnsupportedOperationException e) {
- // expected
- }
- try {
- data.getCompletionDate();
- fail("Should not be supported");
- } catch (UnsupportedOperationException e) {
- // expected
- }
- try {
- data.getCc();
- fail("Should not be supported");
- } catch (UnsupportedOperationException e) {
- // expected
- }
+ assertNull(data.getTaskStatus());
+ assertNull(data.getTaskData());
+ assertNull(data.getPriorityLevel());
+ assertNull(data.getModificationDate());
+ assertNull(data.getKeywords());
+ assertNull(data.getDueDate());
+ assertNull(data.getCreationDate());
+ assertNull(data.getCompletionDate());
+ assertNull(data.getCc());
}
public void testTaskKind() throws Exception {
diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/AllTracTests.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/AllTracTests.java
index 62f7bd5..b02b34a 100644
--- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/AllTracTests.java
+++ b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/AllTracTests.java
@@ -40,6 +40,10 @@ import org.eclipse.mylyn.trac.tests.ui.TracRepositorySettingsPageTest;
public class AllTracTests {
public static Test suite() {
+ if (CommonTestUtil.fixProxyConfiguration()) {
+ CommonTestUtil.dumpSystemInfo(System.err);
+ }
+
TestSuite suite = new ManagedTestSuite(AllTracTests.class.getName());
addTests(suite, TestConfiguration.getDefault());
return suite;