TS 65 CompileOnSave

Compile on Save test specification

Author: Jiri Prox
Version: 6.5
Last update: 25.09.2008
Introduction: This document is test specification for Compile On Save feature introduced in Netbeans 6.5. When this feature is turned on the files are compiler immediately when they are saved. The output .class file is stored either in userdir (in index directory) or directly in build directory. When calling run action, the compiled classes are launched from build dir (at first they are copied there if it is necessary). Ant ant script does not run in this case. Here is complete description of Compile on Save feature: CoS
Comments: Start IDE with fresh userdir.

Contents


Test suite: UI

Purpose: This suite is focused on menu item availability.
Setup: Create new J2SE project, make sure that Compile On Save is enabled (Compile tab of project properties). Run the project!!!

  1. Compile singe file, package
    1. Open context menu on file in project view
    2. Open context menu on package in project view
    3. Disable CoS and perform previous steps again.
    • EXPECTED RESULT: Item 'Compile file' / 'Compile package' are disabled if CoS is enabled. After diabling CoS the IDE behaves as previous version - ant is used do compile class or whole
  2. Compile project
    1. Open context menu on project
    2. Open Run main menu
    3. Press Build
    • EXPECTED RESULT: The dialog warning about the fact that clean&build must be performed instead of build is shown.
  3. Compile project with errors
    1. Make a syntax error in the code
    2. Run the project
    • EXPECTED RESULT: The dialog informing about uncompilable code is shown. The user have possibility to cancel run or to continue. There is checkbox to disable this dialog next time
  4. Disable/Enable CoS
    1. Open project properties
    2. Switch to Compile tab
    3. Disable CoS
    4. Close properties
    5. Enable CoS again
    • EXPECTED RESULT: Clean is performed when setting is changed


Test suite: Compiling, Building,Running

Purpose: This suite describes compiling a building project
Setup: Locate the directory, where are stored compiled classes. The location should be {userdir}/var/cache/index/{index_version}/sX/classes, where X is a decimal number
Comments: The test cases should be performed in a row since they depends on result of previous case.

  1. Change and save
    1. Open class from the project
    2. Clean it
    3. Make sure CoS is enabled
    4. Make some modification and save
    • EXPECTED RESULT: The related .class file is updated, but only in userdir, Need to Compile batch should appear. Compile actions are enabled
  2. Compile
    1. Compile the modified file (F9)
    • EXPECTED RESULT: The file is compiled by ant. Need to compile badge disappears. Compile action is still enabled
  3. Build
    1. Build project
    • EXPECTED RESULT: Build is performed by ant
  4. Run
    1. Run project
    • EXPECTED RESULT: The classes from userdir are copied to build/classes folder, the application is launched with build/classes folder on it's classpath. Compile actions are disabled, need to compile badges are not visible
  5. Modify source
    1. Modify any file
    2. Save it
    • EXPECTED RESULT: The .class files is updated in build/classes folder, need to compile badge is not shown
  6. Run project
    1. Run project
    • EXPECTED RESULT: The project is launched w/o any compilation of copying classes
  7. Build project
    1. Build project
    • EXPECTED RESULT: The dialog asking of performing Clean&Build is shown. Cancel the action
  8. Clean
    1. Cleans project
    • EXPECTED RESULT: The content of build/classes is erased. The compile action is enabled again, Need to compile badges appears for all source files


Test suite: Dependend projects

Setup: Have a projct A and B,A is depending on B

  1. Running A
    1. Enable CoS for project A
    2. Run project A
    • EXPECTED RESULT: The CoS is applied on both projects -> classes are copied from userdir if necessary, application has build/classes dirs on its classpath. The behavior is not dependent on project B
  1. Building A
    1. Make sure CoS is enabled for A
    2. Clean&Build project A
    • EXPECTED RESULT: The A is cleaned and build, if there was classes fro inner javac in buidl/classes of project B, the project is cleaned as well. Otherwise B is only build by ant.
  1. Running B
    1. Run project B
    • EXPECTED RESULT: Running depends on CoS setting of project B. No setting of A is taking in account


Test suite: Errors in code

  1. Error in code
    1. Create new project
    2. Make syntax error (e.g undefined variable) in main method)
    • EXPECTED RESULT:
  1. Building A
    1. Make sure CoS is enabled for A
    2. Clean&Build project A
    • EXPECTED RESULT: The A is cleaned and build, if there was classes fro inner javac in buidl/classes of project B, the project is cleaned as well. Otherwise B is only build by ant.
  1. Running B
    1. Run project B
    2. Press Run Anyway
    • EXPECTED RESULT: The dialog announcing error in code is opened when running. The Runtime exception is thrown when application gets to the syntax error.
  1. Disable dialog
    1. Run project B
    2. Check 'Always run w/o asking'
    3. Press Run Anyway
    • EXPECTED RESULT: The dialog is never opened when running project with errors


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