1 2 Previous Next 21 Replies Latest reply on Apr 20, 2009 8:52 PM by Chad Retz

    trouble running testng

    Sascha Janz Master
      i got trouble running my testng test used by my app generated with seam gen.

      the testng test got not connect to the server.

      where is it configured for the tests to use jboss-embedded?

      i added jboss-embedded.jar already to classpath. but got

      ERROR [de.mycompany.manager.Manager] Error creating remotecmdservice
      javax.naming.CommunicationException: Could not obtain connection to any of these urls: localhost:1099 and discovery failed with error: javax.naming.CommunicationException: Receive timed out [Root exception is java.net.SocketTimeoutException: Receive timed out] [Root exception is javax.naming.CommunicationException: Failed to connect to server localhost:1099 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server localhost:1099 [Root exception is java.net.ConnectException: Connection refused: connect]]]
           at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1562)
           at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:634)
           at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:627)
           at javax.naming.InitialContext.lookup(InitialContext.java:351)


      where must i put the configuration files for jboss embedded

      e.g. under
      D:\Projekte\JBossSeam\JBoss\jboss-seam-2.0.2.SP1\bootstrap\deploy

      ??

      i use serveral datasources and jboss-enterprise with the commandservice. where must i put the files for it ?
        • 1. Re: trouble running testng
          Matt Nirgue Newbie

          You need to put your configuration files in the src/test/bootstrap folder of your project(s)... Tell me what happens once you've done this.


          Regards,


          Matt.

          • 2. Re: trouble running testng
            Sascha Janz Master
            there is only a bootstrap folder direct under project.

            when i run my test i got

            Could not obtain connection to any of these urls: localhost:1099 and discovery failed with error: javax.naming.CommunicationException: Receive timed out [Root exception is java.net.SocketTimeoutException: Receive timed out] [Root exception is javax.naming.CommunicationException: Failed to connect to server localhost:1099 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server localhost:1099 [Root exception is java.net.ConnectException: Connection refused: connect]]]

            the embedded server seems not to be startet.

            how can i proof if it is started?
            • 3. Re: trouble running testng
              Matt Nirgue Newbie

              did you put all your configuration files in this folder?


              modify your log4j.xml file in your bootstrap folder if you want to know what happens when starting JBoss, initializing Seam, etc.

              • 4. Re: trouble running testng
                Sascha Janz Master

                i changed to debug but got no messages.


                jboss-embedded-api.jar is in classpath.


                what might be missing?

                • 5. Re: trouble running testng
                  Matt Nirgue Newbie

                  How do you launch your tests? Do you use Maven?

                  • 6. Re: trouble running testng
                    Sascha Janz Master

                    thanks for helping :-)


                    i use the eclipse testng plugin. i right click on the testng xml file and say run as/testng suite

                    • 7. Re: trouble running testng
                      Matt Nirgue Newbie

                      Alright... I've tried to run some of my tests with the plugin and they work just fine... so I guess there's something wrong with your configuration. Is your bootstrap folder in your classpath?


                      You're welcome btw ;)

                      • 8. Re: trouble running testng
                        Sascha Janz Master

                        sorry for beginner questions...


                        but where to specify that? the bootstrap folder i see only in file system. not in project structure. when  i try to import it from file system, eclipse says it's already there.


                        where must i config classpath for textng?  under run configurations/classpath/mytest ? there i see under user entries the bootstrap folder.

                        • 9. Re: trouble running testng
                          Matt Nirgue Newbie

                          woah woah woah... stop there!


                          what do you mean by it's not in the project structure? Have you tried to refresh your workspace? To clean your project(s)? And/or even to restart Eclipse?

                          • 10. Re: trouble running testng
                            Sascha Janz Master

                            argh...grummel grummel...i looked at package explorer...not project explorer. so ok .it is there.


                            and now?

                            • 11. Re: trouble running testng
                              Matt Nirgue Newbie

                              SO you should have something like this, right? I deliberately omitted a lot of files... This is just a global description of how your project should looke like:


                              -yourproject
                                 -src
                                   -main
                                     -java
                                       -com.yourproject.pkg
                                    -resources
                                       -META-INF
                                         persistence.xml
                                   -test
                                     -bootstrap
                                       -conf
                                       -data
                                       -deploy
                                       -deployers
                                       -META-INF
                                       ...
                                     -java
                                       -com.yourproject.pkg
                                     -resources
                                       -META-INF
                                         components.xml
                                .classpath ("hidden" file)
                                .project ("hidden" file)



                              • 12. Re: trouble running testng
                                Sascha Janz Master

                                no, the boostrap folder is direct under yourproject


                                the rest is ok

                                • 13. Re: trouble running testng
                                  Matt Nirgue Newbie

                                  can you post your .classpath file here please?

                                  • 14. Re: trouble running testng
                                    Sascha Janz Master
                                    sure. here it is

                                    <?xml version="1.0" encoding="UTF-8"?>
                                    <classpath>
                                         <classpathentry kind="src" output="classes/model" path="src/model"/>
                                         <classpathentry kind="src" output="classes/action" path="src/action"/>
                                         <classpathentry kind="src" output="classes/test" path="src/test"/>
                                         <classpathentry kind="src" path="src/myapp"/>
                                         <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
                                         <classpathentry kind="lib" path="bootstrap"/>
                                         <classpathentry kind="lib" path="lib/hibernate-validator.jar"/>
                                         <classpathentry kind="lib" path="lib/hibernate.jar"/>
                                         <classpathentry kind="lib" path="lib/hibernate-annotations.jar"/>
                                         <classpathentry kind="lib" path="lib/hibernate-commons-annotations.jar"/>
                                         <classpathentry kind="lib" path="lib/hibernate-entitymanager.jar"/>
                                         <classpathentry kind="lib" path="lib/jboss-seam.jar" sourcepath="lib/src/jboss-seam-sources.jar"/>
                                         <classpathentry kind="lib" path="lib/jboss-seam-debug.jar"/>
                                         <classpathentry kind="lib" path="lib/jboss-cache.jar"/>
                                         <classpathentry kind="lib" path="lib/jbpm-jpdl.jar"/>
                                         <classpathentry kind="lib" path="lib/antlr.jar"/>
                                         <classpathentry kind="lib" path="lib/jgroups.jar"/>
                                         <classpathentry kind="lib" path="lib/jsf-facelets.jar"/>
                                         <classpathentry kind="lib" path="lib/jstl.jar"/>
                                         <classpathentry kind="lib" path="lib/jsf-api.jar"/>
                                         <classpathentry kind="lib" path="lib/servlet-api.jar"/>
                                         <classpathentry kind="lib" path="lib/testng.jar"/>
                                         <classpathentry kind="lib" path="lib/jboss-el.jar"/>
                                         <classpathentry kind="lib" path="lib/el-api.jar"/>
                                         <classpathentry kind="lib" path="lib/mvel14.jar"/>
                                         <classpathentry kind="lib" path="lib/drools-core.jar"/>
                                         <classpathentry kind="lib" path="lib/drools-compiler.jar"/>
                                         <classpathentry kind="lib" path="lib/janino.jar"/>
                                         <classpathentry kind="lib" path="lib/antlr-runtime.jar"/>
                                         <classpathentry kind="lib" path="lib/mail.jar"/>
                                         <classpathentry kind="lib" path="lib/persistence-api.jar"/>
                                         <classpathentry kind="lib" path="lib/ejb-api.jar"/>
                                         <classpathentry kind="lib" path="lib/jsr250-api.jar"/>
                                         <classpathentry kind="lib" path="lib/jta.jar"/>
                                         <classpathentry kind="lib" path="lib/core.jar"/>
                                         <classpathentry kind="lib" path="lib/jboss-embedded-api.jar"/>
                                         <classpathentry kind="lib" path="lib/hibernate-search.jar"/>
                                         <classpathentry kind="lib" path="lib/ojdbc14.jar"/>
                                         <classpathentry kind="lib" path="lib/lucene-core.jar"/>
                                         <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/3"/>
                                         <classpathentry kind="lib" path="lib/commons-beanutils-1.7.0.jar"/>
                                         <classpathentry kind="lib" path="lib/commons-digester-1.8.jar"/>
                                         <classpathentry kind="lib" path="lib/jbpm-enterprise.jar"/>
                                             <classpathentry kind="lib" path="lib/log4j.jar"/>
                                         <classpathentry kind="lib" path="C:/Programme/Microsoft SQL Server 2005 JDBC Driver/sqljdbc_1.2/enu/sqljdbc.jar"/>
                                         <classpathentry kind="lib" path="lib/commons-httpclient-2.0.jar"/>
                                         <classpathentry kind="lib" path="D:/Projekte/JBossSeam/JBoss/jboss-4.2.2.GA/server/default/lib/commons-logging.jar"/>
                                         <classpathentry kind="lib" path="lib/mojarra-scales-1.0RC1.patch_deutsch.jar"/>
                                         <classpathentry kind="lib" path="lib/jsftemplating-base-1.2-SNAPSHOT.jar"/>
                                         <classpathentry kind="lib" path="lib/richfaces-api-3.2.2.GA.jar"/>
                                         <classpathentry kind="lib" path="lib/richfaces-impl-3.2.2.GA.jar"/>
                                         <classpathentry kind="lib" path="lib/richfaces-ui-3.2.2.GA.jar"/>
                                         <classpathentry kind="lib" path="lib/dom4j.jar"/>
                                         <classpathentry kind="lib" path="lib/jboss-seam-ui.jar"/>
                                         <classpathentry kind="lib" path="D:/Projekte/JBossSeam/JBoss/jboss-4.2.2.GA/server/default/lib/htmlparser.jar"/>
                                         <classpathentry kind="output" path="test-build"/>
                                    </classpath>
                                    1 2 Previous Next