СachedRowSet Data Provider Test Specification

See Rave QA Test Specification Template

Tutorials:
Performing Inserts, Updates, and Deletes

Functional Specifications & Other Documents:
VWP and NetBeans Data Source Integration
DatabaseNB6FunctionalSpecs
ResolveBrokenDataSourcesSpec


Supported data bases:

Database DB URL (schema) User/Password
Apache Derby 10.2.2, included into Sun Application Server 9/Glassfish jdbc:derby://localhost:1527/travel travel/travel
Oracle 9i/10g jdbc:oracle:thin:@jbrave-pc1.sfbay.sun.com:1521:ora10g,
jdbc:oracle:thin:@rave-sagwa.sfbay.sun.com:1521:ora10g,
jdbc:oracle:thin:@rave-cheetah.sfbay.sun.com:1521:ora9i
travel/travel
MySQL jdbc:mysql://rave-db.russia.sun.com:3306/mysql travel/travel
PostgreSQL 8.2 jdbc:postgresql://129.159.127.31:5432/postgres
(schema "public")
travel/travel

Sun Application Server 9/Glassfish is used for deployment of created Visual Web Pack applications.


{CRS} - abbreviation for term CachedRowSet
{DPr} - abbreviation for term DataProvider


Test ID (t) Test case (i) Input Spec (o) Output Spec
tutorial-acceptance
(set of acceptance tests)
Perform the tutorial Performing Inserts, Updates, and Deletes Perform this tutorial for all supported DBs. There should be no troubles during creation of Visual Web Pack project according to scenario described in the tutorial.
Created application should be deployed and run properly.
check-Drivers-menu Check popup menu of tree node Drivers

In the window Services call popup menu on tree node Databases | Drivers.

Popup menu should include items:
  • New Driver...
add-DB_driver-Derby Add new DB driver for database Derby

1. Perform test check-Drivers-menu.

2. Select the menu item New Driver...

3. In the dialog New JDBC Driver

3.1 Click Add..., select .jar-file:
for j2sdk1.5.0
<SAS9/Glassfish_path>/javadb/lib/derbyclient.jar
for j2sdk1.6.0
<j2sdk1.6.0>/db/lib/derbyclient.jar

3.2 Click OK

3.1 In the Driver Class should appear org.apache.derby.jdbc.ClientDriver.
In the Name should appear Java DB (Network).

3.2 In the window Services new tree subnode Java DB (Network) should appear under tree node Databases | Drivers.

add-DB_driver-Oracle Add new DB driver for database Oracle

1. Perform test check-Drivers-menu.

2. Select the menu item New Driver...

3. In the dialog New JDBC Driver

3.1 Click Add..., select .jar-file ojdbc14.jar.

3.2 Click OK

3.1 In the Driver Class should appear oracle.jdbc.driver.OracleDriver.
In the Name should appear Oracle.

3.2 In the window Services new tree subnode Oracle should appear under tree node Databases | Drivers.

add-DB_driver-MySQL Add new DB driver for database MySQL.

1. Perform test check-Drivers-menu.

2. Select the menu item New Driver...

3. In the dialog New JDBC Driver

3.1 Click Add..., select .jar-file mysql.jar (mysql-connector-java-3.1.14-bin.jar, mysql-connector-java-5.0.6-bin.jar, mysql-connector-java-5.1.0-bin.jar).

3.2 Click OK

3.1 In the Driver Class should appear com.mysql.jdbc.Driver.
In the Name should appear MySQL (Connector/J driver).

3.2 In the window Services new tree subnode MySQL (Connector/J driver) should appear under tree node Databases | Drivers.

cancel-adding-DB_driver Cancel adding of new DB driver

Perform test add-DB_driver-..., but in the dialog New JDBC Driver click Cancel

In the window Services new DB driver subnode should not appear under tree node Databases | Drivers.

check-DB_driver-menu Check popup menu of DB driver

In the window Services call popup menu on DB driver tree subnode (under tree node Databases | Drivers).

Popup menu should include items:
  • Connect Using...
  • Delete
  • Customize
remove-DB_driver_yes Remove DB driver

In the window Services call popup menu on DB driver tree subnode (under tree node Databases | Drivers), select the menu item Delete.
In the dialog Confirm Object Deletion click Yes.

In the window Services the appropriate tree subnode should disappear under tree node Databases | Drivers.
remove-DB_driver_no Cancel DB driver removing

In the window Services call popup menu on DB driver tree subnode (under tree node Databases | Drivers), select the menu item Delete.
In the dialog Confirm Object Deletion click No.

In the window Services the appropriate tree subnode should not disappear under tree node Databases | Drivers.
check-Databases-menu Check popup menu of tree node Databases

In the window Services call popup menu on tree node Databases.

Popup menu should include items:
  • New Connection...
  • Enable Debug
  • Disable Debug (disabled)
connect-DB-Derby Connect to DB Derby

1. Perform test check-Databases-menu.

2. Select the menu item New Connection...

3. In the dialog New Database Connection

3.1 Select Java DB (Network) from combo-box Name.

3.2 Put the appropriate DB URL to Database URL

3.3 Put the appropriate user name to User name

3.4 Put the appropriate password to Password

3.5 Click OK

3.1 The URL-template jdbc:derby://[:]/databaseName[;attr1=value1[;...]]. should appear in the Database URL

3.5 In the window Services new tree subnode with defined database URL should appear under tree node Databases.
Or, if DB connection can't be established, an error dialog with the appropriate message Unable to add connection, cannot establish a connection to... should appear.

connect-DB-Oracle Connect to DB Oracle

1. Perform test check-Databases-menu.

2. Select the menu item New Connection...

3. In the dialog New Database Connection

3.1 Select Oracle from combo-box Name.

3.2 Put the appropriate DB URL to Database URL

3.3 Put the appropriate user name to User name

3.4 Put the appropriate password to Password

3.5 Click OK

3.1 The URL-template jdbc:oracle:thin:@<HOST>:<PORT>:<SID> should appear in the Database URL

3.5 In the window Services new tree subnode with defined database URL should appear under tree node Databases.
Or, if DB connection can't be established, an error dialog with the appropriate message Unable to add connection, cannot establish a connection to... should appear.

connect-DB-MySQL Connect to DB MySQL

1. Perform test check-Databases-menu.

2. Select the menu item New Connection...

3. In the dialog New Database Connection

3.1 Select MySQL (Connector/J driver) from combo-box Name.

3.2 Put the appropriate DB URL to Database URL

3.3 Put the appropriate user name to User name

3.4 Put the appropriate password to Password

3.5 Click OK

3.1 The URL-template jdbc:mysql://<HOST>:<PORT>:<DB> should appear in the Database URL

3.5 In the window Services new tree subnode with defined database URL should appear under tree node Databases.
Or, if DB connection can't be established, an error dialog with the appropriate message Unable to add connection, cannot establish a connection to... should appear.

check_DB_connection-menu Check popup menu of DB connection tree subnode

In the window Services call popup menu on an existing DB connection tree subnode.

Popup menu should include items:
  • Connect... (disabled)
  • Disconnect
  • Execute Command...
  • Refresh
  • Delete (disabled)
  • Properties
disconnect-DB Break an existing DB connection

In the window Services call popup menu on an existing DB connection. Select the menu item Disconnect.

"Continued" icon of the DB connection should be changed to "broken" icon.
If the DB connection tree node was expanded and its tree subnodes (DB Tables/Views) were displayed, all of them should disappear.

delete-DB_connection Remove an existing DB connection

1. In the window Services call popup menu on an existing disconnected DB connection. Select the menu item Delete.

2. In the dialog Confirm Object Deletion click Yes.

1. The dialog Confirm Object Deletion should appear.

2. In the window Services the selected DB connection tree subnode should be removed under tree node Databases.

create-{CRS}/{DPr}-Design_View Using of web-page Design View for creation new CachedRowSet/DataProvider

1. Connect to one of supported DB.

2. Create new Visual Web Pack project.

3. In the window Services expand the tree subnode Tables (Views) under the appropriate DB connection tree node.

4. Select a DB table (DB view) and DnD it on Design View of Page1.

5. Repeat the step 4 for the same DB table (DB view).

4. In the window Navigator:

  • a tree subnode <DBTableName>RowSet:"SELECT * ..." should appear under the tree node SessionBean1

  • a tree subnode <DBTableName>DataProvider should appear under the tree node Page1

5. In the window Navigator:

  • a tree subnode <DBTableName>RowSet1:"SELECT * ..." should appear under the tree node SessionBean1
  • a tree subnode <DBTableName>DataProvider1 should appear under the tree node Page1
create-{CRS}/{DPr}-page_bean Using of tree node Page1 in the window Navigator for creation new CachedRowSet/DataProvider

1. Connect to one of supported DB.

2. Create new Visual Web Pack project.

3. In the window Services expand the tree subnode Tables (Views) under the appropriate DB connection tree node.

4. Select a DB table (DB view) and DnD it on the tree node Page1 in the window Navigator.

5. Repeat the step 4 for the same DB table (DB view).

The same as in the test create-{CRS}/{DPr}-Design_View.

create-{CRS}/{DPr}-session_bean
create-{CRS}/{DPr}-application_bean
Using of tree node SessionBean1 (ApplicationBean1) in the window Navigator for creation new CachedRowSet/DataProvider

1. Connect to one of supported DB.

2. Create new Visual Web Pack project.

3. In the window Services expand the tree subnode Tables (Views) under the appropriate DB connection tree node.

4. Select a DB table (DB view) and DnD it on the tree node SessionBean1 (ApplicationBean1) in the window Navigator.

5. Repeat the step 4 for the same DB table (DB view).

4. In the window Navigator 2 new tree subnodes <DBTableName>RowSet:"SELECT * ..." and <DBTableName>DataProvider should appear under the tree node SessionBean1 (ApplicationBean1).

5. In the window Navigator 2 new tree subnodes <DBTableName>RowSet1:"SELECT * ..." and <DBTableName>DataProvider1 should appear under the tree node SessionBean1 (ApplicationBean1).

check-{CRS}-sql_statement Check SQL statement, related to created CachedRowSet

1. Perform test create-{CRS}/{DPr}-...

2. In the window Navigator select the created tree subnode <DBTableName>RowSet:"SELECT * ..."

2. Correct name of DB table (DB view) should appear:

  • in the clause FROM of SQL statement SELECT for the RowSet-subnode
  • in the clause FROM of SQL statement SELECT for the property command in the window Properties
  • in the property tableName in the window Properties

SQL statement SELECT for the property command in the window Properties should be equal the appropriate SQL statement SELECT in the method _init() of the file SessionBean1.java (ApplicationBean1.java)
check-{DPr}-row_set Check CachedRowSet, related to created DataProvider

1. Perform test create-{CRS}/{DPr}-...

2. In the window Navigator select the created tree subnode <DBTableName>DataProvider

2. Correct name of the related <DBTableName>RowSet should be:

  • in the property cachedRowSet in the window Properties
  • in the method _init() of the file Page1.java (SessionBean1.java, ApplicationBean1.java)
delete-{CRS}/{DPr} Delete DataProvider and CachedRowSet, related to it.

1. Perform test create-{CRS}/{DPr}-...

2. In the window Navigator select the created CachedRowSet. On a keyboard press the button Del (or call popup menu and use the menu item Delete).
In the dialog Confirm Object Deletion click Yes.

3. In the window Navigator select the created DataProvider, related to deleted CachedRowSet.

2. In the window Navigator the selected CachedRowSet should be removed from the tree.
The appropriate initialization java code, related to deleted CahedRowSet, should be removed from the method _init() of the file SessionBean1.java (ApplicationBean1.java).

3. The property cachedRowSet in the window Properties should be empty.
The method _init() of the file Page1.java (SessionBean1.java, ApplicationBean1.java) should not contain java code, which assign the deleted CachedRowSet to the selected DataProvider.

open-{CRS}-query_editor Open Query Editor for CachedRowSet.

1. Perform test create-{CRS}/{DPr}-...

2. In the window Navigator select the created CachedRowSet. Use the popup menu item Edit SQL Statement.

2. New Query Editor window should be opened.
The 1st (top) pane should contain graphical representation of DB table.
The graphical box should include names of all table columns.
Its title should contain the DB table name.

The 2nd pane should contain a table, which allows to configure SQL statement.
Each table row corresponds to the one DB column.

The 3rd pane should contain the correct SQL statement, which is made on data of the table in the 2nd pane.

check-impact-{CRS}-sql_parameter-
JSF_Table_layout
Check that adding a parameter to a CachedRowSet SQL statement in Query Editor won't damage a layout of a JSF component Table

1. Create new Visual Web Pack project.

2. Perform test connect-DB-Derby

3. In palette Basic of the window Palette select JSF component Table. DnD it on Design View.

4. In the window Services expand the tree subnode Tables under the created DB Derby connection. Select a DB table TRIP. DnD it on JSF component Table, placed on Design View.

5. Use popup menu item Table Layout for JSF component Table. In the list Selected select items TRIP.TRIPID, TRIP.PERSONID, TRIP.LASTUPDATED, click the button <, click OK

6. In the window Navigator select the created tripRowSet under tree node SessionBean1, use the popup menu item Edit SQL Statement.

7. In the Query Editor right click on the row PERSONID, select popup menu item Add Query Criteria

8. In the dialog Add Query Criteria click the radio-button Parameter. Click OK.
Perform Save All, close Query Editor.

5. In the dialog Table Layout items TRIP.TRIPID, TRIP.PERSONID, TRIP.LASTUPDATED will be moved from a list Selected to a list Available.
JSF component Table will contain columns DEPDATE, DEPCITY, DESTCITY, TRIPTYPEID on Design View.

8. View of JSF component Table shouldn't be changed on Design View. It should still contain the following columns: DEPDATE, DEPCITY, DESTCITY, TRIPTYPEID.

check-impact-{CRS}-query_editor-
JSF_Table_layout
Check that modification of a CachedRowSet SQL statement in Query Editor won't damage a layout of a JSF component Table

1. Perform test check-impact-{CRS}-sql_parameter-JSF_Table_layout (steps 1÷6)

7. In the Query Editor unmark all checkboxes in the table column Output and then mark them again.
Perform Save All, close Query Editor.

5. In the dialog Table Layout items TRIP.TRIPID, TRIP.PERSONID, TRIP.LASTUPDATED will be moved from a list Selected to a list Available.
JSF component Table will contain columns DEPDATE, DEPCITY, DESTCITY, TRIPTYPEID on Design View.

7. View of JSF component Table shouldn't be changed on Design View. It should still contain the following columns: DEPDATE, DEPCITY, DESTCITY, TRIPTYPEID.

change-{CRS}-for-{DPr} Change CachedRowSet for DataProvider.

1. Create new Visual Web Pack project.

2. Perform test connect-DB-Derby

3. In the window Services expand the tree subnode Tables under the created DB Derby connection. Select a DB table PERSON. DnD it on Design View of Page1.

4. In palette Basic of the window Palette select JSF component Table. DnD it on Design View.

5. In the window Services select a DB table TRIP. DnD it on JSF Table, placed on Design View.

6. In the window Navigator select the created tripDataProvider.
In the window Properties change value of property cachedRowSet from tripRowSet to personRowSet.

7. Click Continue.

8. In the window Navigator select the created tripDataProvider.
In the window Properties change value of property cachedRowSet from personRowSet to tripRowSet.

3. In the window Navigator 2 new tree subnodes should appear:

  • personRowSet (under tree node SessionBean1)
  • personDataProvider (under tree node Page1)

5. In the window Navigator 2 new tree subnodes should appear:

  • tripRowSet (under tree node SessionBean1)
  • tripDataProvider (under tree node Page1)

7. Component Error-page should be displayed instead of correct Design View. It should contain messages:
Cannot display the table1 component...
Error message from the component: javax.faces.FacesException: javax.el.ELException:
javax.faces.el.PropertyNotFoundException: javax.el.PropertyNotFoundException:
java.lang.IllegalArgumentException: TRIPID

8. Correct Design View should be restored.

rename-{CRS}-for-{DPr} Rename CachedRowSet for DataProvider.

1. Perform test create-{CRS}/{DPr}-Design_View (steps 1÷4).

2. In the window Navigator select created <DBTableName>RowSet.
In the window Properties change a value of a property id to renamedRowSet

3. In the window Navigator select created <DBTableName>DataProvider to check its property.

4. Switch from Design View to Java Editor to check java code of Page1.java.

2. In the window Navigator name of selected CachedRowSet-subnodes should be changed properly.

3. In the window Properties a value of a property cachedRowSet should be renamedRowSet.

4. The method _init() should contain a line with correct new name of CachedRowSet:
<DBTableName>DataProvider.setCachedRowSet(...getValue("#{SessionBean1.renamedRowSet}"));

bind-JSF_component-{DPr}-1 Bind JSF component, which can accept several rows of DB table, to DataProvider, using DnD DB table on JSF component

1. Perform test connect-DB-...

2. Create new Visual Web Pack project.

3. In palette Basic of the window Palette select JSF component Table (Drop Down List, Listbox).
DnD it on Design View.

4. In the window Services select a DB table-subnode under tree node <DB_connection>| Tables.
DnD selected DB table on JSF component, placed on Design View.

5. Run project.

4. In the window Navigator appropriate tree subnodes for new created CachedRowSet and DataProvider should appear.

5. Data of DB table should be displayed in web-browser correctly.

bind-JSF_component-{DPr}-2 Bind JSF component, which can accept only 1 row of DB table, to DataProvider, using DnD DB table on JSF component

1. Perform test connect-DB-...

2. Create new Visual Web Pack project.

3. In palette Basic of the window Palette select JSF component Text Field (Static Text, Button, Checkbox, Text Area, Radio Button, ...).
DnD it on Design View.

4.1 For Text Field, Static Text, Button, ...
In the window Services select a DB table-subnode under tree node <DB_connection>| Tables.
DnD selected DB table on JSF component, placed on Design View.

4.2 For Checkbox, Radio Button, ...
In the window Services select a DB table-subnode under tree node <DB_connection>| Tables.
DnD selected DB table on JSF component, placed on Design View.
Call popup menu for the JSF component, select the menu item Property Bindings.
In the appeared dialog select the property label in the list Select bindable property.
In the list Select binding target expand the appropriate {DPr} and select the appropriate property, related to required DB table column (for example, key:PERSON.NAME String).

5. Run project.

4. In the window Navigator appropriate tree subnodes for new created CachedRowSet and DataProvider should appear.

5. Data of the appropriate DB table column and single DB table row should be displayed in web-browser correctly for this JSF component.

bind-JSF_component-{DPr}-3 Bind JSF component to DataProvider, using popup menu

1. Perform test connect-DB-...

2. Create new Visual Web Pack project.

3. In palette Basic of the window Palette select JSF component Table (Drop Down List, Listbox).
DnD it on Design View.

4. In the window Services select a DB table under tree node <DB_connection>| Tables.
DnD selected DB table on Design View.

5. Use popup menu item Bind to Data...
In the dialog Bind to Data (for Drop Down List, Listbox select tab Bind to Data Provider) select a name of new created DataProvider in combo-box Get Data From (for Drop Down List, Listbox - in combo-box Choose a Data Provider to bind to).
Click OK

6. Run project.

4. In the window Navigator appropriate tree subnodes for new created CachedRowSet and DataProvider should appear.

5. For JSF component Table list Selected should include all columns of DB table, coresponding to DataProvider.
For JSF components Drop Down List, Listbox lists Value field and Display field should include all columns of DB table, coresponding to DataProvider.
Only one item should be selected in each of these lists.

6. Data of DB table should be displayed in web-browser correctly.

add-data-DB_table Insert rows into DB table, which contains columns with main data types: INTEGER, DECIMAL, FLOAT, VARCHAR, DATE, BLOB

1. Perform test connect-DB-...

2. Create new DB table, which contains columns with main data types: INTEGER, DECIMAL, FLOAT, VARCHAR, DATE, BLOB.

3. Create new Visual Web Pack project.

4. In the window Services select new created DB table-subnode under tree node <DB_connection>| Tables and DnD it on Design View.

5. Put on Design View some JSF components (for example, Text Field, Button, etc.), which give an user opportunity to input desired data for new row of DB table.
Add necessary java code into Page1.java, which will add given data to DB table (like as it's described in the tutorial Performing Inserts, Updates, and Deletes).

6. Run project.

6. Deployed web-application should work correctly: new rows with data of all mentioned types should be added to DB table properly.

resolve-data_source-problem Resolve project troubles, related to undefined data source (unexisting DB connection).

1. Perform test connect-DB-...

2. Create new Visual Web Pack project.
In palette Basic of the window Palette select JSF component Table and DnD it on Design View.

3. In the window Services select a DB table under tree node <DB_connection>| Tables and DnD it on JSF component Table, placed on Design View.

4. In the window Services select the used DB connection-subnode under tree node Databases, disconnect (test disconnect-DB) and delete it (test delete-DB_connection).

5. Click Close in the appeared dialog.

6. In the window Projects select project root tree node and use the popup menu item Resolve Datasource Problem...

7. Select JNDI-name of undefined DB connection in the list and click Add Connection...

8. Repeat the step #1.
Click OK in the dialog Resolve Data Sources.

3. In the window Navigator appropriate tree subnodes for new created CachedRowSet and DataProvider should appear.

4. Warning-dialog with message should appear:
One or more projects use database connections that have not been registered. Right-click the project in the Projects window and choose Resolve Data Source Problem to help register database connections.

5. In the window Projects root tree node with project name should be red and have an icon with a mark of exclamation.
Under root tree node should be red tree node Data Source References. It should contain a subnode with JNDI-name of undefined DB connection.

6. The dialog Resolve Data Sources should appear.

7. The dialog New Database Connection should appear.

8. In the window Projects root tree node with project name and tree subnode Data Source References shouldn't be red.
Root tree node with project name shouldn't have popup menu item Resolve Datasource Problem....

check-project-data_source-impact Check cross impact of 2 simultaneously opened projects, using data sources (DB connections), when one of these 2 data sources is removed.

1. Perform test resolve-data_source-problem (steps 1÷3) for the 1st Visual Web Pack project.

2. Perform test resolve-data_source-problem (steps 1÷5) for the 2nd Visual Web Pack project.

3. In the window Projects close both projects.

4. Open 2 created projects, using main menu item File | Open Project....

5. Select Page1 of the 1st project.

6. Select Page1 of the 2nd project.

5. Correct JSF component Table should be displayed on Design View.

6. Component Error-page should be displayed. It should contain messages:
Cannot display the table1 component...
Error message from the component: javax.faces.FacesException: javax.el.ELException:
javax.faces.el.PropertyNotFoundException: ...

Revision History

Author Date Description
Alex Petrov 07/05/2007  
Alex Petrov 09/04/2007  
Alex Petrov 10/22/2007 New test case, which covers the scenario of the bug 119529 has been added.

Project Features

About this Project

QA was started in November 2009, is owned by Jiří Kovalský, and has 97 members.
By use of this website, you agree to the NetBeans Policies and Terms of Use (revision 20160708.bf2ac18). © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo
 
 
Close
loading
Please Confirm
Close