Package com.aragost.javahg

Examples of com.aragost.javahg.Repository


        Assert.assertEquals("x", result.get("y"));
    }

    @Test
    public void testCopyFileToFileInDir() throws IOException {
        Repository repo = getTestRepository();
        writeFile("x", "");
        commit();
        new File(repo.getDirectory(), "b").mkdir();

        Map<String, String> result = RenameCommand.on(repo).execute("x", "b/y");
        Assert.assertEquals(1, result.size());
        Assert.assertEquals("x", result.get(osSep("b/y")));
    }
View Full Code Here


        Assert.assertEquals("x", result.get(osSep("b/y")));
    }

    @Test
    public void testCopyFileInDirToFileInDir() throws IOException {
        Repository repo = getTestRepository();
        new File(repo.getDirectory(), "a").mkdir();
        new File(repo.getDirectory(), "b").mkdir();
        writeFile("a/x", "");
        commit();

        Map<String, String> result = RenameCommand.on(repo).execute("a/x", "b/y");
        Assert.assertEquals(1, result.size());
View Full Code Here

        Assert.assertEquals(osSep("a/x"), result.get(osSep("b/y")));
    }

    @Test
    public void testCopyFileToDir() throws IOException {
        Repository repo = getTestRepository();
        new File(repo.getDirectory(), "b").mkdir();
        writeFile("x", "");
        commit();

        Map<String, String> result = RenameCommand.on(repo).execute("x", "b");
        Assert.assertEquals(1, result.size());
View Full Code Here

        Assert.assertEquals("x", result.get(osSep("b/x")));
    }

    @Test
    public void testCopyDirToDir() throws IOException {
        Repository repo = getTestRepository();
        new File(repo.getDirectory(), "a").mkdir();
        new File(repo.getDirectory(), "b").mkdir();
        writeFile("a/x", "");
        commit();

        Map<String, String> result = RenameCommand.on(repo).execute("a", "b");
        Assert.assertEquals(1, result.size());
View Full Code Here

        Assert.assertEquals(osSep("a/x"), result.get(osSep("b/a/x")));
    }

    @Test
    public void testCopyDirToDirInDir() throws IOException {
        Repository repo = getTestRepository();
        new File(repo.getDirectory(), "a").mkdir();
        new File(repo.getDirectory(), "b/c").mkdirs();
        writeFile("a/x", "");
        commit();

        Map<String, String> result = RenameCommand.on(repo).execute("a", "b/c");
        Assert.assertEquals(1, result.size());
View Full Code Here

        Assert.assertEquals(osSep("a/x"), result.get(osSep("b/c/a/x")));
    }

    @Test
    public void testCopyMultipleFiles() throws IOException {
        Repository repo = getTestRepository();
        new File(repo.getDirectory(), "a").mkdir();
        writeFile("a/x", "");
        writeFile("a/y", "");
        writeFile("z", "");
        commit();

        new File(repo.getDirectory(), "dst").mkdir();
        Map<String, String> result = RenameCommand.on(repo).execute("z", "a",
                "dst");
        Assert.assertEquals(3, result.size());
        Assert.assertEquals(osSep("a/x"), result.get(osSep("dst/a/x")));
        Assert.assertEquals(osSep("a/y"), result.get(osSep("dst/a/y")));
View Full Code Here

        Assert.assertEquals("z", result.get(osSep("dst/z")));
    }

    @Test(expected = IllegalArgumentException.class)
    public void testOneFile() throws IOException {
        Repository repo = getTestRepository();
        RenameCommand.on(repo).execute("a");
    }
View Full Code Here

        RenameCommand.on(repo).execute("a");
    }

    @Test(expected = NullPointerException.class)
    public void testNullPointer() throws IOException {
        Repository repo = getTestRepository();
        RenameCommand.on(repo).execute((String[]) null);
    }
View Full Code Here

        RenameCommand.on(repo).execute((String[]) null);
    }

    @Test
    public void testCopyWithAfterFlag() throws IOException {
        Repository repo = getTestRepository();
        File dir = repo.getDirectory();
        writeFile("x", "");
        commit();
        new File(dir, "x").renameTo(new File(dir, "y"));

        Map<String, String> result = RenameCommand.on(repo).after()
View Full Code Here

        Assert.assertEquals("x", result.get("y"));
    }

    @Test
    public void testCopyAddedFile() throws IOException {
        Repository repo = getTestRepository();
        writeFile("x", "");
        AddCommand.on(repo).execute();

        // The 'x has not been committed yet, so no copy data will be
        // stored for x.' message is sent on stderr and is notparsed
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.