forked from codehaus-plexus/plexus-archiver
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
codehaus-plexus#130 Added test case for DirectoryArchiver
- Loading branch information
Showing
1 changed file
with
43 additions
and
0 deletions.
There are no files selected for viewing
43 changes: 43 additions & 0 deletions
43
src/test/java/org/codehaus/plexus/archiver/dir/DirectoryArchiverTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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()); | ||
} | ||
} |