Testing Applications

Although it is a component of Oracle Application Server, OC4J is also included in Oracle Developer Suite to enable you to test your applications on the same machine where you are running Forms Builder. In this role, OC4J functions both as a lightweight Web listener and as a servlet container.
In other words, you do not need to install Oracle Application Server to test your applications. However, you must deploy your production applications to an Oracle Application Server installation.

Starting OC4J
To test applicaiton, you first start an instance of OC4J by executing the batch file provided, called startinst.bat. This file is located in the j2ee\Devsuite\ sub directory of your Oracle Developer Suite installation.
You can execute this batch file on Windows from the Start Menu: Programs > Oracle Developer Suite > Forms Developer > Start (or Shutdown) OC4J Instance.
OC4J starts in a DOS window. You can minimize this window, but if you close it you will abort the OC4J instance. When you are ready to shut down OC4J, you should execute the stopinst.bat file, or use the shortcut in the Start menu.
You can use OC4J to test a form wiht or without Forms Builder.
Testing from Forms Builder
The Forms Builder tool features the ability to test a form using a three-tier environment.
1) Define the settings for running the form:
Select Edit > Preferences from the Forms Builder menu, and then click the Runtime tab.
a) Application Server URL: Clicking "Reset to DEfault" automatically populates the Application Server URL field with the URL to run a form. You can modify this URL if desired. For example, you can specify the use of named configuraiton by adding the config parameter to the end of the URL, such as ?config=summit.
b) Web Browser Location: You can also designate which Web browser to use by clicking Browse and navigating to the executeable for the desired browser.

2) Run the form that is selected in the Object Navigator: Select the Program > Run Form menu command or just click the Run Form button.

Testing from a Browser
While an instance of OC4J is running, you can invoke any form on your development PC from a browser, even if Forms Builder is not open. Use a URL of the following format:
http://:/forms/frmservlet
Add to the URL any parameters that you need to run the form. For example, to run the test.fmx form with parameters specified in a [myapp] named configuration that you have defined in the formsweb.cfg file:
http://my_pc:8888/forms/frmservlet?form=test.fmx&config=myapp

Note: To run a form in this way, the form must be located in a directory that is incuded in the FORMS_PATH environment variable that you set in the default.env file.

No comments: