mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-09 15:05:44 +01:00
add Test / HgBrowseCommand shouldResolveBranchForRevision
This commit is contained in:
@@ -33,6 +33,7 @@
|
|||||||
|
|
||||||
package sonia.scm.repository.spi;
|
package sonia.scm.repository.spi;
|
||||||
|
|
||||||
|
import com.aragost.javahg.commands.LogCommand;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import sonia.scm.repository.BrowserResult;
|
import sonia.scm.repository.BrowserResult;
|
||||||
import sonia.scm.repository.FileObject;
|
import sonia.scm.repository.FileObject;
|
||||||
@@ -40,6 +41,7 @@ import sonia.scm.repository.FileObject;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
|
||||||
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
import static org.junit.Assert.assertFalse;
|
import static org.junit.Assert.assertFalse;
|
||||||
import static org.junit.Assert.assertNotNull;
|
import static org.junit.Assert.assertNotNull;
|
||||||
@@ -79,6 +81,19 @@ public class HgBrowseCommandTest extends AbstractHgCommandTestBase {
|
|||||||
assertEquals("c", c.getPath());
|
assertEquals("c", c.getPath());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testBrowseShouldResolveBranchForRevision() throws IOException {
|
||||||
|
String defaultBranchRevision = new LogCommand(cmdContext.open()).rev("default").single().getNode();
|
||||||
|
|
||||||
|
BrowseCommandRequest browseCommandRequest = new BrowseCommandRequest();
|
||||||
|
browseCommandRequest.setRevision("default");
|
||||||
|
|
||||||
|
BrowserResult result = new HgBrowseCommand(cmdContext,
|
||||||
|
repository).getBrowserResult(browseCommandRequest);
|
||||||
|
|
||||||
|
assertThat(result.getRevision()).isEqualTo(defaultBranchRevision);
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testBrowseSubDirectory() throws IOException {
|
public void testBrowseSubDirectory() throws IOException {
|
||||||
BrowseCommandRequest request = new BrowseCommandRequest();
|
BrowseCommandRequest request = new BrowseCommandRequest();
|
||||||
|
|||||||
Reference in New Issue
Block a user