How to Visa Test using jPOS-EE simulator?

942 views
Skip to first unread message

bernard

unread,
May 12, 2005, 11:43:59 PM5/12/05
to jpos-...@googlegroups.com
Hi all,

I am trying to setup a testing sample using jpos-ee simulator.

I set up server simulator using a VAPChannel and GenericPackager with
configuration base1.xml. Connect VTS200 (visa test suit tool) to the
server, fire an authorisation msg, and get OK response. All works fine.

The VST can generate msg one at a time, and needed intervention
(clicking/pressing send button), which is not good for automation. So I
tried to replace the VTS with jpos-ee client simulator. Trouble is I
was not successful :-(

I setup the client simulator to use a matching VAPChannel and
GenericPackager with base1.xml configuration. I also changed the
TestRunner.java to used GenericPackager as well:

protected void initService() throws ISOException {
//packager = new XMLPackager();
packager = new GenericPackager("cfg/packager/base1.xml");
}

But I keep getting message unpackacging errors:
===============================================
<log realm="org.jpos.simulator.TestRunner" at="Fri May 13 11:32:01
GMT+08:00 200
5.479">
<error>
<iso-exception>
org.jpos.iso.IFE_CHAR: Problem unpacking field 38
<nested-exception>
java.lang.ArrayIndexOutOfBoundsException: 239
at org.jpos.iso.ISOUtil.ebcdicToAsciiBytes(ISOUtil.java:231)
at org.jpos.iso.ISOUtil.ebcdicToAscii(ISOUtil.java:218)
at
org.jpos.iso.EbcdicInterpreter.uninterpret(EbcdicInterpreter.java:71)

at
org.jpos.iso.ISOStringFieldPackager.unpack(ISOStringFieldPackager.jav
a:204)
at
org.jpos.iso.ISOBasePackager.unpack(ISOBasePackager.java:229)
at org.jpos.iso.ISOMsg.unpack(ISOMsg.java:322)
at
org.jpos.simulator.TestRunner.getMessage(TestRunner.java:173)
at org.jpos.simulator.TestRunner.initSuite(TestRunner.java:148)
at org.jpos.simulator.TestRunner.run(TestRunner.java:75)
at java.lang.Thread.run(Unknown Source)
</nested-exception>
org.jpos.iso.ISOException: org.jpos.iso.IFE_CHAR: Problem
unpacking field
38 (java.lang.ArrayIndexOutOfBoundsException: 239)
at
org.jpos.iso.ISOStringFieldPackager.unpack(ISOStringFieldPackager.jav
a:209)
at
org.jpos.iso.ISOBasePackager.unpack(ISOBasePackager.java:229)
at org.jpos.iso.ISOMsg.unpack(ISOMsg.java:322)
at
org.jpos.simulator.TestRunner.getMessage(TestRunner.java:173)
at org.jpos.simulator.TestRunner.initSuite(TestRunner.java:148)
at org.jpos.simulator.TestRunner.run(TestRunner.java:75)
at java.lang.Thread.run(Unknown Source)
Nested:java.lang.ArrayIndexOutOfBoundsException: 239
at org.jpos.iso.ISOUtil.ebcdicToAsciiBytes(ISOUtil.java:231)
at org.jpos.iso.ISOUtil.ebcdicToAscii(ISOUtil.java:218)
at
org.jpos.iso.EbcdicInterpreter.uninterpret(EbcdicInterpreter.java:71)

at
org.jpos.iso.ISOStringFieldPackager.unpack(ISOStringFieldPackager.jav
a:204)
at
org.jpos.iso.ISOBasePackager.unpack(ISOBasePackager.java:229)
at org.jpos.iso.ISOMsg.unpack(ISOMsg.java:322)
at
org.jpos.simulator.TestRunner.getMessage(TestRunner.java:173)
at org.jpos.simulator.TestRunner.initSuite(TestRunner.java:148)
at org.jpos.simulator.TestRunner.run(TestRunner.java:75)
at java.lang.Thread.run(Unknown Source)
</iso-exception>
</error>
</log>
==============================================

Running the whole thing using XMLChannel and XMLPackager is just fine.
And since the server simulator when configured for VTS client works OK
too, then I must have messed up my client simulator. :-(

Has anyone sucessfully simulating Visa Client using jpos-ee's client
simulator? I would much appreciate any help/pointer here (a simple
sample script would be great!).

Thanks,
/bernard

Alejandro Revilla

unread,
May 13, 2005, 7:32:10 AM5/13/05
to jpos-...@googlegroups.com
>
> The VST can generate msg one at a time, and needed intervention
> (clicking/pressing send button), which is not good for automation. So I
> tried to replace the VTS with jpos-ee client simulator. Trouble is I
> was not successful :-(
>
Good news is that you're going to love our simulator.

>
> I setup the client simulator to use a matching VAPChannel and
> GenericPackager with base1.xml configuration. I also changed the
> TestRunner.java to used GenericPackager as well:
>
> protected void initService() throws ISOException {
> //packager = new XMLPackager();
> packager = new GenericPackager("cfg/packager/base1.xml");
> }
>
Oh, no, that's not how it works. TestRunner uses the XMLPackager
in order to read the test templates from a file. You basically
use three components there:

simulator->mux->channel

You want to use base1.xml configuration in the channel
(see 10_clientsimulator_channel.xml).

>
> But I keep getting message unpackacging errors:
> ===============================================
> <log realm="org.jpos.simulator.TestRunner" at="Fri May 13 11:32:01
> GMT+08:00 200
> 5.479">
> <error>
> <iso-exception>
> org.jpos.iso.IFE_CHAR: Problem unpacking field 38
> <nested-exception>
>
That's because you're probably trying to read your test's template
XML file using an ISO-8583 packager.


bernard

unread,
May 15, 2005, 1:08:33 AM5/15/05
to jpos-...@googlegroups.com
Alejandro Revilla wrote:
> > I setup the client simulator to use a matching VAPChannel and
> > GenericPackager with base1.xml configuration. I also changed the
> > TestRunner.java to used GenericPackager as well:
> >
> > protected void initService() throws ISOException {
> > //packager = new XMLPackager();
> > packager = new GenericPackager("cfg/packager/base1.xml");
> > }
> >
> Oh, no, that's not how it works. TestRunner uses the XMLPackager
> in order to read the test templates from a file. You basically
> use three components there:
>
> simulator->mux->channel
>
> You want to use base1.xml configuration in the channel
> (see 10_clientsimulator_channel.xml).
>

Thanks Alejandro!!

My error was actually my replacing of the XMLPackager with Base1
GenericPakacger in TestRunner.java. All I needed to workout were to
simply match the server simulator & client simulator channels correctly
(+ their respective packagers), there were no need to change the
TestRunner.java at all.

Neat Stuffs!


ps. I notice that the jpos-ee download comes with xerces-1.2.3.jar.
shouldn't we use a more recent one? Is the jar is intentionally there
for backward compatibility purpose (jdk 1.3)?

Thanks,
/bernard

Alejandro Revilla

unread,
May 15, 2005, 8:57:02 AM5/15/05
to jpos-...@googlegroups.com
>
> ps. I notice that the jpos-ee download comes with xerces-1.2.3.jar.
> shouldn't we use a more recent one? Is the jar is intentionally there
> for backward compatibility purpose (jdk 1.3)?
>
The XMLPackager uses org.apache.xerces.parsers.SAXParser, I guess we
could overhaul it and use a higher level API such as JDOM, that in
turn would manage to use any available SAX parser, and then get
rid of xerces-1.2.3.jar.

BTW, I've added a new target to 'build.xml' called 'singlejar'
that creates a huge jpos-ee.jar with all required jars. That task
will benefit from not having xerces around. If you want to test
it, you can 'ant update' your SDK installation.

--Alejandro

bernard

unread,
May 16, 2005, 12:15:40 AM5/16/05
to jpos-...@googlegroups.com

Alejandro Revilla wrote:
> >
> > ps. I notice that the jpos-ee download comes with xerces-1.2.3.jar.
> > shouldn't we use a more recent one? Is the jar is intentionally
there
> > for backward compatibility purpose (jdk 1.3)?
> >
> The XMLPackager uses org.apache.xerces.parsers.SAXParser, I guess we
> could overhaul it and use a higher level API such as JDOM, that in
> turn would manage to use any available SAX parser, and then get
> rid of xerces-1.2.3.jar.
>

OK I see.

Perhaps updating to xerces-2.6.2.jar to reduce the jar size?
xerces-2.6.2.jar size = 988 kb
xerces-1.2.3.jar size = 1465 kb

> BTW, I've added a new target to 'build.xml' called 'singlejar'
> that creates a huge jpos-ee.jar with all required jars. That task
> will benefit from not having xerces around. If you want to test
> it, you can 'ant update' your SDK installation.
>

I just run ant update task from the root of jpos-ee. The build file
still does not has 'singlejar' task. Perhaps I should wait abit longger
....

Thanks,
/bernard

Alejandro Revilla

unread,
May 16, 2005, 7:42:29 AM5/16/05
to jpos-...@googlegroups.com
>
> Perhaps updating to xerces-2.6.2.jar to reduce the jar size?
> xerces-2.6.2.jar size = 988 kb
>
Could be an temporary solution, can you give it a try?
(if clientsimulator works then that means XMLPackager is
working).

>
> I just run ant update task from the root of jpos-ee. The build file
> still does not has 'singlejar' task. Perhaps I should wait abit longger
> ....
>
Oops, my fault. Please 'ant update' again.

bernard

unread,
May 16, 2005, 9:35:24 PM5/16/05
to jpos-...@googlegroups.com
>> Perhaps updating to xerces-2.6.2.jar to reduce the jar size?
>> xerces-2.6.2.jar size = 988 kb

> Could be an temporary solution, can you give it a try?
> (if clientsimulator works then that means XMLPackager is
> working).

Replacing xerces-1.2.3.jar with xerces-2.6.2.jar on jdk-1.4 or greater
is OK. Not sure (not tested) on older jdk though.

>> I just run ant update task from the root of jpos-ee. The build file
>> still does not has 'singlejar' task. Perhaps I should wait abit
longger
>> ....

> Oops, my fault. Please 'ant update' again.

OK, got it already. Thanks.

Alejandro Revilla

unread,
May 16, 2005, 9:49:18 PM5/16/05
to jpos-...@googlegroups.com
>
> >> Perhaps updating to xerces-2.6.2.jar to reduce the jar size?
> >> xerces-2.6.2.jar size = 988 kb
>
> > Could be an temporary solution, can you give it a try?
> > (if clientsimulator works then that means XMLPackager is
> > working).
>
done - 'ant update' should get the new version.


Reply all
Reply to author
Forward
0 new messages