JSF Pages from Entity class
Author: Jaroslav Pospisil
Version: 1.1
Last update: Sun Dec 08 2006
Introduction:
This test specification serves for purpose of testing guide of JSF pages from Entity classes feature. CRUD generator creates basic backing beans for entity classes,
selected in wizard and generates also for each of them basic List,Edit,New and Detail pages. This is of course nothing but very crude JSF application,in the end,but
it colud be used e.g. for demonstration purposes or for easy input of data into database.
Setup: Make sure you have Sun Java System Application Server 8.2 or Sun Java System Application Server 9 installed on your computer.
NetBeans 5.5.1 will support both servers, so Test JSF pages from Entity class on each one.
Table of Contents
|
Purpose: Create application with JSF support
Setup:
| # | Test case | Description |
| 1 | Create a New Web Application with JSF Support | 1.
Choose File > NewProject and selecting the Web Application template from the Web category. 2.
In the Frameworks page, choose jsf framework. 3.
Click finish
|
RESULT:
1. All action are done correctly
2. Web project should be created on selected appserver
3. Jsf librares and files welcomeJSF.jsp, faces-config.xml should exist.
|
|
|
Purpose: Adding Entity classes for JSF pages created later
Setup: Test both ways. In first case is entity class created from existing table in database. In second case is table created from entity class when application is run,of course if it doesn't exist yet.
| # | Test case | Description |
| 1 | Create Entity classes from database |
1.Choose File > New File > Persistence > Entity Classes from Database.
2.As datasource select jdbc/sample from the list.IDE will update list of Available tables according to database.
3.Select Add All and click Next.
4.Click Create Persistence Unit and then Create.
5.Provide Package name pkg and click Finish.
|
RESULT:
1. All actions are done correctly
2. In your web module is created source package pkg with generated entity classes.
3. Check some of generated classes,if there's no errors - there should be none.
|
| 2 | Create Entity classes manually |
1.Choose File > New File > Persistence > Entity Class.
2.As Class Name write TestEntity and into Package org.entity.
3.Click FinishFinish.
4.Go to editor and add private String eName; under line with id declaration.
5.Right click and select Refactor > Encapsulate fields and then Next and Do Refactoring - getters and setters will be added.
6.Create another entity classes the same way with different attribute names.
|
RESULT:
1. All actions are done correctly
2. In your web module is created source package org.entity with your created entity classes.
|
|
|
Purpose: Test of creating JSF pages from Entity classes we created in previous suite.
Setup:
| # | Test case | Description |
| 1 | Creating of JSF pages |
1.Right click on a web application.
2.Choose New > File/Folder and selecting JSF Pages from Entity Class from the Persistence category.
3.Click Ad All and Next
4.Click Finish.
|
RESULT:
All actions are done correctly.
New JSF pages should be created in Web Pages folder.You can check it in Projects tab.
|
|
|
Purpose: Test if the JSF pages were generated correctly and if final applicationm is working.
Setup:
| # | Test case | Description |
| 1 | Running the web module |
1.Right-click on web module in Projects tab and select Run Project
2.Browser will open on page with list of links to pages, where are displayed lists of tables from database.
3.Check all lists,try to add new objects, view, edit, delete.
|
RESULT:
All actions are done correctly. Everything should work without any exception.
Remember to enter correct value types,when adding object into database.Validation isn't implemented yet and entering wrong type of value will result as exception in browser.
|
|
Generated: Sun Sep 24 2006