Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorspingel2009-09-30 21:45:39 +0000
committerspingel2009-09-30 21:45:39 +0000
commitb82505e9797d1ab99067ebf61a153cc9a31b5485 (patch)
treea80d9580b72a8e1b4a181ab8e725c6d1c4b7a7cc /org.eclipse.mylyn.tests.util/src/org
parent3f436f48ffb8dd246b89d7148e6232b88018864f (diff)
downloadorg.eclipse.mylyn.tasks-b82505e9797d1ab99067ebf61a153cc9a31b5485.tar.gz
org.eclipse.mylyn.tasks-b82505e9797d1ab99067ebf61a153cc9a31b5485.tar.xz
org.eclipse.mylyn.tasks-b82505e9797d1ab99067ebf61a153cc9a31b5485.zip
REOPENED - bug 267508: fix and speed up JiraFilterTest
https://bugs.eclipse.org/bugs/show_bug.cgi?id=267508
Diffstat (limited to 'org.eclipse.mylyn.tests.util/src/org')
-rw-r--r--org.eclipse.mylyn.tests.util/src/org/eclipse/mylyn/tests/util/TestFixture.java20
1 files changed, 15 insertions, 5 deletions
diff --git a/org.eclipse.mylyn.tests.util/src/org/eclipse/mylyn/tests/util/TestFixture.java b/org.eclipse.mylyn.tests.util/src/org/eclipse/mylyn/tests/util/TestFixture.java
index 4b2bb0252..e5c6f36cd 100644
--- a/org.eclipse.mylyn.tests.util/src/org/eclipse/mylyn/tests/util/TestFixture.java
+++ b/org.eclipse.mylyn.tests.util/src/org/eclipse/mylyn/tests/util/TestFixture.java
@@ -38,6 +38,7 @@ import org.eclipse.mylyn.tests.util.TestUtil.PrivilegeLevel;
public abstract class TestFixture {
private final class Activation extends TestCase {
+
private final boolean activate;
private Activation(String name, boolean activate) {
@@ -53,6 +54,7 @@ public abstract class TestFixture {
getDefault().activate();
}
}
+
}
/**
@@ -95,13 +97,13 @@ public abstract class TestFixture {
private final String connectorKind;
- private String simpleInfo;
+ private String repositoryName;
protected final String repositoryUrl;
- private TestSuite suite;
+ private String simpleInfo;
- private String repositoryName;
+ private TestSuite suite;
public TestFixture(String connectorKind, String repositoryUrl) {
this.connectorKind = connectorKind;
@@ -110,13 +112,14 @@ public abstract class TestFixture {
protected abstract TestFixture activate();
- protected abstract TestFixture getDefault();
-
public void add(Class<? extends TestCase> clazz) {
Assert.isNotNull(suite, "Invoke createSuite() first");
suite.addTestSuite(clazz);
}
+ protected void configureRepository(TaskRepository repository) {
+ }
+
public AbstractRepositoryConnector connector() {
return connector;
}
@@ -138,6 +141,8 @@ public abstract class TestFixture {
return connectorKind;
}
+ protected abstract TestFixture getDefault();
+
public String getInfo() {
return repositoryName + " " + simpleInfo;
}
@@ -183,6 +188,9 @@ public abstract class TestFixture {
return repository;
}
+ protected void resetRepositories() {
+ }
+
protected void setInfo(String repositoryName, String version, String description) {
Assert.isNotNull(repositoryName);
Assert.isNotNull(version);
@@ -196,11 +204,13 @@ public abstract class TestFixture {
public TaskRepository singleRepository() {
TaskRepositoryManager manager = TasksUiPlugin.getRepositoryManager();
manager.clearRepositories();
+ resetRepositories();
TaskRepository repository = new TaskRepository(connectorKind, repositoryUrl);
Credentials credentials = TestUtil.readCredentials(PrivilegeLevel.USER);
repository.setCredentials(AuthenticationType.REPOSITORY, new AuthenticationCredentials(credentials.username,
credentials.password), false);
+ configureRepository(repository);
manager.addRepository(repository);
return repository;
}

Back to the top