Package test.utils

Source Code of test.utils.TestOptions

package test.utils;

import junit.framework.*;
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("tiger", result);
    }  

}
TOP

Related Classes of test.utils.TestOptions

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.