AbstractParserTest: Use CONSTANT_CASE for static final field
Change-Id: Ica831987e94fda4e7d365c5e2f0c920416dd5a07 Signed-off-by: Edwin Kempin <ekempin@google.com>
This commit is contained in:

committed by
David Pursehouse

parent
fc555d7854
commit
8cc3363c9d
@@ -27,7 +27,7 @@ import org.junit.Ignore;
|
||||
|
||||
@Ignore
|
||||
public class AbstractParserTest {
|
||||
protected static final String changeURL = "https://gerrit-review.googlesource.com/#/changes/123";
|
||||
protected static final String CHANGE_URL = "https://gerrit-review.googlesource.com/#/changes/123";
|
||||
|
||||
protected static void assertChangeMessage(String message, MailComment comment) {
|
||||
assertThat(comment.fileName).isNull();
|
||||
|
@@ -30,7 +30,7 @@ public class GenericHtmlParserTest extends HtmlParserTest {
|
||||
+ "<blockquote class=\"quote\" "
|
||||
+ "<p>foobar <strong>posted comments</strong> on this change.</p>"
|
||||
+ "<p><a href=\""
|
||||
+ changeURL
|
||||
+ CHANGE_URL
|
||||
+ "/1\" "
|
||||
+ "target=\"_blank\">View Change</a></p><div>Patch Set 2: CR-1\n"
|
||||
+ "\n"
|
||||
@@ -38,13 +38,13 @@ public class GenericHtmlParserTest extends HtmlParserTest {
|
||||
+ "<p>"
|
||||
+ // File #1: test.txt
|
||||
"<a href=\""
|
||||
+ changeURL
|
||||
+ CHANGE_URL
|
||||
+ "/1/gerrit-server/test.txt\">"
|
||||
+ "File gerrit-server/<wbr>test.txt:</a></p>"
|
||||
+ commentBlock(f1)
|
||||
+ "<li><p>"
|
||||
+ "<a href=\""
|
||||
+ changeURL
|
||||
+ CHANGE_URL
|
||||
+ "/1/gerrit-server/test.txt\">"
|
||||
+ "Patch Set #2:</a> </p>"
|
||||
+ "<blockquote><pre>Some inline comment from Gerrit</pre>"
|
||||
@@ -53,7 +53,7 @@ public class GenericHtmlParserTest extends HtmlParserTest {
|
||||
+ commentBlock(fc1)
|
||||
+ "<li><p>"
|
||||
+ "<a href=\""
|
||||
+ changeURL
|
||||
+ CHANGE_URL
|
||||
+ "/1/gerrit-server/test.txt@2\">"
|
||||
+ "Patch Set #2, Line 31:</a> </p>"
|
||||
+ "<blockquote><pre>Some inline comment from Gerrit</pre>"
|
||||
@@ -64,7 +64,7 @@ public class GenericHtmlParserTest extends HtmlParserTest {
|
||||
+ // Inline comment #2
|
||||
"<li><p>"
|
||||
+ "<a href=\""
|
||||
+ changeURL
|
||||
+ CHANGE_URL
|
||||
+ "/1/gerrit-server/test.txt@3\">"
|
||||
+ "Patch Set #2, Line 47:</a> </p>"
|
||||
+ "<blockquote><pre>Some comment posted on Gerrit</pre>"
|
||||
@@ -73,7 +73,7 @@ public class GenericHtmlParserTest extends HtmlParserTest {
|
||||
+ commentBlock(c2)
|
||||
+ "<li><p>"
|
||||
+ "<a href=\""
|
||||
+ changeURL
|
||||
+ CHANGE_URL
|
||||
+ "/1/gerrit-server/test.txt@115\">"
|
||||
+ "Patch Set #2, Line 115:</a> <code>some code</code></p>"
|
||||
+ "<p>some comment</p></li></ul></li>"
|
||||
@@ -81,13 +81,13 @@ public class GenericHtmlParserTest extends HtmlParserTest {
|
||||
+ "<li><p>"
|
||||
+ // File #2: test.txt
|
||||
"<a href=\""
|
||||
+ changeURL
|
||||
+ CHANGE_URL
|
||||
+ "/1/gerrit-server/readme.txt\">"
|
||||
+ "File gerrit-server/<wbr>readme.txt:</a></p>"
|
||||
+ commentBlock(f2)
|
||||
+ "<li><p>"
|
||||
+ "<a href=\""
|
||||
+ changeURL
|
||||
+ CHANGE_URL
|
||||
+ "/1/gerrit-server/readme.txt@3\">"
|
||||
+ "Patch Set #2, Line 31:</a> </p>"
|
||||
+ "<blockquote><pre>Some inline comment from Gerrit</pre>"
|
||||
@@ -100,7 +100,7 @@ public class GenericHtmlParserTest extends HtmlParserTest {
|
||||
+ ""
|
||||
+ // Footer
|
||||
"<p>To view, visit <a href=\""
|
||||
+ changeURL
|
||||
+ CHANGE_URL
|
||||
+ "/1\">this change</a>. "
|
||||
+ "To unsubscribe, visit <a href=\"https://someurl\">settings</a>."
|
||||
+ "</p><p>Gerrit-MessageType: comment<br>"
|
||||
|
@@ -29,7 +29,7 @@ public class GmailHtmlParserTest extends HtmlParserTest {
|
||||
+ "<blockquote class=\"gmail_quote\" "
|
||||
+ "<p>foobar <strong>posted comments</strong> on this change.</p>"
|
||||
+ "<p><a href=\""
|
||||
+ changeURL
|
||||
+ CHANGE_URL
|
||||
+ "/1\" "
|
||||
+ "target=\"_blank\">View Change</a></p><div>Patch Set 2: CR-1\n"
|
||||
+ "\n"
|
||||
@@ -37,13 +37,13 @@ public class GmailHtmlParserTest extends HtmlParserTest {
|
||||
+ "<p>"
|
||||
+ // File #1: test.txt
|
||||
"<a href=\""
|
||||
+ changeURL
|
||||
+ CHANGE_URL
|
||||
+ "/1/gerrit-server/test.txt\">"
|
||||
+ "File gerrit-server/<wbr>test.txt:</a></p>"
|
||||
+ commentBlock(f1)
|
||||
+ "<li><p>"
|
||||
+ "<a href=\""
|
||||
+ changeURL
|
||||
+ CHANGE_URL
|
||||
+ "/1/gerrit-server/test.txt\">"
|
||||
+ "Patch Set #2:</a> </p>"
|
||||
+ "<blockquote><pre>Some inline comment from Gerrit</pre>"
|
||||
@@ -52,7 +52,7 @@ public class GmailHtmlParserTest extends HtmlParserTest {
|
||||
+ commentBlock(fc1)
|
||||
+ "<li><p>"
|
||||
+ "<a href=\""
|
||||
+ changeURL
|
||||
+ CHANGE_URL
|
||||
+ "/1/gerrit-server/test.txt@2\">"
|
||||
+ "Patch Set #2, Line 31:</a> </p>"
|
||||
+ "<blockquote><pre>Some inline comment from Gerrit</pre>"
|
||||
@@ -63,7 +63,7 @@ public class GmailHtmlParserTest extends HtmlParserTest {
|
||||
+ // Inline comment #2
|
||||
"<li><p>"
|
||||
+ "<a href=\""
|
||||
+ changeURL
|
||||
+ CHANGE_URL
|
||||
+ "/1/gerrit-server/test.txt@3\">"
|
||||
+ "Patch Set #2, Line 47:</a> </p>"
|
||||
+ "<blockquote><pre>Some comment posted on Gerrit</pre>"
|
||||
@@ -72,7 +72,7 @@ public class GmailHtmlParserTest extends HtmlParserTest {
|
||||
+ commentBlock(c2)
|
||||
+ "<li><p>"
|
||||
+ "<a href=\""
|
||||
+ changeURL
|
||||
+ CHANGE_URL
|
||||
+ "/1/gerrit-server/test.txt@115\">"
|
||||
+ "Patch Set #2, Line 115:</a> <code>some code</code></p>"
|
||||
+ "<p>some comment</p></li></ul></li>"
|
||||
@@ -80,13 +80,13 @@ public class GmailHtmlParserTest extends HtmlParserTest {
|
||||
+ "<li><p>"
|
||||
+ // File #2: test.txt
|
||||
"<a href=\""
|
||||
+ changeURL
|
||||
+ CHANGE_URL
|
||||
+ "/1/gerrit-server/readme.txt\">"
|
||||
+ "File gerrit-server/<wbr>readme.txt:</a></p>"
|
||||
+ commentBlock(f2)
|
||||
+ "<li><p>"
|
||||
+ "<a href=\""
|
||||
+ changeURL
|
||||
+ CHANGE_URL
|
||||
+ "/1/gerrit-server/readme.txt@3\">"
|
||||
+ "Patch Set #2, Line 31:</a> </p>"
|
||||
+ "<blockquote><pre>Some inline comment from Gerrit</pre>"
|
||||
@@ -99,7 +99,7 @@ public class GmailHtmlParserTest extends HtmlParserTest {
|
||||
+ ""
|
||||
+ // Footer
|
||||
"<p>To view, visit <a href=\""
|
||||
+ changeURL
|
||||
+ CHANGE_URL
|
||||
+ "/1\">this change</a>. "
|
||||
+ "To unsubscribe, visit <a href=\"https://someurl\">settings</a>."
|
||||
+ "</p><p>Gerrit-MessageType: comment<br>"
|
||||
|
@@ -49,7 +49,7 @@ public abstract class HtmlParserTest extends AbstractParserTest {
|
||||
null));
|
||||
|
||||
List<Comment> comments = defaultComments();
|
||||
List<MailComment> parsedComments = HtmlParser.parse(b.build(), comments, changeURL);
|
||||
List<MailComment> parsedComments = HtmlParser.parse(b.build(), comments, CHANGE_URL);
|
||||
|
||||
assertThat(parsedComments).hasSize(3);
|
||||
assertChangeMessage("Looks good to me", parsedComments.get(0));
|
||||
@@ -71,7 +71,7 @@ public abstract class HtmlParserTest extends AbstractParserTest {
|
||||
null));
|
||||
|
||||
List<Comment> comments = defaultComments();
|
||||
List<MailComment> parsedComments = HtmlParser.parse(b.build(), comments, changeURL);
|
||||
List<MailComment> parsedComments = HtmlParser.parse(b.build(), comments, CHANGE_URL);
|
||||
|
||||
assertThat(parsedComments).hasSize(3);
|
||||
assertChangeMessage("Looks good to me", parsedComments.get(0));
|
||||
@@ -85,7 +85,7 @@ public abstract class HtmlParserTest extends AbstractParserTest {
|
||||
b.htmlContent(newHtmlBody(null, null, null, null, null, null, null));
|
||||
|
||||
List<Comment> comments = defaultComments();
|
||||
List<MailComment> parsedComments = HtmlParser.parse(b.build(), comments, changeURL);
|
||||
List<MailComment> parsedComments = HtmlParser.parse(b.build(), comments, CHANGE_URL);
|
||||
|
||||
assertThat(parsedComments).isEmpty();
|
||||
}
|
||||
@@ -98,7 +98,7 @@ public abstract class HtmlParserTest extends AbstractParserTest {
|
||||
null, null, null, "Also have a comment here.", "This is a nice file", null, null));
|
||||
|
||||
List<Comment> comments = defaultComments();
|
||||
List<MailComment> parsedComments = HtmlParser.parse(b.build(), comments, changeURL);
|
||||
List<MailComment> parsedComments = HtmlParser.parse(b.build(), comments, CHANGE_URL);
|
||||
|
||||
assertThat(parsedComments).hasSize(2);
|
||||
assertFileComment("This is a nice file", parsedComments.get(0), comments.get(1).key.filename);
|
||||
|
@@ -40,7 +40,7 @@ public class TextParserTest extends AbstractParserTest {
|
||||
b.textContent("Looks good to me\n" + quotedFooter);
|
||||
|
||||
List<Comment> comments = defaultComments();
|
||||
List<MailComment> parsedComments = TextParser.parse(b.build(), comments, changeURL);
|
||||
List<MailComment> parsedComments = TextParser.parse(b.build(), comments, CHANGE_URL);
|
||||
|
||||
assertThat(parsedComments).hasSize(1);
|
||||
assertChangeMessage("Looks good to me", parsedComments.get(0));
|
||||
@@ -61,7 +61,7 @@ public class TextParserTest extends AbstractParserTest {
|
||||
+ quotedFooter);
|
||||
|
||||
List<Comment> comments = defaultComments();
|
||||
List<MailComment> parsedComments = TextParser.parse(b.build(), comments, changeURL);
|
||||
List<MailComment> parsedComments = TextParser.parse(b.build(), comments, CHANGE_URL);
|
||||
|
||||
assertThat(parsedComments).hasSize(3);
|
||||
assertChangeMessage("Looks good to me", parsedComments.get(0));
|
||||
@@ -84,7 +84,7 @@ public class TextParserTest extends AbstractParserTest {
|
||||
+ quotedFooter);
|
||||
|
||||
List<Comment> comments = defaultComments();
|
||||
List<MailComment> parsedComments = TextParser.parse(b.build(), comments, changeURL);
|
||||
List<MailComment> parsedComments = TextParser.parse(b.build(), comments, CHANGE_URL);
|
||||
|
||||
assertThat(parsedComments).hasSize(3);
|
||||
assertChangeMessage("Looks good to me", parsedComments.get(0));
|
||||
@@ -98,7 +98,7 @@ public class TextParserTest extends AbstractParserTest {
|
||||
b.textContent(newPlaintextBody(null, null, null, null, null, null, null) + quotedFooter);
|
||||
|
||||
List<Comment> comments = defaultComments();
|
||||
List<MailComment> parsedComments = TextParser.parse(b.build(), comments, changeURL);
|
||||
List<MailComment> parsedComments = TextParser.parse(b.build(), comments, CHANGE_URL);
|
||||
|
||||
assertThat(parsedComments).isEmpty();
|
||||
}
|
||||
@@ -112,7 +112,7 @@ public class TextParserTest extends AbstractParserTest {
|
||||
+ quotedFooter);
|
||||
|
||||
List<Comment> comments = defaultComments();
|
||||
List<MailComment> parsedComments = TextParser.parse(b.build(), comments, changeURL);
|
||||
List<MailComment> parsedComments = TextParser.parse(b.build(), comments, CHANGE_URL);
|
||||
|
||||
assertThat(parsedComments).hasSize(2);
|
||||
assertFileComment("This is a nice file", parsedComments.get(0), comments.get(1).key.filename);
|
||||
@@ -135,7 +135,7 @@ public class TextParserTest extends AbstractParserTest {
|
||||
.replace("> ", ">> "));
|
||||
|
||||
List<Comment> comments = defaultComments();
|
||||
List<MailComment> parsedComments = TextParser.parse(b.build(), comments, changeURL);
|
||||
List<MailComment> parsedComments = TextParser.parse(b.build(), comments, CHANGE_URL);
|
||||
|
||||
assertThat(parsedComments).hasSize(3);
|
||||
assertChangeMessage("Looks good to me", parsedComments.get(0));
|
||||
@@ -158,7 +158,7 @@ public class TextParserTest extends AbstractParserTest {
|
||||
+ quotedFooter);
|
||||
|
||||
List<Comment> comments = defaultComments();
|
||||
List<MailComment> parsedComments = TextParser.parse(b.build(), comments, changeURL);
|
||||
List<MailComment> parsedComments = TextParser.parse(b.build(), comments, CHANGE_URL);
|
||||
|
||||
assertThat(parsedComments).hasSize(2);
|
||||
assertChangeMessage("Looks good to me", parsedComments.get(0));
|
||||
@@ -184,7 +184,7 @@ public class TextParserTest extends AbstractParserTest {
|
||||
+ "<noreply-gerritcodereview-qUgXfQecoDLHwp0MldAzig@google.com> wrote: \n"
|
||||
+ "> Foo Bar has posted comments on this change. ( \n"
|
||||
+ "> "
|
||||
+ changeURL
|
||||
+ CHANGE_URL
|
||||
+ "/1 )\n"
|
||||
+ "> \n"
|
||||
+ "> Change subject: Test change\n"
|
||||
@@ -196,7 +196,7 @@ public class TextParserTest extends AbstractParserTest {
|
||||
+ "> (3 comments)\n"
|
||||
+ "> \n"
|
||||
+ "> "
|
||||
+ changeURL
|
||||
+ CHANGE_URL
|
||||
+ "/1/gerrit-server/test.txt\n"
|
||||
+ "> File \n"
|
||||
+ "> gerrit-server/test.txt:\n"
|
||||
@@ -204,14 +204,14 @@ public class TextParserTest extends AbstractParserTest {
|
||||
+ "> \n"
|
||||
+ "> Patch Set #4:\n"
|
||||
+ "> "
|
||||
+ changeURL
|
||||
+ CHANGE_URL
|
||||
+ "/1/gerrit-server/test.txt\n"
|
||||
+ "> \n"
|
||||
+ "> Some comment"
|
||||
+ "> \n"
|
||||
+ (fc1 == null ? "" : fc1 + "\n")
|
||||
+ "> "
|
||||
+ changeURL
|
||||
+ CHANGE_URL
|
||||
+ "/1/gerrit-server/test.txt@2\n"
|
||||
+ "> PS1, Line 2: throw new Exception(\"Object has unsupported: \" +\n"
|
||||
+ "> : entry.getValue() +\n"
|
||||
@@ -222,7 +222,7 @@ public class TextParserTest extends AbstractParserTest {
|
||||
+ ">\n"
|
||||
+ "> \n"
|
||||
+ "> "
|
||||
+ changeURL
|
||||
+ CHANGE_URL
|
||||
+ "/1/gerrit-server/test.txt@3\n"
|
||||
+ "> PS1, Line 3: throw new Exception(\"Object has: \" +\n"
|
||||
+ "> : entry.getValue().getClass() +\n"
|
||||
@@ -232,14 +232,14 @@ public class TextParserTest extends AbstractParserTest {
|
||||
+ (c2 == null ? "" : c2 + "\n")
|
||||
+ "> \n"
|
||||
+ "> "
|
||||
+ changeURL
|
||||
+ CHANGE_URL
|
||||
+ "/1/gerrit-server/readme.txt\n"
|
||||
+ "> File \n"
|
||||
+ "> gerrit-server/readme.txt:\n"
|
||||
+ (f2 == null ? "" : f2 + "\n")
|
||||
+ "> \n"
|
||||
+ "> "
|
||||
+ changeURL
|
||||
+ CHANGE_URL
|
||||
+ "/1/gerrit-server/readme.txt@3\n"
|
||||
+ "> PS1, Line 3: E\n"
|
||||
+ "> Should this be EEE like in other places?\n"
|
||||
|
Reference in New Issue
Block a user