Skip to content
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

unignore and fix test whose failure was incorrectly attributed to a JDK bug #12

Merged
merged 1 commit into from
Nov 16, 2020
Merged
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
12 changes: 2 additions & 10 deletions src/test/java/org/apache/maven/archiver/MavenArchiverTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,6 @@ public boolean isAddClasspath()
}

@Test
@Ignore("Currently not working on Linux JDK 9 which looks like a JDK bug at the moment. See comments in Tests")
public void testRecreation()
throws Exception
{
Expand All @@ -264,10 +263,8 @@ public void testRecreation()
assertThat( jarFile ).exists();

long history = System.currentTimeMillis() - 60000L;
System.out.println( "history: " + history );
jarFile.setLastModified( history );
long time = jarFile.lastModified();
System.out.println( "Time:" + time );

List<File> files = FileUtils.getFiles( new File( "target/maven-archiver" ), "**/**", null, true );
for ( File file : files )
Expand All @@ -276,13 +273,8 @@ public void testRecreation()
}

archiver.createArchive( session, project, config );
// Is the assumption correct that the jar file itself
// should have the same last modified time as the files itself ?
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This assumption was not correct.


// Based on some experiments with a result like this:
// History 1532810292406 time:1532810292000 expected:<1532810352000> but was:<1532810292000>
// It looks like a JDK Bug: https://bugs.java.com/bugdatabase/view_bug.do?bug_id=8177809
assertThat( time ).as( "History " + history + " time:" + time ).isEqualTo( jarFile.lastModified() );

assertThat( history ).as( "History " + history + " time:" + time ).isEqualTo( jarFile.lastModified() );

config.setForced( true );
archiver.createArchive( session, project, config );
Expand Down