TS 60 WSDesigner

Web Services Visual Designer Test Specification for "NetBeans 6.5"

Author: Jaroslav Pospisil
Version: 1.4
Estimated time: 1 hour
Last update: 22/10/2008
Introduction: This test specification covers the Web Services Visual Designer functionality in the IDE.
Comments: This specification covers current state of Web Services Designer (22/10/2008).
Some parts of the functionality are covered by automated test

Contents


Specification setup:

  • Start Netbeans IDE with clean userdir ( nb --userdir "your_userdir_path" ).
  • If you have installed full configuration of Netbeans with Glassfish v2 bundled, skip next phase ( you can check it in Services tab | Servers ).
    • Switch to Services tab and right-click on Servers node, select Add Server action.
    • Select Glassfish v2 and click Next__.
    • Click on Browse button next to Platform Location and select your Glassfish server installation folder.
    • Click Next and enter adminadmin in Password field.
    • Click Finish .
  • Click on File|New Project|Java Web|Web Application and then on Next button.
  • Left everything default, click Next again and then Finish.
  • Wait until new web application creates and scanning ends.
  • Right-click on new web project node in Projects tab and select New|Web Service.
  • Write TestWS in Web Service Name field and test in Package field.
  • Click on Finish and web service is created.In editor, default window opened for this web service is Source window.
  • Right-click on new web project node in Projects tab and select New|Web Service from WSDL.
  • Write TestWSfromWSDL in Web Service Name field and writetest.wsdl in Package field.
  • Click on Browse button and select location of wsdl file ( Download Here).
  • Click on Finish and web service from wsdl is created.In editor, default window opened for this web service is Source window.
  • Complete next steps for both cases - Web Service from Java (from scratch) and Web Service from WSDL.


Test suite: Preview WSDL functionality

Purpose: Test if works Preview WSDL functionality.
Setup: Continue where ends previous test suite.

  1. Switch to Preview tab
    1. Click on Preview button up on the multiview window toolbar.
    • {{result|EXPECTED RESULT: In case of Web Service from Java,you'll see empty tab with text: The WSDL preview can not be rendered,because Java source isn't valid.Please switch to Source or Design view and correct the source file. In case of Web Service from WSDL, you should see this result:


WSDLPreview

Test suite: Add Operation functionality

Purpose: Test if works Add operation functionality, the same way as if you add operation by right-clicking on web service node or from context menu in Source view.

  1. Add Operation Dialog
    1. Click on Add Operation button
    2. Left everything default and click OK
    • {{result|EXPECTED RESULT: In Operations window there should be new subwindow with name operation and four empty folders inside.See:
  
WSDesigner
  1. Check source code
    1. Click on Source button
    • EXPECTED RESULT: In Source window there should the same code as this:
/*
* TestWS.java
* 
* Created on 12.9.2007, 16:43:28
* 
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/

package test;

import javax.jws.WebMethod; import javax.jws.WebService;

/**

*
* @author [Your_login_name]
*/

@WebService() public class TestWS {

/**

    * Web service operation
    */
   @WebMethod(operationName = "operation")
   public String operation() {
       //TODO write your implementation code here:
       return null;
   }

}

  1. Check changes in Preview tab
    1. Click on Preview button up on the multiview window toolbar.
    • EXPECTED RESULT: In case of Web Service from Java,you'll see next:
  
WSDLPreview In case of Web Service from WSDL,WSDL code should be properly updated and operation visible.
  1. Add another operation
    1. Click on Add Operation button
    2. Change name to AddOp and click Add button to add default parameter
    3. Change parameter name to str by clicking into name field and changing the name
    4. After you changed parameter name, click on type field,but don't change it
    5. Click OK button
    • EXPECTED RESULT: In editor window there should be this result.See:
  
WSDesigner2ops
  1. Add operation dialog other functions
    1. Click on Add Operation button
    2. Change name to TestOp
    3. Click Add button to add default parameter
    4. Click Return Type field and change type to int
    5. Click Add button to add another parameter, but change its name to p1 and change its type to int and check Final
    6. Click Add button to add another parameter with name to p2 and change its type to Object
    7. Click Up button while p2 selected
    8. Click Down button while p2 selected
    9. Select parameter attribute and click Remove
    10. Click Exceptions folder and Add new exception
    11. You see empty line,so click there and change exception name to e1
    12. Add another exception e2
    13. Try click Up/Down as in previous case of parameters and finally remove e2
    14. Click OK button
    • EXPECTED RESULT: Controls should behave the way its labels says. Parameters and exceptions should be added,removed,changed order
    or edited according to actions, you're invoking.
  


Test suite: Remove Operation functionality

Purpose: Test if works Remove operation functionality.
Setup: Continue where ends previous test suite.

  1. Remove Operation
    1. Click on No parameters inside operation table
    2. Click on Remove Operation button
    3. In next window click Yes
    • EXPECTED RESULT: Operation is removed from the table and also from source code.In Preview tab you should also see WSDL code updated.Design window should look like this:


OpRemoved

Test suite: Refactoring

Purpose: Test if works Refactoring and changes in ws designer corresponds with changes in source code.
Setup: Continue where ends previous test suite.

  1. Operation name refactoring
    1. Double-click on AddOp string in title bar of operation table
    2. Editbox should appear and you can change operation name to ArithmeticOperation
    • EXPECTED RESULT: Switch to source view.Operation's source code should be changed this way (method name remains unchanged):

@WebMethod(operationName = "ArithmeticOperation")

   public String AddOp(@WebParam(name = "str")
   String str) {
       //TODO write your implementation code here:
       return null;
   }
  1. Parameter name refactoring
    1. Double-click on p1 string in TestWS table
    2. Editbox should appear and you can change parameter name to p1s1
    • EXPECTED RESULT: Switch to source view.Operation's source code should be changed this way (Only WebParam name is changed):
@WebMethod(operationName = "TestOp")
   public int TestOp(@WebParam(name = "p1s1")
   final int p1, @WebParam(name = "p2")



Test suite: Other functionality

Purpose: Test various buttons and other controls also in Designer.
Setup: Continue where ends previous test suite.

  1. Folders functionality
    1. Go to editor an select ArithmeticOperation table in Designer
    2. There should be selected Parameters folder
    3. Change Parameter name from str to text
    4. Click on Output folder and check there's java.lang.String value
    5. Click on Faults and check it's empty
    6. Now select TestOp table,click on Faults and check there's e1 listed
    7. Click on Description folder and change text to Operation for testing purposes.No output generated.
    • EXPECTED RESULT: All folders functionality should work as described.
  2. Buttons functionality
    1. Click on TestOp operation table in Designer
    2. Click on uparrow button in top right corner
    3. Operation table should be reduced to title only and button caption will change to downarrow
    4. Now click on downarrow - operation table restores to original state
    5. Each of other uparrow buttons should work the same way
    6. Select TestOp and click Out button immediately left from uparrow button in the tab. Result should look like this:
      OutHint
    7. Do the same with In button. result is another hint window:
      InHint
    8. Close both windows with cross and click on last button / first from left
    9. View for operation will change from folders view to table view
      View
    10. Click the same button again to return to folder view
    • EXPECTED RESULT: All functionality should behave as described
  3. Policy Configuration
    1. Three checkboxes serves only for purposes of setting additional features of web service.
    2. Click on Advanced button. WS Attributes window will open with Quality Of Service tab selected .
      WS Attributes window
    • EXPECTED RESULT: Checkboxes could be checked or unchecked. No source changes are involved.Advanced button works in the way described.
  4. Upper command bar
    1. Buttons for changing from Design to Source view - if you proceeded her through all previous steps,this works.
    2. Add Operation button - redundant another way to invoke Add operation window. This is also possible from Source view right-mouse context menu and from context menu for Web Service node in Projects tab.
    3. Resizing buttons - try each of them, resizing tables in window and finish with Fit Diagram button to restore original state
    • EXPECTED RESULT: Functionality should work as described.


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