Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package test.unit.gov.nist.javax.sip.parser;
 
 
 
 import  junit.framework.TestCase;

Author(s):
sli
public class HostNameParserTest extends TestCase {
    private final static String validHostNames[] = { "foo.bar.com:1234",
            "proxima.chaplin.bt.co.uk""129.6.55.181:2345",
            "foo.bar.com:         1234""foo.bar.com     :      1234   ",
            // "[3ffe:33:0:0:202:2dff:fe32:c31c%4]",
            // "[3ffe:33:0:0:202:2dff:fe32:c31c%4:1234]"
    };
    private final static String invalidHostNames[] = { ":1234", };
    public void testHostNameParser() {
        for (int i = 0; i < .i++) {
            try {
                String hostName = [i];
                ..println("hostName=" + hostName);
                HostNameParser hnp = new HostNameParser(hostName);
                HostPort hp = hnp.hostPort(true);
                ..println("[" + hp.encode() + "]");
            } catch (ParseException ex) {
                fail(ex.getMessage());
            }
        }
    }
New to GrepCode? Check out our FAQ X