@@ -192,7 +192,7 @@ public class IssueJsonReportTest { | |||
private static String sanitize(String s) { | |||
// sanitize issue uuid keys | |||
s = s.replaceAll("\\w\\w\\w\\w\\w\\w\\w\\w\\-\\w\\w\\w\\w\\-\\w\\w\\w\\w\\-\\w\\w\\w\\w\\-\\w\\w\\w\\w\\w\\w\\w\\w\\w\\w\\w\\w", "abcde"); | |||
s = s.replaceAll("\"[a-zA-Z_0-9\\-]{20}\"", "<ISSUE_KEY>"); | |||
// sanitize sonar version. Note that "-SILVER-SNAPSHOT" is used by Goldeneye jobs | |||
s = s.replaceAll("\\d\\.\\d(.\\d)?(\\-.*)?\\-SNAPSHOT", "<SONAR_VERSION>"); |
@@ -2,7 +2,7 @@ | |||
"version": "<SONAR_VERSION>", | |||
"issues": [ | |||
{ | |||
"key": "05652201-6f89-4f07-ba03-1df08eae0d55", | |||
"key": "<ISSUE_KEY>", | |||
"component": "sample:src/main/xoo/sample/Sample.xoo", | |||
"line": 6, | |||
"message": "This issue is generated on each line", | |||
@@ -13,7 +13,7 @@ | |||
"creationDate": "2013-05-02T00:00:00+0200" | |||
}, | |||
{ | |||
"key": "0746cf8f-0b67-4da8-82fc-36a6717c1f81", | |||
"key": "<ISSUE_KEY>", | |||
"component": "sample:src/main/xoo/sample/Sample.xoo", | |||
"line": 5, | |||
"message": "This issue is generated on each line", | |||
@@ -24,7 +24,7 @@ | |||
"creationDate": "2013-05-02T00:00:00+0200" | |||
}, | |||
{ | |||
"key": "0e9c20e2-567b-4c7a-b1e7-b9e5648dbfc5", | |||
"key": "<ISSUE_KEY>", | |||
"component": "sample:src/main/xoo/sample/Sample.xoo", | |||
"line": 13, | |||
"message": "This issue is generated on each line", | |||
@@ -35,7 +35,7 @@ | |||
"creationDate": "2013-05-02T00:00:00+0200" | |||
}, | |||
{ | |||
"key": "107fb325-ddda-43c6-9fde-1e7250571ef8", | |||
"key": "<ISSUE_KEY>", | |||
"component": "sample:src/main/xoo/sample/Sample.xoo", | |||
"line": 1, | |||
"message": "This issue is generated on each line", | |||
@@ -46,7 +46,7 @@ | |||
"creationDate": "2013-05-02T00:00:00+0200" | |||
}, | |||
{ | |||
"key": "226c71cf-0a86-43af-8281-6df0308eac92", | |||
"key": "<ISSUE_KEY>", | |||
"component": "sample:src/main/xoo/sample/Sample.xoo", | |||
"line": 3, | |||
"message": "This issue is generated on each line", | |||
@@ -57,7 +57,7 @@ | |||
"creationDate": "2013-05-02T00:00:00+0200" | |||
}, | |||
{ | |||
"key": "55c9705c-6509-48c6-9773-0437ab60be42", | |||
"key": "<ISSUE_KEY>", | |||
"component": "sample:src/main/xoo/sample/Sample.xoo", | |||
"line": 4, | |||
"message": "This issue is generated on each line", | |||
@@ -68,7 +68,7 @@ | |||
"creationDate": "2013-05-02T00:00:00+0200" | |||
}, | |||
{ | |||
"key": "5d653e95-16e2-4ee7-aac5-91ab8c3aebd6", | |||
"key": "<ISSUE_KEY>", | |||
"component": "sample:src/main/xoo/sample/Sample.xoo", | |||
"line": 12, | |||
"message": "This issue is generated on each line", | |||
@@ -79,7 +79,7 @@ | |||
"creationDate": "2013-05-02T00:00:00+0200" | |||
}, | |||
{ | |||
"key": "86056a4b-1813-4a10-937f-082e3f810152", | |||
"key": "<ISSUE_KEY>", | |||
"component": "sample:src/main/xoo/sample/Sample.xoo", | |||
"line": 10, | |||
"message": "This issue is generated on each line", | |||
@@ -90,7 +90,7 @@ | |||
"creationDate": "2013-05-02T00:00:00+0200" | |||
}, | |||
{ | |||
"key": "906f38ad-ada7-4088-80fe-3fc3b8532ad6", | |||
"key": "<ISSUE_KEY>", | |||
"component": "sample:src/main/xoo/sample/Sample.xoo", | |||
"line": 2, | |||
"message": "This issue is generated on each line", | |||
@@ -101,7 +101,7 @@ | |||
"creationDate": "2013-05-02T00:00:00+0200" | |||
}, | |||
{ | |||
"key": "9328fb3c-6fab-489f-a8ad-eb8277dd7bf7", | |||
"key": "<ISSUE_KEY>", | |||
"component": "sample:src/main/xoo/sample/Sample.xoo", | |||
"line": 9, | |||
"message": "This issue is generated on each line", | |||
@@ -112,7 +112,7 @@ | |||
"creationDate": "2013-05-02T00:00:00+0200" | |||
}, | |||
{ | |||
"key": "9980ca57-dfc4-431c-9a45-7ee9d397078a", | |||
"key": "<ISSUE_KEY>", | |||
"component": "sample:src/main/xoo/sample/Sample.xoo", | |||
"line": 11, | |||
"message": "This issue is generated on each line", | |||
@@ -123,7 +123,7 @@ | |||
"creationDate": "2013-05-02T00:00:00+0200" | |||
}, | |||
{ | |||
"key": "ccf5a264-bbe0-4459-97dc-acc0e323c4bb", | |||
"key": "<ISSUE_KEY>", | |||
"component": "sample:src/main/xoo/sample/Sample.xoo", | |||
"line": 7, | |||
"message": "This issue is generated on each line", | |||
@@ -134,7 +134,7 @@ | |||
"creationDate": "2013-05-02T00:00:00+0200" | |||
}, | |||
{ | |||
"key": "ead82961-2724-4d85-b2af-f810206b0ab1", | |||
"key": "<ISSUE_KEY>", | |||
"component": "sample:src/main/xoo/sample/Sample.xoo", | |||
"line": 8, | |||
"message": "This issue is generated on each line", | |||
@@ -171,4 +171,4 @@ | |||
], | |||
"users": [ ] | |||
} | |||
} |
@@ -2,7 +2,7 @@ | |||
"version": "<SONAR_VERSION>", | |||
"issues": [ | |||
{ | |||
"key": "042f73b0-61e5-43df-b3c3-9d5f1e43dffd", | |||
"key": "<ISSUE_KEY>", | |||
"component": "sample:mybranch:src/main/xoo/sample/Sample.xoo", | |||
"line": 2, | |||
"message": "This issue is generated on each line", | |||
@@ -13,7 +13,7 @@ | |||
"creationDate": "2013-05-01T00:00:00+0200" | |||
}, | |||
{ | |||
"key": "0f1f71b3-4949-406b-abe8-3f61ee5df8e2", | |||
"key": "<ISSUE_KEY>", | |||
"component": "sample:mybranch:src/main/xoo/sample/Sample.xoo", | |||
"line": 10, | |||
"message": "This issue is generated on each line", | |||
@@ -24,7 +24,7 @@ | |||
"creationDate": "2013-05-01T00:00:00+0200" | |||
}, | |||
{ | |||
"key": "45518777-ed03-4282-915f-60cc09ff6c5d", | |||
"key": "<ISSUE_KEY>", | |||
"component": "sample:mybranch:src/main/xoo/sample/Sample.xoo", | |||
"line": 13, | |||
"message": "This issue is generated on each line", | |||
@@ -35,7 +35,7 @@ | |||
"creationDate": "2013-05-01T00:00:00+0200" | |||
}, | |||
{ | |||
"key": "501ee82e-898c-4b88-9975-68655607da8f", | |||
"key": "<ISSUE_KEY>", | |||
"component": "sample:mybranch:src/main/xoo/sample/Sample.xoo", | |||
"line": 15, | |||
"message": "This issue is generated on each line", | |||
@@ -46,7 +46,7 @@ | |||
"creationDate": "2013-05-01T00:00:00+0200" | |||
}, | |||
{ | |||
"key": "55799ca7-85f0-4003-a657-361532b9ad9e", | |||
"key": "<ISSUE_KEY>", | |||
"component": "sample:mybranch:src/main/xoo/sample/Sample.xoo", | |||
"line": 4, | |||
"message": "This issue is generated on each line", | |||
@@ -57,7 +57,7 @@ | |||
"creationDate": "2013-05-01T00:00:00+0200" | |||
}, | |||
{ | |||
"key": "57ba7f32-ac32-4d18-b3cc-61042e59b9aa", | |||
"key": "<ISSUE_KEY>", | |||
"component": "sample:mybranch:src/main/xoo/sample/Sample.xoo", | |||
"line": 3, | |||
"message": "This issue is generated on each line", | |||
@@ -68,7 +68,7 @@ | |||
"creationDate": "2013-05-01T00:00:00+0200" | |||
}, | |||
{ | |||
"key": "5885445b-5f76-45da-8ae4-5b31f145cc68", | |||
"key": "<ISSUE_KEY>", | |||
"component": "sample:mybranch:src/main/xoo/sample/Sample.xoo", | |||
"line": 12, | |||
"message": "This issue is generated on each line", | |||
@@ -79,7 +79,7 @@ | |||
"creationDate": "2013-05-01T00:00:00+0200" | |||
}, | |||
{ | |||
"key": "71be8e1c-3d3b-4704-b86f-efb3de0cc17f", | |||
"key": "<ISSUE_KEY>", | |||
"component": "sample:mybranch:src/main/xoo/sample/Sample.xoo", | |||
"line": 11, | |||
"message": "This issue is generated on each line", | |||
@@ -90,7 +90,7 @@ | |||
"creationDate": "2013-05-02T00:00:00+0200" | |||
}, | |||
{ | |||
"key": "81669e04-75ae-4eb6-8a13-90b7ea0adcf0", | |||
"key": "<ISSUE_KEY>", | |||
"component": "sample:mybranch:src/main/xoo/sample/Sample.xoo", | |||
"line": 5, | |||
"message": "This issue is generated on each line", | |||
@@ -101,7 +101,7 @@ | |||
"creationDate": "2013-05-01T00:00:00+0200" | |||
}, | |||
{ | |||
"key": "939c914b-a899-429e-a98a-73cc5ff7d1f7", | |||
"key": "<ISSUE_KEY>", | |||
"component": "sample:mybranch:src/main/xoo/sample/Sample.xoo", | |||
"line": 7, | |||
"message": "This issue is generated on each line", | |||
@@ -112,7 +112,7 @@ | |||
"creationDate": "2013-05-02T00:00:00+0200" | |||
}, | |||
{ | |||
"key": "b3c66ea0-9d80-4159-868f-05d6fcbbc551", | |||
"key": "<ISSUE_KEY>", | |||
"component": "sample:mybranch:src/main/xoo/sample/Sample.xoo", | |||
"line": 9, | |||
"message": "This issue is generated on each line", | |||
@@ -123,7 +123,7 @@ | |||
"creationDate": "2013-05-01T00:00:00+0200" | |||
}, | |||
{ | |||
"key": "c9a17e92-b355-4c19-9b11-24c006a55a4d", | |||
"key": "<ISSUE_KEY>", | |||
"component": "sample:mybranch:src/main/xoo/sample/Sample.xoo", | |||
"line": 6, | |||
"message": "This issue is generated on each line", | |||
@@ -134,7 +134,7 @@ | |||
"creationDate": "2013-05-01T00:00:00+0200" | |||
}, | |||
{ | |||
"key": "dddba55e-44fa-47b8-bcfc-b88f40659e56", | |||
"key": "<ISSUE_KEY>", | |||
"component": "sample:mybranch:src/main/xoo/sample/Sample.xoo", | |||
"line": 8, | |||
"message": "This issue is generated on each line", | |||
@@ -145,7 +145,7 @@ | |||
"creationDate": "2013-05-01T00:00:00+0200" | |||
}, | |||
{ | |||
"key": "e390f328-f59a-4a9a-9421-f5d0e13a3f4e", | |||
"key": "<ISSUE_KEY>", | |||
"component": "sample:mybranch:src/main/xoo/sample/Sample.xoo", | |||
"line": 1, | |||
"message": "This issue is generated on each line", | |||
@@ -156,7 +156,7 @@ | |||
"creationDate": "2013-05-01T00:00:00+0200" | |||
}, | |||
{ | |||
"key": "fdff9685-de6d-4862-adbd-0d6059da5180", | |||
"key": "<ISSUE_KEY>", | |||
"component": "sample:mybranch:src/main/xoo/sample/Sample.xoo", | |||
"line": 14, | |||
"message": "This issue is generated on each line", | |||
@@ -193,4 +193,4 @@ | |||
], | |||
"users": [ ] | |||
} | |||
} |
@@ -2,7 +2,7 @@ | |||
"version": "<SONAR_VERSION>", | |||
"issues": [ | |||
{ | |||
"key": "05652201-6f89-4f07-ba03-1df08eae0d55", | |||
"key": "<ISSUE_KEY>", | |||
"component": "sample:src/main/xoo/sample/Sample.xoo", | |||
"line": 6, | |||
"message": "This issue is generated on each line", | |||
@@ -13,7 +13,7 @@ | |||
"creationDate": "2013-05-01T00:00:00+0200" | |||
}, | |||
{ | |||
"key": "0746cf8f-0b67-4da8-82fc-36a6717c1f81", | |||
"key": "<ISSUE_KEY>", | |||
"component": "sample:src/main/xoo/sample/Sample.xoo", | |||
"line": 5, | |||
"message": "This issue is generated on each line", | |||
@@ -24,7 +24,7 @@ | |||
"creationDate": "2013-05-01T00:00:00+0200" | |||
}, | |||
{ | |||
"key": "0e9c20e2-567b-4c7a-b1e7-b9e5648dbfc5", | |||
"key": "<ISSUE_KEY>", | |||
"component": "sample:src/main/xoo/sample/Sample.xoo", | |||
"line": 13, | |||
"message": "This issue is generated on each line", | |||
@@ -35,7 +35,7 @@ | |||
"creationDate": "2013-05-01T00:00:00+0200" | |||
}, | |||
{ | |||
"key": "107fb325-ddda-43c6-9fde-1e7250571ef8", | |||
"key": "<ISSUE_KEY>", | |||
"component": "sample:src/main/xoo/sample/Sample.xoo", | |||
"line": 1, | |||
"message": "This issue is generated on each line", | |||
@@ -46,7 +46,7 @@ | |||
"creationDate": "2013-05-01T00:00:00+0200" | |||
}, | |||
{ | |||
"key": "226c71cf-0a86-43af-8281-6df0308eac92", | |||
"key": "<ISSUE_KEY>", | |||
"component": "sample:src/main/xoo/sample/Sample.xoo", | |||
"line": 3, | |||
"message": "This issue is generated on each line", | |||
@@ -57,7 +57,7 @@ | |||
"creationDate": "2013-05-01T00:00:00+0200" | |||
}, | |||
{ | |||
"key": "55c9705c-6509-48c6-9773-0437ab60be42", | |||
"key": "<ISSUE_KEY>", | |||
"component": "sample:src/main/xoo/sample/Sample.xoo", | |||
"line": 4, | |||
"message": "This issue is generated on each line", | |||
@@ -68,7 +68,7 @@ | |||
"creationDate": "2013-05-01T00:00:00+0200" | |||
}, | |||
{ | |||
"key": "5d653e95-16e2-4ee7-aac5-91ab8c3aebd6", | |||
"key": "<ISSUE_KEY>", | |||
"component": "sample:src/main/xoo/sample/Sample.xoo", | |||
"line": 12, | |||
"message": "This issue is generated on each line", | |||
@@ -79,7 +79,7 @@ | |||
"creationDate": "2013-05-01T00:00:00+0200" | |||
}, | |||
{ | |||
"key": "86056a4b-1813-4a10-937f-082e3f810152", | |||
"key": "<ISSUE_KEY>", | |||
"component": "sample:src/main/xoo/sample/Sample.xoo", | |||
"line": 10, | |||
"message": "This issue is generated on each line", | |||
@@ -90,7 +90,7 @@ | |||
"creationDate": "2013-05-01T00:00:00+0200" | |||
}, | |||
{ | |||
"key": "906f38ad-ada7-4088-80fe-3fc3b8532ad6", | |||
"key": "<ISSUE_KEY>", | |||
"component": "sample:src/main/xoo/sample/Sample.xoo", | |||
"line": 2, | |||
"message": "This issue is generated on each line", | |||
@@ -101,7 +101,7 @@ | |||
"creationDate": "2013-05-01T00:00:00+0200" | |||
}, | |||
{ | |||
"key": "9328fb3c-6fab-489f-a8ad-eb8277dd7bf7", | |||
"key": "<ISSUE_KEY>", | |||
"component": "sample:src/main/xoo/sample/Sample.xoo", | |||
"line": 9, | |||
"message": "This issue is generated on each line", | |||
@@ -112,7 +112,7 @@ | |||
"creationDate": "2013-05-01T00:00:00+0200" | |||
}, | |||
{ | |||
"key": "9980ca57-dfc4-431c-9a45-7ee9d397078a", | |||
"key": "<ISSUE_KEY>", | |||
"component": "sample:src/main/xoo/sample/Sample.xoo", | |||
"line": 11, | |||
"message": "This issue is generated on each line", | |||
@@ -123,7 +123,7 @@ | |||
"creationDate": "2013-05-02T00:00:00+0200" | |||
}, | |||
{ | |||
"key": "ccf5a264-bbe0-4459-97dc-acc0e323c4bb", | |||
"key": "<ISSUE_KEY>", | |||
"component": "sample:src/main/xoo/sample/Sample.xoo", | |||
"line": 7, | |||
"message": "This issue is generated on each line", | |||
@@ -134,7 +134,7 @@ | |||
"creationDate": "2013-05-02T00:00:00+0200" | |||
}, | |||
{ | |||
"key": "ead82961-2724-4d85-b2af-f810206b0ab1", | |||
"key": "<ISSUE_KEY>", | |||
"component": "sample:src/main/xoo/sample/Sample.xoo", | |||
"line": 8, | |||
"message": "This issue is generated on each line", | |||
@@ -145,7 +145,7 @@ | |||
"creationDate": "2013-05-01T00:00:00+0200" | |||
}, | |||
{ | |||
"key": "ef617afe-b453-46a2-b004-8f7418059ebc", | |||
"key": "<ISSUE_KEY>", | |||
"component": "sample:src/main/xoo/sample/Sample.xoo", | |||
"line": 14, | |||
"message": "This issue is generated on each line", | |||
@@ -156,7 +156,7 @@ | |||
"creationDate": "2013-05-01T00:00:00+0200" | |||
}, | |||
{ | |||
"key": "f7d19927-2d2f-453c-aa45-1e315e5bfbe6", | |||
"key": "<ISSUE_KEY>", | |||
"component": "sample:src/main/xoo/sample/Sample.xoo", | |||
"line": 15, | |||
"message": "This issue is generated on each line", | |||
@@ -193,4 +193,4 @@ | |||
], | |||
"users": [ ] | |||
} | |||
} |
@@ -3,7 +3,7 @@ | |||
"version": "<SONAR_VERSION>", | |||
"issues": [ | |||
{ | |||
"key": "040a1d39-472b-4cfa-a75d-0547dd21b3c4", | |||
"key": "<ISSUE_KEY>", | |||
"component": "com.sonarsource.it.samples:multi-modules-sample:module_a:module_a1:src/main/xoo/com/sonar/it/samples/modules/a1/HelloA1.xoo", | |||
"line": 4, | |||
"message": "This issue is generated on each line", | |||
@@ -14,7 +14,7 @@ | |||
"creationDate": "2013-05-01T00:00:00+0200" | |||
}, | |||
{ | |||
"key": "0934e722-8456-465d-bb85-adbcd632d3df", | |||
"key": "<ISSUE_KEY>", | |||
"component": "com.sonarsource.it.samples:multi-modules-sample:module_a:module_a1:src/main/xoo/com/sonar/it/samples/modules/a1/HelloA1.xoo", | |||
"line": 7, | |||
"message": "This issue is generated on each line", | |||
@@ -25,7 +25,7 @@ | |||
"creationDate": "2013-05-01T00:00:00+0200" | |||
}, | |||
{ | |||
"key": "3992207a-f3a3-4c3c-a369-28a893e17c60", | |||
"key": "<ISSUE_KEY>", | |||
"component": "com.sonarsource.it.samples:multi-modules-sample:module_a:module_a1:src/main/xoo/com/sonar/it/samples/modules/a1/HelloA1.xoo", | |||
"line": 6, | |||
"message": "This issue is generated on each line", | |||
@@ -36,7 +36,7 @@ | |||
"creationDate": "2013-05-01T00:00:00+0200" | |||
}, | |||
{ | |||
"key": "4b38f729-17f3-4628-b5e1-f6795a6c49c7", | |||
"key": "<ISSUE_KEY>", | |||
"component": "com.sonarsource.it.samples:multi-modules-sample:module_a:module_a1:src/main/xoo/com/sonar/it/samples/modules/a1/HelloA1.xoo", | |||
"line": 1, | |||
"message": "This issue is generated on each line", | |||
@@ -47,7 +47,7 @@ | |||
"creationDate": "2013-05-01T00:00:00+0200" | |||
}, | |||
{ | |||
"key": "50541707-ab11-469d-9ace-b4753ffb84b8", | |||
"key": "<ISSUE_KEY>", | |||
"component": "com.sonarsource.it.samples:multi-modules-sample:module_a:module_a1:src/main/xoo/com/sonar/it/samples/modules/a1/HelloA1.xoo", | |||
"line": 8, | |||
"message": "This issue is generated on each line", | |||
@@ -58,7 +58,7 @@ | |||
"creationDate": "2013-05-01T00:00:00+0200" | |||
}, | |||
{ | |||
"key": "88ddda56-ae14-4121-9dbd-fefc5cc8c86b", | |||
"key": "<ISSUE_KEY>", | |||
"component": "com.sonarsource.it.samples:multi-modules-sample:module_a:module_a1:src/main/xoo/com/sonar/it/samples/modules/a1/HelloA1.xoo", | |||
"line": 15, | |||
"message": "This issue is generated on each line", | |||
@@ -69,7 +69,7 @@ | |||
"creationDate": "2013-05-01T00:00:00+0200" | |||
}, | |||
{ | |||
"key": "a246f099-c97f-4c7e-b1f4-cc3389f3dced", | |||
"key": "<ISSUE_KEY>", | |||
"component": "com.sonarsource.it.samples:multi-modules-sample:module_a:module_a1:src/main/xoo/com/sonar/it/samples/modules/a1/HelloA1.xoo", | |||
"line": 14, | |||
"message": "This issue is generated on each line", | |||
@@ -80,7 +80,7 @@ | |||
"creationDate": "2013-05-01T00:00:00+0200" | |||
}, | |||
{ | |||
"key": "aa2f4b1d-724d-4e2d-85cd-39a86006e2e9", | |||
"key": "<ISSUE_KEY>", | |||
"component": "com.sonarsource.it.samples:multi-modules-sample:module_a:module_a1:src/main/xoo/com/sonar/it/samples/modules/a1/HelloA1.xoo", | |||
"line": 10, | |||
"message": "This issue is generated on each line", | |||
@@ -91,7 +91,7 @@ | |||
"creationDate": "2013-05-01T00:00:00+0200" | |||
}, | |||
{ | |||
"key": "ac908fcc-e533-4229-9a04-3a89d13537e4", | |||
"key": "<ISSUE_KEY>", | |||
"component": "com.sonarsource.it.samples:multi-modules-sample:module_a:module_a1:src/main/xoo/com/sonar/it/samples/modules/a1/HelloA1.xoo", | |||
"line": 3, | |||
"message": "This issue is generated on each line", | |||
@@ -102,7 +102,7 @@ | |||
"creationDate": "2013-05-01T00:00:00+0200" | |||
}, | |||
{ | |||
"key": "c4604a54-5df8-4db7-8670-df6e4932246b", | |||
"key": "<ISSUE_KEY>", | |||
"component": "com.sonarsource.it.samples:multi-modules-sample:module_a:module_a1:src/main/xoo/com/sonar/it/samples/modules/a1/HelloA1.xoo", | |||
"line": 2, | |||
"message": "This issue is generated on each line", | |||
@@ -113,7 +113,7 @@ | |||
"creationDate": "2013-05-01T00:00:00+0200" | |||
}, | |||
{ | |||
"key": "c99f57ec-98e4-464c-8fa5-adbb27a3a81c", | |||
"key": "<ISSUE_KEY>", | |||
"component": "com.sonarsource.it.samples:multi-modules-sample:module_a:module_a1:src/main/xoo/com/sonar/it/samples/modules/a1/HelloA1.xoo", | |||
"line": 16, | |||
"message": "This issue is generated on each line", | |||
@@ -124,7 +124,7 @@ | |||
"creationDate": "2013-05-01T00:00:00+0200" | |||
}, | |||
{ | |||
"key": "d491b9c4-9217-4285-aabd-44d079b1d46a", | |||
"key": "<ISSUE_KEY>", | |||
"component": "com.sonarsource.it.samples:multi-modules-sample:module_a:module_a1:src/main/xoo/com/sonar/it/samples/modules/a1/HelloA1.xoo", | |||
"line": 9, | |||
"message": "This issue is generated on each line", | |||
@@ -135,7 +135,7 @@ | |||
"creationDate": "2013-05-01T00:00:00+0200" | |||
}, | |||
{ | |||
"key": "d4ae59a5-1ece-4735-8142-ac884bdad17a", | |||
"key": "<ISSUE_KEY>", | |||
"component": "com.sonarsource.it.samples:multi-modules-sample:module_a:module_a1:src/main/xoo/com/sonar/it/samples/modules/a1/HelloA1.xoo", | |||
"line": 5, | |||
"message": "This issue is generated on each line", | |||
@@ -146,7 +146,7 @@ | |||
"creationDate": "2013-05-01T00:00:00+0200" | |||
}, | |||
{ | |||
"key": "d832eb5d-5ff1-4095-b9bc-c5b948e74d5f", | |||
"key": "<ISSUE_KEY>", | |||
"component": "com.sonarsource.it.samples:multi-modules-sample:module_a:module_a1:src/main/xoo/com/sonar/it/samples/modules/a1/HelloA1.xoo", | |||
"line": 12, | |||
"message": "This issue is generated on each line", | |||
@@ -157,7 +157,7 @@ | |||
"creationDate": "2013-05-01T00:00:00+0200" | |||
}, | |||
{ | |||
"key": "e4e76304-7920-4a2f-8deb-fe5a7f21d085", | |||
"key": "<ISSUE_KEY>", | |||
"component": "com.sonarsource.it.samples:multi-modules-sample:module_a:module_a1:src/main/xoo/com/sonar/it/samples/modules/a1/HelloA1.xoo", | |||
"line": 13, | |||
"message": "This issue is generated on each line", | |||
@@ -168,7 +168,7 @@ | |||
"creationDate": "2013-05-01T00:00:00+0200" | |||
}, | |||
{ | |||
"key": "fb923e8f-c336-49c0-8884-4529ff8af6e4", | |||
"key": "<ISSUE_KEY>", | |||
"component": "com.sonarsource.it.samples:multi-modules-sample:module_a:module_a1:src/main/xoo/com/sonar/it/samples/modules/a1/HelloA1.xoo", | |||
"line": 11, | |||
"message": "This issue is generated on each line", | |||
@@ -205,4 +205,4 @@ | |||
], | |||
"users": [ ] | |||
} | |||
} |
@@ -39,7 +39,7 @@ import org.slf4j.Logger; | |||
import org.slf4j.LoggerFactory; | |||
import org.sonar.api.issue.Issue; | |||
import org.sonar.api.rule.Severity; | |||
import org.sonar.api.utils.internal.Uuids; | |||
import org.sonar.core.util.Uuids; | |||
import org.sonar.server.es.EsClient; | |||
import org.sonar.server.es.SearchOptions; | |||
import org.sonar.server.es.SearchResult; |
@@ -31,7 +31,7 @@ import org.junit.rules.TemporaryFolder; | |||
import org.slf4j.Logger; | |||
import org.slf4j.LoggerFactory; | |||
import org.sonar.api.utils.System2; | |||
import org.sonar.api.utils.internal.Uuids; | |||
import org.sonar.core.util.Uuids; | |||
import org.sonar.batch.protocol.Constants; | |||
import org.sonar.batch.protocol.output.BatchReport; | |||
import org.sonar.batch.protocol.output.BatchReportWriter; |
@@ -29,7 +29,7 @@ import org.junit.Test; | |||
import org.slf4j.Logger; | |||
import org.slf4j.LoggerFactory; | |||
import org.sonar.api.utils.System2; | |||
import org.sonar.api.utils.internal.Uuids; | |||
import org.sonar.core.util.Uuids; | |||
import org.sonar.db.DbTester; | |||
import org.sonar.db.protobuf.DbFileSources; | |||
import org.sonar.db.source.FileSourceDao; |
@@ -20,7 +20,7 @@ | |||
package org.sonar.server.activity; | |||
import org.sonar.api.utils.KeyValueFormat; | |||
import org.sonar.api.utils.internal.Uuids; | |||
import org.sonar.core.util.Uuids; | |||
import org.sonar.db.activity.ActivityDto; | |||
import org.sonar.server.activity.index.ActivityIndexer; | |||
import org.sonar.db.DbClient; |
@@ -37,7 +37,7 @@ import org.sonar.api.i18n.I18n; | |||
import org.sonar.api.resources.Scopes; | |||
import org.sonar.api.server.ServerSide; | |||
import org.sonar.api.utils.System2; | |||
import org.sonar.api.utils.internal.Uuids; | |||
import org.sonar.core.util.Uuids; | |||
import org.sonar.api.web.UserRole; | |||
import org.sonar.core.component.ComponentKeys; | |||
import org.sonar.core.permission.GlobalPermissions; |
@@ -28,7 +28,7 @@ import javax.annotation.CheckForNull; | |||
import org.apache.commons.io.FileUtils; | |||
import org.sonar.api.config.Settings; | |||
import org.sonar.api.server.ServerSide; | |||
import org.sonar.api.utils.internal.Uuids; | |||
import org.sonar.core.util.Uuids; | |||
import org.sonar.api.utils.log.Loggers; | |||
import org.sonar.db.DbClient; | |||
import org.sonar.db.DbSession; |
@@ -21,7 +21,7 @@ package org.sonar.server.computation.issue; | |||
import javax.annotation.Nullable; | |||
import org.sonar.api.issue.Issue; | |||
import org.sonar.api.utils.internal.Uuids; | |||
import org.sonar.core.util.Uuids; | |||
import org.sonar.core.issue.DefaultIssue; | |||
import org.sonar.core.issue.IssueChangeContext; | |||
import org.sonar.core.issue.IssueUpdater; |
@@ -23,7 +23,7 @@ package org.sonar.server.computation.step; | |||
import java.util.HashMap; | |||
import java.util.List; | |||
import java.util.Map; | |||
import org.sonar.api.utils.internal.Uuids; | |||
import org.sonar.core.util.Uuids; | |||
import org.sonar.batch.protocol.output.BatchReport; | |||
import org.sonar.core.component.ComponentKeys; | |||
import org.sonar.db.DbClient; |
@@ -36,7 +36,7 @@ import java.util.Set; | |||
import org.apache.ibatis.session.ResultContext; | |||
import org.apache.ibatis.session.ResultHandler; | |||
import org.sonar.api.utils.System2; | |||
import org.sonar.api.utils.internal.Uuids; | |||
import org.sonar.core.util.Uuids; | |||
import org.sonar.api.utils.log.Logger; | |||
import org.sonar.api.utils.log.Loggers; | |||
import org.sonar.batch.protocol.output.BatchReport; |
@@ -28,7 +28,7 @@ import javax.annotation.CheckForNull; | |||
import javax.annotation.Nullable; | |||
import org.sonar.api.server.ServerSide; | |||
import org.sonar.api.utils.System2; | |||
import org.sonar.api.utils.internal.Uuids; | |||
import org.sonar.core.util.Uuids; | |||
import org.sonar.core.permission.GlobalPermissions; | |||
import org.sonar.db.DbClient; | |||
import org.sonar.db.DbSession; |
@@ -22,7 +22,7 @@ package org.sonar.server.permission.ws; | |||
import java.util.Date; | |||
import org.sonar.api.utils.System2; | |||
import org.sonar.api.utils.internal.Uuids; | |||
import org.sonar.core.util.Uuids; | |||
import org.sonar.db.permission.PermissionTemplateDto; | |||
class PermissionTemplateDtoBuilder { |
@@ -25,6 +25,7 @@ import org.sonar.api.utils.System2; | |||
import org.sonar.api.utils.internal.TempFolderCleaner; | |||
import org.sonar.core.config.CorePropertyDefinitions; | |||
import org.sonar.core.config.Logback; | |||
import org.sonar.core.util.UuidFactoryImpl; | |||
import org.sonar.db.DaoModule; | |||
import org.sonar.db.DatabaseChecker; | |||
import org.sonar.db.DefaultDatabase; | |||
@@ -74,6 +75,7 @@ public class PlatformLevel1 extends PlatformLevel { | |||
ServerSettings.class, | |||
ServerImpl.class, | |||
Logback.class, | |||
UuidFactoryImpl.INSTANCE, | |||
EmbeddedDatabaseFactory.class, | |||
DefaultDatabase.class, | |||
DatabaseChecker.class, |
@@ -27,7 +27,7 @@ import org.junit.Test; | |||
import org.junit.experimental.categories.Category; | |||
import org.sonar.api.measures.Metric; | |||
import org.sonar.api.utils.System2; | |||
import org.sonar.api.utils.internal.Uuids; | |||
import org.sonar.core.util.Uuids; | |||
import org.sonar.db.DbClient; | |||
import org.sonar.db.DbTester; | |||
import org.sonar.db.component.ComponentDto; |
@@ -26,7 +26,7 @@ import org.junit.Rule; | |||
import org.junit.Test; | |||
import org.junit.experimental.categories.Category; | |||
import org.sonar.api.utils.System2; | |||
import org.sonar.api.utils.internal.Uuids; | |||
import org.sonar.core.util.Uuids; | |||
import org.sonar.db.DbSession; | |||
import org.sonar.db.DbTester; | |||
import org.sonar.db.MyBatis; |
@@ -24,7 +24,7 @@ import org.sonar.api.issue.Issue; | |||
import org.sonar.api.resources.Scopes; | |||
import org.sonar.api.rule.Severity; | |||
import org.sonar.api.utils.DateUtils; | |||
import org.sonar.api.utils.internal.Uuids; | |||
import org.sonar.core.util.Uuids; | |||
import org.sonar.db.component.ComponentDto; | |||
import org.sonar.db.issue.IssueDto; | |||
import org.sonar.db.rule.RuleDto; |
@@ -33,7 +33,7 @@ import org.sonar.api.rule.Severity; | |||
import org.sonar.api.server.ws.WebService.Param; | |||
import org.sonar.api.utils.DateUtils; | |||
import org.sonar.api.utils.System2; | |||
import org.sonar.api.utils.internal.Uuids; | |||
import org.sonar.core.util.Uuids; | |||
import org.sonar.db.DbSession; | |||
import org.sonar.db.DbTester; | |||
import org.sonar.db.qualityprofile.ActiveRuleKey; |
@@ -28,7 +28,7 @@ import java.util.ArrayList; | |||
import java.util.List; | |||
import org.apache.commons.lang.RandomStringUtils; | |||
import org.apache.commons.lang.math.RandomUtils; | |||
import org.sonar.api.utils.internal.Uuids; | |||
import org.sonar.core.util.Uuids; | |||
import org.sonar.db.DbSession; | |||
import org.sonar.db.protobuf.DbFileSources; | |||
import org.sonar.db.source.FileSourceDto; |
@@ -53,6 +53,7 @@ import org.sonar.core.platform.PluginInfo; | |||
import org.sonar.core.platform.PluginLoader; | |||
import org.sonar.core.platform.PluginRepository; | |||
import org.sonar.core.util.DefaultHttpDownloader; | |||
import org.sonar.core.util.UuidFactoryImpl; | |||
public class GlobalContainer extends ComponentContainer { | |||
@@ -106,7 +107,8 @@ public class GlobalContainer extends ComponentContainer { | |||
DefaultI18n.class, | |||
Durations.class, | |||
RuleI18nManager.class, | |||
new GlobalRepositoriesProvider()); | |||
new GlobalRepositoriesProvider(), | |||
UuidFactoryImpl.INSTANCE); | |||
addIfMissing(BatchPluginInstaller.class, PluginInstaller.class); | |||
addIfMissing(DefaultRulesLoader.class, RulesLoader.class); | |||
addIfMissing(DefaultGlobalRepositoriesLoader.class, GlobalRepositoriesLoader.class); |
@@ -24,7 +24,7 @@ import java.util.Date; | |||
import javax.annotation.CheckForNull; | |||
import javax.annotation.Nullable; | |||
import org.sonar.api.issue.ActionPlan; | |||
import org.sonar.api.utils.internal.Uuids; | |||
import org.sonar.core.util.Uuids; | |||
public class DefaultActionPlan implements ActionPlan { | |||
@@ -28,7 +28,7 @@ import org.sonar.api.issue.Issuable; | |||
import org.sonar.api.issue.Issuable.IssueBuilder; | |||
import org.sonar.api.issue.Issue; | |||
import org.sonar.api.rule.RuleKey; | |||
import org.sonar.api.utils.internal.Uuids; | |||
import org.sonar.core.util.Uuids; | |||
public class DefaultIssueBuilder implements Issuable.IssueBuilder { | |||
@@ -24,7 +24,7 @@ import java.util.Date; | |||
import javax.annotation.CheckForNull; | |||
import javax.annotation.Nullable; | |||
import org.sonar.api.issue.IssueComment; | |||
import org.sonar.api.utils.internal.Uuids; | |||
import org.sonar.core.util.Uuids; | |||
/** | |||
* PLUGINS MUST NOT BE USED THIS CLASS, EXCEPT FOR UNIT TESTING. |
@@ -22,7 +22,7 @@ package org.sonar.core.platform; | |||
import java.util.HashSet; | |||
import java.util.Set; | |||
import java.util.regex.Pattern; | |||
import org.sonar.api.utils.internal.Uuids; | |||
import org.sonar.core.util.Uuids; | |||
import org.sonar.api.utils.log.Logger; | |||
import org.sonar.api.utils.log.Loggers; | |||
@@ -0,0 +1,108 @@ | |||
/* | |||
* SonarQube, open source software quality management tool. | |||
* Copyright (C) 2008-2014 SonarSource | |||
* mailto:contact AT sonarsource DOT com | |||
* | |||
* SonarQube is free software; you can redistribute it and/or | |||
* modify it under the terms of the GNU Lesser General Public | |||
* License as published by the Free Software Foundation; either | |||
* version 3 of the License, or (at your option) any later version. | |||
* | |||
* SonarQube 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 | |||
* Lesser General Public License for more details. | |||
* | |||
* You should have received a copy of the GNU Lesser 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 org.sonar.core.util; | |||
import com.google.common.annotations.VisibleForTesting; | |||
import java.net.NetworkInterface; | |||
import java.net.SocketException; | |||
import java.security.SecureRandom; | |||
import java.util.Enumeration; | |||
import javax.annotation.CheckForNull; | |||
import javax.annotation.Nullable; | |||
import org.sonar.api.utils.log.Logger; | |||
import org.sonar.api.utils.log.Loggers; | |||
/** | |||
* Used by {@link UuidFactoryImpl}. Heavily inspired by https://github.com/elastic/elasticsearch/blob/master/core/src/main/java/org/elasticsearch/common/MacAddressProvider.java | |||
*/ | |||
class MacAddressProvider { | |||
private static final Logger LOGGER = Loggers.get(MacAddressProvider.class); | |||
public static final int BYTE_SIZE = 6; | |||
private MacAddressProvider() { | |||
// only static stuff | |||
} | |||
public static byte[] getSecureMungedAddress() { | |||
byte[] address = null; | |||
try { | |||
address = getMacAddress(); | |||
} catch (SocketException se) { | |||
LOGGER.warn("Unable to get mac address, will use a dummy address", se); | |||
// address will be set below | |||
} | |||
if (!isValidAddress(address)) { | |||
LOGGER.warn("Unable to get a valid mac address, will use a dummy address"); | |||
address = constructDummyMulticastAddress(); | |||
} | |||
byte[] mungedBytes = new byte[BYTE_SIZE]; | |||
new SecureRandom().nextBytes(mungedBytes); | |||
for (int i = 0; i < BYTE_SIZE; ++i) { | |||
mungedBytes[i] ^= address[i]; | |||
} | |||
return mungedBytes; | |||
} | |||
private static boolean isValidAddress(@Nullable byte[] address) { | |||
if (address == null || address.length != BYTE_SIZE) { | |||
return false; | |||
} | |||
for (byte b : address) { | |||
if (b != 0x00) { | |||
// If any of the bytes are non zero assume a good address | |||
return true; | |||
} | |||
} | |||
return false; | |||
} | |||
@CheckForNull | |||
private static byte[] getMacAddress() throws SocketException { | |||
Enumeration<NetworkInterface> en = NetworkInterface.getNetworkInterfaces(); | |||
if (en != null) { | |||
while (en.hasMoreElements()) { | |||
NetworkInterface nint = en.nextElement(); | |||
if (!nint.isLoopback()) { | |||
// Pick the first valid non loopback address we find | |||
byte[] address = nint.getHardwareAddress(); | |||
if (isValidAddress(address)) { | |||
return address; | |||
} | |||
} | |||
} | |||
} | |||
// Could not find a mac address | |||
return null; | |||
} | |||
@VisibleForTesting | |||
static byte[] constructDummyMulticastAddress() { | |||
byte[] dummy = new byte[BYTE_SIZE]; | |||
new SecureRandom().nextBytes(dummy); | |||
// Set the broadcast bit to indicate this is not a _real_ mac address | |||
dummy[0] |= (byte) 0x01; | |||
return dummy; | |||
} | |||
} |
@@ -0,0 +1,34 @@ | |||
/* | |||
* SonarQube, open source software quality management tool. | |||
* Copyright (C) 2008-2014 SonarSource | |||
* mailto:contact AT sonarsource DOT com | |||
* | |||
* SonarQube is free software; you can redistribute it and/or | |||
* modify it under the terms of the GNU Lesser General Public | |||
* License as published by the Free Software Foundation; either | |||
* version 3 of the License, or (at your option) any later version. | |||
* | |||
* SonarQube 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 | |||
* Lesser General Public License for more details. | |||
* | |||
* You should have received a copy of the GNU Lesser 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 org.sonar.core.util; | |||
public interface UuidFactory { | |||
/** | |||
* Create a universally unique identifier. Underlying algorithm, so format and max length, | |||
* can vary over SonarQube versions. | |||
* <p/> | |||
* UUID is a base64 ASCII encoded string and is URL-safe. It does not contain - and + characters | |||
* but only letters, digits, dash (-) and underscore (_). Length can vary but does | |||
* not exceed 40 characters (arbitrary value). | |||
*/ | |||
String create(); | |||
} |
@@ -0,0 +1,87 @@ | |||
/* | |||
* SonarQube, open source software quality management tool. | |||
* Copyright (C) 2008-2014 SonarSource | |||
* mailto:contact AT sonarsource DOT com | |||
* | |||
* SonarQube is free software; you can redistribute it and/or | |||
* modify it under the terms of the GNU Lesser General Public | |||
* License as published by the Free Software Foundation; either | |||
* version 3 of the License, or (at your option) any later version. | |||
* | |||
* SonarQube 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 | |||
* Lesser General Public License for more details. | |||
* | |||
* You should have received a copy of the GNU Lesser 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 org.sonar.core.util; | |||
import java.security.SecureRandom; | |||
import java.util.concurrent.atomic.AtomicInteger; | |||
import org.apache.commons.codec.binary.Base64; | |||
/** | |||
* Heavily inspired from Elasticsearch {@code TimeBasedUUIDGenerator}, which could be directly | |||
* used the day {@code UuidFactoryImpl} is moved outside module sonar-core. | |||
* See https://github.com/elastic/elasticsearch/blob/master/core/src/main/java/org/elasticsearch/common/TimeBasedUUIDGenerator.java | |||
*/ | |||
public enum UuidFactoryImpl implements UuidFactory { | |||
/** | |||
* Should be removed as long {@link Uuids} is not used anymore. {@code UuidFactoryImpl} | |||
* should be built by picocontainer through a public constructor. | |||
*/ | |||
INSTANCE; | |||
// We only use bottom 3 bytes for the sequence number. Paranoia: init with random int so that if JVM/OS/machine goes down, clock slips | |||
// backwards, and JVM comes back up, we are less likely to be on the same sequenceNumber at the same time: | |||
private final AtomicInteger sequenceNumber = new AtomicInteger(new SecureRandom().nextInt()); | |||
// Used to ensure clock moves forward | |||
private long lastTimestamp = 0L; | |||
private final byte[] secureMungedAddress = MacAddressProvider.getSecureMungedAddress(); | |||
@Override | |||
public String create() { | |||
int sequenceId = sequenceNumber.incrementAndGet() & 0xffffff; | |||
long timestamp = System.currentTimeMillis(); | |||
synchronized (this) { | |||
// Don't let timestamp go backwards, at least "on our watch" (while this JVM is running). We are still vulnerable if we are | |||
// shut down, clock goes backwards, and we restart... for this we randomize the sequenceNumber on init to decrease chance of | |||
// collision: | |||
timestamp = Math.max(lastTimestamp, timestamp); | |||
if (sequenceId == 0) { | |||
// Always force the clock to increment whenever sequence number is 0, in case we have a long time-slip backwards: | |||
timestamp++; | |||
} | |||
lastTimestamp = timestamp; | |||
} | |||
byte[] uuidBytes = new byte[15]; | |||
// Only use lower 6 bytes of the timestamp (this will suffice beyond the year 10000): | |||
putLong(uuidBytes, timestamp, 0, 6); | |||
// MAC address adds 6 bytes: | |||
System.arraycopy(secureMungedAddress, 0, uuidBytes, 6, secureMungedAddress.length); | |||
// Sequence number adds 3 bytes: | |||
putLong(uuidBytes, sequenceId, 12, 3); | |||
return Base64.encodeBase64URLSafeString(uuidBytes); | |||
} | |||
/** Puts the lower numberOfLongBytes from l into the array, starting index pos. */ | |||
private static void putLong(byte[] array, long l, int pos, int numberOfLongBytes) { | |||
for (int i = 0; i < numberOfLongBytes; ++i) { | |||
array[pos + numberOfLongBytes - i - 1] = (byte) (l >>> (i * 8)); | |||
} | |||
} | |||
} |
@@ -17,13 +17,8 @@ | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
package org.sonar.api.utils.internal; | |||
package org.sonar.core.util; | |||
import java.util.UUID; | |||
/** | |||
* @since 5.0 | |||
*/ | |||
public class Uuids { | |||
private Uuids() { | |||
@@ -31,9 +26,11 @@ public class Uuids { | |||
} | |||
/** | |||
* Create a universally unique identifier. Underlying algorithm can change over SQ versions. | |||
* Create a universally unique identifier. It's recommended to use the non-static way | |||
* through {@link UuidFactory} which is available in IoC container. | |||
* @see UuidFactory#create() | |||
*/ | |||
public static String create() { | |||
return UUID.randomUUID().toString(); | |||
return UuidFactoryImpl.INSTANCE.create(); | |||
} | |||
} |
@@ -0,0 +1,41 @@ | |||
/* | |||
* SonarQube, open source software quality management tool. | |||
* Copyright (C) 2008-2014 SonarSource | |||
* mailto:contact AT sonarsource DOT com | |||
* | |||
* SonarQube is free software; you can redistribute it and/or | |||
* modify it under the terms of the GNU Lesser General Public | |||
* License as published by the Free Software Foundation; either | |||
* version 3 of the License, or (at your option) any later version. | |||
* | |||
* SonarQube 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 | |||
* Lesser General Public License for more details. | |||
* | |||
* You should have received a copy of the GNU Lesser 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 org.sonar.core.util; | |||
import org.junit.Test; | |||
import static org.assertj.core.api.Assertions.assertThat; | |||
public class MacAddressProviderTest { | |||
@Test | |||
public void getSecureMungedAddress() throws Exception { | |||
byte[] address = MacAddressProvider.getSecureMungedAddress(); | |||
assertThat(address).isNotEmpty(); | |||
assertThat(address).hasSize(6); | |||
} | |||
@Test | |||
public void constructDummyMulticastAddress() { | |||
byte[] address = MacAddressProvider.constructDummyMulticastAddress(); | |||
assertThat(address).isNotEmpty(); | |||
assertThat(address).hasSize(6); | |||
} | |||
} |
@@ -0,0 +1,46 @@ | |||
/* | |||
* SonarQube, open source software quality management tool. | |||
* Copyright (C) 2008-2014 SonarSource | |||
* mailto:contact AT sonarsource DOT com | |||
* | |||
* SonarQube is free software; you can redistribute it and/or | |||
* modify it under the terms of the GNU Lesser General Public | |||
* License as published by the Free Software Foundation; either | |||
* version 3 of the License, or (at your option) any later version. | |||
* | |||
* SonarQube 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 | |||
* Lesser General Public License for more details. | |||
* | |||
* You should have received a copy of the GNU Lesser 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 org.sonar.core.util; | |||
import org.junit.Test; | |||
import static org.assertj.core.api.Assertions.assertThat; | |||
public class UuidFactoryImplTest { | |||
UuidFactory underTest = UuidFactoryImpl.INSTANCE; | |||
@Test | |||
public void create_different_uuids() { | |||
// this test is not enough to ensure that generated strings are unique, | |||
// but it still does a simple and stupid verification | |||
assertThat(underTest.create()).isNotEqualTo(underTest.create()); | |||
} | |||
@Test | |||
public void test_format_of_uuid() throws Exception { | |||
String uuid = underTest.create(); | |||
assertThat(uuid.length()).isGreaterThan(10).isLessThan(40); | |||
// URL-safe: only letters, digits, dash and underscore. | |||
assertThat(uuid).matches("^[\\w\\-_]+$"); | |||
} | |||
} |
@@ -17,7 +17,7 @@ | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
package org.sonar.api.utils.internal; | |||
package org.sonar.core.util; | |||
import com.google.common.collect.Sets; | |||
import org.junit.Test; |
@@ -22,7 +22,7 @@ package org.sonar.core.issue; | |||
import java.util.Date; | |||
import org.sonar.api.issue.ActionPlan; | |||
import org.sonar.api.utils.internal.Uuids; | |||
import org.sonar.core.util.Uuids; | |||
public class ActionPlanStats extends DefaultActionPlan { | |||
@@ -37,7 +37,7 @@ import org.sonar.api.resources.Project; | |||
import org.sonar.api.rule.RuleKey; | |||
import org.sonar.api.utils.Duration; | |||
import org.sonar.api.utils.KeyValueFormat; | |||
import org.sonar.api.utils.internal.Uuids; | |||
import org.sonar.core.util.Uuids; | |||
import org.sonar.core.issue.DefaultIssue; | |||
import org.sonar.db.component.ComponentDto; | |||
import org.sonar.db.protobuf.DbIssues; |
@@ -28,7 +28,7 @@ import java.util.concurrent.atomic.AtomicLong; | |||
import org.apache.ibatis.session.ResultContext; | |||
import org.apache.ibatis.session.ResultHandler; | |||
import org.sonar.api.resources.Scopes; | |||
import org.sonar.api.utils.internal.Uuids; | |||
import org.sonar.core.util.Uuids; | |||
import org.sonar.api.utils.log.Logger; | |||
import org.sonar.api.utils.log.Loggers; | |||
import org.sonar.core.util.ProgressLogger; |
@@ -23,7 +23,7 @@ package org.sonar.db.component; | |||
import com.google.common.base.Preconditions; | |||
import org.sonar.api.resources.Qualifiers; | |||
import org.sonar.api.resources.Scopes; | |||
import org.sonar.api.utils.internal.Uuids; | |||
import org.sonar.core.util.Uuids; | |||
import static org.sonar.db.component.ComponentDto.MODULE_UUID_PATH_SEP; | |||
@@ -21,7 +21,7 @@ | |||
package org.sonar.db.permission; | |||
import java.util.Date; | |||
import org.sonar.api.utils.internal.Uuids; | |||
import org.sonar.core.util.Uuids; | |||
import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric; | |||
import static org.apache.commons.lang.RandomStringUtils.randomAscii; |