Skip to content

Commit

Permalink
Attempt to get test working on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
basil committed Oct 26, 2024
1 parent a139b4b commit bd9ccb1
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@

import hudson.Functions;
import hudson.model.FreeStyleProject;
import hudson.tasks.BatchFile;
import hudson.tasks.Shell;

import org.junit.Test;
import org.jvnet.hudson.test.HudsonTestCase;

import static org.junit.Assume.assumeFalse;
/**
* Test Failure Cause project action.
*/
Expand All @@ -43,9 +43,10 @@ public class FailureCauseProjectActionHudsonTest extends HudsonTestCase {
*/
@Test
public void testShowLastFailureOnProjectPage() throws Exception {
assumeFalse(Functions.isWindows());
FreeStyleProject project = createFreeStyleProject();
project.getBuildersList().add(new Shell("test $BUILD_NUMBER -eq 2"));
project.getBuildersList().add(Functions.isWindows()
? new BatchFile("@if %BUILD_NUMBER%==2 exit /b 1")

Check warning on line 48 in src/test/java/com/sonyericsson/jenkins/plugins/bfa/model/FailureCauseProjectActionHudsonTest.java

View check run for this annotation

ci.jenkins.io / Java Compiler

checkstyle:checkstyle

ERROR: Avoid inline conditionals. [AvoidInlineConditionals]

Check warning on line 48 in src/test/java/com/sonyericsson/jenkins/plugins/bfa/model/FailureCauseProjectActionHudsonTest.java

View check run for this annotation

ci.jenkins.io / Java Compiler

checkstyle:check

ERROR: Avoid inline conditionals. [AvoidInlineConditionals]

Check warning on line 48 in src/test/java/com/sonyericsson/jenkins/plugins/bfa/model/FailureCauseProjectActionHudsonTest.java

View check run for this annotation

ci.jenkins.io / Java Compiler

checkstyle:check

ERROR: (coding) AvoidInlineConditionals: Avoid inline conditionals.

Check warning on line 48 in src/test/java/com/sonyericsson/jenkins/plugins/bfa/model/FailureCauseProjectActionHudsonTest.java

View check run for this annotation

ci.jenkins.io / CheckStyle

AvoidInlineConditionalsCheck

ERROR: Avoid inline conditionals.
Raw output
<p>Since Checkstyle 3.1</p><p> Detects inline conditionals. Here is one example of an inline conditional: </p><pre><code> String a = getParameter("a"); String b = (a==null || a.length&lt;1) ? null : a.substring(1); </code></pre><p> Rationale: Some developers find inline conditionals hard to read, so their employer's coding standards forbid them. </p>
: new Shell("test $BUILD_NUMBER -eq 2"));
project.scheduleBuild2(0).get();

FailureCauseProjectAction action = project.getAction(FailureCauseProjectAction.class);
Expand Down

0 comments on commit bd9ccb1

Please sign in to comment.