COMMONSSITE-108: adding assert statements on the scm commit directory
Project: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/commit/d92c25ac Tree: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/tree/d92c25ac Diff: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/diff/d92c25ac Branch: refs/heads/master Commit: d92c25ac64cc371a447692731233479ca98b31af Parents: 0c14b25 Author: Rob Tompkins <[email protected]> Authored: Mon May 21 15:20:59 2018 -0400 Committer: Rob Tompkins <[email protected]> Committed: Mon May 21 15:20:59 2018 -0400 ---------------------------------------------------------------------- checkstyle-suppressions.xml | 1 + .../mojos/CommonsDistributionStagingMojo.java | 2 +- .../CommonsDistributionStagingMojoTest.java | 54 ++++++++++++++++++++ 3 files changed, 56 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/d92c25ac/checkstyle-suppressions.xml ---------------------------------------------------------------------- diff --git a/checkstyle-suppressions.xml b/checkstyle-suppressions.xml index d5c3419..f00b456 100644 --- a/checkstyle-suppressions.xml +++ b/checkstyle-suppressions.xml @@ -30,5 +30,6 @@ <suppress checks="LineLength" files=".*CommonsDistributionDetachmentMojoTest.java" /> + <suppress checks="LineLength" files=".*CommonsDistributionStagingMojoTest.java" /> <suppress checks="FinalClassCheck" files=".*Delegate.java" /> </suppressions> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/d92c25ac/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionStagingMojo.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionStagingMojo.java b/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionStagingMojo.java index 6a4839c..eac1289 100644 --- a/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionStagingMojo.java +++ b/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionStagingMojo.java @@ -261,7 +261,7 @@ public class CommonsDistributionStagingMojo extends AbstractMojo { copy = new File(scmBinariesRoot, file.getName()); SharedFunctions.copyFile(getLog(), file, copy); filesForMavenScmFileSet.add(copy); - } else if (StringUtils.containsAny(file.getName(), "scm", "sha1.properties")) { + } else if (StringUtils.containsAny(file.getName(), "scm", "sha1.properties", "sha256.properties")) { getLog().debug("Not copying scm directory over " + "to the scm directory because it is the scm directory."); //do nothing because we are copying into scm http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/d92c25ac/src/test/java/org/apache/commons/release/plugin/mojos/CommonsDistributionStagingMojoTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/release/plugin/mojos/CommonsDistributionStagingMojoTest.java b/src/test/java/org/apache/commons/release/plugin/mojos/CommonsDistributionStagingMojoTest.java index bf3906e..885ac3e 100644 --- a/src/test/java/org/apache/commons/release/plugin/mojos/CommonsDistributionStagingMojoTest.java +++ b/src/test/java/org/apache/commons/release/plugin/mojos/CommonsDistributionStagingMojoTest.java @@ -76,7 +76,61 @@ public class CommonsDistributionStagingMojoTest { mojoForTest.setBasedir(releaseNotesBasedir); mojoForTest.execute(); File targetScmDirectory = new File(COMMONS_RELEASE_PLUGIN_TEST_DIR_PATH + "/scm"); + File releaseNotes = new File(COMMONS_RELEASE_PLUGIN_TEST_DIR_PATH + "/scm/RELEASE-NOTES.txt"); + File readmeHtml = new File(COMMONS_RELEASE_PLUGIN_TEST_DIR_PATH + "/scm/README.html"); + File headerHtml = new File(COMMONS_RELEASE_PLUGIN_TEST_DIR_PATH + "/scm/HEADER.html"); + File binariesReadmeHtml = new File(COMMONS_RELEASE_PLUGIN_TEST_DIR_PATH + "/scm/binaries/README.html"); + File binariesHeaderHtml = new File(COMMONS_RELEASE_PLUGIN_TEST_DIR_PATH + "/scm/binaries/HEADER.html"); + File binTar = new File(COMMONS_RELEASE_PLUGIN_TEST_DIR_PATH + "/scm/binaries/mockAttachedTar-bin.tar.gz"); + File binTarASC = new File(COMMONS_RELEASE_PLUGIN_TEST_DIR_PATH + "/scm/binaries/mockAttachedTar-bin.tar.gz.asc"); + File binTarMD5 = new File(COMMONS_RELEASE_PLUGIN_TEST_DIR_PATH + "/scm/binaries/mockAttachedTar-bin.tar.gz.md5"); + File binTarSHA1 = new File(COMMONS_RELEASE_PLUGIN_TEST_DIR_PATH + "/scm/binaries/mockAttachedTar-bin.tar.gz.sha1"); + File binTarSHA256 = new File(COMMONS_RELEASE_PLUGIN_TEST_DIR_PATH + "/scm/binaries/mockAttachedTar-bin.tar.gz.sha256"); + File binZip = new File(COMMONS_RELEASE_PLUGIN_TEST_DIR_PATH + "/scm/binaries/mockAttachedZip-bin.zip"); + File binZipASC = new File(COMMONS_RELEASE_PLUGIN_TEST_DIR_PATH + "/scm/binaries/mockAttachedZip-bin.zip.asc"); + File binZipMD5 = new File(COMMONS_RELEASE_PLUGIN_TEST_DIR_PATH + "/scm/binaries/mockAttachedZip-bin.zip.md5"); + File binZipSHA1 = new File(COMMONS_RELEASE_PLUGIN_TEST_DIR_PATH + "/scm/binaries/mockAttachedZip-bin.zip.sha1"); + File binZipSHA256 = new File(COMMONS_RELEASE_PLUGIN_TEST_DIR_PATH + "/scm/binaries/mockAttachedZip-bin.zip.sha256"); + File sourcesReadmeHtml = new File(COMMONS_RELEASE_PLUGIN_TEST_DIR_PATH + "/scm/binaries/README.html"); + File sourceHeaderHtml = new File(COMMONS_RELEASE_PLUGIN_TEST_DIR_PATH + "/scm/binaries/HEADER.html"); + File srcTar = new File(COMMONS_RELEASE_PLUGIN_TEST_DIR_PATH + "/scm/source/mockAttachedTar-src.tar.gz"); + File srcTarASC = new File(COMMONS_RELEASE_PLUGIN_TEST_DIR_PATH + "/scm/source/mockAttachedTar-src.tar.gz.asc"); + File srcTarMD5 = new File(COMMONS_RELEASE_PLUGIN_TEST_DIR_PATH + "/scm/source/mockAttachedTar-src.tar.gz.md5"); + File srcTarSHA1 = new File(COMMONS_RELEASE_PLUGIN_TEST_DIR_PATH + "/scm/source/mockAttachedTar-src.tar.gz.sha1"); + File srcTarSHA256 = new File(COMMONS_RELEASE_PLUGIN_TEST_DIR_PATH + "/scm/source/mockAttachedTar-src.tar.gz.sha256"); + File srcZip = new File(COMMONS_RELEASE_PLUGIN_TEST_DIR_PATH + "/scm/source/mockAttachedZip-src.zip"); + File srcZipASC = new File(COMMONS_RELEASE_PLUGIN_TEST_DIR_PATH + "/scm/source/mockAttachedZip-src.zip.asc"); + File srcZipMD5 = new File(COMMONS_RELEASE_PLUGIN_TEST_DIR_PATH + "/scm/source/mockAttachedZip-src.zip.md5"); + File srcZipSHA1 = new File(COMMONS_RELEASE_PLUGIN_TEST_DIR_PATH + "/scm/source/mockAttachedZip-src.zip.sha1"); + File srcZipSHA256 = new File(COMMONS_RELEASE_PLUGIN_TEST_DIR_PATH + "/scm/source/mockAttachedZip-src.zip.sha256"); assertTrue(targetScmDirectory.exists()); + assertTrue(releaseNotes.exists()); + assertTrue(readmeHtml.exists()); + assertTrue(headerHtml.exists()); + assertTrue(binariesReadmeHtml.exists()); + assertTrue(binariesHeaderHtml.exists()); + assertTrue(binTar.exists()); + assertTrue(binTarASC.exists()); + assertTrue(binTarMD5.exists()); + assertTrue(binTarSHA1.exists()); + assertTrue(binTarSHA256.exists()); + assertTrue(binZip.exists()); + assertTrue(binZipASC.exists()); + assertTrue(binZipMD5.exists()); + assertTrue(binZipSHA1.exists()); + assertTrue(binZipSHA256.exists()); + assertTrue(sourcesReadmeHtml.exists()); + assertTrue(sourceHeaderHtml.exists()); + assertTrue(srcTar.exists()); + assertTrue(srcTarASC.exists()); + assertTrue(srcTarMD5.exists()); + assertTrue(srcTarSHA1.exists()); + assertTrue(srcTarSHA256.exists()); + assertTrue(srcZip.exists()); + assertTrue(srcZipASC.exists()); + assertTrue(srcZipMD5.exists()); + assertTrue(srcZipSHA1.exists()); + assertTrue(srcZipSHA256.exists()); } @Test
