diff options
author | Stas Vilchik <vilchiks@gmail.com> | 2015-03-18 10:55:40 +0100 |
---|---|---|
committer | Stas Vilchik <vilchiks@gmail.com> | 2015-03-18 15:03:22 +0100 |
commit | e034cead6c551a5237134fd5e782a1224b4e6a2a (patch) | |
tree | e6be900f10427877b5db9c80e5948b443f3537e5 /server/sonar-web/src/test/json | |
parent | 6fc483abd0a1db32822d1e3eaaf4427916c1558f (diff) | |
download | sonarqube-e034cead6c551a5237134fd5e782a1224b4e6a2a.tar.gz sonarqube-e034cead6c551a5237134fd5e782a1224b4e6a2a.zip |
add web tests for rule activation from the list
Diffstat (limited to 'server/sonar-web/src/test/json')
6 files changed, 826 insertions, 0 deletions
diff --git a/server/sonar-web/src/test/json/coding-rules-page-list-actions/app-admin.json b/server/sonar-web/src/test/json/coding-rules-page-list-actions/app-admin.json new file mode 100644 index 00000000000..50148bb1b6e --- /dev/null +++ b/server/sonar-web/src/test/json/coding-rules-page-list-actions/app-admin.json @@ -0,0 +1,316 @@ +{ + "canWrite": true, + "qualityprofiles": [ + { + "key": "java-default-with-mojo-conventions-49307", + "name": "Default - Maven Conventions", + "lang": "java", + "parentKey": "java-top-profile-without-formatting-conventions-50037" + }, + { + "key": "java-default-with-sonarsource-conventions-27339", + "name": "Default - SonarSource conventions", + "lang": "java", + "parentKey": "java-top-profile-without-formatting-conventions-50037" + }, + { + "key": "java-top-profile-without-formatting-conventions-50037", + "name": "Default - Top", + "lang": "java" + }, + { + "key": "java-findbugs-14954", + "name": "FindBugs", + "lang": "java" + }, + { + "key": "java-for-sq-java-plugin-only-92289", + "name": "For SQ Java Plugin Only", + "lang": "java", + "parentKey": "java-default-with-sonarsource-conventions-27339" + }, + { + "key": "java-for-sq-only-95381", + "name": "For SQ Only", + "lang": "java", + "parentKey": "java-default-with-sonarsource-conventions-27339" + }, + { + "key": "php-psr-2-06315", + "name": "PSR-2", + "lang": "php" + }, + { + "key": "java-sonar-way-80423", + "name": "Sonar way", + "lang": "java" + }, + { + "key": "js-sonar-way", + "name": "Sonar way", + "lang": "js" + }, + { + "key": "php-sonar-way-05548", + "name": "Sonar way", + "lang": "php" + }, + { + "key": "py-sonar-way-80265", + "name": "Sonar way", + "lang": "py" + }, + { + "key": "java-without-findbugs", + "name": "Without Findbugs", + "lang": "java" + } + ], + "languages": { + "py": "Python", + "js": "JavaScript", + "php": "PHP", + "java": "Java" + }, + "repositories": [ + { + "key": "common-java", + "name": "Common SonarQube", + "language": "java" + }, + { + "key": "common-js", + "name": "Common SonarQube", + "language": "js" + }, + { + "key": "common-php", + "name": "Common SonarQube", + "language": "php" + }, + { + "key": "common-py", + "name": "Common SonarQube", + "language": "py" + }, + { + "key": "Pylint", + "name": "Pylint", + "language": "py" + }, + { + "key": "javascript", + "name": "SonarQube", + "language": "js" + }, + { + "key": "php", + "name": "SonarQube", + "language": "php" + }, + { + "key": "python", + "name": "SonarQube", + "language": "py" + }, + { + "key": "squid", + "name": "SonarQube", + "language": "java" + } + ], + "statuses": { + "BETA": "Beta", + "DEPRECATED": "Deprecated", + "READY": "Ready" + }, + "characteristics": [ + { + "key": "UNDERSTANDABILITY", + "name": "Understandability", + "parent": "MAINTAINABILITY" + }, + { + "key": "MAINTAINABILITY", + "name": "Maintainability" + }, + { + "key": "TIME_ZONE_RELATED_PORTABILITY", + "name": "Time zone related portability", + "parent": "PORTABILITY" + }, + { + "key": "READABILITY", + "name": "Readability", + "parent": "MAINTAINABILITY" + }, + { + "key": "SECURITY_FEATURES", + "name": "Security features", + "parent": "SECURITY" + }, + { + "key": "ARCHITECTURE_RELIABILITY", + "name": "Architecture related reliability", + "parent": "RELIABILITY" + }, + { + "key": "OS_RELATED_PORTABILITY", + "name": "OS related portability", + "parent": "PORTABILITY" + }, + { + "key": "EXCEPTION_HANDLING", + "name": "Exception handling", + "parent": "RELIABILITY" + }, + { + "key": "LOGIC_CHANGEABILITY", + "name": "Logic related changeability", + "parent": "CHANGEABILITY" + }, + { + "key": "SOFTWARE_RELATED_PORTABILITY", + "name": "Software related portability", + "parent": "PORTABILITY" + }, + { + "key": "INPUT_VALIDATION_AND_REPRESENTATION", + "name": "Input validation and representation", + "parent": "SECURITY" + }, + { + "key": "LANGUAGE_RELATED_PORTABILITY", + "name": "Language related portability", + "parent": "PORTABILITY" + }, + { + "key": "ERRORS", + "name": "Errors", + "parent": "SECURITY" + }, + { + "key": "SECURITY", + "name": "Security" + }, + { + "key": "RELIABILITY", + "name": "Reliability" + }, + { + "key": "PORTABILITY", + "name": "Portability" + }, + { + "key": "HARDWARE_RELATED_PORTABILITY", + "name": "Hardware related portability", + "parent": "PORTABILITY" + }, + { + "key": "SYNCHRONIZATION_RELIABILITY", + "name": "Synchronization related reliability", + "parent": "RELIABILITY" + }, + { + "key": "TRANSPORTABILITY", + "name": "Transportability", + "parent": "REUSABILITY" + }, + { + "key": "COMPILER_RELATED_PORTABILITY", + "name": "Compiler related portability", + "parent": "PORTABILITY" + }, + { + "key": "RESOURCE_RELIABILITY", + "name": "Resource", + "parent": "RELIABILITY" + }, + { + "key": "CPU_EFFICIENCY", + "name": "Processor use", + "parent": "EFFICIENCY" + }, + { + "key": "EFFICIENCY", + "name": "Efficiency" + }, + { + "key": "CHANGEABILITY", + "name": "Changeability" + }, + { + "key": "DATA_CHANGEABILITY", + "name": "Data related changeability", + "parent": "CHANGEABILITY" + }, + { + "key": "API_ABUSE", + "name": "API abuse", + "parent": "SECURITY" + }, + { + "key": "ARCHITECTURE_CHANGEABILITY", + "name": "Architecture related changeability", + "parent": "CHANGEABILITY" + }, + { + "key": "UNIT_TESTS", + "name": "Unit tests", + "parent": "RELIABILITY" + }, + { + "key": "INSTRUCTION_RELIABILITY", + "name": "Instruction related reliability", + "parent": "RELIABILITY" + }, + { + "key": "REUSABILITY", + "name": "Reusability" + }, + { + "key": "MODULARITY", + "name": "Modularity", + "parent": "REUSABILITY" + }, + { + "key": "UNIT_TESTABILITY", + "name": "Unit level testability", + "parent": "TESTABILITY" + }, + { + "key": "TESTABILITY", + "name": "Testability" + }, + { + "key": "INTEGRATION_TESTABILITY", + "name": "Integration level testability", + "parent": "TESTABILITY" + }, + { + "key": "NETWORK_USE", + "name": "Network use", + "parent": "EFFICIENCY" + }, + { + "key": "MEMORY_EFFICIENCY", + "name": "Memory use", + "parent": "EFFICIENCY" + }, + { + "key": "DATA_RELIABILITY", + "name": "Data related reliability", + "parent": "RELIABILITY" + }, + { + "key": "FAULT_TOLERANCE", + "name": "Fault tolerance", + "parent": "RELIABILITY" + }, + { + "key": "LOGIC_RELIABILITY", + "name": "Logic related reliability", + "parent": "RELIABILITY" + } + ] +} diff --git a/server/sonar-web/src/test/json/coding-rules-page-list-actions/app.json b/server/sonar-web/src/test/json/coding-rules-page-list-actions/app.json new file mode 100644 index 00000000000..0eb43bc39f7 --- /dev/null +++ b/server/sonar-web/src/test/json/coding-rules-page-list-actions/app.json @@ -0,0 +1,316 @@ +{ + "canWrite": false, + "qualityprofiles": [ + { + "key": "java-default-with-mojo-conventions-49307", + "name": "Default - Maven Conventions", + "lang": "java", + "parentKey": "java-top-profile-without-formatting-conventions-50037" + }, + { + "key": "java-default-with-sonarsource-conventions-27339", + "name": "Default - SonarSource conventions", + "lang": "java", + "parentKey": "java-top-profile-without-formatting-conventions-50037" + }, + { + "key": "java-top-profile-without-formatting-conventions-50037", + "name": "Default - Top", + "lang": "java" + }, + { + "key": "java-findbugs-14954", + "name": "FindBugs", + "lang": "java" + }, + { + "key": "java-for-sq-java-plugin-only-92289", + "name": "For SQ Java Plugin Only", + "lang": "java", + "parentKey": "java-default-with-sonarsource-conventions-27339" + }, + { + "key": "java-for-sq-only-95381", + "name": "For SQ Only", + "lang": "java", + "parentKey": "java-default-with-sonarsource-conventions-27339" + }, + { + "key": "php-psr-2-06315", + "name": "PSR-2", + "lang": "php" + }, + { + "key": "java-sonar-way-80423", + "name": "Sonar way", + "lang": "java" + }, + { + "key": "js-sonar-way", + "name": "Sonar way", + "lang": "js" + }, + { + "key": "php-sonar-way-05548", + "name": "Sonar way", + "lang": "php" + }, + { + "key": "py-sonar-way-80265", + "name": "Sonar way", + "lang": "py" + }, + { + "key": "java-without-findbugs", + "name": "Without Findbugs", + "lang": "java" + } + ], + "languages": { + "py": "Python", + "js": "JavaScript", + "php": "PHP", + "java": "Java" + }, + "repositories": [ + { + "key": "common-java", + "name": "Common SonarQube", + "language": "java" + }, + { + "key": "common-js", + "name": "Common SonarQube", + "language": "js" + }, + { + "key": "common-php", + "name": "Common SonarQube", + "language": "php" + }, + { + "key": "common-py", + "name": "Common SonarQube", + "language": "py" + }, + { + "key": "Pylint", + "name": "Pylint", + "language": "py" + }, + { + "key": "javascript", + "name": "SonarQube", + "language": "js" + }, + { + "key": "php", + "name": "SonarQube", + "language": "php" + }, + { + "key": "python", + "name": "SonarQube", + "language": "py" + }, + { + "key": "squid", + "name": "SonarQube", + "language": "java" + } + ], + "statuses": { + "BETA": "Beta", + "DEPRECATED": "Deprecated", + "READY": "Ready" + }, + "characteristics": [ + { + "key": "UNDERSTANDABILITY", + "name": "Understandability", + "parent": "MAINTAINABILITY" + }, + { + "key": "MAINTAINABILITY", + "name": "Maintainability" + }, + { + "key": "TIME_ZONE_RELATED_PORTABILITY", + "name": "Time zone related portability", + "parent": "PORTABILITY" + }, + { + "key": "READABILITY", + "name": "Readability", + "parent": "MAINTAINABILITY" + }, + { + "key": "SECURITY_FEATURES", + "name": "Security features", + "parent": "SECURITY" + }, + { + "key": "ARCHITECTURE_RELIABILITY", + "name": "Architecture related reliability", + "parent": "RELIABILITY" + }, + { + "key": "OS_RELATED_PORTABILITY", + "name": "OS related portability", + "parent": "PORTABILITY" + }, + { + "key": "EXCEPTION_HANDLING", + "name": "Exception handling", + "parent": "RELIABILITY" + }, + { + "key": "LOGIC_CHANGEABILITY", + "name": "Logic related changeability", + "parent": "CHANGEABILITY" + }, + { + "key": "SOFTWARE_RELATED_PORTABILITY", + "name": "Software related portability", + "parent": "PORTABILITY" + }, + { + "key": "INPUT_VALIDATION_AND_REPRESENTATION", + "name": "Input validation and representation", + "parent": "SECURITY" + }, + { + "key": "LANGUAGE_RELATED_PORTABILITY", + "name": "Language related portability", + "parent": "PORTABILITY" + }, + { + "key": "ERRORS", + "name": "Errors", + "parent": "SECURITY" + }, + { + "key": "SECURITY", + "name": "Security" + }, + { + "key": "RELIABILITY", + "name": "Reliability" + }, + { + "key": "PORTABILITY", + "name": "Portability" + }, + { + "key": "HARDWARE_RELATED_PORTABILITY", + "name": "Hardware related portability", + "parent": "PORTABILITY" + }, + { + "key": "SYNCHRONIZATION_RELIABILITY", + "name": "Synchronization related reliability", + "parent": "RELIABILITY" + }, + { + "key": "TRANSPORTABILITY", + "name": "Transportability", + "parent": "REUSABILITY" + }, + { + "key": "COMPILER_RELATED_PORTABILITY", + "name": "Compiler related portability", + "parent": "PORTABILITY" + }, + { + "key": "RESOURCE_RELIABILITY", + "name": "Resource", + "parent": "RELIABILITY" + }, + { + "key": "CPU_EFFICIENCY", + "name": "Processor use", + "parent": "EFFICIENCY" + }, + { + "key": "EFFICIENCY", + "name": "Efficiency" + }, + { + "key": "CHANGEABILITY", + "name": "Changeability" + }, + { + "key": "DATA_CHANGEABILITY", + "name": "Data related changeability", + "parent": "CHANGEABILITY" + }, + { + "key": "API_ABUSE", + "name": "API abuse", + "parent": "SECURITY" + }, + { + "key": "ARCHITECTURE_CHANGEABILITY", + "name": "Architecture related changeability", + "parent": "CHANGEABILITY" + }, + { + "key": "UNIT_TESTS", + "name": "Unit tests", + "parent": "RELIABILITY" + }, + { + "key": "INSTRUCTION_RELIABILITY", + "name": "Instruction related reliability", + "parent": "RELIABILITY" + }, + { + "key": "REUSABILITY", + "name": "Reusability" + }, + { + "key": "MODULARITY", + "name": "Modularity", + "parent": "REUSABILITY" + }, + { + "key": "UNIT_TESTABILITY", + "name": "Unit level testability", + "parent": "TESTABILITY" + }, + { + "key": "TESTABILITY", + "name": "Testability" + }, + { + "key": "INTEGRATION_TESTABILITY", + "name": "Integration level testability", + "parent": "TESTABILITY" + }, + { + "key": "NETWORK_USE", + "name": "Network use", + "parent": "EFFICIENCY" + }, + { + "key": "MEMORY_EFFICIENCY", + "name": "Memory use", + "parent": "EFFICIENCY" + }, + { + "key": "DATA_RELIABILITY", + "name": "Data related reliability", + "parent": "RELIABILITY" + }, + { + "key": "FAULT_TOLERANCE", + "name": "Fault tolerance", + "parent": "RELIABILITY" + }, + { + "key": "LOGIC_RELIABILITY", + "name": "Logic related reliability", + "parent": "RELIABILITY" + } + ] +} diff --git a/server/sonar-web/src/test/json/coding-rules-page-list-actions/search-active.json b/server/sonar-web/src/test/json/coding-rules-page-list-actions/search-active.json new file mode 100644 index 00000000000..544cca64336 --- /dev/null +++ b/server/sonar-web/src/test/json/coding-rules-page-list-actions/search-active.json @@ -0,0 +1,43 @@ +{ + "total": 2, + "p": 1, + "ps": 200, + "rules": [ + { + "key": "common-java:DuplicatedBlocks", + "tags": [], + "status": "READY", + "langName": "Java", + "name": "Duplicated blocks", + "severity": "MAJOR", + "isTemplate": false, + "params": [], + "lang": "java", + "sysTags": [] + } + ], + "actives": { + "common-java:DuplicatedBlocks": [ + { + "qProfile": "java-default-with-mojo-conventions-49307", + "inherit": "NONE", + "severity": "MAJOR", + "params": [] + } + ] + }, + "qProfiles": { + "java-default-with-mojo-conventions-49307": { + "name": "Default - Maven Conventions", + "lang": "java", + "langName": "Java", + "parent": "java-top-profile-without-formatting-conventions-50037" + }, + "java-top-profile-without-formatting-conventions-50037": { + "name": "Default - Top", + "lang": "java", + "langName": "Java" + } + }, + "facets": [] +} diff --git a/server/sonar-web/src/test/json/coding-rules-page-list-actions/search-actives.json b/server/sonar-web/src/test/json/coding-rules-page-list-actions/search-actives.json new file mode 100644 index 00000000000..50df4bde597 --- /dev/null +++ b/server/sonar-web/src/test/json/coding-rules-page-list-actions/search-actives.json @@ -0,0 +1,106 @@ +{ + "total": 2, + "p": 1, + "ps": 200, + "rules": [ + { + "key": "common-java:DuplicatedBlocks", + "tags": [], + "status": "READY", + "langName": "Java", + "name": "Duplicated blocks", + "severity": "MAJOR", + "isTemplate": false, + "params": [], + "lang": "java", + "sysTags": [] + }, + { + "key": "common-java:InsufficientBranchCoverage", + "tags": [], + "status": "READY", + "langName": "Java", + "name": "Insufficient branch coverage by unit tests", + "severity": "MAJOR", + "isTemplate": false, + "params": [ + { + "key": "minimumBranchCoverageRatio", + "htmlDesc": "The minimum required branch coverage ratio.", + "type": "STRING", + "defaultValue": "65.0" + } + ], + "lang": "java", + "sysTags": [] + } + ], + "actives": { + "common-java:DuplicatedBlocks": [ + { + "qProfile": "java-default-with-mojo-conventions-49307", + "inherit": "NONE", + "severity": "MAJOR", + "params": [] + } + ], + "common-java:InsufficientBranchCoverage": [ + { + "qProfile": "java-default-with-mojo-conventions-49307", + "inherit": "INHERITED", + "severity": "MAJOR", + "params": [ + { + "key": "minimumBranchCoverageRatio", + "value": "65.0" + } + ] + } + ] + }, + "qProfiles": { + "java-default-with-mojo-conventions-49307": { + "name": "Default - Maven Conventions", + "lang": "java", + "langName": "Java", + "parent": "java-top-profile-without-formatting-conventions-50037" + }, + "java-top-profile-without-formatting-conventions-50037": { + "name": "Default - Top", + "lang": "java", + "langName": "Java" + } + }, + "facets": [ + { + "property": "languages", + "values": [ + { + "val": "java", + "count": 2 + } + ] + }, + { + "property": "tags", + "values": [] + }, + { + "property": "repositories", + "values": [ + { + "val": "findbugs", + "count": 302 + }, + { + "val": "squid", + "count": 228 + }, + { + "val": "common-java", + "count": 2 + } + ] + } + ] +} diff --git a/server/sonar-web/src/test/json/coding-rules-page-list-actions/search-inactive.json b/server/sonar-web/src/test/json/coding-rules-page-list-actions/search-inactive.json new file mode 100644 index 00000000000..bff4fda5566 --- /dev/null +++ b/server/sonar-web/src/test/json/coding-rules-page-list-actions/search-inactive.json @@ -0,0 +1,22 @@ +{ + "total": 4, + "p": 1, + "ps": 200, + "rules": [ + { + "key": "common-java:FailedUnitTests", + "tags": [], + "status": "READY", + "langName": "Java", + "name": "Failed unit tests", + "severity": "MAJOR", + "isTemplate": false, + "params": [], + "lang": "java", + "sysTags": [] + } + ], + "actives": {}, + "qProfiles": {}, + "facets": [] +} diff --git a/server/sonar-web/src/test/json/coding-rules-page-list-actions/search.json b/server/sonar-web/src/test/json/coding-rules-page-list-actions/search.json new file mode 100644 index 00000000000..37786fd43b7 --- /dev/null +++ b/server/sonar-web/src/test/json/coding-rules-page-list-actions/search.json @@ -0,0 +1,23 @@ +{ + "total": 609, + "p": 1, + "ps": 25, + "rules": [ + { + "key": "squid:S2077", + "name": "Values passed to SQL commands should be sanitized", + "lang": "java", + "langName": "Java", + "sysTags": [ + "cwe", + "owasp-top10", + "security", + "sql" + ], + "tags": [ + "custom-tag" + ] + } + ], + "facets": [] +} |