7 Replies Latest reply on Feb 20, 2008 5:39 PM by rodrigoy

    Integration Test inside IDE

    rodrigoy

      Is it possible to run SeamTest classes inside Eclipse?


      My current 1.2.1 project based on seam-gen runs OK on 'test' ant target, but doesn't run via right-click on the IDE because Jboss MC doesn't find the components on the IDE classpath.


      Any ideas?

        • 1. Re: Integration Test inside IDE
          gavin.king

          It is supposed to work, and it used to, but some changes have been made to the MC, and so I'm not sure if it's working anymore. Try reporting this in JIRA.

          • 2. Re: Integration Test inside IDE

            Seam 2.0.1 test do work under IDE. You have to make sure that *-all.jar files come first in the classpath (needed for jboss embedded), may be you can do the same trick for 1.2.1.

            • 3. Re: Integration Test inside IDE
              rodrigoy

              Here it is...


              http://jira.jboss.com/jira/browse/JBSEAM-2648


              Why Seam Bijection is so tied to EJB infrastructure? Is it possible to inject components manually in runtime? (see below)


              It's been really hard to use TDD and Seam... Every single test takes 20 seconds to run and extending FacesRequest turns my tests quite verbose and hard to read.


              Maybe we have to improve the way we do integration tests with Seam (plain-plain JSE environment, just bijection and resource-local entitymanager would be OK). I don't know if you have discussed this before.


              For an example, project is a Session scope component:
                             
              new FacesRequest() {
                 protected void updateModelValues() throws Exception {
                    setValue("#{project}", new Projeto());
                 }
              }


              Gives me:


              [testng] javax.el.PropertyNotFoundException: ELResolver cannot handle a null base Object with identifier 'project'


              What do you think?

              • 4. Re: Integration Test inside IDE
                rodrigoy

                Strange: running via 'test' ant build target automatically starts the  MC, running inside de IDE MC doesn't start.


                If I extend SeamTest should I manually start EJB3Bootstrap? Which class start it up?

                • 5. Re: Integration Test inside IDE
                  heshuhua

                  Siarhei:
                  Could you show a more detail description how to make seam test work under IDE? now I only use unit test through testng plugin, when i want to extends SeamTest, console displays some class not found.

                  • 6. Re: Integration Test inside IDE
                    heshuhua

                    Now I used jdk1.5 ,then the problem not appears.
                    And another step is  manully add jdt core lib to test classpath.

                    • 7. Re: Integration Test inside IDE
                      rodrigoy

                      Rodrigo Yoshima wrote on Feb 18, 2008 10:25 PM:


                      Strange: running via 'test' ant build target automatically starts the  MC, running inside de IDE MC doesn't start.

                      If I extend SeamTest should I manually start EJB3Bootstrap? Which class start it up?


                      Got it running! It works if you put an empty seam.properties file inside every classpath root that contains Seam components. Now my tests are running inside Eclipse & Embedable EJB3.


                      You also need to put WEB-INF / META-INF in the IDE classpath. So, you need the same structure as test-build directory inside your IDE.