Web Services Visual Designer Test Specification for "NetBeans 6.0"
Author: Jaroslav Pospisil
Version: 1.3
Estimated time: 30 minutes
Last update: 12/09/2007
Introduction: This test specification covers the
Web Services Visual Designer in the IDE.
Comments: This specification covers current state of Web Services Designer (10/07/2007).
Specification setup:
- Start Netbeans IDE with clean userdir ( nb --userdir "your_userdir_path" ).
- If you have installed Netbeans with Glassfish v2, 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|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 Visual Editor window.
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.
- Add Operation Dialog
- Click on Add Operation button
- Left everything default and click OK
- EXPECTED RESULT: In Operations window there should be new subwindow with name operation and four empty folders inside.See:
- Check source code
- 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;
}
}
- Add another operation
- Click on Add Operation button
- Change name to AddOp and click Add button to add default parameter
- Change parameter name to str by clicking into name field and changing the name
- After you changed parameter name, click on type field,but don't change it
- Click OK button
- EXPECTED RESULT: In editor window there should be this result.See:
- Add operation dialog other functions
- Click on Add Operation button
- Change name to TestOp
- Click Add button to add default parameter
- Click Return Type field and change type to int
- Click Add button to add another parameter, but change its name to p1 and change its type to int and check Final
- Click Add button to add another parameter with name to p2 and change its type to Object
- Click Up button while p2 selected
- Click Down button while p2 selected
- Select parameter attribute and click Remove
- Click Exceptions folder and Add new exception
- You see empty line,so click there and change exception name to e1
- Add another exception e2
- Try click Up/Down as in previous case of parameters and finally remove e2
- 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.
- Remove Operation
- Click on No parameters inside operation table
- Click on Remove Operation button
- In next window click Yes
- EXPECTED RESULT: Operation is removed from the table and also from source code.It should look like this:
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.
- Operation name refactoring
- Double-click on AddOp string in title bar of operation table
- 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;
}
- Parameter name refactoring
- Double-click on p1 string in TestWS table
- 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")