You should look in E:\Projects\EMS\target\surefire-reports to see what the
error is.

Matt

On Tue, Aug 12, 2008 at 8:26 AM, krishgy <[EMAIL PROTECTED]> wrote:

>
> Can you tell me whats wrong with my unit test case here
>
> package ems.webapp.action;
>
> import com.opensymphony.xwork2.ActionSupport;
> import org.apache.struts2.ServletActionContext;
> import org.appfuse.service.GenericManager;
> import ems.model.Client;
> import org.appfuse.webapp.action.BaseActionTestCase;
> import org.springframework.mock.web.MockHttpServletRequest;
>
> public class ClientActionTest extends BaseActionTestCase {
>    private ClientAction action;
>
>    @Override
>    protected void onSetUpBeforeTransaction() throws Exception {
>        super.onSetUpBeforeTransaction();
>        action = new ClientAction();
>        GenericManager ClientManager = (GenericManager)
> applicationContext.getBean("clientManager");
>        action.setClientManager(ClientManager);
>
>        // add a test Client to the database
>        Client Client = new Client();
>        Client.setCode("123");
>        Client.setDescription("Customer");
>        ClientManager.save(Client);
>    }
>
>    public void testSearch() throws Exception {
>        assertEquals(action.list(), ActionSupport.SUCCESS);
>        assertTrue(action.getClients().size() >= 1);
>    }
> }
>
>
> I am getting the following errors
>
>
>
> -------------------------------------------------------
>  T E S T S
> -------------------------------------------------------
> Running ems.webapp.action.ClientActionTest
> Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 3.75 sec
> <<<
> FAI
> LURE!
>
> Results :
>
> Tests in error:
>  testSearch(ems.webapp.action.ClientActionTest)
>
> Tests run: 1, Failures: 0, Errors: 1, Skipped: 0
>
> [INFO]
> ------------------------------------------------------------------------
> [ERROR] BUILD FAILURE
> [INFO]
> ------------------------------------------------------------------------
> [INFO] There are test failures.
>
> Please refer to E:\Projects\EMS\target\surefire-reports for the individual
> test
> results.
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Trace
> org.apache.maven.BuildFailureException: There are test failures.
>
> Please refer to E:\Projects\EMS\target\surefire-reports for the individual
> test
> results.
>        at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa
> ultLifecycleExecutor.java:579)
>        at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLi
> fecycle(DefaultLifecycleExecutor.java:499)
>        at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(Defau
> ltLifecycleExecutor.java:478)
>        at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHan
> dleFailures(DefaultLifecycleExecutor.java:330)
>        at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmen
> ts(DefaultLifecycleExecutor.java:291)
>        at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLi
> fecycleExecutor.java:142)
>        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336)
>        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
>        at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>        at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
> java:39)
>        at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
> sorImpl.java:25)
>        at java.lang.reflect.Method.invoke(Method.java:597)
>        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
> .
>
> Please refer to E:\Projects\EMS\target\surefire-reports for the individual
> test
> results.
>        at
> org.apache.maven.plugin.surefire.SurefirePlugin.execute(SurefirePlugi
> n.java:530)
>        at
> org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPlugi
> nManager.java:451)
>        at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa
> ultLifecycleExecutor.java:558)
>        ... 16 more
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Total time: 21 seconds
> [INFO] Finished at: Tue Aug 12 20:52:53 IST 2008
> [INFO] Final Memory: 25M/46M
> [INFO]
> ------------------------------------------------------------------------
>
> --
> View this message in context:
> http://www.nabble.com/Unit-Test-Help-struts-spring-hibernate-tp18946622s2369p18946622.html
> Sent from the AppFuse - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

Reply via email to