William Woodman [
http://community.jboss.org/people/wiggy] replied to the discussion
"having problems with testNG and Seam tools -"
To view the discussion, visit:
http://community.jboss.org/message/535588#535588
--------------------------------------------------------------
ok - not sure what has happened - however i built the project on my 'other
machine' and tried again applying what i'd learned to date
1. workspace with no spaces in any of the paths
2. set the vm option to include
"-Dsun.lang.ClassLoader.allowArraySyntax=true" for my 1.6 vm i use
3. imported the xxx-ds.xml data source from the xxx-ear/resources folder into the
xxx-test/bootstrap/deploy folder
4 imported the xxx-ejb/META-INF/persistence.xml into the xxx-test/META-INF folder
5. wrote some simple tests
and 'whoa' this seemed to work - i tried to attach my notes as a word rtf file
but with pictures in it its too large -
so instead i created a blog instead and posted the details here
http://wiggy-softwood.blogspot.com/2010/04/1.html
http://wiggy-softwood.blogspot.com/2010/04/1.html
however i still have problem.
i write a test that does an @In directive - and this doesnt seem to work - so something
is still missing - if i do get on the entityManager - this works - but the injection
doesnt - my assert fails the tests
so why does the injection fail ? would rfeally appreciate any guidance - am i just
being stupid or what ?
package org.domain.forsterslist.entity;import javax.persistence.EntityManager;import
org.jboss.seam.annotations.In;import org.jboss.seam.annotations.Name;import
org.jboss.seam.mock.SeamTest;import org.testng.annotations.Test;@Name
(value="nodeTest")public class NodeTest extends SeamTest{ @In
(value="entityManager", create=true) EntityManager em; @In
(create=true) Node node; @Test //passes public void entityManagerTest()
throws Exception { new ComponentTest() {
@Override protected void testComponents() throws Exception
{ assert 1 == 1; EntityManager entityManager =
(EntityManager) getInstance("entityManager"); assert
(entityManager != null); } }.run(); } @Test //passes public
void basic () { String testStr = "basic test ";
System.out.println (testStr); assert testStr.equals("basic test
"); } @Test public void injectedNodeTest () throws Exception
{ assert node != null; //fails node.setName("my
node"); assert node.getName().equals("my node"); }
@Test public void injectionEntityManagerTest () throws Exception { new
ComponentTest () { @Override protected void testComponents
() throws Exception { assert em != null;
//fails } }.run (); }}
--------------------------------------------------------------
Reply to this message by going to Community
[
http://community.jboss.org/message/535588#535588]
Start a new discussion in JBoss Tools at Community
[
http://community.jboss.org/choose-container!input.jspa?contentType=1&...]