Package com.aragost.javahg

Examples of com.aragost.javahg.Repository


        }
    }

    @Test
    public void testUntracked() throws IOException {
        Repository repo = getTestRepository();
        writeFile("a", "");

        RemoveCommand cmd = RemoveCommand.on(repo);
        cmd.execute("a");
        Assert.assertEquals("not removing a: file is untracked\n", cmd.getErrorString());
View Full Code Here


        Assert.assertEquals("not removing a: file is untracked\n", cmd.getErrorString());
    }

    @Test
    public void testNoSuchFile() throws IOException {
        Repository repo = getTestRepository();

        RemoveCommand cmd = RemoveCommand.on(repo);
        cmd.execute("a");
        Assert.assertEquals("a: " + getMissingFileErrorText() + "\n", cmd.getErrorString());
    }
View Full Code Here

        Assert.assertEquals("a: " + getMissingFileErrorText() + "\n", cmd.getErrorString());
    }

    @Test
    public void testMixedSuccess() throws IOException {
        Repository repo = getTestRepository();
        writeFile("a", "");
        commit();

        RemoveCommand cmd = RemoveCommand.on(repo);
        List<File> result = cmd.execute(new File("a"), new File("b"));
View Full Code Here

public class LogCommandTest extends AbstractTestCase {

    @Test
    public void test() throws IOException {
        Repository repo = getTestRepository();
        writeFile("x", "abc");

        LogCommand log = LogCommand.on(repo);
        CommitCommand commit = CommitCommand.on(repo);
        AddCommand.on(repo).execute();
View Full Code Here

        Assert.assertEquals("x", cs.getModifiedFiles().get(0));
    }

    @Test
    public void testLimit() throws IOException {
        Repository repo = getTestRepository();
        writeFile("a");
        commit();
        writeFile("b");
        commit();
        List<Changeset> log = LogCommand.on(repo).limit(1).execute();
View Full Code Here

        Assert.assertEquals(1, log.size());
    }
   
    @Test
    public void testEagerLoading() throws IOException{
        Repository repo = getTestRepository();
        writeFile("a", "abc");
        AddCommand.on(repo).execute();
        Changeset c = CommitCommand.on(repo).user("test").message("added file a").execute();
        String nodeId = c.getNode();
        c = LogCommand.on(repo).fileStatus().rev(nodeId).single();
View Full Code Here

public class ManifestCommandTest extends AbstractTestCase {

    @Test
    public void test() throws IOException {
        Repository repo = getTestRepository();
        writeFile("a");
        writeFile("b");
        commit();
        List<File> manifest = ManifestCommand.on(repo).execute();
        Assert.assertEquals(2, manifest.size());
View Full Code Here

        Assert.assertEquals("b", manifest.get(1).getName());
    }

    @Test
    public void testSingleRevision() throws IOException {
        Repository repo = getTestRepository();
        writeFile("a");
        commit();
        writeFile("b");
        commit();
        ManifestCommand cmd = ManifestCommand.on(repo).rev("0");
View Full Code Here

        Assert.assertEquals("a", manifest.get(0).getName());
    }

    @Test
    public void testAllRevisions() throws IOException {
        Repository repo = getTestRepository();
        writeFile("a");
        commit();
        deleteFile("a");
        commit();
        ManifestCommand cmd = ManifestCommand.on(repo).all();
View Full Code Here

public class CatCommandTest extends AbstractTestCase {

    @Test
    public void test() throws IOException {
        String data = "This is a binary file:\n\0\1\2\3\4\5\6\7";
        Repository repo = getTestRepository();
        writeFile("a", data);
        commit();

        InputStream stream = CatCommand.on(repo).execute("a");
        byte[] result = new byte[data.getBytes().length];
View Full Code Here

TOP

Related Classes of com.aragost.javahg.Repository

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.