changeset 549:80a45e45918c

Run subrepo tests only for hg with revsets
author Dmitry Neverov <dmitry.neverov@jetbrains.com>
date Mon, 25 Feb 2013 12:22:27 +0400
parents 6c8911ed66f2
children 2fbe8c7fa710
files mercurial-tests/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/BookmarksTest.java mercurial-tests/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/HgVersionConstraint.java mercurial-tests/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/SubrepoChangesTest.java
diffstat 3 files changed, 12 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial-tests/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/BookmarksTest.java	Thu Feb 21 18:46:43 2013 +0400
+++ b/mercurial-tests/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/BookmarksTest.java	Mon Feb 25 12:22:27 2013 +0400
@@ -24,7 +24,7 @@
 
 
 @RequiredHgVersion(min = "2.4")
-@Test(dataProviderClass = HgVersionConstraint.class, dataProvider = "create")
+@Test(dataProviderClass = HgVersionConstraint.class, dataProvider = "installedHgVersion")
 public class BookmarksTest {
 
   static {
--- a/mercurial-tests/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/HgVersionConstraint.java	Thu Feb 21 18:46:43 2013 +0400
+++ b/mercurial-tests/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/HgVersionConstraint.java	Mon Feb 25 12:22:27 2013 +0400
@@ -12,7 +12,7 @@
 public class HgVersionConstraint {
 
   @DataProvider
-  public static Object[][] create(Method testMethod) throws Exception {
+  public static Object[][] installedHgVersion(Method testMethod) throws Exception {
     HgVersion actualVersion = getHgVersion();
     RequiredHgVersion constaint = testMethod.getAnnotation(RequiredHgVersion.class);
     if (constaint == null)
--- a/mercurial-tests/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/SubrepoChangesTest.java	Thu Feb 21 18:46:43 2013 +0400
+++ b/mercurial-tests/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/SubrepoChangesTest.java	Mon Feb 25 12:22:27 2013 +0400
@@ -4,6 +4,7 @@
 import jetbrains.buildServer.TempFiles;
 import jetbrains.buildServer.log.Log4jFactory;
 import jetbrains.buildServer.vcs.*;
+import org.jetbrains.annotations.NotNull;
 import org.testng.annotations.AfterMethod;
 import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.Test;
@@ -23,7 +24,8 @@
 import static org.hamcrest.Matchers.*;
 import static org.testng.AssertJUnit.assertEquals;
 
-@Test
+@RequiredHgVersion(min = "1.7.0") //support subrepos only for hg with revsets
+@Test(dataProviderClass = HgVersionConstraint.class, dataProvider = "installedHgVersion")
 public class SubrepoChangesTest {
 
   static {
@@ -59,28 +61,28 @@
   }
 
 
-  public void should_report_changes_from_subrepos() throws Exception {
+  public void should_report_changes_from_subrepos(@NotNull HgVersion _) throws Exception {
     VcsRoot root = vcsRoot().withUrl(myRemoteRepo1.getAbsolutePath()).withSubrepoChanges(true).build();
     List<ModificationData> changes = myVcs.collectChanges(root, "d350e7209906", "09c256b6163e", CheckoutRules.DEFAULT);
     assertEquals(3, changes.size());
   }
 
 
-  public void should_not_report_any_changes_when_subrepo_removed() throws Exception {
+  public void should_not_report_any_changes_when_subrepo_removed(@NotNull HgVersion _) throws Exception {
     VcsRoot root = vcsRoot().withUrl(myRemoteRepo1.getAbsolutePath()).withSubrepoChanges(true).build();
     List<ModificationData> changes = myVcs.collectChanges(root, "34017377d9c3", "4d7b3db8779f", CheckoutRules.DEFAULT);
     assertEquals(1, changes.size());
   }
 
 
-  public void should_not_report_any_changes_when_subrepo_added() throws Exception {
+  public void should_not_report_any_changes_when_subrepo_added(@NotNull HgVersion _) throws Exception {
     VcsRoot root = vcsRoot().withUrl(myRemoteRepo1.getAbsolutePath()).withSubrepoChanges(true).build();
     List<ModificationData> changes = myVcs.collectChanges(root, "4d7b3db8779f", "d350e7209906", CheckoutRules.DEFAULT);
     assertEquals(1, changes.size());
   }
 
 
-  public void should_report_subrepo_changes_recursevly() throws Exception {
+  public void should_report_subrepo_changes_recursevly(@NotNull HgVersion _) throws Exception {
     VcsRoot root = vcsRoot().withUrl(myRemoteRepo1.getAbsolutePath()).withSubrepoChanges(true).build();
     List<ModificationData> changes = myVcs.collectChanges(root, "09c256b6163e", "d64d9799c143", CheckoutRules.DEFAULT);
     assertEquals(5, changes.size());
@@ -103,7 +105,7 @@
   }
 
 
-  public void report_subrepo_changes_without_revsets() throws Exception {
+  public void report_subrepo_changes_without_revsets(@NotNull HgVersion _) throws Exception {
     ServerPluginConfig pluginConfig = new ServerPluginConfigBuilder()
             .cachesDir(myTempFiles.createTempDir())
             .detectSubrepoChanges(true)
@@ -116,7 +118,7 @@
   }
 
 
-  public void report_subrepo_revision_changed() throws Exception {
+  public void report_subrepo_revision_changed(@NotNull HgVersion _) throws Exception {
     ServerPluginConfig pluginConfig = new ServerPluginConfigBuilder()
             .cachesDir(myTempFiles.createTempDir())
             .detectSubrepoChanges(true)
@@ -135,7 +137,7 @@
   }
 
 
-  public void report_subrepo_changes() throws Exception {
+  public void report_subrepo_changes(@NotNull HgVersion _) throws Exception {
     ServerPluginConfig pluginConfig = new ServerPluginConfigBuilder()
             .cachesDir(myTempFiles.createTempDir())
             .detectSubrepoChanges(true)