KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > incava > jagol > TestOption


1 package org.incava.jagol;
2
3 import java.io.*;
4 import java.util.*;
5 import junit.framework.TestCase;
6
7
8 public class TestOption extends TestCase
9 {
10     public TestOption(String JavaDoc name)
11     {
12         super(name);
13     }
14
15     public void testDefault()
16     {
17         Option opt = new Option("name", "this is the description of name") {
18                 public boolean set(String JavaDoc arg, List args) throws OptionException { return false; }
19                 public void setValue(String JavaDoc value) throws InvalidTypeException {}
20             };
21         assertEquals("name", opt.getLongName());
22         assertEquals("this is the description of name", opt.getDescription());
23
24         opt.setShortName('n');
25         assertEquals('n', opt.getShortName());
26     }
27
28 }
29
30
Popular Tags