|
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 }); |