JSF 1.2, servlet 2.5 is being used,
eclipse m2eclipse plugin installed.
by default JUnit 4.8 is being used.
OK, no worries i think we will find a nice solution that suites your usecase (-:
So, to summarize:
* Java EE 5 compliant environment, Tomcat 6, Junit
* purpose: focus on testing JSF
Are you using Maven? AFAIK, you do build your app with Eclipse and push WAR straight to integrated server config, right?
@Aslak: There is no chance to use Arquillian without Maven, right? Or is there some JBossTools magic for that?
OK, i think your environmet is clear and straight forward.
The Maven part is interesting.
JSFUnit integration is probably what you are looking for. Please have a look on this sample code:
Are you loooking for something like that?
thanks for replying. Couple of days ago i opened a discussion about using Arquillian with non-maven projects... I got good answers... here is the link.
OK back to your post:
yes your summary was correct.
I'll look at the example and let you know what I get.
I was able to import "arquillian-framework-jsfunit" into eclipse as aseparate project.
when I right click -> Debug as -> JUnit Test I get following error:
Exception occurred executing command line. Cannot run program "C:\Program Files\Java\jre6\bin\javaw.exe" (in directory "C:\Users\arquillian-framework-jsfunit"): CreateProcess error=87, The parameter is incorrect
It seems that JUnit can not be launched for some reasons!!!
I've never seen this msg before.
We need to think about how to produce instructions for which libraries developer need for a given container...whether it be using Maven, Gradle or a shell script to fetch what you need and put it all in a folder somewhere.
To be honest, if you are testing on more than one container, using Arquillian without a dependency management solution is a tedious task.
If you are sticking to a single container, then I suppose you just dump all the JARs in a lib/ folder and add them all to the IDE classpath. That's a pretty old school approach. In that case I'm inclined to recommend the old "eclipse:eclipse" task of Maven (or Gradle).
I'll put something together as a prototype.
I have prepared an example project which demonstrates the Arquillian JSFUnit integration running in a Servlet container. The example has profiles for Jetty 8 and Tomcat 6, with the Jetty profile activating by default.
First, clone the repo and go into the jsfunit-servlet example
git clone http://github.com/arquillian/arquillian-examples cd arquillian-examples/jsfunit-servlet
You can then run the example on Jetty using this command:
or on Tomcat using this command:
mvn test -Parq-tomcat-embedded
If you are not using Maven in your project, follow these steps to get the libraries you need.
- Install Maven 3 (for the purpose of using it as a script)
Run the following command on the project if you want to use Embedded Jetty (recommended)
mvn process-test-resources -Pcopy-test-libs
Run the following command on the project if you want to use Embedded Tomcat (recommended)
mvn process-test-resources -Parq-tomcat-embedded,copy-test-libs
- Now copy all the JARs in the target/test-libs directory into your own project and add them to the classpath
You will need to copy either src/test/resources-jetty/jsf-web.xml or src/test/resources-tomcat/jsf-web.xml into your project and use it in the ShrinkWrap archive (if you are using this example as a reference point).
To get Tomcat 6 working, all of the auxiliary web.xml configuration must be added directly to web.xml that's added to the @Deployment archive. This will no longer be required once the fix to ARQ-316 is merged in.
Thank you guys for all the helps
I'll try it and let you know.
Exception occurred executing command line.
Cannot run program "C:\Program Files\Java\jre6\bin\javaw.exe"
(in directory "C:\Users\arquillian-framework-jsfunit"):
CreateProcess error=87, The parameter is incorrect
I am seeing the same error , was this problem solved ?
I followed the maven set up given in the arquillian doc
The command line launch has exceeded 32k...
I know it sounds amazing but, there are over 400+ jars in JBoss (not sure about Tomcat).
Depending on where you installed it, it makes a HUGE difference.
Are you on windows?
Yes I am on windows
JBOSS in d:\server
Is it dependend on java location as well?
Got a better solution with simpler dependency
Yes we need maven :-) Guess ur thread was not to use maven
Yes, we don't use maven (yet)...