25 Jan 03:22
possible Bug report-BaseChannel multiple hosts inconsistency (from r2568 commit)
From: Christopher Barham <cbarham@...>
Subject: possible Bug report-BaseChannel multiple hosts inconsistency (from r2568 commit)
Newsgroups: gmane.comp.java.jpos.devel
Date: 2008-01-25 02:23:27 GMT
Subject: possible Bug report-BaseChannel multiple hosts inconsistency (from r2568 commit)
Newsgroups: gmane.comp.java.jpos.devel
Date: 2008-01-25 02:23:27 GMT
Hi,
I've just spent some time upgrading my jPos installation and found a
problem resulting from the multi-hosts changes made as part of
subversion r2568. Basically, I use aChannel.setHost("host") followed by
aChannel.setPort(123456) and am getting NullPointerException deep in the
socket code. Tracing this through, it seems there is now an
inconsistency in how the host/port setter is carried out depending on
whether you call setHost(String host, int port) or setHost(String host)
followed by setPort(int port) in BaseChannel.
In order to make myself clearer may I present the following jUnit 4 test
exposing the issue, (the test requires use of jUnit 4 from
http://www.junit.org and junit addons from
http://junit-addons.sourceforge.net to get at the private fields) :
Please can you advise as to whether this is intended behaviour? If not,
may I suggest that BaseChannel be amended so that host and channel are
removed as fields, and the getter/setter will interact with the hosts
and ports arrays, using the first position only?
<CODE>
package org.jpos.iso;
import static org.junit.Assert.assertEquals;
import junit.framework.JUnit4TestAdapter;
import org.junit.Before;
import org.junit.Test;
public class BaseChannelSetterTest {
(Continue reading)
RSS Feed