1 package org.apache.maven.cli;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 import static org.hamcrest.CoreMatchers.is;
23 import static org.junit.Assert.assertThat;
24 import static org.junit.Assert.assertTrue;
25
26 import org.apache.commons.cli.CommandLine;
27 import org.junit.Before;
28 import org.junit.Test;
29
30 public class CLIManagerTest
31 {
32 private CLIManager cliManager;
33
34 @Before
35 public void setup()
36 {
37 cliManager = new CLIManager();
38 }
39
40 @Test
41 public void spacedOptions()
42 throws Exception
43 {
44 CommandLine cmdLine = cliManager.parse( "-X -Dx=1 -D y=2 test".split( " " ) );
45 assertTrue( cmdLine.hasOption( CLIManager.DEBUG ) );
46 assertThat( cmdLine.getOptionValues( CLIManager.SET_SYSTEM_PROPERTY )[0], is( "x=1" ) );
47 assertThat( cmdLine.getOptionValues( CLIManager.SET_SYSTEM_PROPERTY )[1], is( "y=2" ) );
48 }
49
50 }