Package com.aragost.javahg

Examples of com.aragost.javahg.RepositoryConfiguration


        server.initMecurialRepository(dir);
        return dir;
    }

    protected static RepositoryConfiguration makeRepoConf() {
        RepositoryConfiguration conf = new RepositoryConfiguration();
        conf.setCachePolicy(CachePolicy.WEAK);
        conf.addExtension(JavaHgTestExtension.class);

        return conf;
    }
View Full Code Here


    }

    @Test
    public void testKillServerProcess() throws IOException {
        File dir = Files.createTempDir();
        RepositoryConfiguration repoConfig = new RepositoryConfiguration();
        repoConfig.addExtension(JavaHgTestExtension.class);
        Repository repo = Repository.create(repoConfig, dir);
        Process process = getFirstServer(repo).getProcess();
        process.destroy();
        // Process is dead and we can't send command
        try {
View Full Code Here

    }

    @Test
    @Ignore
    public void testStderrDuringStartup() throws IOException {
        RepositoryConfiguration conf = new RepositoryConfiguration();
        String stderr = retrieveStartupStderr(conf);
        Assert.assertTrue("stderr=" + stderr,
                stderr.startsWith("*** failed to import extension javahgmissing from javahgmissing: [Errno 2]"));
    }
View Full Code Here

                stderr.startsWith("*** failed to import extension javahgmissing from javahgmissing: [Errno 2]"));
    }

    @Test
    public void testStderrDuringStartupWillFullBuffer() throws IOException {
        RepositoryConfiguration conf = new RepositoryConfiguration();
        conf.setStderrBufferSize(1);
        String stderr = retrieveStartupStderr(conf);
        Assert.assertEquals("*", stderr);
    }
View Full Code Here

        return 0;
    }
   
    @Test
    public void testServerIdle() throws InterruptedException {
        RepositoryConfiguration conf = makeRepoConf();
        conf.setServerIdleTime(1);
        BaseRepository repo = Repository.create(conf, Files.createTempDir());

        Assert.assertEquals(1, repo.getServerPool().getNumIdleServers());

        Thread.sleep(2000);
View Full Code Here

        System.err.println("Cache stats: " + repo.getCacheStats());
    }

    @Test
    public void stressTestConcurrency() throws InterruptedException, IOException {
        RepositoryConfiguration conf = makeRepoConf();
        conf.setConcurrency(3);
        BaseRepository repo = Repository.create(conf, Files.createTempDir());

        Stats stats = new Stats();
        List<StressThread> threads = Lists.newArrayList();
View Full Code Here

        // Without that available call in checkStderr typically not
        // everything from stderr will be read and this testcase fails
        // Assume.assumeTrue(System.getProperty("java.runtime.version").compareTo("1.7")
        // < 0);
        BaseRepository repo = getTestRepository();
        RepositoryConfiguration configuration = repo.getConfiguration();
        int bufSize = configuration.getStderrBufferSize();
        String longMessage = Strings.repeat("x", bufSize + 100) + "A";
        GenericCommand cmd = new GenericCommand(repo, "javahg-stderr");
        try {
            cmd.execute(longMessage);
            assertFailedExecution(cmd);
View Full Code Here

        // Without that available call in checkStderr typically not
        // everything from stderr will be read and this testcase fails
        // Assume.assumeTrue(System.getProperty("java.runtime.version").compareTo("1.7")
        // < 0);
        BaseRepository repo = getTestRepository();
        RepositoryConfiguration configuration = repo.getConfiguration();
        int bufSize = configuration.getStderrBufferSize();
        String longMessage = Strings.repeat("x", bufSize + 100) + "A";
        GenericCommand cmd = new GenericCommand(repo, "javahg-stderr");
        try {
            cmd.execute(longMessage);
            assertFailedExecution(cmd);
View Full Code Here

    }

    @Test
    public void testKillServerProcess() throws IOException {
        File dir = Files.createTempDir();
        RepositoryConfiguration repoConfig = new RepositoryConfiguration();
        repoConfig.addExtension(JavaHgTestExtension.class);
        Repository repo = Repository.create(repoConfig, dir);
        Process process = getFirstServer(repo).getProcess();
        process.destroy();
        // Process is dead and we can't send command
        try {
View Full Code Here

    }

    @Test
    @Ignore
    public void testStderrDuringStartup() throws IOException {
        RepositoryConfiguration conf = new RepositoryConfiguration();
        String stderr = retrieveStartupStderr(conf);
        Assert.assertTrue("stderr=" + stderr,
                stderr.startsWith("*** failed to import extension javahgmissing from javahgmissing: [Errno 2]"));
    }
View Full Code Here

TOP

Related Classes of com.aragost.javahg.RepositoryConfiguration

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.