1 Reply Latest reply on Sep 28, 2007 9:59 AM by Pete Muir

    Maven, Seam, TestNG - IntegrationTests

    Matthias Huber Newbie

      what libraries are needed to get the integrationtest running ?
      I added all jars contained in 'lib' of the current cvs into test
      of my parent-project. this did not work ...

      thats my testcase

      public class BarInputManagerTest
       extends SeamTest
      {
      
       @Test
       public void testSplit () throws Exception {
       new ComponentTest () {
      
       @Override
       protected void testComponents() throws Exception {
       System.out.println("Beginning test");
      
       String input = "+label1-label2 label3 + label4 - label5";
       setValue("#{bar.input}", input);
       assert getValue("#{bar.input}").equals(input);
      
       List<String> values = (List<String>) getValue("#{barInputManager.split}");
       List<String> myValues = Arrays.asList(new String [] {
       "+label1","-label2","label3","+label4","-label5"
       });
       assert values.equals(myValues);
       }
      
       }.run();
       }
      
      }
      



      however, it fails with

      Tests run: 2, Failures: 1, Errors: 0, Skipped: 1, Time elapsed: 6.515 sec <<< FAILURE!
      
      Results :
      
      Failed tests:
       init(com.emarsys.monitor.BarInputManagerTest)
      
      Tests run: 4, Failures: 1, Errors: 0, Skipped: 1
      
      [INFO] ------------------------------------------------------------------------
      [ERROR] BUILD FAILURE
      [INFO] ------------------------------------------------------------------------
      [INFO] There are test failures.
      [INFO] ------------------------------------------------------------------------
      [INFO] Trace
      org.apache.maven.BuildFailureException: There are test failures.
       at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:560)
       at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:480)
       at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:459)
       at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:311)
       at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:278)
       at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:143)
       at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:334)
       at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:125)
       at org.apache.maven.cli.MavenCli.main(MavenCli.java:280)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
       at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
       at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
       at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
      Caused by: org.apache.maven.plugin.MojoFailureException: There are test failures.
       at org.apache.maven.plugin.surefire.SurefirePlugin.execute(SurefirePlugin.java:421)
       at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:443)
       at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:539)
       ... 16 more
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time: 29 seconds
      [INFO] Finished at: Fri Sep 28 14:41:59 CEST 2007
      [INFO] Final Memory: 7M/20M
      [INFO] ------------------------------------------------------------------------
      
      


      it seems that the init() method does not finish correctly ... but there is unfortunately no accurate description why it fails .....

      has anybody experience doing test with maven, seam and testng ?

      i did a quickhack to add all the jars to my repository ..

      for i in `ls *.jar`; do echo $i; mvn install:install-file -Dfile=$i -DartifactId=$i -DgroupId=org.jboss.seam -Dversion=2.0.0.SNAPSHOT -Dpackaging=jar -DgeneratePom=true; done;
      


      rm -f tmp.txt; for i in `ls *.jar`; do echo "<dependency>
      <groupId>org.jboss.seam</groupId>
      <artifactId>$i</artifactId>
      <version>2.0.0.SNAPSHOT</version>
      <scope>test</scope>
      </dependency>" >> tmp.txt; done;
      


      <dependency>
      <groupId>org.jboss.seam</groupId>
      <artifactId>activation.jar</artifactId>
      <version>2.0.0.SNAPSHOT</version>
      <scope>test</scope>
      </dependency>
      <dependency>
      <groupId>org.jboss.seam</groupId>
      <artifactId>antlr.jar</artifactId>
      <version>2.0.0.SNAPSHOT</version>
      <scope>test</scope>
      </dependency>
      <dependency>
      <groupId>org.jboss.seam</groupId>
      <artifactId>antlr-runtime.jar</artifactId>
      <version>2.0.0.SNAPSHOT</version>
      <scope>test</scope>
      </dependency>
      <dependency>
      <groupId>org.jboss.seam</groupId>
      <artifactId>asm-attrs.jar</artifactId>
      <version>2.0.0.SNAPSHOT</version>
      <scope>test</scope>
      </dependency>
      <dependency>
      <groupId>org.jboss.seam</groupId>
      <artifactId>asm.jar</artifactId>
      <version>2.0.0.SNAPSHOT</version>
      <scope>test</scope>
      </dependency>
      <dependency>
      <groupId>org.jboss.seam</groupId>
      <artifactId>cglib.jar</artifactId>
      <version>2.0.0.SNAPSHOT</version>
      <scope>test</scope>
      </dependency>
      <dependency>
      <groupId>org.jboss.seam</groupId>
      <artifactId>commons-beanutils.jar</artifactId>
      <version>2.0.0.SNAPSHOT</version>
      <scope>test</scope>
      </dependency>
      <dependency>
      <groupId>org.jboss.seam</groupId>
      <artifactId>commons-collections.jar</artifactId>
      <version>2.0.0.SNAPSHOT</version>
      <scope>test</scope>
      </dependency>
      <dependency>
      <groupId>org.jboss.seam</groupId>
      <artifactId>commons-digester.jar</artifactId>
      <version>2.0.0.SNAPSHOT</version>
      <scope>test</scope>
      </dependency>
      <dependency>
      <groupId>org.jboss.seam</groupId>
      <artifactId>commons-logging.jar</artifactId>
      <version>2.0.0.SNAPSHOT</version>
      <scope>test</scope>
      </dependency>
      <dependency>
      <groupId>org.jboss.seam</groupId>
      <artifactId>core.jar</artifactId>
      <version>2.0.0.SNAPSHOT</version>
      <scope>test</scope>
      </dependency>
      <dependency>
      <groupId>org.jboss.seam</groupId>
      <artifactId>dom4j.jar</artifactId>
      <version>2.0.0.SNAPSHOT</version>
      <scope>test</scope>
      </dependency>
      <dependency>
      <groupId>org.jboss.seam</groupId>
      <artifactId>drools-compiler.jar</artifactId>
      <version>2.0.0.SNAPSHOT</version>
      <scope>test</scope>
      </dependency>
      <dependency>
      <groupId>org.jboss.seam</groupId>
      <artifactId>drools-core.jar</artifactId>
      <version>2.0.0.SNAPSHOT</version>
      <scope>test</scope>
      </dependency>
      <dependency>
      <groupId>org.jboss.seam</groupId>
      <artifactId>ejb-api.jar</artifactId>
      <version>2.0.0.SNAPSHOT</version>
      <scope>test</scope>
      </dependency>
      <dependency>
      <groupId>org.jboss.seam</groupId>
      <artifactId>el-api.jar</artifactId>
      <version>2.0.0.SNAPSHOT</version>
      <scope>test</scope>
      </dependency>
      <dependency>
      <groupId>org.jboss.seam</groupId>
      <artifactId>groovy-all.jar</artifactId>
      <version>2.0.0.SNAPSHOT</version>
      <scope>test</scope>
      </dependency>
      <dependency>
      <groupId>org.jboss.seam</groupId>
      <artifactId>gwt-servlet.jar</artifactId>
      <version>2.0.0.SNAPSHOT</version>
      <scope>test</scope>
      </dependency>
      <dependency>
      <groupId>org.jboss.seam</groupId>
      <artifactId>hibernate-annotations.jar</artifactId>
      <version>2.0.0.SNAPSHOT</version>
      <scope>test</scope>
      </dependency>
      <dependency>
      <groupId>org.jboss.seam</groupId>
      <artifactId>hibernate-commons-annotations.jar</artifactId>
      <version>2.0.0.SNAPSHOT</version>
      <scope>test</scope>
      </dependency>
      <dependency>
      <groupId>org.jboss.seam</groupId>
      <artifactId>hibernate.jar</artifactId>
      <version>2.0.0.SNAPSHOT</version>
      <scope>test</scope>
      </dependency>
      <dependency>
      <groupId>org.jboss.seam</groupId>
      <artifactId>hibernate-search.jar</artifactId>
      <version>2.0.0.SNAPSHOT</version>
      <scope>test</scope>
      </dependency>
      <dependency>
      <groupId>org.jboss.seam</groupId>
      <artifactId>hibernate-validator.jar</artifactId>
      <version>2.0.0.SNAPSHOT</version>
      <scope>test</scope>
      </dependency>
      <dependency>
      <groupId>org.jboss.seam</groupId>
      <artifactId>itext.jar</artifactId>
      <version>2.0.0.SNAPSHOT</version>
      <scope>test</scope>
      </dependency>
      <dependency>
      <groupId>org.jboss.seam</groupId>
      <artifactId>janino.jar</artifactId>
      <version>2.0.0.SNAPSHOT</version>
      <scope>test</scope>
      </dependency>
      <dependency>
      <groupId>org.jboss.seam</groupId>
      <artifactId>javassist.jar</artifactId>
      <version>2.0.0.SNAPSHOT</version>
      <scope>test</scope>
      </dependency>
      <dependency>
      <groupId>org.jboss.seam</groupId>
      <artifactId>jaxws-api.jar</artifactId>
      <version>2.0.0.SNAPSHOT</version>
      <scope>test</scope>
      </dependency>
      <dependency>
      <groupId>org.jboss.seam</groupId>
      <artifactId>jboss-aop.jar</artifactId>
      <version>2.0.0.SNAPSHOT</version>
      <scope>test</scope>
      </dependency>
      <dependency>
      <groupId>org.jboss.seam</groupId>
      <artifactId>jboss-cache.jar</artifactId>
      <version>2.0.0.SNAPSHOT</version>
      <scope>test</scope>
      </dependency>
      <dependency>
      <groupId>org.jboss.seam</groupId>
      <artifactId>jboss-common-core.jar</artifactId>
      <version>2.0.0.SNAPSHOT</version>
      <scope>test</scope>
      </dependency>
      <dependency>
      <groupId>org.jboss.seam</groupId>
      <artifactId>jboss-container.jar</artifactId>
      <version>2.0.0.SNAPSHOT</version>
      <scope>test</scope>
      </dependency>
      <dependency>
      <groupId>org.jboss.seam</groupId>
      <artifactId>jboss-dependency.jar</artifactId>
      <version>2.0.0.SNAPSHOT</version>
      <scope>test</scope>
      </dependency>
      <dependency>
      <groupId>org.jboss.seam</groupId>
      <artifactId>jboss-deployers.jar</artifactId>
      <version>2.0.0.SNAPSHOT</version>
      <scope>test</scope>
      </dependency>
      <dependency>
      <groupId>org.jboss.seam</groupId>
      <artifactId>jboss-el.jar</artifactId>
      <version>2.0.0.SNAPSHOT</version>
      <scope>test</scope>
      </dependency>
      <dependency>
      <groupId>org.jboss.seam</groupId>
      <artifactId>jboss-embedded-api.jar</artifactId>
      <version>2.0.0.SNAPSHOT</version>
      <scope>test</scope>
      </dependency>
      <dependency>
      <groupId>org.jboss.seam</groupId>
      <artifactId>jboss-jmx.jar</artifactId>
      <version>2.0.0.SNAPSHOT</version>
      <scope>test</scope>
      </dependency>
      <dependency>
      <groupId>org.jboss.seam</groupId>
      <artifactId>jboss-kernel.jar</artifactId>
      <version>2.0.0.SNAPSHOT</version>
      <scope>test</scope>
      </dependency>
      <dependency>
      <groupId>org.jboss.seam</groupId>
      <artifactId>jboss-logging-spi.jar</artifactId>
      <version>2.0.0.SNAPSHOT</version>
      <scope>test</scope>
      </dependency>
      <dependency>
      <groupId>org.jboss.seam</groupId>
      <artifactId>jboss-seam-debug.jar</artifactId>
      <version>2.0.0.SNAPSHOT</version>
      <scope>test</scope>
      </dependency>
      <dependency>
      <groupId>org.jboss.seam</groupId>
      <artifactId>jboss-seam-gen.jar</artifactId>
      <version>2.0.0.SNAPSHOT</version>
      <scope>test</scope>
      </dependency>
      <dependency>
      <groupId>org.jboss.seam</groupId>
      <artifactId>jboss-seam-ioc.jar</artifactId>
      <version>2.0.0.SNAPSHOT</version>
      <scope>test</scope>
      </dependency>
      <dependency>
      <groupId>org.jboss.seam</groupId>
      <artifactId>jboss-seam.jar</artifactId>
      <version>2.0.0.SNAPSHOT</version>
      <scope>test</scope>
      </dependency>
      <dependency>
      <groupId>org.jboss.seam</groupId>
      <artifactId>jboss-seam-mail.jar</artifactId>
      <version>2.0.0.SNAPSHOT</version>
      <scope>test</scope>
      </dependency>
      <dependency>
      <groupId>org.jboss.seam</groupId>
      <artifactId>jboss-seam-pdf.jar</artifactId>
      <version>2.0.0.SNAPSHOT</version>
      <scope>test</scope>
      </dependency>
      <dependency>
      <groupId>org.jboss.seam</groupId>
      <artifactId>jboss-seam-remoting.jar</artifactId>
      <version>2.0.0.SNAPSHOT</version>
      <scope>test</scope>
      </dependency>
      <dependency>
      <groupId>org.jboss.seam</groupId>
      <artifactId>jboss-seam-ui.jar</artifactId>
      <version>2.0.0.SNAPSHOT</version>
      <scope>test</scope>
      </dependency>
      <dependency>
      <groupId>org.jboss.seam</groupId>
      <artifactId>jboss-system.jar</artifactId>
      <version>2.0.0.SNAPSHOT</version>
      <scope>test</scope>
      </dependency>
      <dependency>
      <groupId>org.jboss.seam</groupId>
      <artifactId>jbossxb.jar</artifactId>
      <version>2.0.0.SNAPSHOT</version>
      <scope>test</scope>
      </dependency>
      <dependency>
      <groupId>org.jboss.seam</groupId>
      <artifactId>jbpm-jpdl.jar</artifactId>
      <version>2.0.0.SNAPSHOT</version>
      <scope>test</scope>
      </dependency>
      <dependency>
      <groupId>org.jboss.seam</groupId>
      <artifactId>jcaptcha-all.jar</artifactId>
      <version>2.0.0.SNAPSHOT</version>
      <scope>test</scope>
      </dependency>
      <dependency>
      <groupId>org.jboss.seam</groupId>
      <artifactId>jcommon.jar</artifactId>
      <version>2.0.0.SNAPSHOT</version>
      <scope>test</scope>
      </dependency>
      <dependency>
      <groupId>org.jboss.seam</groupId>
      <artifactId>jfreechart.jar</artifactId>
      <version>2.0.0.SNAPSHOT</version>
      <scope>test</scope>
      </dependency>
      <dependency>
      <groupId>org.jboss.seam</groupId>
      <artifactId>jgroups.jar</artifactId>
      <version>2.0.0.SNAPSHOT</version>
      <scope>test</scope>
      </dependency>
      <dependency>
      <groupId>org.jboss.seam</groupId>
      <artifactId>jms.jar</artifactId>
      <version>2.0.0.SNAPSHOT</version>
      <scope>test</scope>
      </dependency>
      <dependency>
      <groupId>org.jboss.seam</groupId>
      <artifactId>jsf-api.jar</artifactId>
      <version>2.0.0.SNAPSHOT</version>
      <scope>test</scope>
      </dependency>
      <dependency>
      <groupId>org.jboss.seam</groupId>
      <artifactId>jsf-facelets.jar</artifactId>
      <version>2.0.0.SNAPSHOT</version>
      <scope>test</scope>
      </dependency>
      <dependency>
      <groupId>org.jboss.seam</groupId>
      <artifactId>jsf-impl.jar</artifactId>
      <version>2.0.0.SNAPSHOT</version>
      <scope>test</scope>
      </dependency>
      <dependency>
      <groupId>org.jboss.seam</groupId>
      <artifactId>jsp-api.jar</artifactId>
      <version>2.0.0.SNAPSHOT</version>
      <scope>test</scope>
      </dependency>
      <dependency>
      <groupId>org.jboss.seam</groupId>
      <artifactId>jsr250-api.jar</artifactId>
      <version>2.0.0.SNAPSHOT</version>
      <scope>test</scope>
      </dependency>
      <dependency>
      <groupId>org.jboss.seam</groupId>
      <artifactId>jstl.jar</artifactId>
      <version>2.0.0.SNAPSHOT</version>
      <scope>test</scope>
      </dependency>
      <dependency>
      <groupId>org.jboss.seam</groupId>
      <artifactId>jta.jar</artifactId>
      <version>2.0.0.SNAPSHOT</version>
      <scope>test</scope>
      </dependency>
      <dependency>
      <groupId>org.jboss.seam</groupId>
      <artifactId>log4j.jar</artifactId>
      <version>2.0.0.SNAPSHOT</version>
      <scope>test</scope>
      </dependency>
      <dependency>
      <groupId>org.jboss.seam</groupId>
      <artifactId>lucene-core.jar</artifactId>
      <version>2.0.0.SNAPSHOT</version>
      <scope>test</scope>
      </dependency>
      <dependency>
      <groupId>org.jboss.seam</groupId>
      <artifactId>mail.jar</artifactId>
      <version>2.0.0.SNAPSHOT</version>
      <scope>test</scope>
      </dependency>
      <dependency>
      <groupId>org.jboss.seam</groupId>
      <artifactId>meldware-mailapi.jar</artifactId>
      <version>2.0.0.SNAPSHOT</version>
      <scope>test</scope>
      </dependency>
      <dependency>
      <groupId>org.jboss.seam</groupId>
      <artifactId>meldware-mailjmx.jar</artifactId>
      <version>2.0.0.SNAPSHOT</version>
      <scope>test</scope>
      </dependency>
      <dependency>
      <groupId>org.jboss.seam</groupId>
      <artifactId>mvel14.jar</artifactId>
      <version>2.0.0.SNAPSHOT</version>
      <scope>test</scope>
      </dependency>
      <dependency>
      <groupId>org.jboss.seam</groupId>
      <artifactId>persistence-api.jar</artifactId>
      <version>2.0.0.SNAPSHOT</version>
      <scope>test</scope>
      </dependency>
      <dependency>
      <groupId>org.jboss.seam</groupId>
      <artifactId>portlet-api.jar</artifactId>
      <version>2.0.0.SNAPSHOT</version>
      <scope>test</scope>
      </dependency>
      <dependency>
      <groupId>org.jboss.seam</groupId>
      <artifactId>quartz.jar</artifactId>
      <version>2.0.0.SNAPSHOT</version>
      <scope>test</scope>
      </dependency>
      <dependency>
      <groupId>org.jboss.seam</groupId>
      <artifactId>richfaces-api-3.1.1-20070924.010402-14.jar</artifactId>
      <version>2.0.0.SNAPSHOT</version>
      <scope>test</scope>
      </dependency>
      <dependency>
      <groupId>org.jboss.seam</groupId>
      <artifactId>richfaces-impl-3.1.1-20070924.010402-14.jar</artifactId>
      <version>2.0.0.SNAPSHOT</version>
      <scope>test</scope>
      </dependency>
      <dependency>
      <groupId>org.jboss.seam</groupId>
      <artifactId>richfaces-ui-3.1.1-20070924.010402-11.jar</artifactId>
      <version>2.0.0.SNAPSHOT</version>
      <scope>test</scope>
      </dependency>
      <dependency>
      <groupId>org.jboss.seam</groupId>
      <artifactId>saaj-api.jar</artifactId>
      <version>2.0.0.SNAPSHOT</version>
      <scope>test</scope>
      </dependency>
      <dependency>
      <groupId>org.jboss.seam</groupId>
      <artifactId>servlet-api.jar</artifactId>
      <version>2.0.0.SNAPSHOT</version>
      <scope>test</scope>
      </dependency>
      <dependency>
      <groupId>org.jboss.seam</groupId>
      <artifactId>spring.jar</artifactId>
      <version>2.0.0.SNAPSHOT</version>
      <scope>test</scope>
      </dependency>
      <dependency>
      <groupId>org.jboss.seam</groupId>
      <artifactId>testng.jar</artifactId>
      <version>2.0.0.SNAPSHOT</version>
      <scope>test</scope>
      </dependency>
      
      


        • 1. Re: Maven, Seam, TestNG - IntegrationTests
          Pete Muir Master

          I don't know how to best set this up in a maven project, but as I just added to the seam-gen src/test/readme.txt file you need to make sure your test classpath looks like this

          lib/test/jboss-embedded-all.jar
          lib/test/hibernate-all.jar
          lib/test/thirdparty-all.jar
          lib/test/jboss-deployers.jar
          ${everything else normally in your compile classpath + the test classes + testng}

          The order of the classpath is very very important here - the test/*.jar *must* come before everything else otherwise jboss embedded won't work.

          I'll try to blog about this soon.