7
7
*
8
8
*/
9
9
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 ;
13
13
import java .io .File ;
14
14
import java .io .IOException ;
15
15
import java .net .URISyntaxException ;
@@ -306,65 +306,63 @@ public void verifyDefaultMatlabNotPicked() throws Exception {
306
306
jenkins .assertLogContains ("MatlabNotFoundError" , build );
307
307
}
308
308
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.
311
311
*
312
312
* NOTE: This test assumes there is no MATLAB installed and is not on System Path.
313
313
*
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
+ }
338
338
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 );
360
360
}
361
361
362
- /*
362
+ /*
363
363
* Test to verify if command parses succesfully when multiple combinations of
364
364
* characters are passed. (candidate for integ-tests once integrated)
365
365
*/
366
-
367
-
368
366
public void verifyMultispecialChar () throws Exception {
369
367
final String actualCommand =
370
368
"!\" \" #$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\ ]^_`abcdefghijklmnopqrstuvwxyz{|}~" ;
@@ -384,7 +382,6 @@ public void verifyMultispecialChar() throws Exception {
384
382
/*
385
383
* Test to verify error message when command is empty.
386
384
*/
387
-
388
385
@ Test
389
386
public void verifyErrorMessageOnEmptyCommand () throws Exception {
390
387
this .buildWrapper .setMatlabBuildWrapperContent (new MatlabBuildWrapperContent (Message .getValue ("matlab.custom.location" ), getMatlabroot ("R2017a" )));
0 commit comments