77 *
88 */
99
10- import com . gargoylesoftware .htmlunit .WebAssert ;
11- import com . gargoylesoftware .htmlunit .html .HtmlCheckBoxInput ;
12- import com . gargoylesoftware .htmlunit .html .HtmlPage ;
10+ import org .htmlunit .WebAssert ;
11+ import org .htmlunit .html .HtmlCheckBoxInput ;
12+ import org .htmlunit .html .HtmlPage ;
1313import java .io .File ;
1414import java .io .IOException ;
1515import java .net .URISyntaxException ;
@@ -306,65 +306,63 @@ public void verifyDefaultMatlabNotPicked() throws Exception {
306306 jenkins .assertLogContains ("MatlabNotFoundError" , build );
307307 }
308308
309- /*
310- * Test to verify if Matrix build fails when MATLAB is not available.
309+ /*
310+ * Test to verify if Matrix build fails when MATLAB is not available.
311311 *
312312 * NOTE: This test assumes there is no MATLAB installed and is not on System Path.
313313 *
314- */
315- @ Test
316- public void verifyMatrixBuildFails () throws Exception {
317- MatrixProject matrixProject = jenkins .createProject (MatrixProject .class );
318- Axis axes = new Axis ("VERSION" , "R2018a" , "R2015b" );
319- matrixProject .setAxes (new AxisList (axes ));
320- String matlabRoot = getMatlabroot ("R2018b" );
321- this .buildWrapper .setMatlabBuildWrapperContent (new MatlabBuildWrapperContent (Message .getValue ("matlab.custom.location" ), matlabRoot .replace ("R2018b" , "$VERSION" )));
322- matrixProject .getBuildWrappersList ().add (this .buildWrapper );
323-
324- scriptBuilder .setMatlabCommand ("pwd" );
325- matrixProject .getBuildersList ().add (scriptBuilder );
326- Map <String , String > vals = new HashMap <String , String >();
327- vals .put ("VERSION" , "R2018a" );
328- Combination c1 = new Combination (vals );
329- MatrixRun build = matrixProject .scheduleBuild2 (0 ).get ().getRun (c1 );
330- jenkins .assertLogContains ("run-matlab-command" , build );
331- jenkins .assertBuildStatus (Result .FAILURE , build );
332- vals .put ("VERSION" , "R2015b" );
333- Combination c2 = new Combination (vals );
334- MatrixRun build2 = matrixProject .scheduleBuild2 (0 ).get ().getRun (c2 );
335- jenkins .assertLogContains ("MatlabNotFoundError" , build2 );
336- jenkins .assertBuildStatus (Result .FAILURE , build2 );
337- }
314+ */
315+ @ Test
316+ public void verifyMatrixBuildFails () throws Exception {
317+ MatrixProject matrixProject = jenkins .createProject (MatrixProject .class );
318+ Axis axes = new Axis ("VERSION" , "R2018a" , "R2015b" );
319+ matrixProject .setAxes (new AxisList (axes ));
320+ String matlabRoot = getMatlabroot ("R2018b" );
321+ this .buildWrapper .setMatlabBuildWrapperContent (new MatlabBuildWrapperContent (Message .getValue ("matlab.custom.location" ), matlabRoot .replace ("R2018b" , "$VERSION" )));
322+ matrixProject .getBuildWrappersList ().add (this .buildWrapper );
323+
324+ scriptBuilder .setMatlabCommand ("pwd" );
325+ matrixProject .getBuildersList ().add (scriptBuilder );
326+ Map <String , String > vals = new HashMap <String , String >();
327+ vals .put ("VERSION" , "R2018a" );
328+ Combination c1 = new Combination (vals );
329+ MatrixRun build = matrixProject .scheduleBuild2 (0 ).get ().getRun (c1 );
330+ jenkins .assertLogContains ("run-matlab-command" , build );
331+ jenkins .assertBuildStatus (Result .FAILURE , build );
332+ vals .put ("VERSION" , "R2015b" );
333+ Combination c2 = new Combination (vals );
334+ MatrixRun build2 = matrixProject .scheduleBuild2 (0 ).get ().getRun (c2 );
335+ jenkins .assertLogContains ("MatlabNotFoundError" , build2 );
336+ jenkins .assertBuildStatus (Result .FAILURE , build2 );
337+ }
338338
339- /*
340- * Test to verify if Matrix build passes (mock MATLAB).
341- */
342- @ Test
343- public void verifyMatrixBuildPasses () throws Exception {
344- MatrixProject matrixProject = jenkins .createProject (MatrixProject .class );
345- Axis axes = new Axis ("VERSION" , "R2018a" , "R2018b" );
346- matrixProject .setAxes (new AxisList (axes ));
347- String matlabRoot = getMatlabroot ("R2018b" );
348- this .buildWrapper .setMatlabBuildWrapperContent (new MatlabBuildWrapperContent (Message .getValue ("matlab.custom.location" ), matlabRoot .replace ("R2018b" , "$VERSION" )));
349- matrixProject .getBuildWrappersList ().add (this .buildWrapper );
350- RunMatlabCommandBuilderTester tester = new RunMatlabCommandBuilderTester (matlabExecutorAbsolutePath ,
351- "-positive" );
352-
353- tester .setMatlabCommand ("pwd" );
354- matrixProject .getBuildersList ().add (tester );
355- MatrixBuild build = matrixProject .scheduleBuild2 (0 ).get ();
356-
357- jenkins .assertLogContains ("R2018a completed" , build );
358- jenkins .assertLogContains ("R2018b completed" , build );
359- jenkins .assertBuildStatus (Result .SUCCESS , build );
339+ /*
340+ * Test to verify if Matrix build passes (mock MATLAB).
341+ */
342+ @ Test
343+ public void verifyMatrixBuildPasses () throws Exception {
344+ MatrixProject matrixProject = jenkins .createProject (MatrixProject .class );
345+ Axis axes = new Axis ("VERSION" , "R2018a" , "R2018b" );
346+ matrixProject .setAxes (new AxisList (axes ));
347+ String matlabRoot = getMatlabroot ("R2018b" );
348+ this .buildWrapper .setMatlabBuildWrapperContent (new MatlabBuildWrapperContent (Message .getValue ("matlab.custom.location" ), matlabRoot .replace ("R2018b" , "$VERSION" )));
349+ matrixProject .getBuildWrappersList ().add (this .buildWrapper );
350+ RunMatlabCommandBuilderTester tester = new RunMatlabCommandBuilderTester (matlabExecutorAbsolutePath ,
351+ "-positive" );
352+
353+ tester .setMatlabCommand ("pwd" );
354+ matrixProject .getBuildersList ().add (tester );
355+ MatrixBuild build = matrixProject .scheduleBuild2 (0 ).get ();
356+
357+ jenkins .assertLogContains ("R2018a completed" , build );
358+ jenkins .assertLogContains ("R2018b completed" , build );
359+ jenkins .assertBuildStatus (Result .SUCCESS , build );
360360 }
361361
362- /*
362+ /*
363363 * Test to verify if command parses succesfully when multiple combinations of
364364 * characters are passed. (candidate for integ-tests once integrated)
365365 */
366-
367-
368366 public void verifyMultispecialChar () throws Exception {
369367 final String actualCommand =
370368 "!\" \" #$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\ ]^_`abcdefghijklmnopqrstuvwxyz{|}~" ;
@@ -384,7 +382,6 @@ public void verifyMultispecialChar() throws Exception {
384382 /*
385383 * Test to verify error message when command is empty.
386384 */
387-
388385 @ Test
389386 public void verifyErrorMessageOnEmptyCommand () throws Exception {
390387 this .buildWrapper .setMatlabBuildWrapperContent (new MatlabBuildWrapperContent (Message .getValue ("matlab.custom.location" ), getMatlabroot ("R2017a" )));
0 commit comments