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

William Woodman do-not-reply at jboss.com
Mon Apr 5 08:39:10 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/535579#535579

--------------------------------------------------------------
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've attached my notes as a word rtf file if any is interested

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/535579#535579]

Start a new discussion in JBoss Tools at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2128]

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


More information about the jboss-user mailing list