Adjust integration test for new folder .ci
This commit is contained in:
@ -29,9 +29,10 @@
|
||||
<exclude>**/.idea/**</exclude>
|
||||
<exclude>**/*.iml</exclude>
|
||||
|
||||
<exclude>.travis/secrets.tar</exclude>
|
||||
<exclude>.travis/id_rsa</exclude>
|
||||
<exclude>.travis/*.gpg</exclude>
|
||||
<exclude>.ci/files/id_rsa</exclude>
|
||||
<exclude>.ci/files/private-env</exclude>
|
||||
<exclude>.ci/files/public-env</exclude>
|
||||
<exclude>.ci/files/release-signing-key-D0BF1D737C9A1C22.gpg.gpg</exclude>
|
||||
|
||||
<exclude>.bundle/**</exclude>
|
||||
<exclude>vendor/**</exclude>
|
||||
|
@ -10,7 +10,6 @@ import java.io.File;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
@ -19,7 +18,6 @@ import net.sourceforge.pmd.PMDVersion;
|
||||
|
||||
public class SourceDistributionIT {
|
||||
private static final String BASE_PATH = "pmd-src-" + PMDVersion.VERSION;
|
||||
private static final Pattern GPG_PATTERN = Pattern.compile(Pattern.quote(BASE_PATH + "/.travis/") + ".+\\.[gG][pP][gG]");
|
||||
|
||||
private File getSourceDistribution() {
|
||||
return new File(".", "target/" + BASE_PATH + ".zip");
|
||||
@ -33,13 +31,14 @@ public class SourceDistributionIT {
|
||||
@Test
|
||||
public void verifyExclusions() throws Exception {
|
||||
Set<String> exclusions = new HashSet<>();
|
||||
exclusions.add(BASE_PATH + "/.travis/secrets.tar");
|
||||
exclusions.add(BASE_PATH + "/.travis/id_rsa");
|
||||
exclusions.add(BASE_PATH + "/.ci/files/id_rsa");
|
||||
exclusions.add(BASE_PATH + "/.ci/files/private-env");
|
||||
exclusions.add(BASE_PATH + "/.ci/files/public-env");
|
||||
exclusions.add(BASE_PATH + "/.ci/files/release-signing-key-D0BF1D737C9A1C22.gpg.gpg");
|
||||
List<String> files = ZipFileExtractor.readZipFile(getSourceDistribution().toPath());
|
||||
|
||||
for (String file : files) {
|
||||
Assert.assertFalse("File " + file + " must not be included", exclusions.contains(file)
|
||||
|| GPG_PATTERN.matcher(file).matches());
|
||||
Assert.assertFalse("File " + file + " must not be included", exclusions.contains(file));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user