gecko-dev/modules/oji/tests
2002-04-15 22:26:29 +00:00
..
build
doc
script
src
FAQ
README

This README file indicates steps required for Building and Execution of OJI API tests 

How the Tests Work
------------------
 These OJI API Tests basically 4 areas via:
    Java Native Interface     (JNI)
    JVM Manager Tests         (JM)
    Thread Manager Tests      (TM)
    LiveConnect Manager Tests (LCM)

 On Building the Test Base ( from build directory) 5 shared libraries are 
 created which are copied over to the bin/components dir. 
 (  libojiapijmtests.so,libojiapilcmtests.so, libojiapitmtests.so,
    libojiapijnitests.so, libojiapitl.so )

 On Invoking the browser, it registers all these libraries and then invokes
 the page test.html (in script dir.)
 
 It first prompts a dialog box for Permissions to invoke a XPConnect call.
 The user has to grant permissions to execute the tests. 
 (NOTE: If user denys, then the tests cannot be invoked) 

 Once permissions are granted, it will follow these steps
    *  Create a TestLoader  instance.
    *  Read List of Tests from file OJITestsList.lst (in script dir.)
    *  For each test entry in that file, determine type of Test (JNI/JM/LCM/TM)
    *  Load appropriate library if not already loaded
    *  Find method address from the loaded library
    *  Invoke method to be tested with appropriate test parameters
    *  Record results in log file

Below are instructions on how to build and execute.
Also check FAQ for answers to known problems encountered.

-------------------------------------------------------------------------------

Instructions (Build/Execution)
==============================

Win32
-----

============-=============
I. Build OJI API test:
==========================

 Pre-Requisite: You must have built mozilla browser and 
                have Perl (version >= 5) installed.

 1. set MOZILLA_HOME (top of Mozilla's tree) and JAVAHOME variables
 2. set MOZILLA_FIVE_HOME  to <MOZILLA_HOME>/dist/win32_O.obj/bin directory
    where mozilla.exe is located
 3. goto build directory and say
        nmake -f Makefile.win

 Libraries created are located in 'build/bin' dir. and 
 MOZILLA_FIVE_HOME/components directory.

=============================
II.Execute  OJI API tests:
=============================

 Pre-Requisite: Have Perl  (version >= 5) installed and 
                Java1.3.0_01 SDK installed.

 1. Update <homedir>/Program Files/Users50/<profile dir>/prefs.js to add line
         user_pref("signed.applets.codebase_principal_support",true);
    where <profile dir> is your profile name
 2. Update Path variable to include 
         $MOZILLA_HOME/dist/win32_O.obj/bin and
         $MOZILLA_HOME/dist/win32_O.obj/bin/components
 3. Set TEST_URL to point to url location of test.html.
    (file://<mozilla dir>/modules/oji/tests/script)
 4. Delete component.reg file in Mozilla's bin directory.
 5. Click on Start-Settings-Control Panel->Duke icon.
    This will invoke the Java Plugin Control Panel
 6. In Runtime Parameter Text Field add the following line
       -Xbootclasspath/a:<class dir>
    where <class dir> is <MOZILLA_HOME>\modules\oji\tests\build\classes
 7. Create .java.policy file in you home directory and add this line 
     grant {
         permission java.security.AllPermission;
     }
 8. Change DELAY_FACTOR in script/autorun.pl to some higher value, if mozilla
    takes more time to load. It should be a value greater than 0.
 9  Change script/autorun.pl and change ADDITIONAL_PARAMETERS  to reflect your
    profile
10. Goto script dir. and run perl script
       perl autorun.pl
11. It will invoke the browser and load 'test.html'.
12. It should prompt a "Internet Security" Dialog box prompting for Permissions
    Check "Remember the decision" checkbox.
    Click on 'Yes' (NOTE: clicking on 'No' will not invoke any of the Tests).

All done
 See results of execution in the script/log directory.
 Output HTML file is script/log/BWTest.html



--------------------------------------------------------------------------
Solaris/Linux
--------------

==========================
I. Build OJI API test:
==========================

 Pre-Requisite: You must have built mozilla browser and have 
                have Perl (version >= 5) installed.

 1. set MOZILLA_HOME (top of Mozilla's tree) and JAVAHOME variables
 2. set MOZILLA_FIVE_HOME to <MOZILLA_HOME>/dist/bin
    where mozilla-bin is located
 3. set CC to point to gcc
       setenv CC gcc
 4. goto build directory and say
          gmake

 Libraries created are located in 'build/bin' dir. and 
 MOZILLA_FIVE_HOME/components directory.

=============================
II. Execute OJI API tests:
=============================

 Pre-Requisite: Have Perl installed and Java2 SDK installed.

 1. Update <home dir>/.mozilla/<profile dir>/prefs.js to add line
        user_pref("signed.applets.codebase_principal_support",true);
    where <profile dir> is your profile name
 2. Update LD_LIBRARY_PATH variable to include 
        $MOZILLA_HOME/dist/bin and
        $MOZILLA_HOME/dist/bin/components
 3. Set TEST_URL to point to url location of test.html.
    (file://<mozilla dir>/modules/oji/tests/script)
 4. Delete component.reg file in Mozilla's bin directory.
 5. Invoke <Java2 SDK dir.>/jre/bin/ControlPanel
 6. In RunTime Parameter Text Field add the following line
       -Xbootclasspath/a:<class dir>
    where <class dir> is <MOZILLA_HOME>/modules/oji/tests/build/classes
      
 7. Create .java.policy file in you home directory and add the lines
     grant {
         permission java.security.AllPermission;
     }
 8. Change DELAY_FACTOR in script/autorun.pl to some higher value, if mozilla
    takes more time to load. It should be a value greater than 0.
 9  Change script/autorun.pl and change ADDITIONAL_PARAMETERS  to reflect your
    profile (by default it uses default).
10. Goto script dir. and run perl script
          perl autorun.pl
11. It will invoke the browser and load 'test.html'.
12. It should prompt a "Internet Security" Dialog box prompting for Permissions
    Check "Remember the decision" checkbox.
    Click on 'Yes' (NOTE: clicking on 'No' will not invoke any of the Tests).


All done
 See results of execution in the script/log directory.
 Output HTML file is script/log/BWTest.html


--------------------------------------------------------------------------
Mac
---

 Currently does not work with Mac.