Home | History | Annotate | Download | only in test
      1 package test;
      2 
      3 import java.util.ArrayList;
      4 import java.util.List;
      5 
      6 import org.testng.Assert;
      7 import org.testng.annotations.Test;
      8 
      9 import com.beust.jcommander.JCommander;
     10 import com.beust.jcommander.Parameter;
     11 
     12 public class QuotedMainTest {
     13   @Parameter
     14   List<String> args = new ArrayList<String>();
     15 
     16   String quoted = "\" \"";
     17 
     18   @Test
     19   public void testMain() {
     20     JCommander jc = new JCommander(this);
     21     jc.parse(quoted);
     22     Assert.assertEquals(args.size(), 1);
     23     Assert.assertEquals(args.get(0), " ");
     24   }
     25 
     26   public static void main(String[] args) {
     27     new QuotedMainTest().testMain();
     28   }
     29 }
     30