hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Glenn Murray <gmur...@mines.edu>
Subject HttpClient won't run in Swing JUnit
Date Mon, 11 Jul 2005 22:13:17 GMT
Hi,

I've got a strange JUnit/HttpClient problem. If I run the
ff. class with

java -cp .:commons-httpclient-2.0.2.jar:commons-logging.jar:junit_3.8.1.jar junit.textui.TestRunner
Test2

it passes, but if I run

java -cp .:commons-httpclient-2.0.2.jar:commons-logging.jar:junit_3.8.1.jar junit.swingui.TestRunner
Test2

it fails.  Is it not possible to run HttpClient from JUnit's
Swing TestRunner?  Part of the mystery is that
commons-logging.jar need not be in the classpath when I
compile.  Also, the ExceptionInInitializerError won't get
printed.

Thanks,
Glenn


import junit.framework.TestCase;
import org.apache.commons.httpclient.HttpClient;
/**
 * A short class for testing.
 */
public class Test2  extends TestCase {
    /**
     * For JUnit.
     */
    public Test2(String name) {
        super(name);
    }

    public void testIt() {
        try{
            System.out.println("Yo, "+System.getProperty("user.name")+"!");
            HttpClient client = new HttpClient();
        }catch(Exception e) {
            e.printStackTrace();
        }
    }
}


---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-user-help@jakarta.apache.org


Mime
View raw message