mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
trac integration test enabled
This commit is contained in:
@@ -9,6 +9,7 @@ import com.intellij.tasks.impl.LocalTaskImpl;
|
||||
import com.intellij.tasks.impl.TaskCompletionContributor;
|
||||
import com.intellij.tasks.impl.TaskManagerImpl;
|
||||
import com.intellij.testFramework.MapDataContext;
|
||||
import com.intellij.testFramework.PlatformTestCase;
|
||||
import com.intellij.testFramework.fixtures.LightCodeInsightFixtureTestCase;
|
||||
|
||||
import java.util.Arrays;
|
||||
@@ -18,6 +19,11 @@ import java.util.Arrays;
|
||||
*/
|
||||
public class TaskCompletionTest extends LightCodeInsightFixtureTestCase {
|
||||
|
||||
@SuppressWarnings("JUnitTestCaseWithNonTrivialConstructors")
|
||||
public TaskCompletionTest() {
|
||||
PlatformTestCase.setPlatformPrefix("PlatformLangXml");
|
||||
}
|
||||
|
||||
public void testTaskCompletion() throws Exception {
|
||||
doTest("<caret>", "TEST-001: Test task<caret>");
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.intellij.tasks;
|
||||
|
||||
import com.intellij.testFramework.PlatformTestCase;
|
||||
import com.intellij.testFramework.fixtures.LightCodeInsightFixtureTestCase;
|
||||
|
||||
/**
|
||||
@@ -7,6 +8,10 @@ import com.intellij.testFramework.fixtures.LightCodeInsightFixtureTestCase;
|
||||
*/
|
||||
public abstract class TaskManagerTestCase extends LightCodeInsightFixtureTestCase {
|
||||
|
||||
protected TaskManagerTestCase() {
|
||||
PlatformTestCase.setPlatformPrefix("PlatformLangXml");
|
||||
}
|
||||
|
||||
protected TaskManager myManager;
|
||||
|
||||
@Override
|
||||
|
||||
+6
-23
@@ -18,40 +18,23 @@ package com.intellij.tasks.integration;
|
||||
import com.intellij.tasks.Task;
|
||||
import com.intellij.tasks.TaskManagerTestCase;
|
||||
import com.intellij.tasks.trac.TracRepository;
|
||||
import org.apache.xmlrpc.CommonsXmlRpcTransport;
|
||||
import org.apache.xmlrpc.XmlRpc;
|
||||
import org.apache.xmlrpc.XmlRpcClient;
|
||||
import org.apache.xmlrpc.XmlRpcRequest;
|
||||
|
||||
import java.net.URL;
|
||||
import java.util.Arrays;
|
||||
import java.util.Vector;
|
||||
|
||||
/**
|
||||
* @author Dmitry Avdeev
|
||||
* Date: 1/25/12
|
||||
*/
|
||||
public abstract class TracIntegrationTest extends TaskManagerTestCase {
|
||||
public class TracIntegrationTest extends TaskManagerTestCase {
|
||||
|
||||
public void testTracEncoding() throws Exception {
|
||||
|
||||
XmlRpc.setDefaultInputEncoding("UTF-8");
|
||||
XmlRpcClient client = new XmlRpcClient("http://trac.shopware.de/trac/login/rpc");
|
||||
// client.setBasicAuthentication();
|
||||
|
||||
CommonsXmlRpcTransport transport = new CommonsXmlRpcTransport(new URL("http://trac.shopware.de/trac/login/rpc"));
|
||||
transport.setBasicAuthentication("jetbrains", "jetbrains");
|
||||
Object o = client.execute(new XmlRpcRequest("ticket.get", new Vector(Arrays.asList("5358"))),
|
||||
transport);
|
||||
|
||||
System.out.println(o);
|
||||
|
||||
TracRepository repository = new TracRepository();
|
||||
repository.setUrl("http://trac.shopware.de/trac/login/rpc");
|
||||
repository.setPassword("jetbrains");
|
||||
repository.setUsername("jetbrains");
|
||||
repository.setUrl("http://trac.shopware.de/trac/login/rpc");
|
||||
Task[] issues = repository.getIssues("", 10, 0);
|
||||
repository.setUseHttpAuthentication(true);
|
||||
|
||||
Task task = repository.findTask("5358");
|
||||
System.out.println(task.getDescription());
|
||||
assertNotNull(task);
|
||||
assertEquals("Artikel können nicht in den Warenkorb gelegt werden", task.getSummary());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user