Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Set default value of Generator in Java instead of jelly, for improved usability in pipeline plugin
- Loading branch information
Showing
5 changed files
with
94 additions
and
30 deletions.
There are no files selected for viewing
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package hudson.plugins.cmake; | ||
|
||
import static org.junit.Assert.assertEquals; | ||
import static org.junit.Assert.assertNotNull; | ||
import static org.junit.Assert.assertTrue; | ||
|
||
import org.junit.Test; | ||
|
||
/** | ||
* Tests the CmakeBuilder`s getters and setters. | ||
* | ||
* @author Martin Weber | ||
*/ | ||
public class CmakeBuilderTest { | ||
|
||
/** | ||
* Verify that a default generator is set. | ||
*/ | ||
@Test | ||
public void testDefaultGenerator() throws Exception { | ||
CmakeBuilder cmb = new CmakeBuilder(CmakeTool.DEFAULT); | ||
final String generator = cmb.getGenerator(); | ||
assertNotNull(generator); | ||
assertTrue(generator.trim().length() > 0); | ||
} | ||
|
||
/** | ||
* Verify that a default generator is set even if set to null. | ||
*/ | ||
@Test | ||
public void testDefaultGeneratorSet() throws Exception { | ||
CmakeBuilder cmb = new CmakeBuilder(CmakeTool.DEFAULT); | ||
final String setGenerator = "null: gipsnich"; | ||
cmb.setGenerator(setGenerator); | ||
assertEquals(setGenerator, cmb.getGenerator()); | ||
cmb.setGenerator(null); | ||
String generator = cmb.getGenerator(); | ||
assertNotNull(generator); | ||
assertTrue(generator.trim().length() > 0); | ||
} | ||
} |