|
18 | 18 | * under the License. |
19 | 19 | */ |
20 | 20 |
|
21 | | -//import java.util.zip.*; |
22 | | -import org.apache.commons.compress.archivers.zip.*; |
| 21 | +//import java.util.zip.* |
| 22 | +import org.apache.commons.compress.archivers.zip.* |
23 | 23 |
|
24 | 24 | File deployDir = new File( basedir, 'target/repo/org/apache/maven/its/reproducible/1.0' ) |
25 | 25 |
|
26 | 26 | assert deployDir.exists() |
27 | 27 |
|
28 | | -assert new File( deployDir, 'reproducible-1.0-src.zip.sha1' ).text == '5ce34fc133d47cbc9c81195877dbe10b9ec7d864' |
29 | | -assert new File( deployDir, 'reproducible-1.0-src.tar.sha1' ).text == '0b9dc1da069705a93b4954a198c18bd248822bf8' |
30 | | -assert new File( deployDir, 'reproducible-1.0-src.jar.sha1' ).text == '289cb3ecd418b8099deefb930dc7aa39c06888cb' |
| 28 | +ZipFile zip = new ZipFile( new File( deployDir, "reproducible-1.0-src.zip" ) ) |
| 29 | +StringBuilder sb = new StringBuilder() |
| 30 | +for( ZipArchiveEntry entry : zip.getEntries() ) |
| 31 | +{ |
| 32 | + sb.append( String.format("%o %s\n", entry.getUnixMode(), entry.getName() ) ) |
| 33 | +} |
| 34 | +for( String type : [ "zip", "jar", "tar" ] ) |
| 35 | +{ |
| 36 | + String name = "reproducible-1.0-src." + type + ".sha1" |
| 37 | + sb.append( String.format("%s %s\n", new File( deployDir, name ).text, name ) ) |
| 38 | +} |
| 39 | + |
| 40 | +effective = sb.toString() |
| 41 | + |
| 42 | +// 3 different reference results: |
| 43 | +// 1. Windows does not support executable flag |
| 44 | +// 2. on *nix, based on system configuration, group flag differs |
| 45 | +reference = "zip-content-" + ( effective.contains( "644 executable" ) ? "win" : effective.contains( "0775" ) ? "775" : "755" ) + ".txt" |
| 46 | +content = new File( basedir, reference ).text.replace( "\r\n", "\n" ) |
| 47 | + |
| 48 | +assert content == effective |
0 commit comments