Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorspingel2009-09-25 02:10:24 +0000
committerspingel2009-09-25 02:10:24 +0000
commit3a54587123992cf2c60d56ac2c37f8f27c2f032f (patch)
treea169b39c034b79d577fcee02a8f37e5e285bc210
parentc5e6cc1d8c39059ffaf0b46e1be56810dc0063a9 (diff)
downloadorg.eclipse.mylyn.tasks-3a54587123992cf2c60d56ac2c37f8f27c2f032f.tar.gz
org.eclipse.mylyn.tasks-3a54587123992cf2c60d56ac2c37f8f27c2f032f.tar.xz
org.eclipse.mylyn.tasks-3a54587123992cf2c60d56ac2c37f8f27c2f032f.zip
NEW - bug 290203: convert all tests to using JiraFixture
https://bugs.eclipse.org/bugs/show_bug.cgi?id=290203
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/support/BugzillaFixture.java2
-rw-r--r--org.eclipse.mylyn.tests.util/src/org/eclipse/mylyn/tests/util/TestFixture.java28
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/support/TracFixture.java2
3 files changed, 20 insertions, 12 deletions
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 3dd9e892b..e6f72f88d 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
@@ -105,7 +105,7 @@ public class BugzillaFixture extends TestFixture {
public BugzillaFixture(String url, String version, String info) {
super(BugzillaCorePlugin.CONNECTOR_KIND, url);
this.version = version;
- setInfo("Bugzilla " + version + ((info.length() > 0) ? "/" + info : ""));
+ setInfo("Bugzilla", version, info);
}
@Override
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 f1f407ab4..4b2bb0252 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
@@ -95,12 +95,14 @@ public abstract class TestFixture {
private final String connectorKind;
- private String info;
+ private String simpleInfo;
protected final String repositoryUrl;
private TestSuite suite;
+ private String repositoryName;
+
public TestFixture(String connectorKind, String repositoryUrl) {
this.connectorKind = connectorKind;
this.repositoryUrl = repositoryUrl;
@@ -112,11 +114,7 @@ public abstract class TestFixture {
public void add(Class<? extends TestCase> clazz) {
Assert.isNotNull(suite, "Invoke createSuite() first");
- if (Boolean.parseBoolean(System.getProperty("mylyn.tests.annotate")) && getInfo() != null) {
- suite.addTest(new TestSuite(clazz, clazz.getName() + " [@" + getInfo() + "]"));
- } else {
- suite.addTestSuite(clazz);
- }
+ suite.addTestSuite(clazz);
}
public AbstractRepositoryConnector connector() {
@@ -126,7 +124,7 @@ public abstract class TestFixture {
public TestSuite createSuite(TestSuite parentSuite) {
suite = new TestSuite("Testing on " + getInfo());
parentSuite.addTest(suite);
- suite.addTest(new Activation("repository: " + getRepositoryUrl() + " [@" + getInfo() + "]", true));
+ suite.addTest(new Activation("repository: " + getRepositoryUrl() + " [@" + getSimpleInfo() + "]", true));
return suite;
}
@@ -141,13 +139,17 @@ public abstract class TestFixture {
}
public String getInfo() {
- return info;
+ return repositoryName + " " + simpleInfo;
}
public String getRepositoryUrl() {
return repositoryUrl;
}
+ public String getSimpleInfo() {
+ return simpleInfo;
+ }
+
public AbstractWebLocation location() throws Exception {
return location(PrivilegeLevel.USER);
}
@@ -181,8 +183,14 @@ public abstract class TestFixture {
return repository;
}
- protected void setInfo(String info) {
- this.info = info;
+ protected void setInfo(String repositoryName, String version, String description) {
+ Assert.isNotNull(repositoryName);
+ Assert.isNotNull(version);
+ this.repositoryName = repositoryName;
+ this.simpleInfo = version;
+ if (description != null && description.length() > 0) {
+ this.simpleInfo += "/" + description;
+ }
}
public TaskRepository singleRepository() {
diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/support/TracFixture.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/support/TracFixture.java
index e60340590..975e2aa0a 100644
--- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/support/TracFixture.java
+++ b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/support/TracFixture.java
@@ -142,7 +142,7 @@ public class TracFixture extends TestFixture {
super(TracCorePlugin.CONNECTOR_KIND, url);
this.accessMode = accessMode;
this.version = version;
- setInfo("Trac " + version + "/" + info);
+ setInfo("Trac", version, info);
}
@Override

Back to the top