TS 61 JDADatabase

Java Desktop Project - Database Shell Test Specification

Author: Jiri Vagner
Version: 6.1
Lastupdate: 2008/01/29
Introduction:

Contents

Test suite: Generating and running JDA Database App

Setup: In following testcases you need to have access into database with a sample tables. SQL scripts for creating sample tables are attached, you can find them at the bottom of the page. Choose your favourite database, create connection and sample tables. For creating connection and tables you can use Netbeans Database Explorer, visit tab Services and expand node Databases.

  1. Detail area as textfields
    • Setup: Start IDE with clean userdir.
    1. Invoke New Project wizard using shortcut SHIFT+CTRL+N or via main menu File->New Project
    2. Choose category "Java", project type "Java Desktop Application" and press "Next" button
    3. In "Name and Location" wizard step choose "Database Applications" shell and press "Next" button
    4. Select connection to your database, choose sample simple db table "CAR" and press "Next" button. (For details about database settings check the comments of this test suite)
    5. Because simple db table "CAR" is not referenced via foreign key there is available only possibility to create detail area as textfields. So just press "Finish" button and wait a few seconds. IDE will generate simple CRUD application.
    • EXPECTED RESULT: Project contains simple CRUD app. Expand Source Packages project tree node and start exploration. There should be a special package META-INF with persistance unit definition xml file inside. Also in main app package there should be a JPA entity class Car. Opened ...View.java file contains Entity Manager, Query and List. All this JPA stuff is used for easy working with database tables. In designer you should see form with master table and details shoud be rendered as a few textfields. Project should be compilable and runnable.
  2. Detail area as table
    • Setup: Start IDE with clean userdir.
    1. Invoke New Project wizard using shortcut SHIFT+CTRL+N or via main menu File->New Project
    2. Choose category "Java", project type "Java Desktop Application" and press "Next" button
    3. In "Name and Location" wizard step choose "Database Applications" shell and press "Next" button
    4. Select connection to your database, choose sample db table "AUTHOR" and press "Next" button. (For details about database settings check the comments of this test suite)
    5. In database there is a table "ALBUM" with foreign key and this key references to table "AUTHOR". This is why you can choose "Create Detail Area as : Table" in last wizard step. Do it, press "Finish" button and wait a few seconds. IDE will generate application.
    • EXPECTED RESULT: Project contains simple CRUD app. Expand Source Packages project tree node and start exploration. There should be a special package META-INF with persistance unit definition xml file inside. Also in main app package there should be JPA entity classes Album and Author. Opened ...View.java file contains Entity Manager, Query and List. All this JPA stuff is used for easy working with database tables. In designer you should see form with master table and details shoud be rendered not as a few textfields but also as table. Project should be compilable and runnable.
  3. Playing with columns
    • Setup: Start IDE with clean userdir.
    1. Create project using the same steps like in previous case, but before pressing "Finish" button in last wizard step try to modify column settings in last two wizard steps ("Available Columns" and "Columns to Include")
    • EXPECTED RESULT: ... Project should be compilable and runnable.
Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo