Mock svn instance for testing svnkit tests

The project I'm working on interacts heavily with Subversion using svnkit.

Are there any examples to run a mock-in-memory svn instance to facilitate testing, etc.

Greetings

Marty

+3
source share
3 answers

It is very simple to create a temporary SVN repository in the file system that will be used during the test, which you can delete immediately at the end of the test. You must use the file: // protocol to access it.

import static org.junit.Assert.*;
import java.io.*;
import org.apache.commons.io.FileUtils;
import org.junit.*;
import org.tmatesoft.svn.core.*;

public class SVNTest {

    private static final String path = "/tmp/testrepo";
    SVNURL tgtURL;

    @Before
    public void setUp() throws Exception {
        SVNRepositoryFactoryImpl.setup();
        tgtURL = SVNRepositoryFactory.createLocalRepository( new File( path ), true , false );
    }

    @After
    public void tearDown() throws IOException {
        FileUtils.deleteDirectory(new File(path));
    }

    @Test
    public void test() {
        fail("Not yet implemented");
    }

}
+3
source

Why don't you just create a simple SVN repository with mock data? These are just a few of the teams.

+1

mockito, SVNkit

my 0.02 $

0

Source: https://habr.com/ru/post/1708547/


All Articles