Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorspingel2010-02-11 03:36:16 +0000
committerspingel2010-02-11 03:36:16 +0000
commitade2251e078750c362e812763ffd00dc4d7b2477 (patch)
tree0adff70033312987dfc2269a27c9c1fcb24babf8 /org.eclipse.mylyn.trac.tests/src
parent939b70c9141fe62e587cf851e54b1ca87f92c1a9 (diff)
downloadorg.eclipse.mylyn.tasks-ade2251e078750c362e812763ffd00dc4d7b2477.tar.gz
org.eclipse.mylyn.tasks-ade2251e078750c362e812763ffd00dc4d7b2477.tar.xz
org.eclipse.mylyn.tasks-ade2251e078750c362e812763ffd00dc4d7b2477.zip
REOPENED - bug 296894: [releng] fix failing tests for 3.4
https://bugs.eclipse.org/bugs/show_bug.cgi?id=296894
Diffstat (limited to 'org.eclipse.mylyn.trac.tests/src')
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/support/TracFixture.java9
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/support/TracTestCleanupUtil.java41
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/support/TracTestConstants.java2
3 files changed, 45 insertions, 7 deletions
diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/support/TracFixture.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/support/TracFixture.java
index dc4a3df54..ce8376c7d 100644
--- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/support/TracFixture.java
+++ b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/support/TracFixture.java
@@ -62,6 +62,9 @@ public class TracFixture extends TestFixture {
public static TracFixture TRAC_0_11_XML_RPC = new TracFixture(Version.XML_RPC, TracTestConstants.TEST_TRAC_011_URL,
"0.11", "XML-RPC");
+ public static TracFixture TRAC_TRUNK_XML_RPC = new TracFixture(Version.XML_RPC,
+ TracTestConstants.TEST_TRAC_TRUNK_URL, "0.12dev-r0", "XML-RPC");
+
public static TracFixture DEFAULT = TRAC_0_11_XML_RPC;
//public static TracFixture DEFAULT = TRAC_0_11_WEB;
@@ -70,7 +73,9 @@ public class TracFixture extends TestFixture {
* Standard configurations for running all test against.
*/
public static final TracFixture[] ALL = new TracFixture[] { TRAC_0_9_WEB, TRAC_0_10_WEB, TRAC_0_11_WEB,
- TRAC_0_10_XML_RPC, TRAC_0_11_XML_RPC, /* TRAC_0_10_XML_RPC_SSL, */};
+ TRAC_0_10_XML_RPC, TRAC_0_11_XML_RPC,/* TRAC_TRUNK_XML_RPC, *//* TRAC_0_10_XML_RPC_SSL, */};
+
+// public static final TracFixture[] ALL = new TracFixture[] { TRAC_TRUNK_XML_RPC };
/**
* Misc configurations for running a limited number of test against.
@@ -78,6 +83,8 @@ public class TracFixture extends TestFixture {
public static final TracFixture[] MISC = new TracFixture[] { TRAC_0_10_XML_RPC_DIGEST_AUTH,
TRAC_0_10_XML_RPC_FORM_AUTH, };
+// public static final TracFixture[] MISC = new TracFixture[] {};
+
public static void cleanup010() throws Exception {
if (data010 != null) {
// data010.cleanup();
diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/support/TracTestCleanupUtil.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/support/TracTestCleanupUtil.java
index fe1a12532..1ff4e45fb 100644
--- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/support/TracTestCleanupUtil.java
+++ b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/support/TracTestCleanupUtil.java
@@ -43,34 +43,63 @@ public class TracTestCleanupUtil extends TestCase {
public void testCleanup010() throws Exception {
TracFixture fixture = TracFixture.TRAC_0_10_XML_RPC.activate();
+ System.err.println("Connected to " + fixture.getRepositoryUrl());
client = fixture.connect(PrivilegeLevel.ADMIN);
- cleanup();
+ deleteOldAttachments();
+ deleteOldTickets();
}
public void testCleanup011() throws Exception {
TracFixture fixture = TracFixture.TRAC_0_11_XML_RPC.activate();
+ System.err.println("Connected to " + fixture.getRepositoryUrl());
client = fixture.connect(PrivilegeLevel.ADMIN);
- cleanup();
+ deleteOldAttachments();
+ deleteOldTickets();
}
- private void cleanup() throws TracException {
+ public void testCleanupTrunk() throws Exception {
+ TracFixture fixture = TracFixture.TRAC_TRUNK_XML_RPC.activate();
+ System.err.println("Connected to " + fixture.getRepositoryUrl());
+ client = fixture.connect(PrivilegeLevel.ADMIN);
+ deleteOldAttachments();
+ deleteOldTickets();
+ }
+
+ private void deleteOldAttachments() throws TracException {
TracTicket ticket = client.getTicket(data.attachmentTicketId, null);
TracAttachment[] attachments = ticket.getAttachments();
+ System.err.println("Found " + attachments.length + " attachments");
// skips the first attachment
+ System.err.print("Deleting attachment: ");
for (int i = 1; i < attachments.length; i++) {
+ System.err.print(i + ", ");
client.deleteAttachment(data.attachmentTicketId, attachments[i].getFilename(), null);
+ if (i % 20 == 0) {
+ System.err.println();
+ System.err.print(" ");
+ }
}
+ System.err.println();
}
public void deleteOldTickets() throws TracException {
TracSearch query = new TracSearch();
+ query.setMax(10000);
List<Integer> result = new ArrayList<Integer>();
client.searchForTicketIds(query, result, null);
- for (Integer id : result) {
- if (id > 10) {
- client.deleteTicket(id, null);
+ System.err.println("Found " + result.size() + " tickets");
+ System.err.print("Deleting ticket: ");
+ for (Integer i : result) {
+ if (i > 10) {
+ System.err.print(i + ", ");
+ client.deleteTicket(i, null);
+ if (i % 20 == 0) {
+ System.err.println();
+ System.err.print(" ");
+ }
}
}
+ System.err.println();
}
}
diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/support/TracTestConstants.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/support/TracTestConstants.java
index b9b6f8554..11146eb2f 100644
--- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/support/TracTestConstants.java
+++ b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/support/TracTestConstants.java
@@ -30,6 +30,8 @@ public class TracTestConstants {
public static final String TEST_TRAC_011_URL = "http://" + SERVER + "/trac011";
+ public static final String TEST_TRAC_TRUNK_URL = "http://" + SERVER + "/tractrunk";
+
public static final String TEST_TRAC_INVALID_URL = "http://" + SERVER + "/doesnotexist";
}

Back to the top