commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 37985] - unit tests fail for commons-net-1.4.1 with NullPointerException
Date Wed, 21 Dec 2005 22:17:19 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=37985>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=37985


dfs@apache.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID




------- Additional Comments From dfs@apache.org  2005-12-21 23:17 -------
disconnect should not be called on a SocketClient instance that has not
been successfully connected.  If there's a problem, it would be
with the unit test, not SocketClient. In other words, the test code should be
  if(client.isConnected())
    client.disconnect();
instead of
  client.disconnect();

However, if you do that, then the unit test doesn't fail when a connection
is not established.  So you could write
  if(client.isConnected())
    client.disconnect();
  else
    throw SomeAppropriateException("Connection failed.");

But since client.disconnect() already throws an exception, I have to assume
the test writer opted for the shorter
   client.disconnect();

In short, the test is supposed to fail if it can't connect.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


Mime
View raw message