You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cactus-user@jakarta.apache.org by Anil Agrawal <a....@popnet.co.in> on 2003/05/16 14:48:17 UTC
Please give me feedback
Hi,
In writing DRC cactus automated tests, I faced following problems.
I found alternative solution for them due to that testcases became
more complicated.
Please give me your feedback.
1) Ideal procedure
---------------
Cactus provides redirector servlet to test any servlet.
Cactus also provides implicit object request,response etc.
We can use this implicit object like
request.setUserData(requestBytes);
Now When we instantiate our servlet (e.g. PKICommsSwitch)
Cactus uses ServletRedirector and automatically call the servlet.
-> while testing PKICommsSwitch, I found that with above approach
cactus alters this message.
-> During research face, I successfully tested our
servlet(TLV encoded request) with above approach.
Alternative solution adopted by me
----------------------------------
Cactus extends the junit test cases. Instead of using the cactus
ServletRedirector and cactus API request.setUserData(requestBytes)
I took http url connection to PKICommsSwitch and pass the
requestBytes.
My testcase extends the cactus testcase but I am not using cactus
API.
In the past We used to write our servlet test junit test cases using
the
solution adopted by me.
2) Maximum problem I faced in session management.
Cactus does session management per testcase only.
After Authentication PKICommsSwitch Servlet sets CLPUEK in session.
For Rest of requests PKICommsSwitch gets the CLPUEK from session.
-> For the testing of DRC seq-3,5,7, & 9
I wrote a test servlet which gives me CLPUEK after parsing
the Seq-01.txt.
From setup() method of my testcases, I call this servlet
which sets require CLPUEK in the session.
with regards
anil