Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorspingel2011-01-26 00:16:23 +0000
committerspingel2011-01-26 00:16:23 +0000
commit1935ca4ef9de0befd4d410633eb03cc03ec433a8 (patch)
treef3ae38cf3abeda129fce8b5de46c15269f7a7f05 /org.eclipse.mylyn.bugzilla.tests
parent5a8cc07921637899b1904a490985888dabdd788f (diff)
downloadorg.eclipse.mylyn.tasks-1935ca4ef9de0befd4d410633eb03cc03ec433a8.tar.gz
org.eclipse.mylyn.tasks-1935ca4ef9de0befd4d410633eb03cc03ec433a8.tar.xz
org.eclipse.mylyn.tasks-1935ca4ef9de0befd4d410633eb03cc03ec433a8.zip
NEW - bug 335097: fix test failures on hudson
https://bugs.eclipse.org/bugs/show_bug.cgi?id=335097
Diffstat (limited to 'org.eclipse.mylyn.bugzilla.tests')
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/META-INF/MANIFEST.MF1
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/AllBugzillaHeadlessStandaloneTests.java2
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaClientTest.java9
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaConfigurationTest.java6
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/support/BugzillaFixture.java6
5 files changed, 15 insertions, 9 deletions
diff --git a/org.eclipse.mylyn.bugzilla.tests/META-INF/MANIFEST.MF b/org.eclipse.mylyn.bugzilla.tests/META-INF/MANIFEST.MF
index d797b0ea0..4d04acc3f 100644
--- a/org.eclipse.mylyn.bugzilla.tests/META-INF/MANIFEST.MF
+++ b/org.eclipse.mylyn.bugzilla.tests/META-INF/MANIFEST.MF
@@ -24,6 +24,7 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.mylyn.commons.ui,
org.eclipse.compare,
org.eclipse.mylyn.commons.core,
+ org.eclipse.mylyn.commons.tests,
org.eclipse.mylyn.commons.xmlrpc;bundle-version="[3.4.0,4.0.0)",
org.apache.xmlrpc
Bundle-Vendor: Eclipse Mylyn
diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/AllBugzillaHeadlessStandaloneTests.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/AllBugzillaHeadlessStandaloneTests.java
index e60bb0fab..c7f8a205e 100644
--- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/AllBugzillaHeadlessStandaloneTests.java
+++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/AllBugzillaHeadlessStandaloneTests.java
@@ -69,8 +69,6 @@ public class AllBugzillaHeadlessStandaloneTests {
fixture.add(BugzillaCustomFieldsTest.class);
fixture.add(BugzillaFlagsTest.class);
}
-
- fixture.add(BugzillaClientTest.class);
}
fixture.done();
}
diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaClientTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaClientTest.java
index f97904a87..222146808 100644
--- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaClientTest.java
+++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaClientTest.java
@@ -18,6 +18,7 @@ import java.util.Set;
import junit.framework.TestCase;
+import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.mylyn.bugzilla.tests.support.BugzillaFixture;
import org.eclipse.mylyn.commons.net.AbstractWebLocation;
@@ -32,6 +33,7 @@ import org.eclipse.mylyn.internal.bugzilla.core.RepositoryConfiguration;
import org.eclipse.mylyn.internal.tasks.core.RepositoryQuery;
import org.eclipse.mylyn.internal.tasks.core.TaskRepositoryLocation;
import org.eclipse.mylyn.tasks.core.RepositoryResponse;
+import org.eclipse.mylyn.tasks.core.RepositoryStatus;
import org.eclipse.mylyn.tasks.core.TaskRepository;
import org.eclipse.mylyn.tasks.core.data.TaskAttribute;
import org.eclipse.mylyn.tasks.core.data.TaskData;
@@ -130,10 +132,9 @@ public class BugzillaClientTest extends TestCase {
client = new BugzillaClient(location, repository, BugzillaFixture.current().connector());
try {
client.validate(new NullProgressMonitor());
- } catch (Exception e) {
- assertEquals("Unable to login to " + repository.getUrl()
- + ".\n\n\n The username or password you entered is not valid.\n\n"
- + "Please validate credentials via Task Repositories view.", e.getMessage());
+ } catch (CoreException e) {
+ assertEquals("Expected login error, got: " + e.getMessage(), RepositoryStatus.ERROR_REPOSITORY_LOGIN,
+ e.getStatus().getCode());
}
}
diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaConfigurationTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaConfigurationTest.java
index b347950b2..c733e4b0b 100644
--- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaConfigurationTest.java
+++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaConfigurationTest.java
@@ -13,7 +13,7 @@ package org.eclipse.mylyn.bugzilla.tests.core;
import java.io.BufferedReader;
import java.io.File;
-import java.io.FileInputStream;
+import java.io.InputStream;
import java.io.InputStreamReader;
import junit.framework.TestCase;
@@ -107,8 +107,8 @@ public class BugzillaConfigurationTest extends TestCase {
* included (rdfconfig218.txt) is from mylyn.eclipse.org/bugs218
*/
public void testRepositoryConfigurationFromFile() throws Exception {
- File file = BugzillaFixture.getFile("testdata/configuration/rdfconfig218.txt");
- BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(file)));
+ InputStream stream = BugzillaFixture.getResource("testdata/configuration/rdfconfig218.txt");
+ BufferedReader in = new BufferedReader(new InputStreamReader(stream));
if (true) {
File tempFile = File.createTempFile("XmlCleaner-", "tmp");
diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/support/BugzillaFixture.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/support/BugzillaFixture.java
index 65f3d8d5e..dc2303ccf 100644
--- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/support/BugzillaFixture.java
+++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/support/BugzillaFixture.java
@@ -13,6 +13,7 @@ package org.eclipse.mylyn.bugzilla.tests.support;
import java.io.File;
import java.io.IOException;
+import java.io.InputStream;
import java.util.Collections;
import junit.framework.AssertionFailedError;
@@ -22,6 +23,7 @@ import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.mylyn.commons.net.AbstractWebLocation;
import org.eclipse.mylyn.commons.net.AuthenticationType;
import org.eclipse.mylyn.commons.net.WebLocation;
+import org.eclipse.mylyn.commons.tests.support.CommonTestUtil;
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaAttribute;
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaClient;
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaClientManager;
@@ -224,6 +226,10 @@ public class BugzillaFixture extends TestFixture {
return TestUtil.getFile(BugzillaFixture.class, filename);
}
+ public static InputStream getResource(String filename) throws IOException {
+ return CommonTestUtil.getResource(BugzillaFixture.class, filename);
+ }
+
/**
* Create and returns a minimal task.
*

Back to the top