trac integration test enabled
authorDmitry Avdeev <Dmitry.Avdeev@jetbrains.com>
Fri, 27 Jan 2012 09:38:04 +0000 (13:38 +0400)
committerDmitry Avdeev <Dmitry.Avdeev@jetbrains.com>
Fri, 27 Jan 2012 09:39:54 +0000 (13:39 +0400)
plugins/tasks/tasks-tests/test/com/intellij/tasks/TaskCompletionTest.java
plugins/tasks/tasks-tests/test/com/intellij/tasks/TaskManagerTestCase.java
plugins/tasks/tasks-tests/test/com/intellij/tasks/integration/TracIntegrationTest.java

index 3af2d7c7b5c1027b3d5336d518a77d2524646f54..b4696ae1a2423190ce673991450b4a02ddaf4cd8 100644 (file)
@@ -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>");
   }
index 6cc70958912e8364eee7d6bac6ef579b9c8653c6..a65f9f2067990d1c056963cf122ac43aebda4e13 100644 (file)
@@ -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
index 61a0b8f76323d021625ea5428acfacf1ec905ac7..117daf66194429e23a4d8971ca8bd98515386168 100644 (file)
@@ -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());
   }
 }