Skip to content

Commit

Permalink
codehaus-plexus#130 Added test case for DirectoryArchiver
Browse files Browse the repository at this point in the history
  • Loading branch information
jameshans committed Feb 2, 2020
1 parent f72a9d7 commit 7eb2752
Showing 1 changed file with 43 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
package org.codehaus.plexus.archiver.dir;

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
*/
@Test
public void testSymlinkWithParentDirectory()
throws IOException
{
DirectoryArchiver archiver = new DirectoryArchiver();
archiver.addSymlink(SYMLINK_FILE.getPath(), CURRENT_DIR.getPath());
archiver.setDestFile(CURRENT_DIR);
archiver.execute();
assertTrue(SYMLINK_FILE.isDirectory());
}
}

0 comments on commit 7eb2752

Please sign in to comment.