Skip to content

Commit

Permalink
Make naming consistent
Browse files Browse the repository at this point in the history
  • Loading branch information
basil committed Jun 1, 2019
1 parent 1574a30 commit dfd5a32
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 43 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Text Finder Plugin
# Text Finder

[![Build Status](https://ci.jenkins.io/buildStatus/icon?job=Plugins/text-finder-plugin/master)](https://ci.jenkins.io/job/Plugins/job/text-finder-plugin/job/master/)
[![Jenkins Plugin](https://img.shields.io/jenkins/plugin/v/text-finder.svg)](https://plugins.jenkins.io/text-finder)
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<artifactId>text-finder</artifactId>
<packaging>hpi</packaging>
<version>${revision}${changelist}</version>
<name>Jenkins TextFinder plugin</name>
<name>Text Finder</name>
<url>http://wiki.jenkins-ci.org/display/JENKINS/Text-finder+Plugin</url>
<properties>
<revision>1.12</revision>
Expand Down
17 changes: 8 additions & 9 deletions src/main/java/hudson/plugins/textfinder/TextFinderPublisher.java
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ private void findText(Run<?, ?> run, FilePath workspace, TaskListener listener)

if (alsoCheckConsoleOutput) {
// Do not mention the pattern we are looking for to avoid false positives
logger.println("[TextFinder plugin] Scanning console output...");
logger.println("[Text Finder] Scanning console output...");
foundText |=
checkFile(
run.getLogFile(),
Expand All @@ -138,7 +138,7 @@ private void findText(Run<?, ?> run, FilePath workspace, TaskListener listener)
run.getCharset(),
true);
logger.println(
"[TextFinder plugin] Finished looking for pattern "
"[Text Finder] Finished looking for pattern "
+ "'"
+ regexp
+ "'"
Expand All @@ -149,7 +149,7 @@ private void findText(Run<?, ?> run, FilePath workspace, TaskListener listener)

if (fileSet != null) {
logger.println(
"[TextFinder plugin] Looking for pattern "
"[Text Finder] Looking for pattern "
+ "'"
+ regexp
+ "'"
Expand Down Expand Up @@ -210,7 +210,7 @@ private static boolean checkFile(
}
}
} catch (IOException e) {
logger.println("Jenkins Text Finder: Error reading file '" + f + "' -- ignoring");
logger.println("[Text Finder] Error reading file '" + f + "' -- ignoring");
} finally {
IOUtils.closeQuietly(reader);
}
Expand All @@ -222,8 +222,7 @@ private static Pattern compilePattern(PrintStream logger, String regexp) {
try {
pattern = Pattern.compile(regexp);
} catch (PatternSyntaxException e) {
logger.println(
"Jenkins Text Finder: Unable to compile regular expression '" + regexp + "'");
logger.println("[Text Finder] Unable to compile regular expression '" + regexp + "'");
throw new AbortException();
}
return pattern;
Expand Down Expand Up @@ -298,7 +297,7 @@ public Boolean invoke(File ws, VirtualChannel channel) throws IOException {
// Any files in the final set?
String[] files = ds.getIncludedFiles();
if (files.length == 0) {
logger.println("Jenkins Text Finder: File set '" + fileSet + "' is empty");
logger.println("[Text Finder] File set '" + fileSet + "' is empty");
throw new AbortException();
}

Expand All @@ -310,12 +309,12 @@ public Boolean invoke(File ws, VirtualChannel channel) throws IOException {
File f = new File(ws, file);

if (!f.exists()) {
logger.println("Jenkins Text Finder: Unable to find file '" + f + "'");
logger.println("[Text Finder] Unable to find file '" + f + "'");
continue;
}

if (!f.canRead()) {
logger.println("Jenkins Text Finder: Unable to read from file '" + f + "'");
logger.println("[Text Finder] Unable to read from file '" + f + "'");
continue;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
TextFinderPublisher.DisplayName=Jenkins Text Finder
TextFinderPublisher.DisplayName=Text Finder
Original file line number Diff line number Diff line change
@@ -1 +1 @@
TextFinderPublisher.DisplayName=Jenkins\u6587\u5b57\u5217\u691c\u7d22
TextFinderPublisher.DisplayName=\u6587\u5b57\u5217\u691c\u7d22
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,7 @@ public void failureIfFoundInFileOnAgent() throws Exception {
WorkflowRun build = project.scheduleBuild2(0).get();
rule.waitForCompletion(build);
rule.assertLogContains(
"[TextFinder plugin] Looking for pattern "
+ "'"
+ UNIQUE_TEXT
+ "'"
+ " in the files at",
"[Text Finder] Looking for pattern " + "'" + UNIQUE_TEXT + "'" + " in the files at",
build);
assertLogContainsMatch(new File(getWorkspace(build), "out.txt"), UNIQUE_TEXT, build, false);
rule.assertBuildStatus(Result.FAILURE, build);
Expand All @@ -85,9 +81,9 @@ public void failureIfFoundInConsoleOnAgent() throws Exception {
agent.getNodeName(), agent.getNodeName())));
WorkflowRun build = project.scheduleBuild2(0).get();
rule.waitForCompletion(build);
rule.assertLogContains("[TextFinder plugin] Scanning console output...", build);
rule.assertLogContains("[Text Finder] Scanning console output...", build);
rule.assertLogContains(
"[TextFinder plugin] Finished looking for pattern '"
"[Text Finder] Finished looking for pattern '"
+ UNIQUE_TEXT
+ "' in the console output",
build);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ public void successIfFoundInConsole() throws Exception {
project.getPublishersList().add(textFinder);
FreeStyleBuild build = project.scheduleBuild2(0).get();
rule.waitForCompletion(build);
rule.assertLogContains("[TextFinder plugin] Scanning console output...", build);
rule.assertLogContains("[Text Finder] Scanning console output...", build);
rule.assertLogContains(
"[TextFinder plugin] Finished looking for pattern '"
"[Text Finder] Finished looking for pattern '"
+ UNIQUE_TEXT
+ "' in the console output",
build);
Expand All @@ -71,9 +71,9 @@ public void failureIfFoundInConsole() throws Exception {
project.getPublishersList().add(textFinder);
FreeStyleBuild build = project.scheduleBuild2(0).get();
rule.waitForCompletion(build);
rule.assertLogContains("[TextFinder plugin] Scanning console output...", build);
rule.assertLogContains("[Text Finder] Scanning console output...", build);
rule.assertLogContains(
"[TextFinder plugin] Finished looking for pattern '"
"[Text Finder] Finished looking for pattern '"
+ UNIQUE_TEXT
+ "' in the console output",
build);
Expand All @@ -95,9 +95,9 @@ public void unstableIfFoundInConsole() throws Exception {
project.getPublishersList().add(textFinder);
FreeStyleBuild build = project.scheduleBuild2(0).get();
rule.waitForCompletion(build);
rule.assertLogContains("[TextFinder plugin] Scanning console output...", build);
rule.assertLogContains("[Text Finder] Scanning console output...", build);
rule.assertLogContains(
"[TextFinder plugin] Finished looking for pattern '"
"[Text Finder] Finished looking for pattern '"
+ UNIQUE_TEXT
+ "' in the console output",
build);
Expand All @@ -113,9 +113,9 @@ public void notFoundInConsole() throws Exception {
project.getPublishersList().add(textFinder);
FreeStyleBuild build = project.scheduleBuild2(0).get();
rule.waitForCompletion(build);
rule.assertLogContains("[TextFinder plugin] Scanning console output...", build);
rule.assertLogContains("[Text Finder] Scanning console output...", build);
rule.assertLogContains(
"[TextFinder plugin] Finished looking for pattern '"
"[Text Finder] Finished looking for pattern '"
+ UNIQUE_TEXT
+ "' in the console output",
build);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public void successIfFoundInFile() throws Exception {
WorkflowRun build = project.scheduleBuild2(0).get();
rule.waitForCompletion(build);
rule.assertLogContains(
"[TextFinder plugin] Looking for pattern '"
"[Text Finder] Looking for pattern '"
+ UNIQUE_TEXT
+ "' in the files at "
+ "'"
Expand Down Expand Up @@ -97,7 +97,7 @@ public void failureIfFoundInFile() throws Exception {
WorkflowRun build = project.scheduleBuild2(0).get();
rule.waitForCompletion(build);
rule.assertLogContains(
"[TextFinder plugin] Looking for pattern '"
"[Text Finder] Looking for pattern '"
+ UNIQUE_TEXT
+ "' in the files at "
+ "'"
Expand Down Expand Up @@ -126,7 +126,7 @@ public void unstableIfFoundInFile() throws Exception {
WorkflowRun build = project.scheduleBuild2(0).get();
rule.waitForCompletion(build);
rule.assertLogContains(
"[TextFinder plugin] Looking for pattern '"
"[Text Finder] Looking for pattern '"
+ UNIQUE_TEXT
+ "' in the files at "
+ "'"
Expand Down Expand Up @@ -155,7 +155,7 @@ public void notBuiltIfFoundInFile() throws Exception {
WorkflowRun build = project.scheduleBuild2(0).get();
rule.waitForCompletion(build);
rule.assertLogContains(
"[TextFinder plugin] Looking for pattern '"
"[Text Finder] Looking for pattern '"
+ UNIQUE_TEXT
+ "' in the files at "
+ "'"
Expand All @@ -182,7 +182,7 @@ public void notFoundInFile() throws Exception {
WorkflowRun build = project.scheduleBuild2(0).get();
rule.waitForCompletion(build);
rule.assertLogContains(
"[TextFinder plugin] Looking for pattern '"
"[Text Finder] Looking for pattern '"
+ UNIQUE_TEXT
+ "' in the files at "
+ "'"
Expand All @@ -207,9 +207,9 @@ public void successIfFoundInConsole() throws Exception {
+ "', succeedIfFound: true, alsoCheckConsoleOutput: true}\n"));
WorkflowRun build = project.scheduleBuild2(0).get();
rule.waitForCompletion(build);
rule.assertLogContains("[TextFinder plugin] Scanning console output...", build);
rule.assertLogContains("[Text Finder] Scanning console output...", build);
rule.assertLogContains(
"[TextFinder plugin] Finished looking for pattern '"
"[Text Finder] Finished looking for pattern '"
+ UNIQUE_TEXT
+ "' in the console output",
build);
Expand All @@ -232,9 +232,9 @@ public void failureIfFoundInConsole() throws Exception {
+ "', alsoCheckConsoleOutput: true}\n"));
WorkflowRun build = project.scheduleBuild2(0).get();
rule.waitForCompletion(build);
rule.assertLogContains("[TextFinder plugin] Scanning console output...", build);
rule.assertLogContains("[Text Finder] Scanning console output...", build);
rule.assertLogContains(
"[TextFinder plugin] Finished looking for pattern '"
"[Text Finder] Finished looking for pattern '"
+ UNIQUE_TEXT
+ "' in the console output",
build);
Expand All @@ -257,9 +257,9 @@ public void unstableIfFoundInConsole() throws Exception {
+ "', unstableIfFound: true, alsoCheckConsoleOutput: true}\n"));
WorkflowRun build = project.scheduleBuild2(0).get();
rule.waitForCompletion(build);
rule.assertLogContains("[TextFinder plugin] Scanning console output...", build);
rule.assertLogContains("[Text Finder] Scanning console output...", build);
rule.assertLogContains(
"[TextFinder plugin] Finished looking for pattern '"
"[Text Finder] Finished looking for pattern '"
+ UNIQUE_TEXT
+ "' in the console output",
build);
Expand All @@ -282,9 +282,9 @@ public void notBuiltIfFoundInConsole() throws Exception {
+ "', notBuiltIfFound: true, alsoCheckConsoleOutput: true}\n"));
WorkflowRun build = project.scheduleBuild2(0).get();
rule.waitForCompletion(build);
rule.assertLogContains("[TextFinder plugin] Scanning console output...", build);
rule.assertLogContains("[Text Finder] Scanning console output...", build);
rule.assertLogContains(
"[TextFinder plugin] Finished looking for pattern '"
"[Text Finder] Finished looking for pattern '"
+ UNIQUE_TEXT
+ "' in the console output",
build);
Expand All @@ -302,9 +302,9 @@ public void notFoundInConsole() throws Exception {
+ "', alsoCheckConsoleOutput: true}\n"));
WorkflowRun build = project.scheduleBuild2(0).get();
rule.waitForCompletion(build);
rule.assertLogContains("[TextFinder plugin] Scanning console output...", build);
rule.assertLogContains("[Text Finder] Scanning console output...", build);
rule.assertLogContains(
"[TextFinder plugin] Finished looking for pattern '"
"[Text Finder] Finished looking for pattern '"
+ UNIQUE_TEXT
+ "' in the console output",
build);
Expand Down

0 comments on commit dfd5a32

Please sign in to comment.