-
1. Re: jdniPattern exception in TestNG tests
benmoore Mar 17, 2008 9:21 PM (in response to benmoore)Anyone? I don't even know where to begin looking...
-
2. Re: jdniPattern exception in TestNG tests
dazz_x Mar 19, 2008 10:38 AM (in response to benmoore)Hi,
I write here to know if you've found a solution to your problem, because I'm facing the same right now...
FAILED CONFIGURATION: @BeforeClass init java.lang.RuntimeException: Could not create Component: myComponent at org.jboss.seam.init.Initialization.addComponent(Initialization.java:976) at org.jboss.seam.init.Initialization.installComponents(Initialization.java:898) at org.jboss.seam.init.Initialization.init(Initialization.java:576) at org.jboss.seam.mock.BaseSeamTest.startSeam(BaseSeamTest.java:939) at org.jboss.seam.mock.BaseSeamTest.init(BaseSeamTest.java:923) at org.jboss.seam.mock.SeamTest.init(SeamTest.java:42) Caused by: java.lang.IllegalArgumentException: You must specify org.jboss.seam.core.init.jndiPattern or use @JndiName: myComponent at org.jboss.seam.Component.getJndiName(Component.java:438) at org.jboss.seam.Component.<init>(Component.java:243) at org.jboss.seam.Component.<init>(Component.java:217) at org.jboss.seam.init.Initialization.addComponent(Initialization.java:961) ... 27 more ... Removed 22 stack frames
My components.xml for tests uses this jndi pattern
#{ejbName}/local
My classpath uses :
jboss-embedded-all.jar
hibernate-all.jar
thirdparty-all.jar
testng.jar
bootstrap (a folder that I picked from Seam and imported without any modification... I would be glad to know if tests could work without this one)Any clue to make this work ?
Does someone know a resource that explain exactly how the Seam tests work with testng ?Thanks
Dazzx
PS : I tried to create a project with seam-gen to see tests working, but It didn't work...
-
3. Re: jdniPattern exception in TestNG tests
benmoore Mar 20, 2008 6:56 PM (in response to benmoore)No, I haven't gotten it working. Instead, I thought I'd try to get out-of-the-box TestNG tests (from seam-gen) working with JBoss. I can't even get those to work, although the error is slightly different. See my new post here.
-
4. Re: jdniPattern exception in TestNG tests
akakunin.akakunin.emdev.ru Aug 28, 2008 12:47 PM (in response to benmoore)I had same issues - finally it was resolved by adding web-root folder into test-run class-path (how to do it - depends from IDE you are using - I used NetBeans and JUnit4 to run tests)
Since web-root is not added into class-path, test runner cannot find WEB-INF/components.xml during Seam initialization - and used default settings
-
5. Re: jdniPattern exception in TestNG tests
pisce.gabriel.goic.gmail.com Oct 15, 2008 7:14 PM (in response to benmoore)Same here... if you're testing a project that is a dependency and has no descriptors, just make sure your test-build/META-INF directory (assuming you're building in a seam-gen-friendly way) does contain components.xml (and persistence.xml if you're also testing DB access). In components.xml make sure you have the following:
`<core:init debug="true" jndi-pattern="#{ejbName}/local"/>`
There is no ear named in this jndi pattern as you're outside any ear.
An alternative consists in putting this into your seam.properties:
org.jboss.seam.core.init.jndiPattern = #{ejbName}/local
Anyway, you need this bootstrap directory in your test classpath if you want any advanced feature while testing. For example, this is where you deploy your datasource descriptor (bootstrap/deploy).