1 17 18 package org.sablecc.sablecc.launcher; 19 20 import junit.framework.TestCase; 21 22 import org.sablecc.sablecc.exception.InternalException; 23 24 public class OptionArgumentTest 25 extends TestCase { 26 27 OptionArgument optionArgument; 28 29 Option option; 30 31 String operand; 32 33 @Override 34 protected void setUp() 35 throws Exception { 36 37 this.option = Option.DESTINATION; 38 39 this.operand = "operand"; 40 41 this.optionArgument = new OptionArgument(this.option, this.operand); 42 } 43 44 public void testOptionArgument() { 45 46 Option nullOption = null; 48 try { 49 this.optionArgument = new OptionArgument(nullOption, this.operand); 50 fail("option may not be null"); 51 } 52 catch (InternalException e) { 53 } 55 56 assertEquals("invalid option", this.option, this.optionArgument 57 .getOption()); 58 assertEquals("invalid operand", this.operand, this.optionArgument 59 .getOperand()); 60 } 61 } 62 | Popular Tags |