@@ -0,0 +1,2536 @@
+package de.eleon.jswap;%0A%0Aimport com.google.common.collect.ImmutableList;%0Aimport com.jayway.awaitility.Awaitility;%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0A%0Aimport java.io.IOException;%0Aimport java.nio.file.Files;%0Aimport java.nio.file.Path;%0Aimport java.nio.file.Paths;%0Aimport java.util.concurrent.Callable;%0A%0Aimport static com.jayway.awaitility.Awaitility.await;%0Aimport static de.eleon.jswap.test.Util.dropCreate;%0Aimport static java.nio.file.Files.createDirectory;%0Aimport static java.nio.file.Files.createFile;%0A%0Apublic class JSwapIntegrationTest %7B%0A%0A    Path baseFrom;%0A    Path baseTo;%0A    Path baseFromB;%0A    Path baseToB;%0A%0A%0A    @Before%0A    public void setUp() throws IOException %7B%0A        baseFrom = dropCreate(%22/tmp/from%22);%0A        baseTo = dropCreate(%22/tmp/to%22);%0A        baseFromB = dropCreate(%22/tmp/fromB%22);%0A        baseToB = dropCreate(%22/tmp/toB%22);%0A%0A        Awaitility.reset();%0A    %7D%0A%0A    @Test%0A    public void shouldCopyFile() throws Exception %7B%0A        JSwap jSwap = new JSwap(ImmutableList.%3CConfig%3Ebuilder().add(new Config(baseFrom.toString(), baseTo.toString(), %22%22)).build());%0A        jSwap.run(true);%0A        createFile(Paths.get(baseFrom.toString(), %22/test.txt%22));%0A%0A        await(%22copy process%22)%0A                .until(fileExists(Paths.get(baseTo.toString(), %22/test.txt%22)));%0A    %7D%0A%0A    @Test%0A    public void shouldInitializeAgain() throws Exception %7B%0A        JSwap jSwap = new JSwap(ImmutableList.%3CConfig%3Ebuilder().add(new Config(baseFrom.toString(), baseTo.toString(), %22%22)).build());%0A        jSwap.run(true);%0A%0A        baseFrom = dropCreate(%22/tmp/from%22);%0A        baseTo = dropCreate(%22/tmp/to%22);%0A%0A        createFile(Paths.get(baseFrom.toString(), %22/test.txt%22));%0A%0A        await(%22copy process%22)%0A                .until(fileExists(Paths.get(baseTo.toString(), %22/test.txt%22)));%0A    %7D%0A%0A    @Test%0A    public void shouldCopyFileFromNewSubdir() throws Exception %7B%0A        JSwap jSwap = new JSwap(ImmutableList.%3CConfig%3Ebuilder().add(new Config(baseFrom.toString(), baseTo.toString(), %22%22)).build());%0A        jSwap.run(true);%0A%0A        createDirectory(Paths.get(baseFrom.toString(), %22/dir%22));%0A        createFile(Paths.get(baseFrom.toString(), %22/dir/test.txt%22));%0A%0A        await(%22copy process%22)%0A                .until(fileExists(Paths.get(baseTo.toString(), %22/dir/test.txt%22)));%0A    %7D%0A%0A    private Callable%3CBoolean%3E fileExists(final Path path) %7B%0A        return new Callable%3CBoolean%3E() %7B%0A            @Override%0A            public Boolean call() throws Exception %7B%0A                return Files.exists(path);%0A            %7D%0A        %7D;%0A    %7D%0A%0A%7D%0A

rename integration test