# HG changeset patch # User Artem Tikhomirov # Date 1303855095 -7200 # Node ID 883f1efbcf2791021f32e9d09bfc3c6396620d80 # Parent 66fd2c73c56f57739d6269c9b85708cb9b98cd1e Add clone,incoming and outging tests diff -r 66fd2c73c56f -r 883f1efbcf27 build.xml --- a/build.xml Tue Apr 26 15:52:33 2011 +0200 +++ b/build.xml Tue Apr 26 23:58:15 2011 +0200 @@ -80,11 +80,15 @@ + + + + diff -r 66fd2c73c56f -r 883f1efbcf27 src/org/tmatesoft/hg/core/HgCloneCommand.java --- a/src/org/tmatesoft/hg/core/HgCloneCommand.java Tue Apr 26 15:52:33 2011 +0200 +++ b/src/org/tmatesoft/hg/core/HgCloneCommand.java Tue Apr 26 23:58:15 2011 +0200 @@ -56,6 +56,11 @@ public HgCloneCommand() { } + /** + * @param folder location to become root of the repository (i.e. where .hg folder would reside). Either + * shall not exist or be empty otherwise. + * @return this for convenience + */ public HgCloneCommand destination(File folder) { destination = folder; return this; diff -r 66fd2c73c56f -r 883f1efbcf27 test/org/tmatesoft/hg/test/Configuration.java --- a/test/org/tmatesoft/hg/test/Configuration.java Tue Apr 26 15:52:33 2011 +0200 +++ b/test/org/tmatesoft/hg/test/Configuration.java Tue Apr 26 23:58:15 2011 +0200 @@ -21,7 +21,6 @@ import java.io.File; import java.util.ArrayList; import java.util.Arrays; -import java.util.Collections; import java.util.List; import org.tmatesoft.hg.repo.HgLookup; @@ -81,7 +80,9 @@ public List allRemote() throws Exception { if (remoteServers == null) { - remoteServers = Collections.singletonList("hg4j-gc"); // just a default + String rr = System.getProperty("hg4j.tests.remote"); + assertNotNull("System property hg4j.tests.remote is undefined", rr); + remoteServers = Arrays.asList(rr.split(" ")); } ArrayList rv = new ArrayList(remoteServers.size()); for (String key : remoteServers) { diff -r 66fd2c73c56f -r 883f1efbcf27 test/org/tmatesoft/hg/test/TestClone.java --- a/test/org/tmatesoft/hg/test/TestClone.java Tue Apr 26 15:52:33 2011 +0200 +++ b/test/org/tmatesoft/hg/test/TestClone.java Tue Apr 26 23:58:15 2011 +0200 @@ -24,6 +24,7 @@ import org.hamcrest.CoreMatchers; import org.junit.Rule; +import org.junit.Test; import org.tmatesoft.hg.core.HgCloneCommand; import org.tmatesoft.hg.repo.HgRemoteRepository; @@ -46,6 +47,7 @@ public TestClone() { } + @Test public void testSimpleClone() throws Exception { int x = 0; final File tempDir = Configuration.get().getTempDir(); diff -r 66fd2c73c56f -r 883f1efbcf27 test/org/tmatesoft/hg/test/TestIncoming.java --- a/test/org/tmatesoft/hg/test/TestIncoming.java Tue Apr 26 15:52:33 2011 +0200 +++ b/test/org/tmatesoft/hg/test/TestIncoming.java Tue Apr 26 23:58:15 2011 +0200 @@ -70,7 +70,7 @@ // hg pull total/2 // hg in, hg4j in, compare List incoming = runAndCompareIncoming(localRepo, hgRemote); - Assert.assertTrue("Need remote repository of reasonable size to test incoming command for partially filled case", incoming.size() > 5); + Assert.assertTrue("Need remote repository of reasonable size to test incoming command for partially filled case", incoming.size() >= 5); // Nodeid median = incoming.get(incoming.size() / 2); System.out.println("About to pull up to revision " + median.shortNotation()); diff -r 66fd2c73c56f -r 883f1efbcf27 test/org/tmatesoft/hg/test/TestOutgoing.java --- a/test/org/tmatesoft/hg/test/TestOutgoing.java Tue Apr 26 15:52:33 2011 +0200 +++ b/test/org/tmatesoft/hg/test/TestOutgoing.java Tue Apr 26 23:58:15 2011 +0200 @@ -48,7 +48,6 @@ } public TestOutgoing() { - Configuration.get().remoteServers("http://localhost:8000/"); } @Test