Ensuring Java EE Compliance


The Java EE platform extends the many benefits of the Java language to the enterprise, such as portability, by providing a set of specifications for application servers and an extensive set of compatibility tests. The Java EE platform enables you to run enterprise applications on a variety of Java EE application servers.

The IDE provides a rich environment for developing Java enterprise applications. But one of your most crucial objectives as an enterprise developer is ensuring that your application is Java EE compliant. By being Java EE compliant, the application will deploy and run in any Java EE vendor's application server as long as that vendor's application server is compliant with the given Java EE specification (e.g., the J2EE 1.4 specification).

To help you ensure that your enterprise application is Java EE compliant, the IDE provides a built-in verifier to help you test your web application or enterprise application for the correct use of Java EE APIs. In addition, the verifier confirms portability across Java EE compatible application servers, which helps you avoid inadvertently writing non-portable code. In NetBeans IDE 5.0, the verifier tests against the J2EE 1.4 specification.

When the verifier is invoked in NetBeans IDE, it runs a series of tests against a selected NetBeans IDE project. The output from running the verifier is displayed in the IDE's Output window in table form and contains the following information:

  • Test Statuspass, fail, or warning

  • Test Descriptiona description of the compatibility test that was run

  • Test Result Descriptiona detailed description of the test result

You can also filter the Verifier output. You can view all compatibility test results, compatibility failures only, or compatibility failures and warnings only.

After you finish developing a web application or enterprise application and before you deploy it, you should run the verifier against your project to ensure that you are not using any vendor-specific proprietary extensions to the Java EE platform. Using a proprietary extension will make it difficult to port to other Java EE application servers.

To launch the verifier against your web application or enterprise application project, you must have your project open in NetBeans IDE. From the Projects window, right-click the main node of the project you want to verify and choose Verify Project. Figure 13-36 shows the contextual menu that is displayed when you right-click a web application or enterprise application project.

Figure 13-36. From the Projects window, running the Verify Project command for an EJB module application


Once the Verify Project command is chosen, the Verifier window (shown in Figure 13-37) appears at the bottom of the IDE and starts displaying results of the verification.

Figure 13-37. Output from the Verify Project command


The results consist of all of the compatibility tests performed against your application. The Verifier lists test status, test description, and a detailed test result. The default for the Verifier results is to display all compatibility tests that fail first, followed by those that have a warning result and then those that have passed. When a row or test is selected in the table, a detailed description of the test result is displayed. Also, the Verifier test results display can be filtered by selecting one of the following radio buttons:

  • All Resultsdisplays all of the compatibility test results

  • Failures Onlydisplays only the compatibility test failures

  • Failures and Warnings Onlydisplays both compatibility test failures and warnings

You should fix all compatibility test failures before deploying the application. As you make corrections to your web or enterprise application, you can rerun the Verifier by again right-clicking the project's node in the Projects window and choosing Verify.



NetBeans IDE Field Guide(c) Developing Desktop, Web, Enterprise, and Mobile Applications
NetBeans IDE Field Guide(c) Developing Desktop, Web, Enterprise, and Mobile Applications
ISBN: N/A
EAN: N/A
Year: 2004
Pages: 279

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net