Lab #8 (Server-less Testing with TestNG)

Overview

Seam provides full round-trip testing capabilities without the need to deploy to a server. Using TestNG, a JUnit alternative that's JUnit compatible, you will test a Seam application.

Lab Instructions

  1. Open your seam command window/shell
  2. type: cd @seamHome@
  3. type: seam switch-project (helloworld-lab8 should be entered as the project name)
  4. CHEAT:
  5. NO CHEAT:
  6. type: cd @seamHome@
  7. type: seam explode restart
  8. Goto URL: http://localhost:8080/helloworld-lab8/hello.seam
  9. type: seam unexplode (Will undeploy the exploded EAR file)
  10. EXTRA CREDIT: Implement a new method/test case that always throws a NullPointerException.

Key Files

@workspaceHome@@sep@helloworld-lab8@sep@resources@sep@WEB-INF@sep@components.xml
@workspaceHome@@sep@helloworld-lab8@sep@resources@sep@WEB-INF@sep@faces-config.xml
@workspaceHome@@sep@helloworld-lab6@sep@resources@sep@WEB-INF@sep@web.xml

@workspaceHome@@sep@helloworld-lab8@sep@src@sep@com@sep@mydomain@sep@helloworld@sep@Hello.java
@workspaceHome@@sep@helloworld-lab8@sep@src@sep@com@sep@mydomain@sep@helloworld@sep@HelloBean.java
@workspaceHome@@sep@helloworld-lab8@sep@src@sep@com@sep@mydomain@sep@helloworld@sep@test@sep@HelloTest.java
@workspaceHome@@sep@helloworld-lab8@sep@src@sep@com@sep@mydomain@sep@helloworld@sep@test@sep@HelloTest.xml

@workspaceHome@@sep@helloworld-lab8@sep@view@sep@hello.xhtml

Home | Next