0 Replies Latest reply on Jul 20, 2010 2:43 AM by Dolphin Here

    Seam Testing with JUnit

    Dolphin Here Newbie
      Hi All,

      Need help on integrating Seam project for testing with JUnit. i have no clues to where and how to start. i tried created a seam web project using eclipse, created few seam actions.i tried to run the <clasNameTest>.xml as JUNIT test, it says "No Test found for JUnit 3".

      given below are my action, actiontest and corresponding xml.

      public class RegistrationBean implements Registration
          @Logger private Log log;

           private EntityManager em;

          @In StatusMessages statusMessages;

          String customerName;
          private short customerStatus = 4;
          public String getCustomerName() {
                return customerName;

           public void setCustomerName(String customerName) {
                this.customerName = customerName;

           public void saveCustomer()
             try {
                // implement your business logic here
                    log.info("Registration.saveCustomer() action called");
                    log.info("Customer Name" + customerName);
                    //my entity
                    CasStatusRef tcsr = em.find(CasStatusRef.class, customerStatus);
                    Customer tc = new Customer();
           } catch (Exception e) {
                // TODO Auto-generated catch block
           public void destroy() {
          // add additional action methods



      package com.tcs.tib.tcaretest.test;

      import org.testng.annotations.Test;
      import org.jboss.seam.mock.SeamTest;

      public class TcareRegistrationTest extends SeamTest {

           public void test_saveCustomer() throws Exception {
                new FacesRequest() {
                    protected void updateModelValues() throws Exception
                       setValue("#{Registration.customerName}", "testing-JUNIT");
                     protected void invokeApplication() {
                          //call action methods here


      <!DOCTYPE suite SYSTEM "http://beust.com/testng/testng-1.0.dtd" >

      <suite name="Registration Tests" verbose="2" parallel="false">
         <test name="Registration Test">
             <class name="com.abc.bcd.pjttest.test.RegistrationTest"/>      

      Note: right click of this xml, didn't gimme the option to run as JUNIT. hence i tried to configure it and run.

      kindly guide me.