Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 302654 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaVersion.java (+4 lines)
Lines 89-94 Link Here
89
		return compareTo(v) <= 0;
89
		return compareTo(v) <= 0;
90
	}
90
	}
91
91
92
	public boolean isSmaller(BugzillaVersion v) {
93
		return compareTo(v) < 0;
94
	}
95
92
	public int compareTo(BugzillaVersion v) {
96
	public int compareTo(BugzillaVersion v) {
93
		if (major < v.major) {
97
		if (major < v.major) {
94
			return -1;
98
			return -1;
(-)src/org/eclipse/mylyn/bugzilla/tests/AllBugzillaTests.java (+5 lines)
Lines 14-19 Link Here
14
import junit.framework.Test;
14
import junit.framework.Test;
15
import junit.framework.TestSuite;
15
import junit.framework.TestSuite;
16
16
17
import org.eclipse.mylyn.bugzilla.tests.core.BugzillaXMLRPCTest;
17
import org.eclipse.mylyn.bugzilla.tests.support.BugzillaFixture;
18
import org.eclipse.mylyn.bugzilla.tests.support.BugzillaFixture;
18
import org.eclipse.mylyn.bugzilla.tests.ui.BugzillaRepositorySettingsPageTest;
19
import org.eclipse.mylyn.bugzilla.tests.ui.BugzillaRepositorySettingsPageTest;
19
import org.eclipse.mylyn.bugzilla.tests.ui.BugzillaSearchPageTest;
20
import org.eclipse.mylyn.bugzilla.tests.ui.BugzillaSearchPageTest;
Lines 60-65 Link Here
60
				}
61
				}
61
				fixture.add(BugzillaAttachmentHandlerTest.class);
62
				fixture.add(BugzillaAttachmentHandlerTest.class);
62
			}
63
			}
64
			if (!fixture.getBugzillaVersion().isSmaller(BugzillaVersion.BUGZILLA_3_6)) {
65
				fixture.add(BugzillaXMLRPCTest.class);
66
			}
67
63
			fixture.done();
68
			fixture.done();
64
		}
69
		}
65
70
(-)src/org/eclipse/mylyn/bugzilla/tests/BugzillaTestConstants.java (-1 / +3 lines)
Lines 39-47 Link Here
39
39
40
	public static final String TEST_BUGZILLA_34_URL = getServerUrl("bugs34");
40
	public static final String TEST_BUGZILLA_34_URL = getServerUrl("bugs34");
41
41
42
	public static final String TEST_BUGZILLA_36_URL = getServerUrl("bugs36");
43
42
	public static final String TEST_BUGZILLA_HEAD_URL = getServerUrl("bugshead");
44
	public static final String TEST_BUGZILLA_HEAD_URL = getServerUrl("bugshead");
43
45
44
	public static final String TEST_BUGZILLA_LATEST_URL = TEST_BUGZILLA_34_URL;
46
	public static final String TEST_BUGZILLA_LATEST_URL = TEST_BUGZILLA_36_URL;
45
47
46
	private static final String getServerUrl(String version) {
48
	private static final String getServerUrl(String version) {
47
		return "http://" + SERVER + "/" + version;
49
		return "http://" + SERVER + "/" + version;
(-)src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaClientTest.java (-2 / +2 lines)
Lines 188-200 Link Here
188
	}
188
	}
189
189
190
	public void testLeadingZeros() throws Exception {
190
	public void testLeadingZeros() throws Exception {
191
		String taskNumber = "0010";
191
		String taskNumber = "0002";
192
		TaskData taskData = BugzillaFixture.current().getTask(taskNumber, client);
192
		TaskData taskData = BugzillaFixture.current().getTask(taskNumber, client);
193
		assertNotNull(taskData);
193
		assertNotNull(taskData);
194
		assertNotNull(taskData);
194
		assertNotNull(taskData);
195
		TaskAttribute idAttribute = taskData.getRoot().getAttribute(BugzillaAttribute.BUG_ID.getKey());
195
		TaskAttribute idAttribute = taskData.getRoot().getAttribute(BugzillaAttribute.BUG_ID.getKey());
196
		assertNotNull(idAttribute);
196
		assertNotNull(idAttribute);
197
		assertEquals("10", idAttribute.getValue());
197
		assertEquals("2", idAttribute.getValue());
198
	}
198
	}
199
199
200
}
200
}
(-)src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaCustomFieldsTest.java (-1 / +1 lines)
Lines 50-56 Link Here
50
50
51
	public void testCustomAttributes() throws Exception {
51
	public void testCustomAttributes() throws Exception {
52
52
53
		String taskNumber = "1";
53
		String taskNumber = "2";
54
		TaskData taskData = BugzillaFixture.current().getTask(taskNumber, client);
54
		TaskData taskData = BugzillaFixture.current().getTask(taskNumber, client);
55
		assertNotNull(taskData);
55
		assertNotNull(taskData);
56
		TaskMapper mapper = new TaskMapper(taskData);
56
		TaskMapper mapper = new TaskMapper(taskData);
(-)src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaFlagsTest.java (-1 / +1 lines)
Lines 40-46 Link Here
40
40
41
	@SuppressWarnings("null")
41
	@SuppressWarnings("null")
42
	public void testFlags() throws Exception {
42
	public void testFlags() throws Exception {
43
		String taskNumber = "10";
43
		String taskNumber = "2";
44
		TaskData taskData = BugzillaFixture.current().getTask(taskNumber, client);
44
		TaskData taskData = BugzillaFixture.current().getTask(taskNumber, client);
45
		assertNotNull(taskData);
45
		assertNotNull(taskData);
46
46
(-)src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaXMLRPCTest.java (-8 / +17 lines)
Lines 14-36 Link Here
14
import java.util.Date;
14
import java.util.Date;
15
import java.util.HashMap;
15
import java.util.HashMap;
16
16
17
import org.eclipse.mylyn.bugzilla.tests.BugzillaTestConstants;
17
import junit.framework.TestCase;
18
19
import org.eclipse.mylyn.bugzilla.tests.support.BugzillaFixture;
18
import org.eclipse.mylyn.commons.net.AuthenticationType;
20
import org.eclipse.mylyn.commons.net.AuthenticationType;
19
import org.eclipse.mylyn.commons.net.WebLocation;
21
import org.eclipse.mylyn.commons.net.WebLocation;
20
import org.eclipse.mylyn.internal.bugzilla.core.service.BugzillaXmlRpcClient;
22
import org.eclipse.mylyn.internal.bugzilla.core.service.BugzillaXmlRpcClient;
21
23
22
public class BugzillaXMLRPCTest {
24
/**
25
 * Tests should be run against Bugzilla 3.6 or greater
26
 * 
27
 * @author Frank Becker
28
 */
29
30
public class BugzillaXMLRPCTest extends TestCase {
23
	private BugzillaXmlRpcClient bugzillaClient;
31
	private BugzillaXmlRpcClient bugzillaClient;
24
32
25
//	private static String TEST_REPO = "http://.../Bugzilla36noRPC";
33
//	private static String TEST_REPO = "http://.../Bugzilla36noRPC";
34
//	private static String TEST_REPO = "http://mylyn.eclipse.org/bugs36";
26
35
27
//	private static String TEST_REPO = "http://.../Bugzilla36";
36
	@Override
28
29
	public void setUp() throws Exception {
37
	public void setUp() throws Exception {
30
//		WebLocation webLocation = new WebLocation(TEST_REPO + "/xmlrpc.cgi");
31
//		webLocation.setCredentials(AuthenticationType.REPOSITORY, "user", "password");
38
//		webLocation.setCredentials(AuthenticationType.REPOSITORY, "user", "password");
32
//		webLocation.setCredentials(AuthenticationType.HTTP, "user", "password");
39
//		webLocation.setCredentials(AuthenticationType.HTTP, "user", "password");
33
		WebLocation webLocation = new WebLocation(BugzillaTestConstants.TEST_BUGZILLA_HEAD_URL + "/xmlrpc.cgi");
40
//		WebLocation webLocation = new WebLocation(BugzillaTestConstants.TEST_BUGZILLA_HEAD_URL + "/xmlrpc.cgi");
41
42
		WebLocation webLocation = new WebLocation(BugzillaFixture.current().getRepositoryUrl() + "/xmlrpc.cgi");
34
		webLocation.setCredentials(AuthenticationType.REPOSITORY, "tests@mylyn.eclipse.org", "mylyntest");
43
		webLocation.setCredentials(AuthenticationType.REPOSITORY, "tests@mylyn.eclipse.org", "mylyntest");
35
		bugzillaClient = new BugzillaXmlRpcClient(webLocation);
44
		bugzillaClient = new BugzillaXmlRpcClient(webLocation);
36
		bugzillaClient.setContentTypeCheckingEnabled(true);
45
		bugzillaClient.setContentTypeCheckingEnabled(true);
Lines 44-51 Link Here
44
		Date x2 = bugzillaClient.getDBTime();
53
		Date x2 = bugzillaClient.getDBTime();
45
		Date x3 = bugzillaClient.getWebTime();
54
		Date x3 = bugzillaClient.getWebTime();
46
		Object[] xx0 = bugzillaClient.getUserInfoFromIDs(new Integer[] { 1, 2 });
55
		Object[] xx0 = bugzillaClient.getUserInfoFromIDs(new Integer[] { 1, 2 });
47
		Object[] xx1 = bugzillaClient.getUserInfoFromNames(new String[] { "Frank@Frank-Becker.de" });
56
		Object[] xx1 = bugzillaClient.getUserInfoFromNames(new String[] { "tests@mylyn.eclipse.org" });
48
		Object[] xx2 = bugzillaClient.getUserInfoWithMatch(new String[] { "eck" });
57
		Object[] xx2 = bugzillaClient.getUserInfoWithMatch(new String[] { "est" });
49
		Object[] xx3 = bugzillaClient.getAllFields();
58
		Object[] xx3 = bugzillaClient.getAllFields();
50
		Object[] xx4 = bugzillaClient.getFieldsWithNames(new String[] { "qa_contact" });
59
		Object[] xx4 = bugzillaClient.getFieldsWithNames(new String[] { "qa_contact" });
51
		Object[] xx5 = bugzillaClient.getFieldsWithIDs(new Integer[] { 12, 18 });
60
		Object[] xx5 = bugzillaClient.getFieldsWithIDs(new Integer[] { 12, 18 });
(-)src/org/eclipse/mylyn/bugzilla/tests/support/BugzillaFixture.java (-3 / +6 lines)
Lines 91-103 Link Here
91
	public static BugzillaFixture BUGS_3_4 = new BugzillaFixture(BugzillaTestConstants.TEST_BUGZILLA_34_URL, //
91
	public static BugzillaFixture BUGS_3_4 = new BugzillaFixture(BugzillaTestConstants.TEST_BUGZILLA_34_URL, //
92
			"3.4.4", "");
92
			"3.4.4", "");
93
93
94
	public static BugzillaFixture BUGS_3_6 = new BugzillaFixture(BugzillaTestConstants.TEST_BUGZILLA_36_URL, //
95
			"3.6", "");
96
94
	public static BugzillaFixture BUGS_HEAD = new BugzillaFixture(BugzillaTestConstants.TEST_BUGZILLA_HEAD_URL, //
97
	public static BugzillaFixture BUGS_HEAD = new BugzillaFixture(BugzillaTestConstants.TEST_BUGZILLA_HEAD_URL, //
95
			"3.5.2+", "");
98
			"3.7", "");
96
99
97
	public static BugzillaFixture DEFAULT = BUGS_3_4;
100
	public static BugzillaFixture DEFAULT = BUGS_3_6;
98
101
99
	public static final BugzillaFixture[] ALL = new BugzillaFixture[] { BUGS_2_22, BUGS_3_0, BUGS_3_2, BUGS_3_4,
102
	public static final BugzillaFixture[] ALL = new BugzillaFixture[] { BUGS_2_22, BUGS_3_0, BUGS_3_2, BUGS_3_4,
100
			BUGS_HEAD };
103
			BUGS_3_6, BUGS_HEAD };
101
104
102
	private final String version;
105
	private final String version;
103
106

Return to bug 302654