[jboss-user] [JBoss Tools] - having problems with testNG and Seam tools -

William Woodman do-not-reply at jboss.com
Mon Apr 5 09:41:49 EDT 2010

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

Start a new discussion in JBoss Tools at Community

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20100405/5252daf1/attachment.html 

More information about the jboss-user mailing list