TS 71 SpringSupport

Spring Support Test Specification

Author: Andrei Badea, Jan Horvath, Jiri Skrivanek
Version: NetBeans 7.1
Last update: 11-th October 2011
Introduction: This document contains procedures for testing Spring Support.
Comments: Repeat tests for Maven project.


Test suite: Project support

  1. Create new project.
    1. Open new project wizard
    2. Select "Java Web|Web Application"
    3. Click Next and select project location
    4. Click Next and choose target server (add one if not ready)
    5. Click Next and select "Spring Web MVC" in Frameworks page
    6. Switch to Configuration tab and change Dispatcher Name and Dispatcher Mapping to e.g "dispatcher1" and "/app/*"
    7. Finish wizard
    • EXPECTED RESULT: Check the files were generated correctly: web/WEB-INF/applicationContext.xml, web/WEB-INF/dispatcher1-servlet.xml, web/redirect.jsp (containing a redirect to app/index), web/WEB-INF/jsp/index.jsp.
  2. Create controller
    1. Open new file wizard
    2. Choose "Spring Framework|Abstract Controller" and click Next
    3. Provide package name and finish the wizard
    4. Open new file wizard
    5. Choose "Spring Framework|Simple Form Controller" and click Next
    6. Provide package name and finish the wizard
    • EXPECTED RESULT: All files created successfully and source code doesn't contain parser errors.
  3. Run project
    1. Run created project (F6)
    • EXPECTED RESULT: Check that project is deployed and page at address WebApplication1/app/index is opened.
  4. Add framework to project.
    1. Create a new project as in previous test case but does not select any framework
    2. Right-click project root node and choose Properties
    3. Go to Frameworks category
    4. Click Add... button
    5. In "Add a Framework" dialog select "Spring Web MVC" and click OK
    • EXPECTED RESULT: Check the files were generated correctly: web/WEB-INF/applicationContext.xml, web/WEB-INF/dispatcher-servlet.xml, web/redirect.jsp (containing a redirect to index.htm), web/WEB-INF/jsp/index.jsp.
  5. Create Spring configuration file
    1. Open new file wizard
    2. Choose "Spring Framework|Spring XML Configuration file" and click Next
    3. Select web\WEB-INF folder and click Next
    4. Select some namespaces and click Finish
    • EXPECTED RESULT: Check that the file was generated correctly (it is a well-formed, selected namespace declarations are present).
  6. Modify configuration file groups
    1. Open project properties
    2. Go to "Spring Framework" category
    3. Check that 3 files are listed within Configuration Files tab
    4. Go to "Configuration File Groups"
    5. Click "Add Group", provide group name and click OK
    6. Click Add Files
    7. Select and check newSpringXMLConfig.xml and click OK
    8. Click OK in project properties
    9. Open project properties again
    10. Check that "Default Group" contains two files and newly created group one file.
    11. Remove file from group.
    12. Remove group.
    • EXPECTED RESULT: Every step was successful.

Test suite: Code Completion and Hyperlinking

  1. Code completion in configuration file
    1. Open new file wizard
    2. Create "Java|Java Class" file FooService in package org.example
    3. Open WEB-INF/applicationContext.xml
    4. insert <bean id="fooService" class="
    5. invoke code completion, select "org", type ".", select "example", type ".", select "FooService".
    6. alternately, type "FooS", invoke the code completion and select "FooService (org.example)". The whole class name should be completed.
    7. finish the bean definition to <bean id="fooService" class="org.example.FooService"/>
    8. in applicationContext.xml insert <bean id="foo" parent="
    9. invoke the code completion, select "fooService".
    10. finish the bean definition to <bean id="foo" parent="fooService"/>
  2. Hyperlinking
    1. Press Ctrl and move cursor over parent="fooService"
    2. Click mouse button to follow hyperlink
    3. Check cursor moved to <bean id="fooService"
    4. Press Ctrl and move cursor over org.example.FooService
    5. Click mouse button to follow hyperlink
    6. Check FooService class is opened
  3. Test Code completion using EL in JSP file
    1. Create new Java class FooBean in package org.example
    2. Copy the code below to class:
package org.example;

import org.springframework.stereotype.Controller;

public class FooBean {

    private String name;

    public void setName(String name) {
        this.name = name;

    public String getName() {
        return name;
    1. Open jsp file (redirect.jsp), type "#{f" and invoke code completion
    2. select fooBean and type "."
    3. invoke code completion and select name
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