File: TestOptions.java

package info (click to toggle)
axis 1.4-29
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 52,100 kB
  • sloc: java: 129,124; xml: 10,602; jsp: 983; sh: 84; cs: 36; makefile: 18
file content (43 lines) | stat: -rw-r--r-- 1,172 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package test.utils;

import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
import org.apache.axis.utils.Options;

import java.net.MalformedURLException;

public class TestOptions extends TestCase
{
    public TestOptions (String name) {
        super(name);
    }

    public static Test suite() {
        return new TestSuite(TestOptions.class);
    }

    protected void setup() {
    }

    public void testOptionsConstructor() throws MalformedURLException
    {
        String[] fake_args = { "-h 127.0.0.1","-p 8081","-u scott","-w tiger" };
        Options ops = new Options(fake_args); 
    }   


    /* 
    * Note - by Java conventions, the isFlagSet and isValueSet should either
    * return a boolean value, or be given more descriptive names.  I might
    * suggest getFlagFrequency and getArgValue or something.
    */
    public void testIsFlagSet() throws MalformedURLException 
    {
        String[] fake_args = { "-w tiger" };
        Options ops = new Options(fake_args); 
        String result = ops.isValueSet('w');
        assertEquals("Result was: " + result + ", not tiger", "tiger", result);
    }   

}