Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorspingel2008-12-14 23:23:27 +0000
committerspingel2008-12-14 23:23:27 +0000
commit2ca93f6bb81f6652c6b98c70ece43a1e29d6a46e (patch)
tree1ec1a12b0626f4f2da71f61e484549a1143df373
parentc607df0938f18a286b1533bde2cfaa918f66bf75 (diff)
downloadorg.eclipse.mylyn.tasks-2ca93f6bb81f6652c6b98c70ece43a1e29d6a46e.tar.gz
org.eclipse.mylyn.tasks-2ca93f6bb81f6652c6b98c70ece43a1e29d6a46e.tar.xz
org.eclipse.mylyn.tasks-2ca93f6bb81f6652c6b98c70ece43a1e29d6a46e.zip
NEW - bug 257972: fix standalone tests
https://bugs.eclipse.org/bugs/show_bug.cgi?id=257972
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/TaskListStandaloneTest.java10
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/AllTracHeadlessStandaloneTests.java51
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/AllTracTests.java35
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/core/RepositorySearchTest.java (renamed from org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/RepositorySearchTest.java)2
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/core/TracAttachmentHandlerTest.java (renamed from org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracAttachmentHandlerTest.java)2
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/core/TracClientManagerTest.java (renamed from org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracClientManagerTest.java)2
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/core/TracRepositoryConnectorTest.java (renamed from org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracRepositoryConnectorTest.java)2
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/core/TracRepositoryQueryTest.java (renamed from org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracRepositoryQueryTest.java)2
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/core/TracTaskDataHandlerTest.java (renamed from org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracTaskDataHandlerTest.java)2
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/core/TracUtilTest.java (renamed from org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracUtilTest.java)2
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/ui/TracHyperlinkUtilTest.java (renamed from org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracHyperlinkUtilTest.java)2
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/ui/TracRepositorySettingsPageTest.java (renamed from org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracRepositorySettingsPageTest.java)2
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/ui/TracTaskEditorTest.java (renamed from org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracTaskEditorTest.java)2
13 files changed, 79 insertions, 37 deletions
diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/TaskListStandaloneTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/TaskListStandaloneTest.java
index 3c8356836..3ebcc0704 100644
--- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/TaskListStandaloneTest.java
+++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/TaskListStandaloneTest.java
@@ -98,10 +98,13 @@ public class TaskListStandaloneTest extends TestCase {
AbstractTask task = new LocalTask("1", "task 1");
TasksUiPlugin.getTaskList().addTask(task);
- assertDatesCloseEnough(task.getCreationDate(), start);
+ assertNull(task.getCreationDate());
+ task.setCreationDate(start);
+ assertEquals(start, task.getCreationDate());
task.setCompletionDate(creation);
- assertDatesCloseEnough(task.getCompletionDate(), start);
+ assertNull(task.getCompletionDate());
+ assertEquals(start, task.getCompletionDate());
assertEquals(1, TasksUiPlugin.getTaskList().getRootElements().size());
TasksUiPlugin.getExternalizationManager().requestSave();
@@ -186,7 +189,4 @@ public class TaskListStandaloneTest extends TestCase {
assertEquals(1, TasksUiPlugin.getTaskList().getQueries().size());
}
- public void assertDatesCloseEnough(Date first, Date second) {
- assertTrue(second.getTime() - first.getTime() < 100);
- }
}
diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/AllTracHeadlessStandaloneTests.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/AllTracHeadlessStandaloneTests.java
new file mode 100644
index 000000000..3db0f9d84
--- /dev/null
+++ b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/AllTracHeadlessStandaloneTests.java
@@ -0,0 +1,51 @@
+/*******************************************************************************
+ * Copyright (c) 2006, 2008 Steffen Pingel 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.trac.tests;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.eclipse.mylyn.internal.trac.ui.TracHyperlinkUtilStandaloneTest;
+import org.eclipse.mylyn.trac.tests.client.TracClientFactoryTest;
+import org.eclipse.mylyn.trac.tests.client.TracClientProxyTest;
+import org.eclipse.mylyn.trac.tests.client.TracSearchTest;
+import org.eclipse.mylyn.trac.tests.client.TracTicketTest;
+import org.eclipse.mylyn.trac.tests.client.TracWebClientSearchTest;
+import org.eclipse.mylyn.trac.tests.client.TracWebClientTest;
+import org.eclipse.mylyn.trac.tests.client.TracXmlRpcClientSearchTest;
+import org.eclipse.mylyn.trac.tests.client.TracXmlRpcClientTest;
+import org.eclipse.mylyn.trac.tests.core.TracClientManagerTest;
+
+/**
+ * @author Mik Kersten
+ * @author Steffen Pingel
+ */
+public class AllTracHeadlessStandaloneTests {
+
+ public static Test suite() {
+ TestSuite suite = new TestSuite("Headless Standalone Tests for org.eclipse.mylyn.trac.tests");
+ // other
+ suite.addTestSuite(TracClientManagerTest.class);
+ suite.addTestSuite(TracHyperlinkUtilStandaloneTest.class);
+ // client
+ suite.addTestSuite(TracSearchTest.class);
+ suite.addTestSuite(TracTicketTest.class);
+ suite.addTestSuite(TracXmlRpcClientTest.class);
+ suite.addTestSuite(TracXmlRpcClientSearchTest.class);
+ suite.addTestSuite(TracWebClientTest.class);
+ suite.addTestSuite(TracWebClientSearchTest.class);
+ suite.addTestSuite(TracClientFactoryTest.class);
+ suite.addTestSuite(TracClientProxyTest.class);
+ return suite;
+ }
+
+} \ No newline at end of file
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 e0e172c33..2c6941259 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
@@ -1,5 +1,5 @@
/*******************************************************************************
-* Copyright (c) 2006, 2008 Steffen Pingel and others.
+ * Copyright (c) 2006, 2008 Steffen Pingel 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
@@ -11,18 +11,19 @@
package org.eclipse.mylyn.trac.tests;
+import org.eclipse.mylyn.trac.tests.core.RepositorySearchTest;
+import org.eclipse.mylyn.trac.tests.core.TracAttachmentHandlerTest;
+import org.eclipse.mylyn.trac.tests.core.TracRepositoryConnectorTest;
+import org.eclipse.mylyn.trac.tests.core.TracRepositoryQueryTest;
+import org.eclipse.mylyn.trac.tests.core.TracTaskDataHandlerTest;
+import org.eclipse.mylyn.trac.tests.core.TracUtilTest;
+import org.eclipse.mylyn.trac.tests.ui.TracHyperlinkUtilTest;
+import org.eclipse.mylyn.trac.tests.ui.TracRepositorySettingsPageTest;
+import org.eclipse.mylyn.trac.tests.ui.TracTaskEditorTest;
+
import junit.framework.Test;
import junit.framework.TestSuite;
-import org.eclipse.mylyn.trac.tests.client.TracClientFactoryTest;
-import org.eclipse.mylyn.trac.tests.client.TracClientProxyTest;
-import org.eclipse.mylyn.trac.tests.client.TracSearchTest;
-import org.eclipse.mylyn.trac.tests.client.TracTicketTest;
-import org.eclipse.mylyn.trac.tests.client.TracWebClientSearchTest;
-import org.eclipse.mylyn.trac.tests.client.TracWebClientTest;
-import org.eclipse.mylyn.trac.tests.client.TracXmlRpcClientSearchTest;
-import org.eclipse.mylyn.trac.tests.client.TracXmlRpcClientTest;
-
/**
* @author Mik Kersten
* @author Steffen Pingel
@@ -30,27 +31,17 @@ import org.eclipse.mylyn.trac.tests.client.TracXmlRpcClientTest;
public class AllTracTests {
public static Test suite() {
- TestSuite suite = new TestSuite("Test for org.eclipse.mylyn.trac.tests");
- // $JUnit-BEGIN$
- suite.addTestSuite(TracSearchTest.class);
- suite.addTestSuite(TracTicketTest.class);
- suite.addTestSuite(TracXmlRpcClientTest.class);
- suite.addTestSuite(TracXmlRpcClientSearchTest.class);
- suite.addTestSuite(TracWebClientTest.class);
- suite.addTestSuite(TracWebClientSearchTest.class);
- suite.addTestSuite(TracClientFactoryTest.class);
- suite.addTestSuite(TracClientProxyTest.class);
+ TestSuite suite = new TestSuite("Tests for org.eclipse.mylyn.trac.tests");
+ suite.addTest(AllTracHeadlessStandaloneTests.suite());
suite.addTestSuite(TracRepositoryConnectorTest.class);
suite.addTestSuite(TracUtilTest.class);
suite.addTestSuite(TracRepositoryQueryTest.class);
- suite.addTestSuite(TracClientManagerTest.class);
suite.addTestSuite(TracAttachmentHandlerTest.class);
suite.addTestSuite(RepositorySearchTest.class);
suite.addTestSuite(TracTaskDataHandlerTest.class);
suite.addTestSuite(TracTaskEditorTest.class);
suite.addTestSuite(TracRepositorySettingsPageTest.class);
suite.addTestSuite(TracHyperlinkUtilTest.class);
- // $JUnit-END$
return suite;
}
diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/RepositorySearchTest.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/core/RepositorySearchTest.java
index 7299ac2a8..8412b899d 100644
--- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/RepositorySearchTest.java
+++ b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/core/RepositorySearchTest.java
@@ -9,7 +9,7 @@
* Tasktop Technologies - initial API and implementation
*******************************************************************************/
-package org.eclipse.mylyn.trac.tests;
+package org.eclipse.mylyn.trac.tests.core;
import junit.framework.TestCase;
diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracAttachmentHandlerTest.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/core/TracAttachmentHandlerTest.java
index 8f3658b71..d341e089f 100644
--- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracAttachmentHandlerTest.java
+++ b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/core/TracAttachmentHandlerTest.java
@@ -9,7 +9,7 @@
* Tasktop Technologies - initial API and implementation
*******************************************************************************/
-package org.eclipse.mylyn.trac.tests;
+package org.eclipse.mylyn.trac.tests.core;
import java.io.File;
import java.io.FileOutputStream;
diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracClientManagerTest.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/core/TracClientManagerTest.java
index 6ef4aff2f..c74b5ead3 100644
--- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracClientManagerTest.java
+++ b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/core/TracClientManagerTest.java
@@ -9,7 +9,7 @@
* Tasktop Technologies - initial API and implementation
*******************************************************************************/
-package org.eclipse.mylyn.trac.tests;
+package org.eclipse.mylyn.trac.tests.core;
import java.io.File;
import java.util.Arrays;
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/core/TracRepositoryConnectorTest.java
index 79089b31d..3aeeafa0a 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/core/TracRepositoryConnectorTest.java
@@ -9,7 +9,7 @@
* Tasktop Technologies - initial API and implementation
*******************************************************************************/
-package org.eclipse.mylyn.trac.tests;
+package org.eclipse.mylyn.trac.tests.core;
import java.io.File;
import java.net.MalformedURLException;
diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracRepositoryQueryTest.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/core/TracRepositoryQueryTest.java
index f1e2c8e8b..684c8f72e 100644
--- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracRepositoryQueryTest.java
+++ b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/core/TracRepositoryQueryTest.java
@@ -9,7 +9,7 @@
* Tasktop Technologies - initial API and implementation
*******************************************************************************/
-package org.eclipse.mylyn.trac.tests;
+package org.eclipse.mylyn.trac.tests.core;
import junit.framework.TestCase;
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/core/TracTaskDataHandlerTest.java
index 9f268bf79..74ec42eac 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/core/TracTaskDataHandlerTest.java
@@ -9,7 +9,7 @@
* Tasktop Technologies - initial API and implementation
*******************************************************************************/
-package org.eclipse.mylyn.trac.tests;
+package org.eclipse.mylyn.trac.tests.core;
import java.util.ArrayList;
import java.util.Arrays;
diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracUtilTest.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/core/TracUtilTest.java
index 1eeb8441a..b00729a13 100644
--- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracUtilTest.java
+++ b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/core/TracUtilTest.java
@@ -9,7 +9,7 @@
* Tasktop Technologies - initial API and implementation
*******************************************************************************/
-package org.eclipse.mylyn.trac.tests;
+package org.eclipse.mylyn.trac.tests.core;
import java.util.Arrays;
import java.util.List;
diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracHyperlinkUtilTest.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/ui/TracHyperlinkUtilTest.java
index b113b6b0b..d5b3ff251 100644
--- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracHyperlinkUtilTest.java
+++ b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/ui/TracHyperlinkUtilTest.java
@@ -10,7 +10,7 @@
* David Green - improvements
*******************************************************************************/
-package org.eclipse.mylyn.trac.tests;
+package org.eclipse.mylyn.trac.tests.ui;
import java.util.List;
diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracRepositorySettingsPageTest.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/ui/TracRepositorySettingsPageTest.java
index aba4f27e4..ff587cf53 100644
--- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracRepositorySettingsPageTest.java
+++ b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/ui/TracRepositorySettingsPageTest.java
@@ -9,7 +9,7 @@
* Tasktop Technologies - initial API and implementation
*******************************************************************************/
-package org.eclipse.mylyn.trac.tests;
+package org.eclipse.mylyn.trac.tests.ui;
import java.net.Proxy;
diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracTaskEditorTest.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/ui/TracTaskEditorTest.java
index 20ccea286..d90cd6942 100644
--- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracTaskEditorTest.java
+++ b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/ui/TracTaskEditorTest.java
@@ -9,7 +9,7 @@
* Tasktop Technologies - initial API and implementation
*******************************************************************************/
-package org.eclipse.mylyn.trac.tests;
+package org.eclipse.mylyn.trac.tests.ui;
import junit.framework.TestCase;

Back to the top