From 8536fe34be073cbb3c8fefee198d2dc5eded2451 Mon Sep 17 00:00:00 2001 From: Slava Semushin Date: Tue, 14 Feb 2017 22:30:38 +0100 Subject: [PATCH 01/19] [DO NOT MERGE] travis: run only travis profile. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index fc0df0fdfd..800bb994c1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,7 @@ language: java # @todo #1034 Travis CI: run tests on PostgreSQL env: matrix: - - SPRING_PROFILES_ACTIVE=test + #- SPRING_PROFILES_ACTIVE=test - SPRING_PROFILES_ACTIVE=travis global: - MAVEN_OPTS='-Xss256k' From 9f63ef3e5cda3fa22457931fc85d890146a8dc41 Mon Sep 17 00:00:00 2001 From: Slava Semushin Date: Tue, 14 Feb 2017 22:39:32 +0100 Subject: [PATCH 02/19] [DO NOT MERGE] make codenarc-maven-plugin fail. --- .../web/feature/collection/CollectionServiceImplTest.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/groovy/ru/mystamps/web/feature/collection/CollectionServiceImplTest.groovy b/src/test/groovy/ru/mystamps/web/feature/collection/CollectionServiceImplTest.groovy index d19c4c1f47..99a54f6f95 100644 --- a/src/test/groovy/ru/mystamps/web/feature/collection/CollectionServiceImplTest.groovy +++ b/src/test/groovy/ru/mystamps/web/feature/collection/CollectionServiceImplTest.groovy @@ -109,7 +109,7 @@ class CollectionServiceImplTest extends Specification { @SuppressWarnings(['ClosureAsLastMethodParameter', 'FactoryMethodName', 'UnnecessaryReturnKeyword']) def 'createCollection() should assign updated at to current date'() { when: - service.createCollection(Random.userId(), 'any-login') + service.createCollection(Random.userId(), "any-login") then: 1 * collectionDao.add({ AddCollectionDbDto collection -> assert DateUtils.roughlyEqual(collection?.updatedAt, new Date()) From 3ee0cb8e8f4ba8a4038df555a3b5587bd7218f99 Mon Sep 17 00:00:00 2001 From: Slava Semushin Date: Tue, 14 Feb 2017 22:41:48 +0100 Subject: [PATCH 03/19] [DO NOT MERGE] make maven-checkstyle-plugin fail. --- .../java/ru/mystamps/web/feature/account/UserServiceImpl.java | 1 + .../ru/mystamps/web/feature/category/CategoryController.java | 3 +-- .../ru/mystamps/web/feature/country/CountryController.java | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/ru/mystamps/web/feature/account/UserServiceImpl.java b/src/main/java/ru/mystamps/web/feature/account/UserServiceImpl.java index 6ad8f974da..36f1c93232 100644 --- a/src/main/java/ru/mystamps/web/feature/account/UserServiceImpl.java +++ b/src/main/java/ru/mystamps/web/feature/account/UserServiceImpl.java @@ -28,6 +28,7 @@ import java.util.Date; import java.util.Locale; +import static ru.mystamps.web.feature.account.UserDetails.Role.ADMIN; import static ru.mystamps.web.feature.account.UserDetails.Role.USER; @RequiredArgsConstructor diff --git a/src/main/java/ru/mystamps/web/feature/category/CategoryController.java b/src/main/java/ru/mystamps/web/feature/category/CategoryController.java index 63349ecf61..ce10499ad2 100644 --- a/src/main/java/ru/mystamps/web/feature/category/CategoryController.java +++ b/src/main/java/ru/mystamps/web/feature/category/CategoryController.java @@ -46,8 +46,7 @@ public class CategoryController { @InitBinder("addCategoryForm") protected void initBinder(WebDataBinder binder) { - // We can't use StringTrimmerEditor here because "only one single registered custom - // editor per property path is supported". + // We can't use StringTrimmerEditor here because "only one single registered custom editor per property path is supported". ReplaceRepeatingSpacesEditor editor = new ReplaceRepeatingSpacesEditor(true); binder.registerCustomEditor(String.class, "name", editor); binder.registerCustomEditor(String.class, "nameRu", editor); diff --git a/src/main/java/ru/mystamps/web/feature/country/CountryController.java b/src/main/java/ru/mystamps/web/feature/country/CountryController.java index 49e589e064..568a8822d4 100644 --- a/src/main/java/ru/mystamps/web/feature/country/CountryController.java +++ b/src/main/java/ru/mystamps/web/feature/country/CountryController.java @@ -17,6 +17,8 @@ */ package ru.mystamps.web.feature.country; +import javax.validation.Valid; + import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; @@ -32,7 +34,6 @@ import ru.mystamps.web.support.spring.mvc.ReplaceRepeatingSpacesEditor; import ru.mystamps.web.support.spring.security.CurrentUser; -import javax.validation.Valid; import java.util.List; import java.util.Locale; From db24eecab776349f8dfbdd19a831668f4beed5e0 Mon Sep 17 00:00:00 2001 From: Slava Semushin Date: Tue, 14 Feb 2017 22:42:58 +0100 Subject: [PATCH 04/19] [DO NOT MERGE] make maven-pmd-plugin fail. --- .../java/ru/mystamps/web/feature/series/JdbcSeriesDao.java | 6 ------ .../java/ru/mystamps/web/feature/site/SiteServiceImpl.java | 2 -- 2 files changed, 8 deletions(-) diff --git a/src/main/java/ru/mystamps/web/feature/series/JdbcSeriesDao.java b/src/main/java/ru/mystamps/web/feature/series/JdbcSeriesDao.java index 8de80ca1e1..d973326bce 100644 --- a/src/main/java/ru/mystamps/web/feature/series/JdbcSeriesDao.java +++ b/src/main/java/ru/mystamps/web/feature/series/JdbcSeriesDao.java @@ -34,12 +34,6 @@ import java.util.Map; // FIXME: move stamps related methods to separate interface (#88) -@SuppressWarnings({ - "PMD.AvoidDuplicateLiterals", - "PMD.TooManyMethods", - "PMD.TooManyFields", - "PMD.LongVariable" -}) @RequiredArgsConstructor public class JdbcSeriesDao implements SeriesDao { diff --git a/src/main/java/ru/mystamps/web/feature/site/SiteServiceImpl.java b/src/main/java/ru/mystamps/web/feature/site/SiteServiceImpl.java index d6f7366099..2dedff576e 100644 --- a/src/main/java/ru/mystamps/web/feature/site/SiteServiceImpl.java +++ b/src/main/java/ru/mystamps/web/feature/site/SiteServiceImpl.java @@ -37,7 +37,6 @@ public class SiteServiceImpl implements SiteService { private final SuspiciousActivityDao suspiciousActivities; @Override - @SuppressWarnings("PMD.UseObjectForClearerAPI") @Async @Transactional public void logAboutAbsentPage( @@ -61,7 +60,6 @@ public void logAboutAbsentPage( } @Override - @SuppressWarnings("PMD.UseObjectForClearerAPI") @Transactional public void logAboutFailedAuthentication( String page, From d182a9fdb523d5fa88e6a477683b838efe308906 Mon Sep 17 00:00:00 2001 From: Slava Semushin Date: Tue, 14 Feb 2017 22:43:49 +0100 Subject: [PATCH 05/19] [DO NOT MERGE] make license-maven-plugin fail. --- .../series/importing/SeriesImportDb.java | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/src/main/java/ru/mystamps/web/feature/series/importing/SeriesImportDb.java b/src/main/java/ru/mystamps/web/feature/series/importing/SeriesImportDb.java index f1c41e7bcd..6f3feae174 100644 --- a/src/main/java/ru/mystamps/web/feature/series/importing/SeriesImportDb.java +++ b/src/main/java/ru/mystamps/web/feature/series/importing/SeriesImportDb.java @@ -1,20 +1,3 @@ -/* - * Copyright (C) 2009-2019 Slava Semushin - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ package ru.mystamps.web.feature.series.importing; @SuppressWarnings("PMD.CommentDefaultAccessModifier") From 2c31c4e3d34c3d0511d65fc52fe2bf06a76d3e60 Mon Sep 17 00:00:00 2001 From: Slava Semushin Date: Tue, 14 Feb 2017 22:44:05 +0100 Subject: [PATCH 06/19] [DO NOT MERGE] make sortpom-maven-plugin fail. --- pom.xml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pom.xml b/pom.xml index eea930e68f..a099869b96 100644 --- a/pom.xml +++ b/pom.xml @@ -10,12 +10,6 @@ - - com.github.heneke.thymeleaf - thymeleaf-extras-togglz - ${thymeleaf.togglz.version} - - com.sun.mail @@ -35,6 +29,12 @@ ${thumbnailator.version} + + com.github.heneke.thymeleaf + thymeleaf-extras-togglz + ${thymeleaf.togglz.version} + + org.apache.commons commons-lang3 From cb34ee99a17395dcf7b3450d4dfa0aa55fc6ed4c Mon Sep 17 00:00:00 2001 From: Slava Semushin Date: Tue, 14 Feb 2017 22:44:44 +0100 Subject: [PATCH 07/19] [DO NOT MERGE] make jasmine-maven-plugin fail. --- src/test/javascript/CatalogUtilsSpec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/javascript/CatalogUtilsSpec.js b/src/test/javascript/CatalogUtilsSpec.js index 5d275c9ba9..a20e6f0651 100644 --- a/src/test/javascript/CatalogUtilsSpec.js +++ b/src/test/javascript/CatalogUtilsSpec.js @@ -13,7 +13,7 @@ describe("CatalogUtils.expandNumbers()", function() { }); it("should return string without hyphen as is", function() { - expect(CatalogUtils.expandNumbers("test")).toEqual("test"); + expect(CatalogUtils.expandNumbers("test")).toEqual("2test"); }); it("should return 'one-two' for 'one-two'", function() { From 8be9ff49f924c3568f48d5e2417727318da4029a Mon Sep 17 00:00:00 2001 From: Slava Semushin Date: Tue, 14 Feb 2017 22:45:20 +0100 Subject: [PATCH 08/19] [DO NOT MERGE] make spotbugs-maven-plugin fail. --- src/main/config/spotbugs-filter.xml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/main/config/spotbugs-filter.xml b/src/main/config/spotbugs-filter.xml index 70631b9b22..e67d68f519 100644 --- a/src/main/config/spotbugs-filter.xml +++ b/src/main/config/spotbugs-filter.xml @@ -147,13 +147,6 @@ - - - - - - -
  • - - 1 (current) - -
  • -
  • - - -
  • - - - + From fdf2aa87654f7914a76224569276393e1100a478 Mon Sep 17 00:00:00 2001 From: Slava Semushin Date: Thu, 23 Feb 2017 16:02:55 +0100 Subject: [PATCH 13/19] [DO NOT MERGE] make jasmine-maven-plugin fail. --- src/test/javascript/CatalogUtilsSpec.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/javascript/CatalogUtilsSpec.js b/src/test/javascript/CatalogUtilsSpec.js index a20e6f0651..c1dfc5ecf0 100644 --- a/src/test/javascript/CatalogUtilsSpec.js +++ b/src/test/javascript/CatalogUtilsSpec.js @@ -17,7 +17,7 @@ describe("CatalogUtils.expandNumbers()", function() { }); it("should return 'one-two' for 'one-two'", function() { - expect(CatalogUtils.expandNumbers("one-two")).toEqual("one-two"); + expect(CatalogUtils.expandNumbers("one-two")).toEqual("one two"); }); it("should return '1,2' for '1-2'", function() { @@ -81,7 +81,7 @@ describe("CatalogUtils.expandNumbers()", function() { }); it("should return '1,2,3' for '1/3'", function() { - expect(CatalogUtils.expandNumbers("1/3")).toEqual("1,2,3"); + expect(CatalogUtils.expandNumbers("1/3")).toEqual("1,2"); }); it("should return '1,2,3,4,5,6' for '1/3, 4-6'", function() { From d6d6317b67dbd782be37d494d6e1a444eae1edd1 Mon Sep 17 00:00:00 2001 From: Slava Semushin Date: Mon, 27 Feb 2017 23:10:22 +0100 Subject: [PATCH 14/19] [DO NOT MERGE] make html5validator fail. --- expected-validator.log | 3 +++ src/main/webapp/WEB-INF/views/participant/add.html | 2 ++ src/main/webapp/WEB-INF/views/site/events.html | 1 - 3 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 expected-validator.log diff --git a/expected-validator.log b/expected-validator.log new file mode 100644 index 0000000000..0a9aefb876 --- /dev/null +++ b/expected-validator.log @@ -0,0 +1,3 @@ +ERROR:html5validator.validator:"file:src/main/webapp/WEB-INF/views/participant/add.html":172.3-172.12: info warning: Element name "th:block" cannot be represented as XML 1.0. +"file:src/main/webapp/WEB-INF/views/participant/add.html":172.3-172.12: error: Element "th:block" not allowed as child of element "body" in this context. (Suppressing further errors from this subtree.) +"file:src/main/webapp/WEB-INF/views/site/events.html":15.2-15.8: error: Element "head" is missing a required instance of child element "title". diff --git a/src/main/webapp/WEB-INF/views/participant/add.html b/src/main/webapp/WEB-INF/views/participant/add.html index b80b4fb21b..7cfee51329 100644 --- a/src/main/webapp/WEB-INF/views/participant/add.html +++ b/src/main/webapp/WEB-INF/views/participant/add.html @@ -169,8 +169,10 @@

    + + diff --git a/src/main/webapp/WEB-INF/views/site/events.html b/src/main/webapp/WEB-INF/views/site/events.html index 8fbe43ac0f..dfc3e773dc 100644 --- a/src/main/webapp/WEB-INF/views/site/events.html +++ b/src/main/webapp/WEB-INF/views/site/events.html @@ -8,7 +8,6 @@ - My stamps: suspicious activities From a2e61dc834ec9f450d63d515942c812fede66d32 Mon Sep 17 00:00:00 2001 From: Slava Semushin Date: Wed, 1 Mar 2017 21:02:20 +0100 Subject: [PATCH 15/19] [DO NOT MERGE] make robotframework tests fail. --- src/test/robotframework/category/creation/logic.robot | 2 +- src/test/robotframework/series/access.robot | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/robotframework/category/creation/logic.robot b/src/test/robotframework/category/creation/logic.robot index 19bf7269ed..e340f3a84b 100644 --- a/src/test/robotframework/category/creation/logic.robot +++ b/src/test/robotframework/category/creation/logic.robot @@ -26,7 +26,7 @@ Create category with name in English and Russian Input Text id:nameRu Космос Submit Form id:add-category-form Location Should Be ${SITE_URL}/category/space - Element Text Should Be id:page-header Space + Element Text Should Be id:page-header Space! Go To ${SITE_URL}/category/space?lang=ru Element Text Should Be id:page-header Космос diff --git a/src/test/robotframework/series/access.robot b/src/test/robotframework/series/access.robot index 01f94f4775..08d06ad53d 100644 --- a/src/test/robotframework/series/access.robot +++ b/src/test/robotframework/series/access.robot @@ -13,7 +13,7 @@ Anonymous user cannot create series Element Text Should Be id:error-msg Forbidden Opening a page of non-existing series show an error - Go To ${SITE_URL}/series/999 + Go To ${SITE_URL}/series/1 Element Text Should Be id:error-code 404 Element Text Should Match Regexp id:error-msg Requested page[\\n\\r]+not found From ab42b8404dd1fbfd49f57924cf229d5995aed0ba Mon Sep 17 00:00:00 2001 From: Slava Semushin Date: Thu, 23 Mar 2017 00:01:08 +0100 Subject: [PATCH 16/19] [DO NOT MERGE] modify JS/CSS files. --- src/main/javascript/series/add.js | 3 +++ src/main/webapp/WEB-INF/static/styles/main.css | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/src/main/javascript/series/add.js b/src/main/javascript/series/add.js index e830a14df1..da779b1b6b 100644 --- a/src/main/javascript/series/add.js +++ b/src/main/javascript/series/add.js @@ -2,6 +2,9 @@ // IMPORTANT: // You must update ResourceUrl.RESOURCES_VERSION each time whenever you're modified this file! // +function exampleFunction() { + // do nothing +} function initPage(suggestCategoryUrl, suggestCountryUrl) { $('#country').selectize(); diff --git a/src/main/webapp/WEB-INF/static/styles/main.css b/src/main/webapp/WEB-INF/static/styles/main.css index 9548a2b2de..c14aecb4ad 100644 --- a/src/main/webapp/WEB-INF/static/styles/main.css +++ b/src/main/webapp/WEB-INF/static/styles/main.css @@ -14,6 +14,10 @@ } */ +#some-element { + color: red; +} + body, #user_bar ul { margin: 0; From ff596d8bfcbbe7ffded813236fb8405fb21245c9 Mon Sep 17 00:00:00 2001 From: Slava Semushin Date: Thu, 23 Nov 2017 23:08:22 +0100 Subject: [PATCH 17/19] [DO NOT MERGE] make shellcheck fail. --- expected-shellcheck.log | 1 + src/main/scripts/ci/deploy.sh | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 expected-shellcheck.log diff --git a/expected-shellcheck.log b/expected-shellcheck.log new file mode 100644 index 0000000000..9ecc5bc9b7 --- /dev/null +++ b/expected-shellcheck.log @@ -0,0 +1 @@ +src/main/scripts/ci/deploy.sh:28:9: note: Double quote to prevent globbing and word splitting. [SC2086] diff --git a/src/main/scripts/ci/deploy.sh b/src/main/scripts/ci/deploy.sh index 79b5298277..0d061416d8 100755 --- a/src/main/scripts/ci/deploy.sh +++ b/src/main/scripts/ci/deploy.sh @@ -25,7 +25,7 @@ trap 'cleanup' EXIT SIGHUP SIGINT SIGTERM # See: http://docs.ansible.com/ansible/intro_getting_started.html#host-key-checking export ANSIBLE_HOST_KEY_CHECKING=False -if [ -z "${encrypted_bf07cb25089f_key:-}" ] || [ -z "${encrypted_bf07cb25089f_iv:-}" ] ; then +if [ -z ${encrypted_bf07cb25089f_key:-} ] || [ -z "${encrypted_bf07cb25089f_iv:-}" ] ; then echo >&2 'ERROR: encrypted_bf07cb25089f_key or encrypted_bf07cb25089f_iv were not defined!' exit 1 fi From ea5303d2cfb3bbcf39f99f4392f6c827c86bb348 Mon Sep 17 00:00:00 2001 From: Slava Semushin Date: Thu, 17 Oct 2019 21:23:55 +0100 Subject: [PATCH 18/19] TODO: trailing space on end test case name should be detected --- src/test/robotframework/series/search/logic-anonymous.robot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/robotframework/series/search/logic-anonymous.robot b/src/test/robotframework/series/search/logic-anonymous.robot index e7b24bca58..643a353986 100644 --- a/src/test/robotframework/series/search/logic-anonymous.robot +++ b/src/test/robotframework/series/search/logic-anonymous.robot @@ -7,7 +7,7 @@ Suite Teardown Close Browser Force Tags series search logic *** Test Cases *** -Search series by non-existing catalog number +Search series by non-existing catalog number Input Text id:catalogNumber 888 Select Random Option From List id:catalogName Submit Form id:search-series-form From d39b40cda3f0d88540df7d3e3e63c95129d5ff5a Mon Sep 17 00:00:00 2001 From: Slava Semushin Date: Thu, 17 Oct 2019 21:28:29 +0100 Subject: [PATCH 19/19] ci(rflint): remove suppression of the errors that aren't present anymore. --- src/main/scripts/ci/check-build-and-verify.sh | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/main/scripts/ci/check-build-and-verify.sh b/src/main/scripts/ci/check-build-and-verify.sh index 9584a314b3..b3a33c3d7d 100755 --- a/src/main/scripts/ci/check-build-and-verify.sh +++ b/src/main/scripts/ci/check-build-and-verify.sh @@ -143,12 +143,7 @@ if [ "$RUN_ONLY_INTEGRATION_TESTS" = 'no' ]; then if [ "$RFLINT_STATUS" != 'skip' ]; then rflint \ --error=all \ - --ignore TooFewTestSteps \ - --ignore TooManyTestSteps \ --ignore TooFewKeywordSteps \ - --ignore TooManyTestCases \ - --ignore RequireTestDocumentation \ - --ignore RequireKeywordDocumentation \ --configure LineTooLong:130 \ src/test/robotframework \ >rflint.log 2>&1 || RFLINT_STATUS=fail