Skip to content

Fix tests that fail when run twice in a row #62

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import org.codehaus.plexus.archiver.Archiver;
import org.codehaus.plexus.archiver.UnArchiver;
import org.codehaus.plexus.archiver.xz.XZArchiver;
import org.codehaus.plexus.util.FileUtils;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertTrue;
import static org.codehaus.plexus.PlexusTestCase.getTestFile;
Expand Down Expand Up @@ -48,6 +49,10 @@ public void testExtract()
assertFalse( file2InTar.exists() );

File testXZFile = getTestFile( "target/output/archive.tar.xz" );
if ( testXZFile.exists() )
{
FileUtils.fileDelete( testXZFile.getPath() );
}
assertFalse( testXZFile.exists() );

tarArchiver.addFile( getTestFile( "src/test/resources/manifests/manifest1.mf" ), fileName1 );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ public void testCreateArchive()
inputFiles[0] = "archiveForxz.zip";

File targetOutputFile = getTestFile( "target/output/archive.xz" );
if ( targetOutputFile.exists() )
{
FileUtils.fileDelete( targetOutputFile.getPath() );
}
assertFalse( targetOutputFile.exists() );

archiver.addDirectory( getTestFile( "target/output" ), inputFiles, null );
Expand Down