Skip to content

Commit

Permalink
codehaus-plexus#130 Cleaned up DirectoryArchiverTest
Browse files Browse the repository at this point in the history
  • Loading branch information
jameshans committed Feb 2, 2020
1 parent 7eb2752 commit 1ac8c06
Showing 1 changed file with 10 additions and 19 deletions.
Expand Up @@ -2,30 +2,14 @@

import java.io.File;
import java.io.IOException;
import org.junit.After;
import org.junit.Test;
import static org.junit.Assert.*;
import org.junit.Before;

public class DirectoryArchiverTest {

private static final File CURRENT_DIR = new File(".");
private static final File DEST_DIR = new File("target/output/testCreateDirsForSymlink");
private static final File SYMLINK_FILE = new File(DEST_DIR, "testSymlink");

@Before
public void prepare()
{
SYMLINK_FILE.delete();
DEST_DIR.delete();
}

@After
public void cleanUp()
{
prepare();
}

/**
* Test case for ISSUE-130
* @throws IOException
Expand All @@ -34,10 +18,17 @@ public void cleanUp()
public void testSymlinkWithParentDirectory()
throws IOException
{
removeSymlink();
DirectoryArchiver archiver = new DirectoryArchiver();
archiver.addSymlink(SYMLINK_FILE.getPath(), CURRENT_DIR.getPath());
archiver.setDestFile(CURRENT_DIR);
archiver.addSymlink( SYMLINK_FILE.getPath(), CURRENT_DIR.getPath() );
archiver.setDestFile( CURRENT_DIR );
archiver.execute();
assertTrue(SYMLINK_FILE.isDirectory());
removeSymlink();
}

private void removeSymlink()
{
SYMLINK_FILE.delete();
DEST_DIR.delete();
}
}

0 comments on commit 1ac8c06

Please sign in to comment.