TS 61 WebServicesConsumptionTestSpecification

Web Services Consumption Test Specification

Author: Roman Mostyka
Revision: Martin Fousek
Features to be tested: Features that will be Implemented and Tested for LongFin Release

  • Testing Interface for Web Services
  • Adding WebService to Services Tab
  • Viewing a Web Service WSDL file
  • Adding Web Service to Visual Web JSF Projects
  • Binding WebService with components via DataProviders
  • Using Web Service from Java code

Approach refinements: This exercise would comprise of :

  • Identifying a list of web services that can be used by this testing
  • Identifying features that need to be tested/verified by this testing
  • Identifying difference between web services for J2EE 1.4 (JAX-RPC) and for Java 5 EE (JAX-WS)

Related documentation:
Web Services Node
Web Service Public Contracts
VWP Web Service consumer
Web Services(info)
Web Services User Doc(info)

Contents


Test suite: Add W/S using URL

Setup: Instaled NetBeans IDE with opened Service Tab

  1. Add new correct W/S (no proxy)
    • }}note ENV NEEDS: Should be used direct Internet connection or W/S located in the local network }}
    1. Switch to "Services" tab
    2. Services -> Web Services -> Add Web Service
    3. Enter valid URL in the input text field with WSDL URL label (for example http://www.webservicemart.com/uszip.asmx?WSDL)
    4. Click Add button
    • EXPECTED RESULT: Corresponding node for W/S appears in the Services window
  2. Add new correct W/S (proxy)
    • }}note ENV NEEDS: Needs valid proxy server in the local network }}
    1. Switch to "Services" tab
    2. Services -> Web Services -> Add Web Service
    3. Click Set Proxy... and enter correct proxy and port values
    4. Enter valid URL in the input text field with WSDL URL label (for example http://www.webservicemart.com/uszip.asmx?WSDL)
    5. Click Add button
    • EXPECTED RESULT: Corresponding node for W/S appears in the Services window
  3. Incorrect URL (no proxy)
    1. Switch to "Services" tab
    2. Services -> Web Services -> Add Web Service
    3. Enter valid URL in the input text field with WSDL URL label (for example http://bla.bla.com/bla.wsdl)
    4. Click Add button
    5. Click on the added W/S
    • EXPECTED RESULT: Information dialog appears with message that specified W/S can't be added (Server returned HTTP response code: 504 for URL)
  4. Incorrect URL (proxy)
    1. Services -> Web Services -> Add Web Service
    2. Click Set Proxy... and enter correct proxy and port values
    3. Enter valid URL in the input text field with WSDL URL label (for example http://bla.bla.com/bla.wsdl)
    4. Click Add button
    • EXPECTED RESULT: Information dialog appears with message that specified W/S can't be added (Server returned HTTP response code: 504 for URL)
  5. Cancel action
    1. Services -> Web Services -> Add Web Service
    2. Click Set Proxy... and enter correct proxy and port values
    3. Enter valid URL in the input text field with WSDL URL label (for example http://www.webservicemart.com/uszip.asmx?WSDL)
    4. Click Add button
    • EXPECTED RESULT: No new node appears in the Services window
  6. Package validation (valid package name)
    1. Services -> Web Services -> Add Web Service
    2. Click Set Proxy... and enter correct proxy and port values
    3. Enter valid URL in the input text field with WSDL URL label (for example http://www.webservicemart.com/uszip.asmx?WSDL)
    4. Click Add button
    5. Delete added W/S
    6. Services->Web Services->Add Web Service
    7. Enter valid URL in the input text field with WSDL URL label (for example http://www.webservicemart.com/uszip.asmx?WSDL)
    8. In Package Name input text field type package name different from default
    9. Click Add button
    • EXPECTED RESULT: After step 3) new node for W/S appears in the Services. Look at sources: W/S should have default package ("websvc")
      After step 8) new node for W/S appears in the Services. Look at sources: W/S should have specified package (the package you can verify here for example: c:\Documents and Settings\Administrator\.netbeans\dev\config\WebServices\uszip-asmx\jaxws\src\NameOfPackageWS\)
  7. Package validation (invalid package name)
    1. Services -> Web Services -> Add Web Service
    2. Enter valid URL in the input text field with WSDL URL label (for example http://www.webservicemart.com/uszip.asmx?WSDL)
    3. In Package Name input text field type invalid package name (for example beginning form digit: "1websvc")
    4. Click Add button
    • EXPECTED RESULT: The Add button should be disabled
  8. Package validation (empty package name)
    1. Services -> Web Services -> Add Web Service
    2. Enter valid URL in the input text field with WSDL URL label (for example http://www.webservicemart.com/uszip.asmx?WSDL)
    3. In Package Name input text field type invalid package name (for example beginning form digit: "1websvc")
    4. Click Add button
    • EXPECTED RESULT: The W/S should be added but in no package.
  9. Help system
    1. Services -> Web Services -> Add Web Service
    2. Click Help button
    • EXPECTED RESULT: Help window 'Add Web Service Dialog Box' will appear
  10. Help system using shortcut
    1. Services -> Web Services -> Add Web Service
    2. Press F1 key
    • EXPECTED RESULT: Help window 'Add Web Service Dialog Box' will appear
  11. Add already existing W/S
    1. Services -> Web Services -> Add Web Service
    2. Check that it appears under Web Services node
    3. Try to add a new W/S using the same URL
    • EXPECTED RESULT: The Web Service should be updated (recompiled).


Test suite: Add W/S using local WSDL file

Setup: Go to the some URL for getting WDSL file (for example: http://www.webservicex.net/whois.asmx?wsdl). View Page Source in browser and then save page as ".wdsl" file.

  1. Add W/S using valid WSDL file
    • }}note ENV NEEDS: Should have a correct WSDL file }}
    1. Services->Web Services->Add Web Service
    2. Choose Local File radio button
    3. Click Browse button and select correct WSDL file
    4. Click Open button
    5. Click Add button
    • EXPECTED RESULT: Corresponding node for W/S appears in the Services window.
  2. Use incorrect or broken WSDL file
    • }}note ENV NEEDS: Should have a incorrect WSDL file }}
    1. Services->Web Services->Add Web Service
    2. Choose Local File radio button
    3. Click Browse button and select any but not WSDL file
    4. Click Open button
    5. Click Add button
    • EXPECTED RESULT: Information message with message that WSDL model cannot be generated appears.
  3. Use not existing file
    1. Services->Web Services->Add Web Service
    2. Choose Local File radio button
    3. Type anything in the Local File input text field
    4. Click Add button
    • EXPECTED RESULT: When the path is nonexistent the Add button is disabled. If you wrote path to some file (not wsdl, wadl file], the W/S should be not added.
  4. Cancel action
    1. Services->Web Services->Add Web Service
    2. Choose Local File radio button
    3. Click Browse button and select any but not WSDL file
    4. Click Open button
    5. Click Cancel button
    • EXPECTED RESULT: No new node appears in the Services window.
  5. Add another instance of the same W/S
    1. Add any W/S using correct local file
    2. Check that it appears under Web Services node
    3. Try to add a new W/S using the same local file
    • EXPECTED RESULT: The Web Service should be updated (recompiled).


Test suite: Add special types of Web Services

  1. Web Service with two ports
    1. Services->Web Services->Add Web Service
    2. Enter valid URL for W/S with two ports in the input text field with WSDL URL label (for example: http://www.webservicex.net/BibleWebservice.asmx?wsdl)
    3. Push Add button
    • EXPECTED RESULT: New node appears in the Services. Rightclick on this node and choose View WSDL. In opened file should be more definitions of wsdl:port. In WSDL tab should be more Port Types
  2. Web Service with the error in the definition
    1. Services->Web Services->Add Web Service
    2. Enter valid URL for W/S with error in definition in the input text field with WSDL URL label
    3. Push Add button
    • EXPECTED RESULT: Information message with message that WSDL model cannot be generated appears.


Test suite: Other operations with W/S

  1. Test Method with simple result Execution
    • }}note ENV NEEDS: It's necessary to set a proxy setting in the Options if the machine behind a firewall}}
    1. Internet connection should be available
    2. Explore Web Service to see method's nodes
    3. Rightclick method and select Test Method
    4. Enter necessary values to parameters
    5. Push Submit
    • EXPECTED RESULT: After step 3) Test Web Service Method dialog appears. After step 4) new value appears in the Results list.
  2. Test Method with no internet connection
    1. No Internet connection should be available (wrong proxy setting behind a firewall)
    2. Explore Web Service to see method's nodes
    3. Rightclick method and select Test Method
    4. Enter necessary values to parameters
    5. Push Submit
    • EXPECTED RESULT: After step 3) 'Test Web Service Method' dialog appears. After step 5) 'Exception' dialog should be visible.
  3. Help button
    1. No Internet connection should be available (wrong proxy setting behind a firewall)
    2. Explore Web Service to see method's nodes
    3. Rightclick method and select Test Method
    4. Enter necessary values to parameters
    5. Push Help button
    • EXPECTED RESULT: After step 5) Help window shoud appear with the corresponding topic.
  4. Help system using keyboard shortcut
    1. No Internet connection should be available (wrong proxy setting behind a firewall)
    2. Explore Web Service to see method's nodes
    3. Rightclick method and select Test Method
    4. Enter necessary values to parameters
    5. Press F1 button
    • EXPECTED RESULT: After step 5) Help window shoud appear with the corresponding topic.


Test suite: Web Services Group

  1. Create a new W/S group
    1. Services -> Web Services -> Add Web Service
    • EXPECTED RESULT: New Webservice Group added under Web Services node.
  2. Rename W/S group
    1. Services -> Web Services -> Create Group
    2. Select New Webservice Group node and perform Rename... popup action
    3. Enter new name for W/S group
    4. Press OK
    • EXPECTED RESULT: W/S group node has a new name, all web services added before still exist under this node.
  3. Cancel Rename W/S group action
    1. Services -> Web Services -> Create Group
    2. Select New Webservice Group node and perform Rename... popup action
    3. Enter new name for W/S group
    4. Press Cancel
    • EXPECTED RESULT: Rename dialog disappears, node still have previous name.
  4. Delete W/S group
    1. Services -> Web Services -> Create Group
    2. Select New Webservice Group node and perform Delete popup action
    3. Press OK
    • EXPECTED RESULT: New Webservice Group node disappears, all web services added before to this group disappears too.
  5. Cancel Delete W/S group action
    1. Services -> Web Services -> Create Group
    2. Select New Webservice Group node and perform Delete popup action
    3. Press Cancel
    • EXPECTED RESULT: New Webservice Group node still exists, all web services added before exist too.
  6. Add W/S to the group
    1. Services -> Web Services -> Create Group
    2. Select New Webservice Group node and perform Add Web Service action
    3. Perform steps from Add W/S to the Services part to add W/S
    • EXPECTED RESULT: New W/S appears under group node.
  7. Remove W/S from the group
    1. Services -> Web Services -> Create Group
    2. Select New Webservice Group node and perform Add Web Service action
    3. Perform steps from Add W/S to the Servers part to add W/S
    4. Select new node and perform Delete action
    • EXPECTED RESULT: After step (3) new W/S appears under group node. After step (4) this node disappears.
  8. Delete multiple W/S groups
    1. Services -> Web Services -> Create Group
    2. Repeat step 1) multiple times
    3. Select all created groups and perform Delete popup action
    • EXPECTED RESULT: All selected groups should be deleted.
  9. Move W/S from one group to another
    1. Services -> Web Services -> Create Group
    2. Select New Webservice Group node and perform Add Web Service action
    3. Perform steps from Add W/S to the Servers part to add W/S
    4. Services -> Web Services -> Create Group
    5. DnD added W/S from one W/S group to another
    • EXPECTED RESULT: W/S node should be moved.


Test suite: View WSDL Feature Tests

  1. Menu Pick Enabled WITHOUT Project Open
    1. Make sure all projects are closed
    2. Rightclick Services -> Web Services -> Add -> W/S node
    • EXPECTED RESULT: The context menu should have View WSDL enabled.
  2. Menu Pick Enabled WITH Project Open
    1. Make sure all projects is opened
    2. Rightclick Services -> Web Services -> Add -> W/S node
    • EXPECTED RESULT: The context menu should have View WSDL enabled.
  3. Open Local WSDL File
    1. Services -> Web Services -> Add Web Service
    2. Choose local file: and hit the browse button
    3. Choose the local WSDL file
    4. Add the web service
    5. Rightclick Services -> Web Services -> W/S
    6. Choose View WSDL
    • EXPECTED RESULT: The contents of the appropriateWSDL file should be displayed.
  4. Open Local WSDL File That Has Been Removed
    1. Services -> Web Services -> Add Web Service
    2. Choose Local File radio button
    3. Click Browse button and select any but not WSDL file
    4. Click Open button
    5. Click Add button
    6. Remove WSDL file
    7. Rightclick Services -> Web Services -> W/S
    8. Choose View WSDL
    • EXPECTED RESULT: The WSDL file should be displayed (because the file is saved in ...netbeans\dev\config\WebServices\uszip-wsdl\catalog\ )
  5. Open Remote WSDL File
    1. Services -> Web Services -> Add Web Service
    2. Enter valid URL in the input text field with WSDL URL label (for example http://www.webservicemart.com/uszip.asmx?WSDL)
    3. Click Add button
    4. Rightclick Services -> Web Services -> W/S
    5. Choose View WSDL
  6. Open Remote WSDL File Without Setting the Proxy Settings
    1. Services -> Web Services -> Add Web Service
    2. Enter valid URL in the input text field with WSDL URL label (for example http://www.webservicemart.com/uszip.asmx?WSDL)
    3. Click Add button
    4. Clear proxy settings of IDE
    5. Rightclick Services -> Web Services -> W/S
    6. Choose View WSDL
    • EXPECTED RESULT: The WSDL file should be displayed (because the file is saved in ...netbeans\dev\config\WebServices\uszip-wsdl\catalog\ )
  7. View WSDL on multiple WS nodes
    1. Select multiple W/S nodes.
    2. Rightclick and select View WSDL
    • EXPECTED RESULT: WSDL files for selected W/S should be opened.
  8. View WSDL menu action not on webservice leaf nodes
    1. Rightclick Web Services Methods node, Web Services Group node
    • EXPECTED RESULT: Verify that View WSDL context menu action is not present on web service leaf nodes , Web Services Module node, Web Services Group node.
  9. WSDL file in Editor Pane
    1. Services -> Web Services -> Add Web Service
    2. Enter valid URL in the input text field with WSDL URL label (for example http://www.webservicemart.com/uszip.asmx?WSDL)
    3. Click Add button
    4. Rightclick Services -> Web Services -> W/S
    5. Choose View WSDL
    • EXPECTED RESULT: Opening/View WSDL file should set the focus on Open. Should be scrollable (fully viewable), editable. Editor Tab shows up with appropriate icon


Test suite: Add W/S To Project

Setup: All projects in this testing area must be Visual Web JSF (Invoke "New Project", "Web" -> "Web Application", three times Next, check "Visual Web JavaServer Faces", Finish).

  1. Add W/S using Drag & Drop
    • }}note NOTE: Use steps from Add W/S using URL to add a valid web service. }}
    1. Drag W/S from Servers window to the Form Designer
    • EXPECTED RESULT: Library References of Project should have a new node Web Service - NameService with the reference to the corresponding jar file. Page1 of Navigator should have a reference to the W/S client Java bean file should have corresponding import for the webservice.
  2. Remove W/S from Project
    1. Select existing W/S in the Navigator window and perform Delete popup action
    • }}note NOTE: Web Service JARS are not being deleted from project. Not implemented yet. }}
    • EXPECTED RESULT: Corresponding library reference should be removed from the Library References. WS client should be removed from Navigator. Corresponding import should be removed from the Java bean file.
  3. Remove W/S from Project
    1. Select existing W/S in the Navigator and perform Delete using delete key
    • }}note NOTE: Web Service JARS are not being deleted from project. Not implemented yet. }}
    • EXPECTED RESULT: Corresponding library reference should be removed from the Library References. WS client should be removed from Navigator. Corresponding import should be removed from the Java bean file.
  4. Rename W/S id
    1. Select existing W/S in the Navigator
    2. In the Property Window change id property
    • EXPECTED RESULT: W/S name should be changed in Navigator.
  5. Verify Cut/Copy/Paste operations for W/S icon in tray
    1. Add some W/S to the webform
    2. Click for popup on W/S icon in Navigator window and try to Cut/Copy/Paste W/S - W/S can be paste on node "Page1"
    • EXPECTED RESULT: All operations should work.
  6. Verify Ctrl+X/Ctrl+C/Ctrl+V for W/S icon in tray
    1. Add some W/S to the webform
    2. Select W/S icon in tray and try to Cut/Copy/Paste W/S using keyboard shortcuts (Ctrl+X/Ctrl+C/Ctrl+V )
    • EXPECTED RESULT: All operations should work.
  7. Verify that Web Service Support Libraries are not included in project w/o any web service added
    1. Create a new project
    2. From Project tab, expand Library -> Web Service Support
    • EXPECTED RESULT: There should be no previously added Web Service support - libraries/jars.



Test suite: Data Binding with W/S

Setup: All projects in this testing area must be Visual Web JSF (Invoke "New Project", "Web" -> "Web Application", three times Next, check "Visual Web JavaServer Faces", Finish).

  1. Bind to complex data type using Bind to Data
    1. Add some WS (for example: http://www.webservicemart.com/uszip.asmx?WSDL)
    2. D&D Table
    3. D&D W/S over some table field for binding data
    4. Supply necessary parameters (ZIP code)
    5. Run
    • EXPECTED RESULT: Should be able to browse the result data.
  2. Bind to primitive data type using Property Binding
    1. D&D staticText
    2. Do Bind to Data/Bind to Data Provider/ the_web_service -> click OK
    3. Run
    • EXPECTED RESULT: Should be able to browse the result data.


Test suite: Using W/S from Java code

Setup: All projects in this testing area must be Visual Web JSF (Invoke "New Project", "Web" -> "Web Application", three times Next, check "Visual Web JavaServer Faces", Finish).

  1. Use W/S from Java code
    1. Add some W/S
    2. DnD this W/S to the page
    3. DnD Static Text component to the page
    4. In prerender() method call some of W/S method (for example D&D W/S into method prerender()) and use static text for output (in Design rightclick on Static Text component and click on Add Binding Attribute, look for id this component and in prerender() write ID_Of_Static_Text.setText(output from the W/S))
    5. Run
    • EXPECTED RESULT: Should be able to browse the result data.


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