Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSam Davis2016-06-17 12:54:20 -0400
committerGerrit Code Review @ Eclipse.org2016-06-20 13:23:54 -0400
commita2896831fb1b1f804e2d412c78b697230860137e (patch)
treedf9fb8067add50536fd56d3167078405fe30ecee
parent7b6c8404b6eaa24858337cf04ba4d05aa0f4cb3b (diff)
downloadorg.eclipse.mylyn.tasks-a2896831fb1b1f804e2d412c78b697230860137e.tar.gz
org.eclipse.mylyn.tasks-a2896831fb1b1f804e2d412c78b697230860137e.tar.xz
org.eclipse.mylyn.tasks-a2896831fb1b1f804e2d412c78b697230860137e.zip
reduce log noise from org.eclipse.mylyn.tasks.tests
This bundle has tests of exception handling that cause log messages at startup. This change makes those log messages much shorter and makes it more obvious what they are. Change-Id: I3bce9b55c76f09ae05ed28018ddaf83062aac918
-rw-r--r--org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TestException.java24
-rw-r--r--org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/support/MockRepositoryConnectorAdapter.java8
2 files changed, 28 insertions, 4 deletions
diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TestException.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TestException.java
new file mode 100644
index 000000000..bc291ed7a
--- /dev/null
+++ b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TestException.java
@@ -0,0 +1,24 @@
+/*******************************************************************************
+ * Copyright (c) 2016 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.tasks.tests;
+
+/**
+ * An exception for testing handing of RuntimeExceptions. Has no stack trace to reduce the size of log messages.
+ */
+public class TestException extends RuntimeException {
+ private static final long serialVersionUID = 1L;
+
+ public TestException() {
+ super("Test of exception handling");
+ setStackTrace(new StackTraceElement[] {});
+ }
+} \ No newline at end of file
diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/support/MockRepositoryConnectorAdapter.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/support/MockRepositoryConnectorAdapter.java
index 37f815726..ae02073c1 100644
--- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/support/MockRepositoryConnectorAdapter.java
+++ b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/support/MockRepositoryConnectorAdapter.java
@@ -20,6 +20,7 @@ import org.eclipse.core.runtime.IAdapterFactory;
import org.eclipse.mylyn.commons.sdk.util.CommonTestUtil;
import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector;
import org.eclipse.mylyn.tasks.core.spi.RepositoryConnectorBranding;
+import org.eclipse.mylyn.tasks.tests.TestException;
import org.eclipse.mylyn.tasks.tests.connector.MockRepositoryConnector;
import org.eclipse.mylyn.tasks.tests.connector.MockRepositoryConnectorUi;
import org.eclipse.mylyn.tasks.ui.AbstractRepositoryConnectorUi;
@@ -27,7 +28,6 @@ import org.eclipse.mylyn.tasks.ui.AbstractRepositoryConnectorUi;
import com.google.common.collect.ImmutableList;
public class MockRepositoryConnectorAdapter implements IAdapterFactory {
-
public final static class DynamicMockRepositoryConnectorUi extends MockRepositoryConnectorUi {
private final AbstractRepositoryConnector connector;
@@ -65,8 +65,8 @@ public class MockRepositoryConnectorAdapter implements IAdapterFactory {
@Override
public List<String> getBrands() {
- ArrayList<String> brands = new ArrayList<String>(ImmutableList.of("org.mylyn", "org.eclipse",
- "exceptional"));
+ ArrayList<String> brands = new ArrayList<String>(
+ ImmutableList.of("org.mylyn", "org.eclipse", "exceptional"));
brands.add(1, null);
return brands;
}
@@ -74,7 +74,7 @@ public class MockRepositoryConnectorAdapter implements IAdapterFactory {
@Override
public String getConnectorLabel(String brand) {
if ("exceptional".equals(brand)) {
- throw new NullPointerException();
+ throw new TestException();
} else if (getBrands().contains(brand)) {
return "Label for " + brand;
}

Back to the top