Skip to content

Commit

Permalink
SONARJAVA-4940 Enable various main code rules on test code as well (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
johann-beleites-sonarsource authored Apr 18, 2024
1 parent 975a191 commit a596f66
Show file tree
Hide file tree
Showing 24 changed files with 908 additions and 13 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"ruleKey": "S1874",
"hasTruePositives": true,
"falseNegatives": 151,
"falseNegatives": 246,
"falsePositives": 0
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"ruleKey": "S4144",
"hasTruePositives": true,
"falseNegatives": 2,
"falseNegatives": 3,
"falsePositives": 7
}
}
29 changes: 29 additions & 0 deletions its/ruling/src/test/resources/commons-beanutils/java-S1172.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,33 @@
"commons-beanutils:commons-beanutils:src/main/java/org/apache/commons/beanutils2/converters/AbstractConverter.java": [
454
],
"commons-beanutils:commons-beanutils:src/test/java/org/apache/commons/beanutils2/A.java": [
31
],
"commons-beanutils:commons-beanutils:src/test/java/org/apache/commons/beanutils2/AbstractParent.java": [
34,
41,
51
],
"commons-beanutils:commons-beanutils:src/test/java/org/apache/commons/beanutils2/BetaBean.java": [
34
],
"commons-beanutils:commons-beanutils:src/test/java/org/apache/commons/beanutils2/LazyDynaListTestCase.java": [
177
],
"commons-beanutils:commons-beanutils:src/test/java/org/apache/commons/beanutils2/MappedPropertyTestBean.java": [
77
],
"commons-beanutils:commons-beanutils:src/test/java/org/apache/commons/beanutils2/TestBean.java": [
434
],
"commons-beanutils:commons-beanutils:src/test/java/org/apache/commons/beanutils2/TestResultSet.java": [
202,
206,
210,
222
],
"commons-beanutils:commons-beanutils:src/test/java/org/apache/commons/beanutils2/memoryleaktests/MemoryLeakTestCase.java": [
540
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,11 @@
"commons-beanutils:commons-beanutils:src/main/java/org/apache/commons/beanutils2/WrapDynaClass.java": [
353
],
"commons-beanutils:commons-beanutils:src/test/java/org/apache/commons/beanutils2/locale/LocaleBeanificationTestCase.java": [
109,
129,
178,
218,
253
]
}
93 changes: 93 additions & 0 deletions its/ruling/src/test/resources/commons-beanutils/java-S1854.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,97 @@
"commons-beanutils:commons-beanutils:src/main/java/org/apache/commons/beanutils2/WrapDynaClass.java": [
353
],
"commons-beanutils:commons-beanutils:src/test/java/org/apache/commons/beanutils2/BeanificationTestCase.java": [
106,
107,
153,
154,
234,
236
],
"commons-beanutils:commons-beanutils:src/test/java/org/apache/commons/beanutils2/ConvertUtilsTestCase.java": [
146
],
"commons-beanutils:commons-beanutils:src/test/java/org/apache/commons/beanutils2/DynaPropertyUtilsTestCase.java": [
537,
548,
559,
570,
581,
592,
603,
614,
625,
636
],
"commons-beanutils:commons-beanutils:src/test/java/org/apache/commons/beanutils2/LazyDynaListTestCase.java": [
296,
454,
455,
479,
480,
504,
505,
529,
530
],
"commons-beanutils:commons-beanutils:src/test/java/org/apache/commons/beanutils2/PropertyUtilsTestCase.java": [
892,
903,
914,
925,
936,
947,
958,
969,
980,
991,
1002,
1013,
1811
],
"commons-beanutils:commons-beanutils:src/test/java/org/apache/commons/beanutils2/TestResultSetMetaData.java": [
127
],
"commons-beanutils:commons-beanutils:src/test/java/org/apache/commons/beanutils2/bugs/Jira347TestCase.java": [
117
],
"commons-beanutils:commons-beanutils:src/test/java/org/apache/commons/beanutils2/locale/LocaleBeanificationTestCase.java": [
109,
114,
115,
129,
159,
160,
178,
218,
232,
234,
253
],
"commons-beanutils:commons-beanutils:src/test/java/org/apache/commons/beanutils2/memoryleaktests/MemoryLeakTestCase.java": [
84,
85,
86,
133,
134,
135,
230,
231,
232,
281,
282,
283,
329,
330,
331,
332,
382,
383,
384,
430,
431,
432,
495
]
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"org.eclipse.jetty:jetty-project:jetty-server/src/main/java/org/eclipse/jetty/server/CustomRequestLog.java": [
433
],
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,10 @@
"org.eclipse.jetty:jetty-project:jetty-server/src/main/java/org/eclipse/jetty/server/session/SessionData.java": [
240
],
"org.eclipse.jetty:jetty-project:jetty-server/src/test/java/org/eclipse/jetty/server/GracefulStopTest.java": [
177
],
"org.eclipse.jetty:jetty-project:jetty-server/src/test/java/org/eclipse/jetty/server/HttpWriterTest.java": [
243
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"org.eclipse.jetty:jetty-project:jetty-http/src/test/java/org/eclipse/jetty/http/HttpCookieTest.java": [
74
],
"org.eclipse.jetty:jetty-project:jetty-http/src/test/java/org/eclipse/jetty/http/pathmap/WebSocketUriMappingTest.java": [
91
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,62 @@
"org.eclipse.jetty:jetty-project:jetty-http/src/main/java/org/eclipse/jetty/http/QuotedCSVParser.java": [
193
],
"org.eclipse.jetty:jetty-project:jetty-http/src/test/java/org/eclipse/jetty/http/HttpCookieTest.java": [
74,
103
],
"org.eclipse.jetty:jetty-project:jetty-http/src/test/java/org/eclipse/jetty/http/pathmap/WebSocketUriMappingTest.java": [
91
],
"org.eclipse.jetty:jetty-project:jetty-io/src/test/java/org/eclipse/jetty/io/SslConnectionTest.java": [
92,
94,
97,
105,
147,
272
],
"org.eclipse.jetty:jetty-project:jetty-server/src/test/java/org/eclipse/jetty/server/HttpOutputTest.java": [
861
],
"org.eclipse.jetty:jetty-project:jetty-server/src/test/java/org/eclipse/jetty/server/LowResourcesMonitorTest.java": [
183
],
"org.eclipse.jetty:jetty-project:jetty-server/src/test/java/org/eclipse/jetty/server/PartialRFC2616Test.java": [
184,
188,
191,
230,
235,
239,
268,
271,
314,
319,
348,
349,
420,
431,
438,
449,
456,
461,
479,
484,
486,
503,
521,
543,
559,
571,
578,
649,
654,
656,
660,
672,
679,
684,
685
]
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"org.eclipse.jetty:jetty-project:jetty-io/src/test/java/org/eclipse/jetty/io/SocketChannelEndPointTest.java": [
429
],
"org.eclipse.jetty:jetty-project:jetty-server/src/main/java/org/eclipse/jetty/server/HomeBaseWarning.java": [
72
],
Expand All @@ -16,4 +19,12 @@
"org.eclipse.jetty:jetty-project:jetty-server/src/main/java/org/eclipse/jetty/server/ShutdownMonitor.java": [
142
],
"org.eclipse.jetty:jetty-project:jetty-server/src/test/java/org/eclipse/jetty/server/AsyncStressTest.java": [
117,
146,
158
],
"org.eclipse.jetty:jetty-project:jetty-server/src/test/java/org/eclipse/jetty/server/HttpConnectionTest.java": [
1209
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
"org.eclipse.jetty:jetty-project:jetty-http/src/main/java/org/eclipse/jetty/http/HttpField.java": [
451
],
"org.eclipse.jetty:jetty-project:jetty-http/src/test/java/org/eclipse/jetty/http/HttpFieldsTest.java": [
453
],
"org.eclipse.jetty:jetty-project:jetty-io/src/main/java/org/eclipse/jetty/io/SocketChannelEndPoint.java": [
296
],
Expand All @@ -17,4 +20,10 @@
"org.eclipse.jetty:jetty-project:jetty-server/src/main/java/org/eclipse/jetty/server/Response.java": [
928
],
"org.eclipse.jetty:jetty-project:jetty-server/src/test/java/org/eclipse/jetty/server/HttpOutputTest.java": [
117
],
"org.eclipse.jetty:jetty-project:jetty-server/src/test/java/org/eclipse/jetty/server/LocalConnectorTest.java": [
101
]
}
4 changes: 4 additions & 0 deletions its/ruling/src/test/resources/eclipse-jetty/java-S1144.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
{
"org.eclipse.jetty:jetty-project:jetty-server/src/main/java/org/eclipse/jetty/server/CustomRequestLog.java": [
433
],
"org.eclipse.jetty:jetty-project:jetty-util/src/test/java/org/eclipse/jetty/util/TestIntrospectionUtil.java": [
71,
90
]
}
31 changes: 31 additions & 0 deletions its/ruling/src/test/resources/eclipse-jetty/java-S1172.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,27 @@
"org.eclipse.jetty:jetty-project:jetty-server/src/main/java/org/eclipse/jetty/server/session/SessionData.java": [
240
],
"org.eclipse.jetty:jetty-project:jetty-server/src/test/java/org/eclipse/jetty/server/GracefulStopTest.java": [
177
],
"org.eclipse.jetty:jetty-project:jetty-server/src/test/java/org/eclipse/jetty/server/HttpServerTestFixture.java": [
112
],
"org.eclipse.jetty:jetty-project:jetty-server/src/test/java/org/eclipse/jetty/server/HttpWriterTest.java": [
243
],
"org.eclipse.jetty:jetty-project:jetty-server/src/test/java/org/eclipse/jetty/server/StressTest.java": [
352
],
"org.eclipse.jetty:jetty-project:jetty-server/src/test/java/org/eclipse/jetty/server/handler/NcsaRequestLogTest.java": [
622
],
"org.eclipse.jetty:jetty-project:jetty-server/src/test/java/org/eclipse/jetty/server/ssl/SSLCloseTest.java": [
93
],
"org.eclipse.jetty:jetty-project:jetty-server/src/test/java/org/eclipse/jetty/server/ssl/SSLSelectChannelConnectorLoadTest.java": [
334
],
"org.eclipse.jetty:jetty-project:jetty-util-ajax/src/main/java/org/eclipse/jetty/util/ajax/JSONObjectConvertor.java": [
100
],
Expand All @@ -29,6 +50,16 @@
"org.eclipse.jetty:jetty-project:jetty-util/src/main/java/org/eclipse/jetty/util/resource/Resource.java": [
289
],
"org.eclipse.jetty:jetty-project:jetty-util/src/test/java/org/eclipse/jetty/util/PathWatcherTest.java": [
295
],
"org.eclipse.jetty:jetty-project:jetty-util/src/test/java/org/eclipse/jetty/util/TestIntrospectionUtil.java": [
71,
90
],
"org.eclipse.jetty:jetty-project:jetty-util/src/test/java/org/eclipse/jetty/util/statistic/SampleStatisticTest.java": [
69
],
"org.eclipse.jetty:jetty-project:tests/jetty-http-tools/src/main/java/org/eclipse/jetty/http/tools/HttpTester.java": [
271
]
Expand Down
31 changes: 31 additions & 0 deletions its/ruling/src/test/resources/eclipse-jetty/java-S1481.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,37 @@
{
"org.eclipse.jetty:jetty-project:jetty-http/src/test/java/org/eclipse/jetty/http/HttpCookieTest.java": [
74
],
"org.eclipse.jetty:jetty-project:jetty-http/src/test/java/org/eclipse/jetty/http/pathmap/WebSocketUriMappingTest.java": [
91
],
"org.eclipse.jetty:jetty-project:jetty-server/src/test/java/org/eclipse/jetty/server/ResponseTest.java": [
526
],
"org.eclipse.jetty:jetty-project:jetty-server/src/test/java/org/eclipse/jetty/server/handler/ContextHandlerCollectionTest.java": [
235
],
"org.eclipse.jetty:jetty-project:jetty-server/src/test/java/org/eclipse/jetty/server/handler/ContextHandlerGetResourceTest.java": [
307
],
"org.eclipse.jetty:jetty-project:jetty-server/src/test/java/org/eclipse/jetty/server/ssl/SSLSelectChannelConnectorLoadTest.java": [
123,
136,
175,
188
],
"org.eclipse.jetty:jetty-project:jetty-server/src/test/java/org/eclipse/jetty/server/ssl/SslUploadTest.java": [
126
],
"org.eclipse.jetty:jetty-project:jetty-util/src/main/java/org/eclipse/jetty/util/security/Password.java": [
159,
162
],
"org.eclipse.jetty:jetty-project:jetty-util/src/test/java/org/eclipse/jetty/util/BufferUtilTest.java": [
259
],
"org.eclipse.jetty:jetty-project:jetty-util/src/test/java/org/eclipse/jetty/util/PoolTest.java": [
366,
519
]
}
Loading

0 comments on commit a596f66

Please sign in to comment.