Deploying the JSFUnit Test Cases on a Remote Server
dareurdream Feb 18, 2009 11:20 AMHi Stan,
Thanks for your help in my earlier post. I have one more requirement and I need to know how I can get that working.
I have written JSFUnit Test class for 10 different views of my application. When I deploy the application and the test classes on the same server it works. Now, what I want to do is deploy all the JSFUnit Test classes on a remote server and use it from there to test the view which is generated from the application running on my PC or any other PC. The server is like a repository for all test cases and who so ever want to check that his modifications doesn't break the application calls the JSFunit test- cases that are deployed on the server machine.
In general, we call the JSFUnit test classes using this URL format:-
http://localhost:8080/AppName/ServletTestRunner?suite=com.foo.JSFUnitTest&xsl=cactus-report.xsl
As per my requirement, I added one more parameter to this URL called "target-url", which specifies the details of the machine where the application is hosted.
So, the url format changes to:-
http://localhost:8080/AppName/ServletTestRunner?suite=com.foo.JSFUnitTest&xsl=cactus-report.xsl&target-url=http://machine22:8082/AppName
Now, after I did that I expected to get the parameter in my test-class in this manner:-
this.request.getParameter("target-url");
But, to my surprise this parameter was not all there. After that i tried a lot of things to get it but I was not able to retrive it in my test-class.
So, I had to develop a small API to forward the request to the test-class, while giving me the value of the parameter "target-url".
Now, I have the url(target-url) of the application(deployed on some other machine) in my test-class. So, I tried to get the org.jboss.jsfunit.jsfsession.JSFSession in this manner:-
ParameterDetails paramDetails = ParameterDetails.getInstance(); //Singleton Class String targetURL = paramDetails.getTargetURL(); // = http://machine22:8082/AppName JSFSession jsfSession = new JSFSession(targetURL + "/login.html");
I expected to get a JSFSession, but that doesn't happen. It tries to look for the application on my machine
So, JSFUnit throws an exception where the most interesting thing for me to watch was the details of the URL........The URL for which it was trying to execute the test looks like this
http://localhost:8080/AppNamehttp://machine22:8082/AppName
Please tell me, how can I obtain the JSFSession of the application running on some other machine?
Manish