TS 61 EJB withEx sources

EJB with existing sources

Author: Radim Roska
Version: 1.1
Estimated time: 4 hours
Default IZ component(s): j2ee/ejbproject
Last update: 19/05/2008
Introduction: This test specification is focused on testing of creating EJB project with existing sources.
Comments: This test specification is writen just for Java EE 5, but it should work for J2EE 1.4 in the same way.

Contents


Test suite: Sources from NB project

Purpose: This test suit prepares some sources.
Setup: No special setup is required for this test suite. Just follow all the test cases stated below.

  1. Create 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.
    • EXPECTED RESULT: New EJBModule1 project node shows up in Projects tab.
  2. Create entity
    1. Invoke File|New File... from main menu.
    2. Select "Persistence" category and "Entity Class" file type. Push Next button.
    3. Type "entity" into Package field. A warning about a missing persistence unit is displayed: There is no persistence unit in the project yet. You need a persistence unit... Push Create Persistence Unit... button.
    4. Push Create button. Then push Finish button.
    • EXPECTED RESULT: New entity class gets created under Source Packages together with specified package.
  3. Create Session bean
    1. Invoke File|New File... from main menu.
    2. Select "Enterprise" category and "Session bean" file type. Push Next button.
    3. Type "bean" into Package field. Push Finish button.
    • EXPECTED RESULT: New session bean class is created under Source Packages together with specified package.
  4. Delete EJB project
    1. Right_click EJBmodule in Projects view .
    2. Select Delete from popup menu.
    3. Make sure the checkbox "Also delete sources under ..." is not checked, so that the sources won't be deleted. Press Yes button.
    • EXPECTED RESULT: Project is closed and all its files are deleted. Just "src" and "test" directories remains in the project directory.


Test suite: New EJB with Existing sources

Purpose: This test checks if it is possible to create a new EJB project after deleting project files
Setup: Steps from previous test suite (or you need to have some existing sources of EJB project).

  1. Create EJB module from NB sources
    1. Invoke File|New Project from main menu.
    2. Select "Enterprise" category and "EJB Module with Existing Sources" project type. Push Next button.
    3. Press Browse button to find the project directory created in the previous test suit. Press Next. Make sure GlassFish Application Server is selected and and J2EE version is set to JAVA EE5. Press Next button.
    4. Use Browse button to to set Configuration Files Folder to <project dir>/src/conf.
    5. Add <project dir>/src/java folder to "Source Package Folders" and <project dir>/test folder to "Test Package Folders" using Add Folder button.
    6. Push Finish button.
    • EXPECTED RESULT: New EJBModule is created. Check project structure to ensure packages are created as it should be (packages "entity" and "bean" must be present if you use data from previous test suite).
  2. Deployment
    1. Right-click EJBmodule in Projects view .
    2. Choose Undeploy and Deploy from popup menu.
    • EXPECTED RESULT: Java Sun Application Server should be started and project should be deployed without any error.
  3. Delete project files
    1. Delete all files and directories from NewEJBModule1 folder except src and test directories.
    2. Restart IDE.
    3. Repeat 1-3 test cases.
    • EXPECTED RESULT: It should be possible to create and to deploy a project created just from source files.
  4. Extern source
    1. Download File:Simple-ejb TS 61 EJB withEx sources.ZIP this this file and unzip it into your home directory.
    2. Repeat 1-3 test cases, and set sources of Java to version J2EE 1.4 in the first test case.
    3. Download File:Customer-cmp-ejb TS 61 EJB withEx sources.zip this file and unzip it into your home directory.
    4. Repeat 1-3 test cases, and set sources of Java to version Java EE 5 in the first test case.
    • EXPECTED RESULT: It should be possible to create and to deploy a project created just from source files.


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