Web Services Editor Support Test Specification

Author: Jindrich Sedek
Version: 1.7
Last update: 2006/07/03
Introduction: This test specification is focused on testing Web Service support in Java editor which features code verification, error highlighting, hints or code completion of JSR 181 annotations.
Comment: Please note that execution of the following tests requires GlassFish application server installed on your computer.

Table of Contents

Test suite 1: Code verification

Purpose: This test suite checks that error highlighting and annotations work correctly.
Setup: No special setup is required for this test suite. Just follow all the test cases stated below.

#Test caseDescription
1Register application server
  1. Download latest milestone build of GlassFish application server.
  2. Unzip it by java -Xmx256m -jar filename.jar command and install by ant -f setup.xml command.
  3. Launch NetBeans 5.5 and switch to Runtime tab.
  4. Right click Servers node and select Add Server... from popup menu.
  5. Setup GlassFish Application Server as Name and push Next button.
  6. Use Browse... to point to GlassFish installation directory and press Finish.
RESULT:
GlassFish Application Server node shows up under Servers node.
2Create EJB module
  1. Invoke File|New Project... from main menu.
  2. Select Enterprise category and EJB Module project type. Push Next > button.
  3. Make sure GlassFish Application Server is selected and push Finish button.
RESULT:
New EJBModule1 project node shows up in Projects tab.
3Create WSDL file
  1. Invoke File|New File... from main menu.
  2. Select Web Services category and WSDL File file type. Push Next > button.
  3. Type web\WEB-INF into Folder field and push Finish button.
RESULT:
New WSDL file gets created under Source Packages together with wsdl folder.
4Create web service
  1. Invoke File|New File... from main menu.
  2. Select Web Services category and Web Service file type. Push Next > button.
  3. Type test into Package field and push Finish button.
RESULT:
New web service gets created under Source Packages together with its test package.
5Error highlighting
  1. Type serviceName="ms" between parenthesis at line 23.
  2. Change declaration of NewWebService from class to interface at line 24.
  3. Now set your cursor at position 23:30.
RESULT:
Code serviceName="ms" at line 23 gets underlined because of WS error. Besides, red square appears instead of line number. If you point your mouse to that icon The serviceName attribute is not allowed on interfaces message shows up.
Similar error is annotated at next line 24. In addition to that both two errors must be visible in error stripe.

Test suite 2: Code completion

Purpose: This test suite checks that code completion of web service annotations works.
Setup: No special setup is required for this test suite. Just follow all the test cases stated below.
test / TestWebService.java

#Test caseDescription
1Annotations
  1. Use CTRL+Z to undo both changes done in the previous test case.
  2. Create new line 24 above class declaration and type @. Press CTRL+Space.
  3. Code completion shows up. Make sure that it suggests at least the following annotations: WebService (javax.jws), WebParam (javax.jws), HandlerChain (javax.jws)and SOAPBinding (javax.jws.soap).
  4. Type H to reduce list of suggestions to single item HandlerChain (javax.jws). Javadoc window shows online documentation for the selected item. Press Enter.
RESULT: The code is completed to @HandlerChain() and import javax.jws.HandlerChain; statement gets added to imports section.
2Attributes
  1. While having cursor between parenthesis at position 25:15 i.e. @HandlerChain(|) press CTRL+Space.
  2. Code completion shows up suggesting two attributes file and name. Type fil to reduce list to only single file item and press Enter.
RESULT: Instant substitution completes the statement to @HandlerChain(file=).
3Values
  1. Create new line 26 above class declaration and type @WebParam(header=|). Then press CTRL+Space.
  2. Code completion suggests false and true. Select the latter and press Enter.
  3. The statement is completed to @WebParam(header=true).
  4. Press CTRL+Z and replace header attribute by mode.
  5. While having @WebParam(mode=|) in editor press CTRL+Space. IN, INOUT and OUT modes are suggested. Type O character. List of possibilities is reduced to two items starting with O. Press Enter.
RESULT: Now you have @WebParam(mode=Mode.OUT) in editor. Besides corresponding import javax.jws.WebParam.Mode; statement was added automatically in the code above.
4File selection
  1. While having cursor between quotation marks at position 26:21 i.e. @HandlerChain(file="|") press CTRL+Space.
  2. Code completion suggests web service as and its parent folder. Press Enter and CTRL+Space. Now select test/, press Enter and CTRL+Space again. Instant substitution completes the statement to @HandlerChain(file="../test/NewWebService.java")
  3. Type wsdlLocation="" between parenthesis at line 25.
  4. While having cursor between quotation marks at position 25:26 i.e. @WebService(wsdlLocation="|") press CTRL+Space.
  5. Instant substitution is performed to expand path to "file://|". Use code completion further to select the WSDL file created in the first suite.
RESULT: You should be able to browse to desired file. In the end the statement must be @WebService(wsdlLocation="file://../wsdl/newWSDL.wsdl").

Test suite 3: Editor hints

Purpose: This test suite checks that error hints work correctly suggesting appropriate solutions to make user code WS compliant.
Setup: No special setup is required for this test suite. Just follow all the test cases stated below.

#Test caseDescription
1Endpoint interface forbidden
  1. Replace the whole content of NewWebService.java file by endpointInterface_forbidden.txt file.
  2. Two errors show up. Point with your mouse at red square at line 7. The endpointInterface attribute is not allowed on interfaces error message is displayed.
  3. Place cursor at line 7 and press Alt+Enter. Select Remove endpointInterface attribute hint and press Enter.
RESULT: Forbidden attribute is removed so that you have only @WebService at line 7.
2Exceptions forbidden
  1. Replace the whole content of NewWebService.java file by exceptions_forbidden.txt file.
  2. One error shows up. Point with your mouse at red square at line 11. An operation marked @Oneway must not declare any exception error message is displayed.
  3. Place cursor at line 11 and press Alt+Enter. Select Remove @Oneway annotation hint and press Enter.
RESULT:The line 11 is deleted and source has no errors.
3Handlers conflict
  1. Replace the whole content of NewWebService.java file by handlers_conflict.txt file.
  2. One error and 3 warnings show up. Point with your mouse at red square at line 10. It is not allowed to combine @HandlerChain annotation with @SOAPMessageHandlers annotation error message is displayed.
  3. Place cursor at line 10 and press Alt+Enter. Two hints are suggested. Select Remove @HandlerChain annotation hint and press Enter.
RESULT: The line 10 is deleted and source has no errors. Test that second hint works as expected too.
4I/O parameters forbidden
  1. Replace the whole content of NewWebService.java file by io_parameters_forbidden.txt file.
  2. Two errors show up. Point with your mouse at red square at line 13. An operation marked @Oneway must not have out/in-out parameters error message is displayed.
  3. Place cursor at line 13 and press Alt+Enter. Select Remove @Oneway annotation hint and press Enter.
RESULT: The line 13 is deleted. Do the same for the second error until source has no errors.
5Return value forbidden
  1. Replace the whole content of NewWebService.java file by return_value_forbidden.txt file.
  2. One error shows up. Point with your mouse at red square at line 11. An operation marked @Oneway must not have a return value error message is displayed.
  3. Place cursor at line 11 and press Alt+Enter. Select Remove @Oneway annotation hint and press Enter.
RESULT:The line 11 is deleted and source has no errors.
6Service name forbidden
  1. Replace the whole content of NewWebService.java file by serviceName_forbidden.txt file.
  2. Two errors show up. Point with your mouse at red square at line 7. The serviceName attribute is not allowed on interface error message is displayed.
  3. Place cursor at line 7 and press Alt+Enter. Select Remove serviceName attribute hint and press Enter.
RESULT: Forbidden attribute is removed so that you have only @WebService at line 7.
7Add new operation
  1. Replace the whole content of NewWebService.java file by add_operation.txt file.
  2. One error shows up. Point with your mouse at red square at line 6. A webservice must have at least one operation error message is displayed.
  3. Place cursor at line 6 and press Alt+Enter. A Hint is suggested. Press Enter.
  4. Add Operation dialog is invoked. Press Enter.
RESULT: New Web service opperation is added, javax.jws.WebMethod is imported and source has no errors.

Generated: 2006 07 21 01:49

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