summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomasz Zarna2013-07-15 06:55:12 (EDT)
committer Gerrit Code Review @ Eclipse.org2013-07-15 21:24:12 (EDT)
commit1daa9b3efe721b1db6b4294a14d80e466f609451 (patch)
tree94b9f6ec624bf60a760b94678bd0d60f284b35d1
parent9ff2036321263f7e444884fe23bdd74b0921fae3 (diff)
downloadorg.eclipse.mylyn.reviews-1daa9b3efe721b1db6b4294a14d80e466f609451.zip
org.eclipse.mylyn.reviews-1daa9b3efe721b1db6b4294a14d80e466f609451.tar.gz
org.eclipse.mylyn.reviews-1daa9b3efe721b1db6b4294a14d80e466f609451.tar.bz2
fix GerritClientTest#testGetVersion failing for Gerrit 2.6-rc3refs/changes/57/14557/2
Change-Id: I85225acaba7619383179d05f9e22e84e1d9589aa Signed-off-by: Tomasz Zarna <tomasz.zarna@tasktop.com>
-rw-r--r--org.eclipse.mylyn.gerrit.tests/src/org/eclipse/mylyn/gerrit/tests/core/client/GerritClientTest.java14
1 files changed, 8 insertions, 6 deletions
diff --git a/org.eclipse.mylyn.gerrit.tests/src/org/eclipse/mylyn/gerrit/tests/core/client/GerritClientTest.java b/org.eclipse.mylyn.gerrit.tests/src/org/eclipse/mylyn/gerrit/tests/core/client/GerritClientTest.java
index fa53a57..e394e6e 100644
--- a/org.eclipse.mylyn.gerrit.tests/src/org/eclipse/mylyn/gerrit/tests/core/client/GerritClientTest.java
+++ b/org.eclipse.mylyn.gerrit.tests/src/org/eclipse/mylyn/gerrit/tests/core/client/GerritClientTest.java
@@ -28,10 +28,12 @@ import org.eclipse.mylyn.internal.gerrit.core.client.GerritAuthenticationState;
import org.eclipse.mylyn.internal.gerrit.core.client.GerritClient;
import org.eclipse.mylyn.internal.gerrit.core.client.GerritConfiguration;
import org.eclipse.mylyn.internal.gerrit.core.client.GerritException;
+import org.eclipse.mylyn.internal.gerrit.core.client.GerritVersion;
import org.eclipse.mylyn.internal.gerrit.core.client.compat.CommentLink;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
+import org.osgi.framework.Version;
import com.google.gerrit.reviewdb.Account;
@@ -118,15 +120,15 @@ public class GerritClientTest extends TestCase {
@Test
public void testGetVersion() throws Exception {
- assertEquals(getCurrentVersion(), client.getVersion(new NullProgressMonitor()).toString());
+ assertEquals(getCurrentVersion(), client.getVersion(new NullProgressMonitor()));
}
- private static String getCurrentVersion() {
- String simpleInfo = GerritFixture.current().getSimpleInfo();
- if (simpleInfo.indexOf('/') != -1) {
- return simpleInfo.substring(0, simpleInfo.indexOf('/'));
+ private static Version getCurrentVersion() {
+ String version = GerritFixture.current().getSimpleInfo();
+ if (version.indexOf('/') != -1) {
+ version = version.substring(0, version.indexOf('/'));
}
- return simpleInfo;
+ return GerritVersion.parseGerritVersion(version);
}
}