Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[JENKINS-17876] Directly invoke QuotedStringTokenizer so quotes can b…
…e preserved in both the installation default args and the instance args.
- Loading branch information
Jonathan Zimmerman
committed
May 30, 2013
1 parent
dbf9ee7
commit 1152504
Showing
2 changed files
with
47 additions
and
8 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
32 changes: 32 additions & 0 deletions
32
src/test/java/hudson/plugins/msbuild/MsBuildBuilderTest.java
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,32 @@ | ||
package hudson.plugins.msbuild; | ||
|
||
import org.junit.Test; | ||
import static org.junit.Assert.*; | ||
|
||
/** | ||
* | ||
* @author Jonathan Zimmerman | ||
*/ | ||
public class MsBuildBuilderTest { | ||
|
||
@Test | ||
public void shouldRetainQuotedArguments() { | ||
final String platform = "/p:Platform=\"Any CPU\""; | ||
|
||
String[] tokenizedArgs = MsBuildBuilder.tokenizeArgs(platform); | ||
assertNotNull(tokenizedArgs); | ||
assertEquals(1, tokenizedArgs.length); | ||
assertEquals(platform, tokenizedArgs[0]); | ||
} | ||
|
||
@Test | ||
public void shouldSplitArguments() { | ||
final String arguments = "/t:Build /p:Configuration=Debug"; | ||
|
||
String[] tokenizedArgs = MsBuildBuilder.tokenizeArgs(arguments); | ||
assertNotNull(tokenizedArgs); | ||
assertEquals(2, tokenizedArgs.length); | ||
assertEquals("/t:Build", tokenizedArgs[0]); | ||
assertEquals("/p:Configuration=Debug", tokenizedArgs[1]); | ||
} | ||
} |