2 Replies Latest reply on May 6, 2008 5:19 PM by yannick bardon

    Seam et unit tests

    yannick bardon Newbie

      Hi,


      I developed a web application with seam, using session beans and entity bean. I work with IDE eclipse, and to create my project, I used seam-gen.
      I do now unit tests to see if everything works well, but I would like to know how, I saw that there is a test case in my project, is what it is here that put our tests, moreover, how to deploy just our tests on the application server JBoss


      Thank you

        • 1. Re: Seam et unit tests
          yannick bardon Newbie

          I begin to understand how to test with seam.
          In the folder test of my project I wrote a class that can test a method, I created the file testng.xml.
          But when I type the following command line:



          ant test




          I have this error :



          test:
             [testng] You need to specify at least one testng.xml or one class
             [testng] Usage:
             [testng] [-d output-directory]
             [testng]             default output directory to : test-output
             [testng] [-testclass list of .class files or list of class names]
             [testng] [-sourcedir a source directory]
             [testng] [-annotations javadoc or JDK]
             [testng]             Specifies the default annotation type to be used in suit
          es when none is explicitly
             [testng]             specified. This version of TestNG (15) supports both "ja
          vadoc" and "JDK" annotation types.
             [testng] [-groups comma-separated list of group names to be run]
             [testng]             works only with -testclass
             [testng] [-excludegroups comma-separated list of group names to be excluded]
             [testng]             works only with -testclass
             [testng] [-testrunfactory list of .class files or list of class names impleme
          nting org.testng.ITestRunnerFactory]
             [testng] [-listener list of .class files or list of class names implementing
          org.testng.ITestListener and/or org.testng.ISuiteListener]
             [testng] [-parallel methods|tests]
             [testng]             run tests in parallel using the specified mode
             [testng] [-threadcount number of threads to use when running tests in paralle
          l]
             [testng] [-suitename name]
             [testng]             Default name of test suite, if not specified in suite de
          finition file or source code
             [testng] [-testname Name]
             [testng]             Default name of test, if not specified in suite definiti
          on file or source code
             [testng] [suite definition files*]
             [testng]
             [testng] For details please consult documentation.
          
          BUILD FAILED




          I don't know why ?


          Thank you
               
                    

          • 2. Re: Seam et unit tests
            yannick bardon Newbie

            I solved my problem, but unfortunately I have another problem.
            ant test works well, but when I look at the result, I have this error:



            @BeforeClass init : java.lang.NoClassDefFoundError: org/jboss/beans/metadata/spi/BeanMetaData
                 at java.lang.Class.forName0(Native Method)
                 at java.lang.Class.forName(Class.java:164)
                 at org.jboss.seam.mock.BaseSeamTest.embeddedJBossAvailable(BaseSeamTest.java:1051)
                 at org.jboss.seam.mock.BaseSeamTest.startJbossEmbeddedIfNecessary(BaseSeamTest.java:1039)
                 at org.jboss.seam.mock.BaseSeamTest.startSeam(BaseSeamTest.java:935)
                 at org.jboss.seam.mock.BaseSeamTest.init(BaseSeamTest.java:923)
                 at org.jboss.seam.mock.SeamTest.init(SeamTest.java:42)
            ... Removed 22 stack frames
            






            Do you know where is the problem ?


            Thank you