From: Julien HENRY Date: Mon, 17 Feb 2014 11:34:41 +0000 (+0100) Subject: Fix UTs after renaming of one test class X-Git-Tag: 4.2~109 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=cc2b50a10410ea20d0608d7d35b829a5d776a018;p=sonarqube.git Fix UTs after renaming of one test class --- diff --git a/plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/issue/ignore/scanner/IgnoreIssuesRegexpScannerTest/file-with-double-regexp-mess.txt b/plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/issue/ignore/scanner/IgnoreIssuesRegexpScannerTest/file-with-double-regexp-mess.txt new file mode 100644 index 00000000000..48d30c92f97 --- /dev/null +++ b/plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/issue/ignore/scanner/IgnoreIssuesRegexpScannerTest/file-with-double-regexp-mess.txt @@ -0,0 +1,37 @@ +package org.sonar.plugins.switchoffviolations.pattern; + +import com.google.common.collect.Sets; + +import java.util.Set; + +/** + * + */ +public class LineRange { + int from, to; + + public LineRange(int from, int to) { + if (to < from) { + throw new IllegalArgumentException("Line range is not valid: " + from + " must be greater than " + to); + } + this.from = from; + this.to = to; + } + + // SONAR-OFF + public boolean in(int lineId) { + return from <= lineId && lineId <= to; + } + // FOO-OFF + + public Set toLines() { + Set lines = Sets.newLinkedHashSet(); + // SONAR-ON + for (int index = from; index <= to; index++) { + lines.add(index); + } + // FOO-ON + return lines; + } + +} \ No newline at end of file diff --git a/plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/issue/ignore/scanner/IgnoreIssuesRegexpScannerTest/file-with-double-regexp-twice.txt b/plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/issue/ignore/scanner/IgnoreIssuesRegexpScannerTest/file-with-double-regexp-twice.txt new file mode 100644 index 00000000000..9ae63dc57f9 --- /dev/null +++ b/plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/issue/ignore/scanner/IgnoreIssuesRegexpScannerTest/file-with-double-regexp-twice.txt @@ -0,0 +1,37 @@ +package org.sonar.plugins.switchoffviolations.pattern; + +import com.google.common.collect.Sets; + +import java.util.Set; + +/** + * + */ +public class LineRange { + int from, to; + + public LineRange(int from, int to) { + if (to < from) { + throw new IllegalArgumentException("Line range is not valid: " + from + " must be greater than " + to); + } + this.from = from; + this.to = to; + } + + // SONAR-OFF + public boolean in(int lineId) { + return from <= lineId && lineId <= to; + } + // SONAR-ON + + public Set toLines() { + Set lines = Sets.newLinkedHashSet(); + // FOO-OFF + for (int index = from; index <= to; index++) { + lines.add(index); + } + // FOO-ON + return lines; + } + +} \ No newline at end of file diff --git a/plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/issue/ignore/scanner/IgnoreIssuesRegexpScannerTest/file-with-double-regexp-unfinished.txt b/plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/issue/ignore/scanner/IgnoreIssuesRegexpScannerTest/file-with-double-regexp-unfinished.txt new file mode 100644 index 00000000000..dd7656180ab --- /dev/null +++ b/plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/issue/ignore/scanner/IgnoreIssuesRegexpScannerTest/file-with-double-regexp-unfinished.txt @@ -0,0 +1,34 @@ +package org.sonar.plugins.switchoffviolations.pattern; + +import com.google.common.collect.Sets; + +import java.util.Set; + +/** + * + */ +public class LineRange { + int from, to; + + public LineRange(int from, int to) { + if (to < from) { + throw new IllegalArgumentException("Line range is not valid: " + from + " must be greater than " + to); + } + this.from = from; + this.to = to; + } + + // SONAR-OFF + public boolean in(int lineId) { + return from <= lineId && lineId <= to; + } + + public Set toLines() { + Set lines = Sets.newLinkedHashSet(); + for (int index = from; index <= to; index++) { + lines.add(index); + } + return lines; + } + +} \ No newline at end of file diff --git a/plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/issue/ignore/scanner/IgnoreIssuesRegexpScannerTest/file-with-double-regexp-wrong-order.txt b/plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/issue/ignore/scanner/IgnoreIssuesRegexpScannerTest/file-with-double-regexp-wrong-order.txt new file mode 100644 index 00000000000..7cac0b98aed --- /dev/null +++ b/plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/issue/ignore/scanner/IgnoreIssuesRegexpScannerTest/file-with-double-regexp-wrong-order.txt @@ -0,0 +1,35 @@ +package org.sonar.plugins.switchoffviolations.pattern; + +import com.google.common.collect.Sets; + +import java.util.Set; + +/** + * + */ +public class LineRange { + int from, to; + + public LineRange(int from, int to) { + if (to < from) { + throw new IllegalArgumentException("Line range is not valid: " + from + " must be greater than " + to); + } + this.from = from; + this.to = to; + } + + // SONAR-ON + public boolean in(int lineId) { + return from <= lineId && lineId <= to; + } + // SONAR-OFF + + public Set toLines() { + Set lines = Sets.newLinkedHashSet(); + for (int index = from; index <= to; index++) { + lines.add(index); + } + return lines; + } + +} \ No newline at end of file diff --git a/plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/issue/ignore/scanner/IgnoreIssuesRegexpScannerTest/file-with-double-regexp.txt b/plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/issue/ignore/scanner/IgnoreIssuesRegexpScannerTest/file-with-double-regexp.txt new file mode 100644 index 00000000000..002169fe031 --- /dev/null +++ b/plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/issue/ignore/scanner/IgnoreIssuesRegexpScannerTest/file-with-double-regexp.txt @@ -0,0 +1,35 @@ +package org.sonar.plugins.switchoffviolations.pattern; + +import com.google.common.collect.Sets; + +import java.util.Set; + +/** + * + */ +public class LineRange { + int from, to; + + public LineRange(int from, int to) { + if (to < from) { + throw new IllegalArgumentException("Line range is not valid: " + from + " must be greater than " + to); + } + this.from = from; + this.to = to; + } + + // SONAR-OFF + public boolean in(int lineId) { + return from <= lineId && lineId <= to; + } + // SONAR-ON + + public Set toLines() { + Set lines = Sets.newLinkedHashSet(); + for (int index = from; index <= to; index++) { + lines.add(index); + } + return lines; + } + +} \ No newline at end of file diff --git a/plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/issue/ignore/scanner/IgnoreIssuesRegexpScannerTest/file-with-no-regexp.txt b/plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/issue/ignore/scanner/IgnoreIssuesRegexpScannerTest/file-with-no-regexp.txt new file mode 100644 index 00000000000..f18fa5b90ad --- /dev/null +++ b/plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/issue/ignore/scanner/IgnoreIssuesRegexpScannerTest/file-with-no-regexp.txt @@ -0,0 +1,33 @@ +package org.sonar.plugins.switchoffviolations.pattern; + +import com.google.common.collect.Sets; + +import java.util.Set; + +/** + * + */ +public class LineRange { + int from, to; + + public LineRange(int from, int to) { + if (to < from) { + throw new IllegalArgumentException("Line range is not valid: " + from + " must be greater than " + to); + } + this.from = from; + this.to = to; + } + + public boolean in(int lineId) { + return from <= lineId && lineId <= to; + } + + public Set toLines() { + Set lines = Sets.newLinkedHashSet(); + for (int index = from; index <= to; index++) { + lines.add(index); + } + return lines; + } + +} \ No newline at end of file diff --git a/plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/issue/ignore/scanner/IgnoreIssuesRegexpScannerTest/file-with-single-regexp-and-double-regexp.txt b/plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/issue/ignore/scanner/IgnoreIssuesRegexpScannerTest/file-with-single-regexp-and-double-regexp.txt new file mode 100644 index 00000000000..e09ecd7a323 --- /dev/null +++ b/plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/issue/ignore/scanner/IgnoreIssuesRegexpScannerTest/file-with-single-regexp-and-double-regexp.txt @@ -0,0 +1,36 @@ +package org.sonar.plugins.switchoffviolations.pattern; + +import com.google.common.collect.Sets; + + // SONAR-OFF + +import java.util.Set; + +/** + * @SONAR-IGNORE-ALL + */ +public class LineRange { + int from, to; + + public LineRange(int from, int to) { + if (to < from) { + throw new IllegalArgumentException("Line range is not valid: " + from + " must be greater than " + to); + } + this.from = from; + this.to = to; + } + + public boolean in(int lineId) { + return from <= lineId && lineId <= to; + } + // SONAR-ON + + public Set toLines() { + Set lines = Sets.newLinkedHashSet(); + for (int index = from; index <= to; index++) { + lines.add(index); + } + return lines; + } + +} \ No newline at end of file diff --git a/plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/issue/ignore/scanner/IgnoreIssuesRegexpScannerTest/file-with-single-regexp.txt b/plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/issue/ignore/scanner/IgnoreIssuesRegexpScannerTest/file-with-single-regexp.txt new file mode 100644 index 00000000000..ef135ebc50c --- /dev/null +++ b/plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/issue/ignore/scanner/IgnoreIssuesRegexpScannerTest/file-with-single-regexp.txt @@ -0,0 +1,33 @@ +package org.sonar.plugins.switchoffviolations.pattern; + +import com.google.common.collect.Sets; + +import java.util.Set; + +/** + * @SONAR-IGNORE-ALL + */ +public class LineRange { + int from, to; + + public LineRange(int from, int to) { + if (to < from) { + throw new IllegalArgumentException("Line range is not valid: " + from + " must be greater than " + to); + } + this.from = from; + this.to = to; + } + + public boolean in(int lineId) { + return from <= lineId && lineId <= to; + } + + public Set toLines() { + Set lines = Sets.newLinkedHashSet(); + for (int index = from; index <= to; index++) { + lines.add(index); + } + return lines; + } + +} \ No newline at end of file diff --git a/plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/issue/ignore/scanner/RegexpScannerTest/file-with-double-regexp-mess.txt b/plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/issue/ignore/scanner/RegexpScannerTest/file-with-double-regexp-mess.txt deleted file mode 100644 index 48d30c92f97..00000000000 --- a/plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/issue/ignore/scanner/RegexpScannerTest/file-with-double-regexp-mess.txt +++ /dev/null @@ -1,37 +0,0 @@ -package org.sonar.plugins.switchoffviolations.pattern; - -import com.google.common.collect.Sets; - -import java.util.Set; - -/** - * - */ -public class LineRange { - int from, to; - - public LineRange(int from, int to) { - if (to < from) { - throw new IllegalArgumentException("Line range is not valid: " + from + " must be greater than " + to); - } - this.from = from; - this.to = to; - } - - // SONAR-OFF - public boolean in(int lineId) { - return from <= lineId && lineId <= to; - } - // FOO-OFF - - public Set toLines() { - Set lines = Sets.newLinkedHashSet(); - // SONAR-ON - for (int index = from; index <= to; index++) { - lines.add(index); - } - // FOO-ON - return lines; - } - -} \ No newline at end of file diff --git a/plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/issue/ignore/scanner/RegexpScannerTest/file-with-double-regexp-twice.txt b/plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/issue/ignore/scanner/RegexpScannerTest/file-with-double-regexp-twice.txt deleted file mode 100644 index 9ae63dc57f9..00000000000 --- a/plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/issue/ignore/scanner/RegexpScannerTest/file-with-double-regexp-twice.txt +++ /dev/null @@ -1,37 +0,0 @@ -package org.sonar.plugins.switchoffviolations.pattern; - -import com.google.common.collect.Sets; - -import java.util.Set; - -/** - * - */ -public class LineRange { - int from, to; - - public LineRange(int from, int to) { - if (to < from) { - throw new IllegalArgumentException("Line range is not valid: " + from + " must be greater than " + to); - } - this.from = from; - this.to = to; - } - - // SONAR-OFF - public boolean in(int lineId) { - return from <= lineId && lineId <= to; - } - // SONAR-ON - - public Set toLines() { - Set lines = Sets.newLinkedHashSet(); - // FOO-OFF - for (int index = from; index <= to; index++) { - lines.add(index); - } - // FOO-ON - return lines; - } - -} \ No newline at end of file diff --git a/plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/issue/ignore/scanner/RegexpScannerTest/file-with-double-regexp-unfinished.txt b/plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/issue/ignore/scanner/RegexpScannerTest/file-with-double-regexp-unfinished.txt deleted file mode 100644 index dd7656180ab..00000000000 --- a/plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/issue/ignore/scanner/RegexpScannerTest/file-with-double-regexp-unfinished.txt +++ /dev/null @@ -1,34 +0,0 @@ -package org.sonar.plugins.switchoffviolations.pattern; - -import com.google.common.collect.Sets; - -import java.util.Set; - -/** - * - */ -public class LineRange { - int from, to; - - public LineRange(int from, int to) { - if (to < from) { - throw new IllegalArgumentException("Line range is not valid: " + from + " must be greater than " + to); - } - this.from = from; - this.to = to; - } - - // SONAR-OFF - public boolean in(int lineId) { - return from <= lineId && lineId <= to; - } - - public Set toLines() { - Set lines = Sets.newLinkedHashSet(); - for (int index = from; index <= to; index++) { - lines.add(index); - } - return lines; - } - -} \ No newline at end of file diff --git a/plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/issue/ignore/scanner/RegexpScannerTest/file-with-double-regexp-wrong-order.txt b/plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/issue/ignore/scanner/RegexpScannerTest/file-with-double-regexp-wrong-order.txt deleted file mode 100644 index 7cac0b98aed..00000000000 --- a/plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/issue/ignore/scanner/RegexpScannerTest/file-with-double-regexp-wrong-order.txt +++ /dev/null @@ -1,35 +0,0 @@ -package org.sonar.plugins.switchoffviolations.pattern; - -import com.google.common.collect.Sets; - -import java.util.Set; - -/** - * - */ -public class LineRange { - int from, to; - - public LineRange(int from, int to) { - if (to < from) { - throw new IllegalArgumentException("Line range is not valid: " + from + " must be greater than " + to); - } - this.from = from; - this.to = to; - } - - // SONAR-ON - public boolean in(int lineId) { - return from <= lineId && lineId <= to; - } - // SONAR-OFF - - public Set toLines() { - Set lines = Sets.newLinkedHashSet(); - for (int index = from; index <= to; index++) { - lines.add(index); - } - return lines; - } - -} \ No newline at end of file diff --git a/plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/issue/ignore/scanner/RegexpScannerTest/file-with-double-regexp.txt b/plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/issue/ignore/scanner/RegexpScannerTest/file-with-double-regexp.txt deleted file mode 100644 index 002169fe031..00000000000 --- a/plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/issue/ignore/scanner/RegexpScannerTest/file-with-double-regexp.txt +++ /dev/null @@ -1,35 +0,0 @@ -package org.sonar.plugins.switchoffviolations.pattern; - -import com.google.common.collect.Sets; - -import java.util.Set; - -/** - * - */ -public class LineRange { - int from, to; - - public LineRange(int from, int to) { - if (to < from) { - throw new IllegalArgumentException("Line range is not valid: " + from + " must be greater than " + to); - } - this.from = from; - this.to = to; - } - - // SONAR-OFF - public boolean in(int lineId) { - return from <= lineId && lineId <= to; - } - // SONAR-ON - - public Set toLines() { - Set lines = Sets.newLinkedHashSet(); - for (int index = from; index <= to; index++) { - lines.add(index); - } - return lines; - } - -} \ No newline at end of file diff --git a/plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/issue/ignore/scanner/RegexpScannerTest/file-with-no-regexp.txt b/plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/issue/ignore/scanner/RegexpScannerTest/file-with-no-regexp.txt deleted file mode 100644 index f18fa5b90ad..00000000000 --- a/plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/issue/ignore/scanner/RegexpScannerTest/file-with-no-regexp.txt +++ /dev/null @@ -1,33 +0,0 @@ -package org.sonar.plugins.switchoffviolations.pattern; - -import com.google.common.collect.Sets; - -import java.util.Set; - -/** - * - */ -public class LineRange { - int from, to; - - public LineRange(int from, int to) { - if (to < from) { - throw new IllegalArgumentException("Line range is not valid: " + from + " must be greater than " + to); - } - this.from = from; - this.to = to; - } - - public boolean in(int lineId) { - return from <= lineId && lineId <= to; - } - - public Set toLines() { - Set lines = Sets.newLinkedHashSet(); - for (int index = from; index <= to; index++) { - lines.add(index); - } - return lines; - } - -} \ No newline at end of file diff --git a/plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/issue/ignore/scanner/RegexpScannerTest/file-with-single-regexp-and-double-regexp.txt b/plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/issue/ignore/scanner/RegexpScannerTest/file-with-single-regexp-and-double-regexp.txt deleted file mode 100644 index e09ecd7a323..00000000000 --- a/plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/issue/ignore/scanner/RegexpScannerTest/file-with-single-regexp-and-double-regexp.txt +++ /dev/null @@ -1,36 +0,0 @@ -package org.sonar.plugins.switchoffviolations.pattern; - -import com.google.common.collect.Sets; - - // SONAR-OFF - -import java.util.Set; - -/** - * @SONAR-IGNORE-ALL - */ -public class LineRange { - int from, to; - - public LineRange(int from, int to) { - if (to < from) { - throw new IllegalArgumentException("Line range is not valid: " + from + " must be greater than " + to); - } - this.from = from; - this.to = to; - } - - public boolean in(int lineId) { - return from <= lineId && lineId <= to; - } - // SONAR-ON - - public Set toLines() { - Set lines = Sets.newLinkedHashSet(); - for (int index = from; index <= to; index++) { - lines.add(index); - } - return lines; - } - -} \ No newline at end of file diff --git a/plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/issue/ignore/scanner/RegexpScannerTest/file-with-single-regexp.txt b/plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/issue/ignore/scanner/RegexpScannerTest/file-with-single-regexp.txt deleted file mode 100644 index ef135ebc50c..00000000000 --- a/plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/issue/ignore/scanner/RegexpScannerTest/file-with-single-regexp.txt +++ /dev/null @@ -1,33 +0,0 @@ -package org.sonar.plugins.switchoffviolations.pattern; - -import com.google.common.collect.Sets; - -import java.util.Set; - -/** - * @SONAR-IGNORE-ALL - */ -public class LineRange { - int from, to; - - public LineRange(int from, int to) { - if (to < from) { - throw new IllegalArgumentException("Line range is not valid: " + from + " must be greater than " + to); - } - this.from = from; - this.to = to; - } - - public boolean in(int lineId) { - return from <= lineId && lineId <= to; - } - - public Set toLines() { - Set lines = Sets.newLinkedHashSet(); - for (int index = from; index <= to; index++) { - lines.add(index); - } - return lines; - } - -} \ No newline at end of file