-
-
Save slide/f5a82e4f683ec475b1eaf02512620b7f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Test | |
public void testPropertyTest() throws Exception { | |
FreeStyleProject project = j.createFreeStyleProject("tester"); | |
project.getBuildersList().add(new TestBuilder() { | |
@Override | |
public boolean perform(AbstractBuild<?,?> build, Launcher launcher, BuildListener listener) throws InterruptedException, IOException { | |
listener.getLogger().println("[2020-12-07T12:06:20.387Z] SonarQube task 'AXY9F-obrAIK9ZVmoTfZ' completed. Quality gate is 'ERROR'"); | |
return true; | |
} | |
}); | |
FreeStyleBuild b = project.scheduleBuild2(0).get(); | |
assertEquals(" 'ERROR'",TokenMacro.expand(b, StreamTaskListener.fromStdout(), | |
"${LOG_REGEX,regex=\"^.*?completed\\. Quality gate is(.*?$)\",replacement=\"\\\\1\"}")); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment