Hi,
I want to write some Componenttests for my Seam-Project. It was created some time ago similar to those you get using JBoss-Tools (EAR-Project). So it consists of 4 Projects (ear,war,ejb,test). After I did some coding in the the first 3 projects I wanted to write some tests with TestNG. My Problem is that my test-methods can't identify my Seam-Components.
This is my test-class:
public class Test extends SeamTest { @org.testng.annotations.Test public void test() throws Exception { new ComponentTest() { @Override protected void testComponents() throws Exception { Object c = getValue("#{testcomponent}"); assertNotNull(c); } }.run(); } }
It throws an 'normal' AssertionError because 'c' is null. When I build a new Seam-Project from scratch this method/class works fine.
I have already compared the two test-projects and they seem to be configured in the same way (classpath, referenced projects,...)
I guess that while writing my app, I somehow misconfigured something in my other 3 projects which only produces errors in the test-project.
My question is, whether someone has experience with writing test in this kind of project an knows exactly what are the dependencies between ear,war,ejb and test or what mistakes I have to avoid. - Thx
fyi - I was right. Some config files in my ejb and war-project were at the 'wrong' places during development-time. I had to correct the position of my components.xml and my seam.properties.