Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorspingel2008-03-01 21:39:32 +0000
committerspingel2008-03-01 21:39:32 +0000
commit98c2cb986a8f23c187b19ace847aacb7e5071c16 (patch)
tree316ea6233aee61c9935f5ec7b592d92079fcdc2c /org.eclipse.mylyn.trac.tests/src/org/eclipse
parent37e447ac80a2b6d0856f40866cadb40618af4776 (diff)
downloadorg.eclipse.mylyn.tasks-98c2cb986a8f23c187b19ace847aacb7e5071c16.tar.gz
org.eclipse.mylyn.tasks-98c2cb986a8f23c187b19ace847aacb7e5071c16.tar.xz
org.eclipse.mylyn.tasks-98c2cb986a8f23c187b19ace847aacb7e5071c16.zip
NEW - bug 210040: activate automatic formating on Java editor savebug_210040_code_cleanup_after
https://bugs.eclipse.org/bugs/show_bug.cgi?id=210040
Diffstat (limited to 'org.eclipse.mylyn.trac.tests/src/org/eclipse')
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/internal/trac/ui/TracHyperlinkUtilTest.java4
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/AbstractTracClientSearchTest.java1
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/AbstractTracClientTest.java8
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/AllTracTests.java6
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/MockAttachment.java4
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracRepositoryConnectorTest.java6
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracTaskDataHandlerTest.java26
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracTaskTest.java4
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracTestConstants.java2
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/support/TracTestUtil.java2
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/support/XmlRpcServer.java22
11 files changed, 47 insertions, 38 deletions
diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/internal/trac/ui/TracHyperlinkUtilTest.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/internal/trac/ui/TracHyperlinkUtilTest.java
index 5fe952286..fec9256be 100644
--- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/internal/trac/ui/TracHyperlinkUtilTest.java
+++ b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/internal/trac/ui/TracHyperlinkUtilTest.java
@@ -121,8 +121,8 @@ public class TracHyperlinkUtilTest extends TestCase {
assertEquals(1, links.length);
assertEquals("http://localhost/changeset/?new=456&old=123", ((WebHyperlink) links[0]).getURLString());
- links = TracHyperlinkUtil.findTracHyperlinks(repository, "diff:trunk/trac@3538//sandbox/vc-refactoring/trac@3539",
- 0, 0);
+ links = TracHyperlinkUtil.findTracHyperlinks(repository,
+ "diff:trunk/trac@3538//sandbox/vc-refactoring/trac@3539", 0, 0);
assertNotNull(links);
assertEquals(1, links.length);
assertEquals(
diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/AbstractTracClientSearchTest.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/AbstractTracClientSearchTest.java
index 604fcba7c..365768f8d 100644
--- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/AbstractTracClientSearchTest.java
+++ b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/AbstractTracClientSearchTest.java
@@ -94,7 +94,6 @@ public abstract class AbstractTracClientSearchTest extends AbstractTracClientTes
assertTicketEquals(tickets.get(1), ticket);
}
-
public void testGetTicketInvalidId096() throws Exception {
if (version == Version.XML_RPC) {
return;
diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/AbstractTracClientTest.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/AbstractTracClientTest.java
index dba622997..99311dc21 100644
--- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/AbstractTracClientTest.java
+++ b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/AbstractTracClientTest.java
@@ -40,10 +40,10 @@ public abstract class AbstractTracClientTest extends TestCase {
public Version version;
- private PrivilegeLevel level;
+ private final PrivilegeLevel level;
final IProgressMonitor callback = new NullProgressMonitor();
-
+
public AbstractTracClientTest(Version version, PrivilegeLevel level) {
this.version = version;
this.level = level;
@@ -95,11 +95,11 @@ public abstract class AbstractTracClientTest extends TestCase {
this.repositoryUrl = url;
this.username = username;
this.password = password;
-
+
WebLocation location = new WebLocation(url, username, password, new IProxyProvider() {
public Proxy getProxyForHost(String host, String proxyType) {
return proxy;
- }
+ }
});
this.repository = TracClientFactory.createClient(location, version);
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 3d59ae227..f25af01c4 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
@@ -24,8 +24,10 @@ public class AllTracTests {
public static Test suite() {
// UrlConnectionUtil.initCommonsLoggingSettings();
- TracCorePlugin.getDefault().getConnector().setTaskRepositoryLocationFactory(new TaskRepositoryLocationFactory());
-
+ TracCorePlugin.getDefault()
+ .getConnector()
+ .setTaskRepositoryLocationFactory(new TaskRepositoryLocationFactory());
+
TestSuite suite = new TestSuite("Test for org.eclipse.mylyn.trac.tests");
// $JUnit-BEGIN$
// suite.addTestSuite(TracXmlRpcTest.class);
diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/MockAttachment.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/MockAttachment.java
index 373808843..be8081825 100644
--- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/MockAttachment.java
+++ b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/MockAttachment.java
@@ -16,12 +16,12 @@ import org.eclipse.mylyn.tasks.core.ITaskAttachment;
public class MockAttachment implements ITaskAttachment {
- private byte[] data;
+ private final byte[] data;
public MockAttachment(byte[] data) {
this.data = data;
}
-
+
public InputStream createInputStream() throws IOException {
return new ByteArrayInputStream(data);
}
diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracRepositoryConnectorTest.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracRepositoryConnectorTest.java
index d18f29a5c..4db36257e 100644
--- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracRepositoryConnectorTest.java
+++ b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracRepositoryConnectorTest.java
@@ -69,8 +69,10 @@ public class TracRepositoryConnectorTest extends TestCase {
protected void setUp() throws Exception {
super.setUp();
- TracCorePlugin.getDefault().getConnector().setTaskRepositoryLocationFactory(new TaskRepositoryLocationFactory());
-
+ TracCorePlugin.getDefault()
+ .getConnector()
+ .setTaskRepositoryLocationFactory(new TaskRepositoryLocationFactory());
+
manager = TasksUiPlugin.getRepositoryManager();
manager.clearRepositories(TasksUiPlugin.getDefault().getRepositoriesFilePath());
diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracTaskDataHandlerTest.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracTaskDataHandlerTest.java
index f814a2f73..05a93100b 100644
--- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracTaskDataHandlerTest.java
+++ b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracTaskDataHandlerTest.java
@@ -285,35 +285,40 @@ public class TracTaskDataHandlerTest extends TestCase {
assertFalse(taskDataHandler.canInitializeSubTaskData(task, null));
task.setSupportsSubtasks(true);
assertTrue(taskDataHandler.canInitializeSubTaskData(task, null));
-
- RepositoryTaskData taskData = taskDataHandler.getTaskData(repository, data.offlineHandlerTicketId + "", new NullProgressMonitor());
+
+ RepositoryTaskData taskData = taskDataHandler.getTaskData(repository, data.offlineHandlerTicketId + "",
+ new NullProgressMonitor());
assertFalse(taskDataHandler.canInitializeSubTaskData(null, taskData));
taskData.setAttributeValue(TracTaskDataHandler.ATTRIBUTE_BLOCKED_BY, "");
assertTrue(taskDataHandler.canInitializeSubTaskData(null, taskData));
-
+
task.setSupportsSubtasks(false);
connector.updateTaskFromTaskData(repository, task, taskData);
- assertTrue(taskDataHandler.canInitializeSubTaskData(task, null));
+ assertTrue(taskDataHandler.canInitializeSubTaskData(task, null));
}
public void testInitializeSubTaskData() throws Exception {
init(TracTestConstants.TEST_TRAC_010_URL, Version.XML_RPC);
- RepositoryTaskData parentTaskData = taskDataHandler.getTaskData(repository, data.offlineHandlerTicketId + "", new NullProgressMonitor());
+ RepositoryTaskData parentTaskData = taskDataHandler.getTaskData(repository, data.offlineHandlerTicketId + "",
+ new NullProgressMonitor());
try {
taskDataHandler.initializeSubTaskData(repository, parentTaskData, parentTaskData, new NullProgressMonitor());
fail("expected CoreException");
} catch (CoreException expected) {
}
-
+
parentTaskData.setSummary("abc");
parentTaskData.setDescription("def");
- String component = parentTaskData.getAttribute(TracAttributeFactory.Attribute.COMPONENT.getTracKey()).getOptions().get(0);
+ String component = parentTaskData.getAttribute(TracAttributeFactory.Attribute.COMPONENT.getTracKey())
+ .getOptions()
+ .get(0);
parentTaskData.setAttributeValue(TracAttributeFactory.Attribute.COMPONENT.getTracKey(), component);
parentTaskData.setAttributeValue(TracTaskDataHandler.ATTRIBUTE_BLOCKED_BY, "");
- RepositoryTaskData subTaskData = new RepositoryTaskData(parentTaskData.getAttributeFactory(), TracCorePlugin.REPOSITORY_KIND, "", "");
+ RepositoryTaskData subTaskData = new RepositoryTaskData(parentTaskData.getAttributeFactory(),
+ TracCorePlugin.REPOSITORY_KIND, "", "");
subTaskData.setAttributeValue(TracTaskDataHandler.ATTRIBUTE_BLOCKING, "");
- taskDataHandler.initializeSubTaskData(repository, subTaskData , parentTaskData, new NullProgressMonitor());
+ taskDataHandler.initializeSubTaskData(repository, subTaskData, parentTaskData, new NullProgressMonitor());
assertEquals("", subTaskData.getSummary());
assertEquals("", subTaskData.getDescription());
assertEquals(component, subTaskData.getAttributeValue(TracAttributeFactory.Attribute.COMPONENT.getTracKey()));
@@ -322,7 +327,8 @@ public class TracTaskDataHandlerTest extends TestCase {
}
public void testGetSubTaskIds() throws Exception {
- RepositoryTaskData taskData = new RepositoryTaskData(new TracAttributeFactory(), TracCorePlugin.REPOSITORY_KIND, "", "");
+ RepositoryTaskData taskData = new RepositoryTaskData(new TracAttributeFactory(),
+ TracCorePlugin.REPOSITORY_KIND, "", "");
taskData.setAttributeValue(TracTaskDataHandler.ATTRIBUTE_BLOCKED_BY, "123 456");
Set<String> subTaskIds = taskDataHandler.getSubTaskIds(taskData);
assertEquals(2, subTaskIds.size());
diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracTaskTest.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracTaskTest.java
index 67af18857..a822d28a0 100644
--- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracTaskTest.java
+++ b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracTaskTest.java
@@ -39,7 +39,7 @@ public class TracTaskTest extends TestCase {
assertEquals("P4", TracTask.getTaskPriority("minor"));
assertEquals("P5", TracTask.getTaskPriority("trivial"));
}
-
+
public void testGetTaskPriorityFromTracPriorities() {
TracPriority p1 = new TracPriority("a", 1);
TracPriority p2 = new TracPriority("b", 2);
@@ -69,7 +69,7 @@ public class TracTaskTest extends TestCase {
assertEquals("P2", TracTask.getTaskPriority("3", priorities));
assertEquals("P2", TracTask.getTaskPriority("4", priorities));
assertEquals("P4", TracTask.getTaskPriority("5", priorities));
- assertEquals("P5", TracTask.getTaskPriority("6", priorities));
+ assertEquals("P5", TracTask.getTaskPriority("6", priorities));
}
}
diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracTestConstants.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracTestConstants.java
index 293277558..9e24b244a 100644
--- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracTestConstants.java
+++ b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracTestConstants.java
@@ -14,7 +14,7 @@ package org.eclipse.mylyn.trac.tests;
public class TracTestConstants {
public static final String SERVER = System.getProperty("mylyn.trac.server", "mylyn.eclipse.org");
-
+
public static final String TEST_TRAC_096_URL = "http://" + SERVER + "/trac096";
public static final String TEST_TRAC_010_URL = "http://" + SERVER + "/trac010";
diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/support/TracTestUtil.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/support/TracTestUtil.java
index e647f4f27..93eccdba8 100644
--- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/support/TracTestUtil.java
+++ b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/support/TracTestUtil.java
@@ -24,5 +24,5 @@ public class TracTestUtil {
int id = client.createTicket(ticket);
return client.getTicket(id);
}
-
+
}
diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/support/XmlRpcServer.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/support/XmlRpcServer.java
index b3a10b151..80bf828c4 100644
--- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/support/XmlRpcServer.java
+++ b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/support/XmlRpcServer.java
@@ -47,11 +47,11 @@ public class XmlRpcServer {
*/
public class ModelEnum extends AbstractTracItem {
- private String[] attributes;
+ private final String[] attributes;
- private String id;
+ private final String id;
- private String module;
+ private final String module;
public ModelEnum(String module, String id, String... attributes) {
this.module = module;
@@ -218,9 +218,9 @@ public class XmlRpcServer {
*/
public class TicketEnum extends AbstractTracItem {
- private String id;
+ private final String id;
- private String module;
+ private final String module;
public TicketEnum(String module, String id) {
this.module = module;
@@ -269,17 +269,17 @@ public class XmlRpcServer {
}
- private XmlRpcClient client;
+ private final XmlRpcClient client;
- private TestData data;
+ private final TestData data;
- private String password;
+ private final String password;
- private TracXmlRpcClient repository;
+ private final TracXmlRpcClient repository;
- private String url;
+ private final String url;
- private String username;
+ private final String username;
public XmlRpcServer(String url, String username, String password) throws Exception {
this.url = url;

Back to the top