diff --git a/java/plugins/test/config/CommonProperties b/java/plugins/test/config/CommonProperties new file mode 100644 index 000000000000..97800525a693 --- /dev/null +++ b/java/plugins/test/config/CommonProperties @@ -0,0 +1,18 @@ +# The timeouts of test execution +DELAY=60 +DELAY_OF_CYCLE=5 +DELAY_INTERNAL=40 + +# The names of files for writing log and result by test +LOG_FILE=PlugletTest.log +RESULT_FILE=PlugletTest.res + +#File separator (Used to specify PLUGLET property) +FSEP=/ +# The root directory of the this pluglet API test suite +TEST_TOP_DIR=C:\sync + +# The URL of directory where the htmls of tests are placed +# The path to this directory should be pointed in set_env.bat to be used +# during building +HTML_ROOT=file:/c:/sync/build/htroot diff --git a/java/plugins/test/config/SecurityTests.keys b/java/plugins/test/config/SecurityTests.keys new file mode 100644 index 000000000000..0accb1f873a6 --- /dev/null +++ b/java/plugins/test/config/SecurityTests.keys @@ -0,0 +1,348 @@ +# +# SecurityTests.keys +# +# Configuration key values +# + +# +# DeleteFileTest.java test properties +# +DeleteFileTest.mustPass=true +DeleteFileTest.FileName=foo + +# +# GetClipboardTest.java test properties +# +GetClipboardTest.mustPass=true + +# +# GetSysPropsTest.java test properties +# +GetSysPropsTest.mustPass=true +GetSysPropsTest.propertyName=path + +# +# OpenWinTest.java test properties +# +OpenWinTest.mustPass=true + +# +# PrintTest.java test properties +# +PrintTest.mustPass=true + +# +# ReadFileTest.java test properties +# +ReadFileTest.mustPass=true +ReadFileTest.FileName=foo + +# +# RemoteConnectTest.java test properties +# +RemoteConnectTest.mustPass=true +RemoteConnectTest.URL=http://sirius + +# +# RunProgramTest.java test properties +# +RunProgramTest.mustPass=true +RunProgramTest.command=ls -l + +# +# SecTestCanRead.java test properties +# +SecTestCanRead.mustPass=true +SecTestCanRead.fName=TestProperties +# +# SecTestCanWrite.java test properties +# +SecTestCanWrite.mustPass=true + +# +# SecTestClipboard.java test properties +# +SecTestClipboard.mustPass=true + +# +# SecTestDelete.java test properties +# +SecTestDelete.mustPass=true + +# +# SecTestEnv.java test properties +# +SecTestEnv.mustPass=true + +# +# SecTestExists.java test properties +# +SecTestExists.mustPass=true + +# +# SecTestFileDescriptorIn.java test properties +# +SecTestFileDescriptorIn.mustPass=true + +# +# SecTestFileDescriptorOut.java test properties +# +SecTestFileDescriptorOut.mustPass=true + +# +# SecTestFileInputStream.java test properties +# +SecTestFileInputStream.mustPass=true +SecTestFileInputStream.fName=TestProperties + +# +# SecTestFileOutputStream.java test properties +# +SecTestFileOutputStream.mustPass=true + +# +# SecTestGetAbsolutePath.java test properties +# +SecTestGetAbsolutePath.mustPass=true + +# +# SecTestGetCanonicalPath.java test properties +# +SecTestGetCanonicalPath.mustPass=true + +# +# SecTestGetContent.java test properties +# +SecTestGetContent.mustPass=true +SecTestGetContent.fName=TestProperties + +# +# SecTestGetParent.java test properties +# +SecTestGetParent.mustPass=true + +# +# SecTestGetPath.java test properties +# +SecTestGetPath.mustPass=true +SecTestGetPath.fName=foo + +# +# SecTestGetProps.java test properties +# +SecTestGetProps.mustPass=true + +# +# SecTestGetSecMgr.java test properties +# +SecTestGetSecMgr.mustPass=true + +# +# SecTestIsDirectory.java test properties +# +SecTestIsDirectory.mustPass=true + +# +# SecTestIsFile.java test properties +# +SecTestIsFile.mustPass=true + +# +# SecTestLastModified.java test properties +# +SecTestLastModified.mustPass=true + +# +# SecTestLength.java test properties +# +SecTestLength.mustPass=true + +# +# SecTestList.java test properties +# +SecTestList.mustPass=true + +# +# SecTestListJSFilter.java test properties +# +SecTestListJSFilter.mustPass=true + +# +# SecTestMkdir.java test properties +# +SecTestMkdir.mustPass=true + +# +# SecTestMkdirs.java test properties +# +SecTestMkdirs.mustPass=true + +# +# SecTestOpenConx.java test properties +# +SecTestOpenConx.mustPass=true +SecTestOpenConx.URL=http://sirius +# +# SecTestPrintStream.java test properties +# +SecTestPrintStream.mustPass=true + +# +# SecTestRandomAccess.java test properties +# +SecTestRandomAccess.mustPass=true + +# +# SecTestRandomAccessRW.java test properties +# +SecTestRandomAccessRW.mustPass=true + +# +# SecTestRenameTo.java test properties +# +SecTestRenameTo.mustPass=true + +# +# SecTestRunExec.java test properties +# +SecTestRunExec.mustPass=true +SecTestRunExec.fExec=ls -l + +# +# SecTestRunExit.java test properties +# +SecTestRunExit.mustPass=true + +# +# SecTestRunLoad.java test properties +# +SecTestRunLoad.mustPass=true +SecTestRunLoad.libName=java +# SecTestRunLoadLib.java test properties +# +SecTestRunLoadLib.mustPass=true +SecTestRunLoadLib.libName=plugletjni + +# +# SecTestSetSecMgr.java test properties +# +SecTestSetSecMgr.mustPass=true + +# +# SecTestSocket.java test properties +# +SecTestSocket.mustPass=true +SecTestSocket.fHost=sirius +SecTestSocket.fPort=80 + +# +# SecTestSysExit.java test properties +# +SecTestSysExit.mustPass=true + +# +# SecTestURLFac.java test properties +# +SecTestURLFac.mustPass=true +# +# SecTestXAccept.java test properties +# +SecTestXAccept.mustPass=true +SecTestXAccept.fHost=sirius +SecTestXAccept.fPort=80 + +# +# SecTestXAccess.java test properties +# +SecTestXAccess.mustPass=true + +# +# SecTestXAccessTG.java test properties +# +SecTestXAccessTG.mustPass=true + +# +# SecTestXAccessTop.java test properties +# +SecTestXAccessTop.mustPass=true + +# +# SecTestXCCL.java test properties +# +SecTestXCCL.mustPass=true + +# +# SecTestXConn.java test properties +# +SecTestXConn.mustPass=true +SecTestXConn.fHost=sirius +SecTestXConn.fPort=80 + +# +# SecTestXDelete.java test properties +# +SecTestXDelete.mustPass=true +SecTestXDelete.fName=foo + +# +# SecTestXExec.java test properties +# +SecTestXExec.mustPass=true +SecTestXExec.fExec=ls -l + +# +# SecTestXExit.java test properties +# +SecTestXExit.mustPass=true + +# +# SecTestXLink.java test properties +# +SecTestXLink.mustPass=true +SecTestXLink.fLink=sirius +# +# SecTestXListen.java test properties +# +SecTestXListen.mustPass=true +SecTestXListen.fPort=80 + +# +# SecTestXPakAcc.java test properties +# +SecTestXPakAcc.mustPass=true +SecTestXPakAcc.packageName=java.awt + +# +# SecTestXPakDef.java test properties +# +SecTestXPakDef.mustPass=true +SecTestXPakDef.packageName=java.awt + +# +# SecTestXPropAcc.java test properties +# +SecTestXPropAcc.mustPass=true + +# +# SecTestXRead.java test properties +# +SecTestXRead.mustPass=true +SecTestXRead.fName=foo + +# +# SecTestXSetFac.java test properties +# +SecTestXSetFac.mustPass=true + +# +# SecTestXWrite.java test properties +# +SecTestXWrite.mustPass=true +SecTestXWrite.fName=foo + +# +# WriteFileTest.java test properties +# +WriteFileTest.mustPass=true +WriteFileTest.FileName=foo + diff --git a/java/plugins/test/config/SecurityTests.properties b/java/plugins/test/config/SecurityTests.properties new file mode 100644 index 000000000000..76061bfd33a3 --- /dev/null +++ b/java/plugins/test/config/SecurityTests.properties @@ -0,0 +1,351 @@ +# +# SecurityTests.template +# +# This is a template file for the security tests properties. +# + +# +# DeleteFileTest.java test properties +# +DeleteFileTest.mustPass=true +DeleteFileTest.FileName=foo + +# +# GetClipboardTest.java test properties +# +GetClipboardTest.mustPass=true + +# +# GetSysPropsTest.java test properties +# +GetSysPropsTest.mustPass=true +GetSysPropsTest.propertyName=path + +# +# OpenWinTest.java test properties +# +OpenWinTest.mustPass=true + +# +# PrintTest.java test properties +# +PrintTest.mustPass=true + +# +# ReadFileTest.java test properties +# +ReadFileTest.mustPass=true +ReadFileTest.FileName=foo + +# +# RemoteConnectTest.java test properties +# +RemoteConnectTest.mustPass=true +RemoteConnectTest.URL=http://sirius + +# +# RunProgramTest.java test properties +# +RunProgramTest.mustPass=true +RunProgramTest.command=ls -l + +# +# SecTestCanRead.java test properties +# +SecTestCanRead.mustPass=true +SecTestCanRead.fName=TestProperties +# +# SecTestCanWrite.java test properties +# +SecTestCanWrite.mustPass=true + +# +# SecTestClipboard.java test properties +# +SecTestClipboard.mustPass=true + +# +# SecTestDelete.java test properties +# +SecTestDelete.mustPass=true + +# +# SecTestEnv.java test properties +# +SecTestEnv.mustPass=true + +# +# SecTestExists.java test properties +# +SecTestExists.mustPass=true + +# +# SecTestFileDescriptorIn.java test properties +# +SecTestFileDescriptorIn.mustPass=true + +# +# SecTestFileDescriptorOut.java test properties +# +SecTestFileDescriptorOut.mustPass=true + +# +# SecTestFileInputStream.java test properties +# +SecTestFileInputStream.mustPass=true +SecTestFileInputStream.fName=TestProperties + +# +# SecTestFileOutputStream.java test properties +# +SecTestFileOutputStream.mustPass=true + +# +# SecTestGetAbsolutePath.java test properties +# +SecTestGetAbsolutePath.mustPass=true + +# +# SecTestGetCanonicalPath.java test properties +# +SecTestGetCanonicalPath.mustPass=true + +# +# SecTestGetContent.java test properties +# +SecTestGetContent.mustPass=true +SecTestGetContent.fName=TestProperties + +# +# SecTestGetParent.java test properties +# +SecTestGetParent.mustPass=true + +# +# SecTestGetPath.java test properties +# +SecTestGetPath.mustPass=true +SecTestGetPath.fName=foo + +# +# SecTestGetProps.java test properties +# +SecTestGetProps.mustPass=true + +# +# SecTestGetSecMgr.java test properties +# +SecTestGetSecMgr.mustPass=true + +# +# SecTestIsDirectory.java test properties +# +SecTestIsDirectory.mustPass=true + +# +# SecTestIsFile.java test properties +# +SecTestIsFile.mustPass=true + +# +# SecTestLastModified.java test properties +# +SecTestLastModified.mustPass=true + +# +# SecTestLength.java test properties +# +SecTestLength.mustPass=true + +# +# SecTestList.java test properties +# +SecTestList.mustPass=true + +# +# SecTestListJSFilter.java test properties +# +SecTestListJSFilter.mustPass=true + +# +# SecTestMkdir.java test properties +# +SecTestMkdir.mustPass=true + +# +# SecTestMkdirs.java test properties +# +SecTestMkdirs.mustPass=true + +# +# SecTestOpenConx.java test properties +# +SecTestOpenConx.mustPass=true +SecTestOpenConx.URL=http://sirius + +# +# SecTestPrintStream.java test properties +# +SecTestPrintStream.mustPass=true + +# +# SecTestRandomAccess.java test properties +# +SecTestRandomAccess.mustPass=true + +# +# SecTestRandomAccessRW.java test properties +# +SecTestRandomAccessRW.mustPass=true + +# +# SecTestRenameTo.java test properties +# +SecTestRenameTo.mustPass=true + +# +# SecTestRunExec.java test properties +# +SecTestRunExec.mustPass=true +SecTestRunExec.fExec=ls -l + +# +# SecTestRunExit.java test properties +# +SecTestRunExit.mustPass=true + +# +# SecTestRunLoad.java test properties +# +SecTestRunLoad.mustPass=true +SecTestRunLoad.libName=java +# +# SecTestRunLoadLib.java test properties +# +SecTestRunLoadLib.mustPass=true +SecTestRunLoadLib.libName=plugletjni + +# +# SecTestSetSecMgr.java test properties +# +SecTestSetSecMgr.mustPass=true + +# +# SecTestSocket.java test properties +# +SecTestSocket.mustPass=true +SecTestSocket.fHost=sirius +SecTestSocket.fPort=80 + +# +# SecTestSysExit.java test properties +# +SecTestSysExit.mustPass=true + +# +# SecTestURLFac.java test properties +# +SecTestURLFac.mustPass=true +# +# SecTestXAccept.java test properties +# +SecTestXAccept.mustPass=true +SecTestXAccept.fHost=sirius +SecTestXAccept.fPort=80 + +# +# SecTestXAccess.java test properties +# +SecTestXAccess.mustPass=true + +# +# SecTestXAccessTG.java test properties +# +SecTestXAccessTG.mustPass=true + +# +# SecTestXAccessTop.java test properties +# +SecTestXAccessTop.mustPass=true + +# +# SecTestXCCL.java test properties +# +SecTestXCCL.mustPass=true + +# +# SecTestXConn.java test properties +# +SecTestXConn.mustPass=true +SecTestXConn.fHost=sirius +SecTestXConn.fPort=80 + +# +# SecTestXDelete.java test properties +# +SecTestXDelete.mustPass=true +SecTestXDelete.fName=foo + +# +# SecTestXExec.java test properties +# +SecTestXExec.mustPass=true +SecTestXExec.fExec=ls -l + +# +# SecTestXExit.java test properties +# +SecTestXExit.mustPass=true + +# +# SecTestXLink.java test properties +# +SecTestXLink.mustPass=true +SecTestXLink.fLink=sirius + +# +# SecTestXListen.java test properties +# +SecTestXListen.mustPass=true +SecTestXListen.fPort=80 + +# +# SecTestXPakAcc.java test properties +# +SecTestXPakAcc.mustPass=true +SecTestXPakAcc.packageName=java.awt + +# +# SecTestXPakDef.java test properties +# +SecTestXPakDef.mustPass=true +SecTestXPakDef.packageName=java.awt + +# +# SecTestXPropAcc.java test properties +# +SecTestXPropAcc.mustPass=true + +# +# SecTestXRead.java test properties +# +SecTestXRead.mustPass=true +SecTestXRead.fName=foo + +# +# SecTestXSetFac.java test properties +# +SecTestXSetFac.mustPass=true + +# +# SecTestXWrite.java test properties +# +SecTestXWrite.mustPass=true +SecTestXWrite.fName=foo + +# +# WriteFileTest.java test properties +# +WriteFileTest.mustPass=true +WriteFileTest.FileName=foo + diff --git a/java/plugins/test/config/SecurityTests.template b/java/plugins/test/config/SecurityTests.template new file mode 100644 index 000000000000..65f0b6820f89 --- /dev/null +++ b/java/plugins/test/config/SecurityTests.template @@ -0,0 +1,351 @@ +# +# SecurityTests.template +# +# This is a template file for the security tests properties. +# + +# +# DeleteFileTest.java test properties +# +DeleteFileTest.mustPass= +DeleteFileTest.FileName= + +# +# GetClipboardTest.java test properties +# +GetClipboardTest.mustPass= + +# +# GetSysPropsTest.java test properties +# +GetSysPropsTest.mustPass= +GetSysPropsTest.propertyName= + +# +# OpenWinTest.java test properties +# +OpenWinTest.mustPass= + +# +# PrintTest.java test properties +# +PrintTest.mustPass= + +# +# ReadFileTest.java test properties +# +ReadFileTest.mustPass= +ReadFileTest.FileName= + +# +# RemoteConnectTest.java test properties +# +RemoteConnectTest.mustPass= +RemoteConnectTest.URL= + +# +# RunProgramTest.java test properties +# +RunProgramTest.mustPass= +RunProgramTest.command= + +# +# SecTestCanRead.java test properties +# +SecTestCanRead.mustPass= +SecTestCanRead.fName= +# +# SecTestCanWrite.java test properties +# +SecTestCanWrite.mustPass= + +# +# SecTestClipboard.java test properties +# +SecTestClipboard.mustPass= + +# +# SecTestDelete.java test properties +# +SecTestDelete.mustPass= + +# +# SecTestEnv.java test properties +# +SecTestEnv.mustPass= + +# +# SecTestExists.java test properties +# +SecTestExists.mustPass= + +# +# SecTestFileDescriptorIn.java test properties +# +SecTestFileDescriptorIn.mustPass= + +# +# SecTestFileDescriptorOut.java test properties +# +SecTestFileDescriptorOut.mustPass= + +# +# SecTestFileInputStream.java test properties +# +SecTestFileInputStream.mustPass= +SecTestFileInputStream.fName= + +# +# SecTestFileOutputStream.java test properties +# +SecTestFileOutputStream.mustPass= + +# +# SecTestGetAbsolutePath.java test properties +# +SecTestGetAbsolutePath.mustPass= + +# +# SecTestGetCanonicalPath.java test properties +# +SecTestGetCanonicalPath.mustPass= + +# +# SecTestGetContent.java test properties +# +SecTestGetContent.mustPass= +SecTestGetContent.fName= + +# +# SecTestGetParent.java test properties +# +SecTestGetParent.mustPass= + +# +# SecTestGetPath.java test properties +# +SecTestGetPath.mustPass= +SecTestGetPath.fName= + +# +# SecTestGetProps.java test properties +# +SecTestGetProps.mustPass= + +# +# SecTestGetSecMgr.java test properties +# +SecTestGetSecMgr.mustPass= + +# +# SecTestIsDirectory.java test properties +# +SecTestIsDirectory.mustPass= + +# +# SecTestIsFile.java test properties +# +SecTestIsFile.mustPass= + +# +# SecTestLastModified.java test properties +# +SecTestLastModified.mustPass= + +# +# SecTestLength.java test properties +# +SecTestLength.mustPass= + +# +# SecTestList.java test properties +# +SecTestList.mustPass= + +# +# SecTestListJSFilter.java test properties +# +SecTestListJSFilter.mustPass= + +# +# SecTestMkdir.java test properties +# +SecTestMkdir.mustPass= + +# +# SecTestMkdirs.java test properties +# +SecTestMkdirs.mustPass= + +# +# SecTestOpenConx.java test properties +# +SecTestOpenConx.mustPass= +SecTestOpenConx.URL= + +# +# SecTestPrintStream.java test properties +# +SecTestPrintStream.mustPass= + +# +# SecTestRandomAccess.java test properties +# +SecTestRandomAccess.mustPass= + +# +# SecTestRandomAccessRW.java test properties +# +SecTestRandomAccessRW.mustPass= + +# +# SecTestRenameTo.java test properties +# +SecTestRenameTo.mustPass= + +# +# SecTestRunExec.java test properties +# +SecTestRunExec.mustPass= +SecTestRunExec.fExec= + +# +# SecTestRunExit.java test properties +# +SecTestRunExit.mustPass= + +# +# SecTestRunLoad.java test properties +# +SecTestRunLoad.mustPass= +SecTestRunLoad.libName= +# +# SecTestRunLoadLib.java test properties +# +SecTestRunLoadLib.mustPass= +SecTestRunLoadLib.libName= + +# +# SecTestSetSecMgr.java test properties +# +SecTestSetSecMgr.mustPass= + +# +# SecTestSocket.java test properties +# +SecTestSocket.mustPass= +SecTestSocket.fHost= +SecTestSocket.fPort= + +# +# SecTestSysExit.java test properties +# +SecTestSysExit.mustPass= + +# +# SecTestURLFac.java test properties +# +SecTestURLFac.mustPass= +# +# SecTestXAccept.java test properties +# +SecTestXAccept.mustPass= +SecTestXAccept.fHost= +SecTestXAccept.fPort= + +# +# SecTestXAccess.java test properties +# +SecTestXAccess.mustPass= + +# +# SecTestXAccessTG.java test properties +# +SecTestXAccessTG.mustPass= + +# +# SecTestXAccessTop.java test properties +# +SecTestXAccessTop.mustPass= + +# +# SecTestXCCL.java test properties +# +SecTestXCCL.mustPass= + +# +# SecTestXConn.java test properties +# +SecTestXConn.mustPass= +SecTestXConn.fHost= +SecTestXConn.fPort= + +# +# SecTestXDelete.java test properties +# +SecTestXDelete.mustPass= +SecTestXDelete.fName= + +# +# SecTestXExec.java test properties +# +SecTestXExec.mustPass= +SecTestXExec.fExec= + +# +# SecTestXExit.java test properties +# +SecTestXExit.mustPass= + +# +# SecTestXLink.java test properties +# +SecTestXLink.mustPass= +SecTestXLink.fLink= + +# +# SecTestXListen.java test properties +# +SecTestXListen.mustPass= +SecTestXListen.fPort= + +# +# SecTestXPakAcc.java test properties +# +SecTestXPakAcc.mustPass= +SecTestXPakAcc.packageName= + +# +# SecTestXPakDef.java test properties +# +SecTestXPakDef.mustPass= +SecTestXPakDef.packageName= + +# +# SecTestXPropAcc.java test properties +# +SecTestXPropAcc.mustPass= + +# +# SecTestXRead.java test properties +# +SecTestXRead.mustPass= +SecTestXRead.fName= + +# +# SecTestXSetFac.java test properties +# +SecTestXSetFac.mustPass= + +# +# SecTestXWrite.java test properties +# +SecTestXWrite.mustPass= +SecTestXWrite.fName= + +# +# WriteFileTest.java test properties +# +WriteFileTest.mustPass= +WriteFileTest.FileName= + diff --git a/java/plugins/test/config/set_env.bat b/java/plugins/test/config/set_env.bat new file mode 100644 index 000000000000..06c72919f32a --- /dev/null +++ b/java/plugins/test/config/set_env.bat @@ -0,0 +1,4 @@ +# The directory where html files of tests should be placed +# The URL of this directory should be pointed in HTML_ROOT +set HTML_ROOT_DIR=h:\apache\share\htdocs\pl_tests + diff --git a/java/plugins/test/doc/automated.html b/java/plugins/test/doc/automated.html new file mode 100644 index 000000000000..1fa493734b20 --- /dev/null +++ b/java/plugins/test/doc/automated.html @@ -0,0 +1,54 @@ + + +Pluglet API automated tests + + +

Pluglet API automated tests

+

Table of contents.

+
+- Preliminary specification
+- How to build
+- How to run
+Documentation on test cases:
+ - Browser side api tests 
+ - Scenario tests 
+ - Security tests 
+ - Tests on passed in client side api parameters 
+ - Tests on return values from client side api 
+
+
+How to build.
+- setup environment for mozilla building and running
+- goto config directory and fill 
+  CommonProperties and set_env.bat files.
+  (or set_env.sh in case of Unix build)
+- run the config/set_env.bat file
+  (or source set_env.sh in case of Unix build)
+- goto src/org/mozilla/pluglet/test/basic/ directory 
+  and make with makefile in this directory
+
+How to run.
+There is autorun.pl script to run test cases and BWTest.lst.ORIG 
+with list of all test cases in src/org/mozilla/pluglet/test/basic/ 
+directory. 
+To run all test cases in BWTest.lst.ORIG:
+
+perl autorun.pl
+
+It is possible to list required test cases in another file:
+
+perl autorun.pl -f file_with_sub_list
+
+To run single test case:
+
+perl autorun.pl -t test_case
+
+
+ + + + + + + diff --git a/java/plugins/test/doc/equiv_classes.html b/java/plugins/test/doc/equiv_classes.html new file mode 100644 index 000000000000..db62527a5a2c --- /dev/null +++ b/java/plugins/test/doc/equiv_classes.html @@ -0,0 +1,438 @@ + + + +Browser side pluglet API arguments partitioning. + + + +Table of contents +
    +
  1. Introduction +
  2. PlugletManager interface +
  3. PlugletPeer interface +
  4. PlugletStreamInfo interface +
  5. PlugletTagInfo +
  6. PlugletTagInfo2 +
+ +Below the description of equivalence class partitioning of the browser side pluglet API.
+This partitioning is based on: +
    +
  • common partitioning for parameter of given type
    + (for example <for_string>: null, 0 length, some arbitrary string) +
  • partitioning from point of view of functional sense of this parameter
    + (for example <for_target>: <for_string>, "_self", "_parent", "_top", "_blank", + non-existing and existing named target) +
+Some commom set of parameters: + + + + + +
<for_int> 0, (+-)MAX, some arbitrary value
<for_boolean> true, false
<for_string>null, non-null with 0 length, some arbitrary string
<for_target> <for_string>, "_self", "_parent", "_top", "_blank", non-existing and + existing named target
+
+Comment: 
+- for PlugletManager.getURL and especially for PlugletManager.postURL the number of 
+  possible combinations of parameters is very big, so the combinations with more than 
+  2 for getURL and 1 for postURL "incorrect" parameters will not be tested.
+- for methods with non-void return values should be modelled situations such that expected 
+  return values cover all significant classes from specified set of return values (
+  for example for PlugletInstancePeer.getMode specified set of return values consist of  
+  only two values indicated embedded pluglet or full-page ( not of whole set of int values)) 
+- values of arguments for each test you can find in the ParamCombinations file in test dir
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Interface PlugletManager
+Method + +Arguments + +Values +
public void getURL +PlugletInstance plugletInstnull, this and other instance (when method is called inside the pluglet instance)
URL urlnull, http, javascript, ftp, file(win32 & unix), gopher, news +
String target +<for_target> +
PlugletStreamListener streamListener +null, new listener and used +
String altHost +null, the same as in url, other than in url, bad string(not ip address) +
URL refferer +null, the url of this page - cases of http, javascript, ftp, file(although in + last 3 cases there is not refferer) +
boolean forceJSEnabled +<for_boolean> +
public void postURL +PlugletInstance plugletInstnull, this and other instance (when method is called inside the pluglet instance)
URL url +null, http, javascript, ftp, file(win32 & unix), news, mailto +
int postDataLen +<for_int>, equal to actual length, less and great +
byte[] postData +null, 0 byte array, random array fulfiled and not, syntactically + correct path + name of existing file and non-existent, also syntactically incorrect path +
boolean isFile +<for_boolean> +
String target +<for_target> +
PlugletStreamListener streamListener +null, new listener and used +
String altHost +null, the same as in url, other than in url, bad string(not ip address) +
URL referrer +null, the url of this page - cases of http, javascript, ftp, file(although in + last 3 cases there is not refferer) +
boolean forceJSEnabled +<for_boolean> +
int postHeadersLength +<for_int>, equal to actual length, less and great +
byte[] postHeaders +postHeaders + null, 0 byte array, correctly formed headers (fulfiled array and not) and not +
public void reloadPluglets +boolean reloadPages<for_boolean>
public String userAgentnonenone
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Interface PlugletPeer
+Method + +Arguments + +Values +
public String getMIMETypenonenone
public int getModenonenone
public PlugletTagInfo getTagInfononenone
public String getValueint variable<for_int>, PlugletInstancePeer.NETSCAPE_WINDOW, PlugletManager.APPCONTEXT, + PlugletManager.DISPLAY
public OutputStream newStreamString type<for_string>, text/html, text/plain, image/gif, application/x-java-vm, incorrectly formed
String target +<for_target> +
public void setWindowSizeint width<for_int>
int height +<for_int> +
public void showStatusString message<for_string>
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Interface PlugletStreamInfo
+Method + +Arguments + +Values +
public String getContentTypenonenone
public int getLastModifiednonenone
public int getLengthnonenone
public String getURLnonenone
public boolean isSeekablenonenone
public void requestReadByteRanges rangesnull, non-null object with 0 ranges, with 1 range for each combination: <for_int> x <for_int>, with more than 1 range
+ +
+ + + + + + + + + + + + + + + + + +
Interface PlugletTagInfo
+Method + +Arguments + +Values +
public String getAttributeString name<for_string>, existing attribute name
public Properties getAttributesnonenone
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Interface PlugletTagInfo2
+Method + +Arguments + +Values +
public String getAlignmentnonenone
public String getAttributeString name<for_string>, existing attribute name
public Properties getAttributesnonenone
public int getBorderHorizSpacenonenone
public int getBorderVertSpacenonenone
public String getDocumentBasenonenone
public String getDocumentEncodingnonenone
public int getHeightnonenone
public String getParameterString name<for_string>, existing parameter name
public Properties getParametersnonenone
public String getTagTextnonenone
public String getTagTypenonenone
public int getUniqueIDnonenone
public int getWidthnonenone
+ + + + + + + + + + + diff --git a/java/plugins/test/doc/index.html b/java/plugins/test/doc/index.html new file mode 100644 index 000000000000..984780e40f0a --- /dev/null +++ b/java/plugins/test/doc/index.html @@ -0,0 +1,14 @@ + + + +Pluglets Test Plan + + + +

Pluglet Tests:

+
+ + diff --git a/java/plugins/test/doc/manual.html b/java/plugins/test/doc/manual.html new file mode 100644 index 000000000000..a4fcc514c794 --- /dev/null +++ b/java/plugins/test/doc/manual.html @@ -0,0 +1,96 @@ + + +

Manual Pluglets tests

+At start of your Pluglet test cycle you should verify that Pluglets are permitted to run, +correctly loaded and rendered.
+
    +
  1. Follow to instructions + and install Java Plugins. +
  2. Build the TestPluglet +
  3. Build the Pluglet demos. +
  4. Put JAR archieves with test pluglet and demos to the directory on your filesystem and point + PLUGLET variable to this dir. +
  5. Performs steps from following table for verify Pluglets behaviour. + + + + + + + + + + + + + + + + + + + + + + + + + +
    +Test Pluglet +
      +
    1. Load HTML document with TestPluglet +
    +
    +
      +
    • Verify that pluglet loaded and window with List rendered. +
    • Load any other page, make Back and verify that + pluglet rendered against. +
    +
    +MediaPlayer +
      +
    1. Follow to instruction from MediaPlayer README + to correct media player installation. +
    2. Load play.html from place, where your MediaPlayer example installed. +
    +
    +
      +
    • Verify that player correctly loaded and works. +
    +
    +PDF Viewer +
      +
    1. Follow to instruction from PDF Viewer README + to correct viewer installation. +
    2. Load pdf.html from place, where your PDF Viewer example installed. +
    +
    +
      +
    • Verify that viewer correctly loaded and works. +
    +
    +RTF Viewer +
      +
    1. Load HTML document with RTF Viewer +
    +
    +
      +
    • Verify that example correctly displayed RTF Viewer README. +
    +
    +ZIP Viewer +
      +
    1. Follow to instruction from ZIP Viewer README + to correct viewer installation. +
    2. Load zip.html from place, where your ZIP Viewer example installed. +
    +
    +
      +
    • Verify that viewer correctly loaded and works.(Contents of ZipView.jar should be shown) +
    +
    +
+ + + \ No newline at end of file diff --git a/java/plugins/test/doc/sequence.html b/java/plugins/test/doc/sequence.html new file mode 100644 index 000000000000..d425ad3fd263 --- /dev/null +++ b/java/plugins/test/doc/sequence.html @@ -0,0 +1,44 @@ + + + +Runtime scenario of calling of +pluglet side API methods: + + + +
+Basic template of runtime scenario of calling of 
+pluglet side API methods:
+
+context:Pluglet
+
+Pluglet.initialize()
+
+Pluglet.createPlugletInstance()
+
+	new context: PlugletInstance
+     
+	PlugletInstance.initialize()
+
+	PlugletInstance.start()
+
+	PlugletInstance.newStream()
+			
+		new context:PlugletStreamListener
+			
+		PlugletStreamListener.onStartBinding()
+					
+		PlugletStreamListener.onDataAvailable()
+					
+		PlugletStreamListener.onFileAvailable()
+
+		PlugletStreamListener.onStopBinding()	
+
+	PlugletInstance.stop()
+
+	PlugletInstance.destroy()
+
+Pluglet.shutdown()
+
+
+ \ No newline at end of file diff --git a/java/plugins/test/doc/test_draft.html b/java/plugins/test/doc/test_draft.html new file mode 100644 index 000000000000..b63ef1eef77d --- /dev/null +++ b/java/plugins/test/doc/test_draft.html @@ -0,0 +1,108 @@ + +Draft Pluglet API test design + + +

Pluglet API tests specification.

+
+
+Subject:
+      The subject of testing is  Pluglet API 
+Goals:
+      Goals of testing - to detect errors in pluglet api 
+      implementation and in  functioning of this api in mozilla.
+
+This API is divided on two part:
+ - called by browser (latter called Pluglet side API) 
+ - called by pluglet (latter called Browser side API).
+
+Basic template of runtime scenario of calling of 
+Pluglet side API methods.
+
+Scenario variations:
+- basic straight scenario - without and with calls caused 
+  by data to be loaded for pluglet
+- behaviour of the same pluglet instance in case of back-forward
+- re-creating pluglet instance after reload 
+
+The different pluglets display types:
+- embedded 
+- embedded hidden
+- full page pluglets
+
+Additional situations:
+- incorrect environment (for example PLUGLET)
+- absence of pluglet
+- incomplete pluglet (for example without instance class)
+   Comment: in these cases (1-3) we need to ensure that mozilla doesn't fall
+- different pluglets having pluglet instances (or other classes) 
+   with equal names 
+- finding and loading pluglets based on mime type of data and 
+   handled mime types of pluglet
+
+Security issues:
+- based on fact that the pluglets are run in java environment 
+  the tests should check the correspondence of actual runtime 
+  constrains to specified constrains. 
+
+So, the sets of tests to develop:
+1. scenario tests for each combinations of scenario variations and pluglet display type
+   The sequence of calls of pluglet side API methods should be corresponding to 
+   situation (in correct order, without lacks and additional non-specified calls)
+2. the tests of correctnesses of passed in values and objects in situations of 
+   different scenario and pluglet display type 
+3. returning (for cases when non-void return value is specified) by pluglet side api different values
+   from set of expected values, boundary and non-correct values (from point of 
+   view of functional sense of return value)
+4. the tests of Browser side API 
+   (passed in objects (for example PlugletManager) as well as 
+   objects by request (for example PlugletTagInfo))
+   - the passing in different sets of parameters, including 
+     boundary and non-correct values(from point of view of functional sense of parameters)  
+   - checking that correct values are returned (if applicable)
+   - checking that correct action are performed (if applicable)
+5. the tests for non-falled (and/or correct) behaviour for "additional" situations
+6. the more typical subset of 1,2,3 tests in cases of more than one pluglet 
+   instance (in parallel ( on the same page) as well as in sequence (pluglet on the next page))  
+7. the more typical subset of api tests in multithreading mode - calling the browser side 
+   api methods simultaneously from different threads
+8. security tests
+
+Test space organization:
+- The src, build, config, util, log and doc directories. 
+- All necessary files should be compiled or copied into the build directory. 
+- All common perl scripts should be placed in the util directory
+- Recursive organization of makefiles.
+- The top-level makefile is placed to src/org/mozilla/pluglet/test/basic
+- Top package for all test classes is org.mozilla.pluglet.tests.basic  
+- The suffixes are like to 
+   .scenario
+   .security
+   .security.automated
+   .returns
+   .params
+   .api
+- Every test is like to consist of necessary java files, html file to cause 
+  pluglet instantiation, test properties file - needed settings 
+  for test if they are different from common settings (as example $DELAY for stress 
+  tests or $PLUGLET for testing incorrect value of this one 
+  may differ from common settings) and test parameters file - the parameters that identify 
+  concrete test case in set of tests with the same structure.
+- Perl script autorun.pl is used to invoke automated test cases 
+  and to record their results
+
+
+ + + + + + + + + + + + + + + diff --git a/java/plugins/test/log/dummy.txt b/java/plugins/test/log/dummy.txt new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/java/plugins/test/utils/configurator.pl b/java/plugins/test/utils/configurator.pl new file mode 100644 index 000000000000..48f3672b8c6f --- /dev/null +++ b/java/plugins/test/utils/configurator.pl @@ -0,0 +1,85 @@ +#!/bin/perl +# +# The contents of this file are subject to the Mozilla Public +# License Version 1.1 (the "License"); you may not use this file +# except in compliance with the License. You may obtain a copy of +# the License at http://www.mozilla.org/MPL/ +# +# Software distributed under the License is distributed on an "AS +# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or +# implied. See the License for the specific language governing +# rights and limitations under the License. +# +# The Original Code is mozilla.org code. +# +# The Initial Developer of the Original Code is Sun Microsystems, +# Inc. Portions created by Sun are +# Copyright (C) 1999 Sun Microsystems, Inc. All +# Rights Reserved. +# +# Contributor(s): + +################################################################### +# +# configurator.pl - properties configuration utility +# +# see configurator.readme for details +# + +# Global variables + +$infile = @ARGV[0]; +$outfile = @ARGV[1]; +$template = @ARGV[2]; + +if( $#ARGV < 2) { + printf "Usage: perl configurator.pl infile outfile template\n"; + printf "See configurator.readme for details.\n"; + exit 0; +}; + +open( in, $infile ) + or die( join '', "Can't open", $infile, " for reading. So bye\n" ); +open( out, join '',">",$outfile ) + or die( join '', "Can't open", $outfile, " for writing. So bye\n" ); +open( temple, $template ) + or die( join '', "Can't open template file ",$template," for reading. So bye.\n" ); + +# Now we will read out all the template file lines into the array. +@storage = ; + +while( $l = ) { +# Sign '=' was found and a line isn't a comment + if( ($l !=~ /#/) && ($l =~ /=/) ) { + chop $l; + $l=~s/\r|\n//g; +# avoid linebreaks + @list = split '=',$l; + # Now opening template file + + $keyvalue = @list[1]; + $keyname = @list[0]; + + # Now search for keyname and replace it with the actual value. + $pattern = join '', "<",$keyname,">"; + + for( $i=0; $i<= $#storage; $i++ ) { + + $line = @storage[$i]; + if( $line =~ /$pattern/ ) { + $line=~s/$pattern/$keyvalue/g; + $storage[$i] = $line; + } # if + } # for + } # if +} # while + +# end-of-search +# preparing the output file + +for( $i=0; $i <= $#storage; $i++ ) { + + printf out $storage[$i]; +} + +# job was done diff --git a/java/plugins/test/utils/configurator.readme b/java/plugins/test/utils/configurator.readme new file mode 100644 index 000000000000..b420c1f7bc6a --- /dev/null +++ b/java/plugins/test/utils/configurator.readme @@ -0,0 +1,85 @@ + +configurator.pl readme file + +--------------------------------------------------------- +1. About + + This utility is necessary for test building. Each + test in suite has each own number of properties. + It is also necessary to the end-user to configurate + properties correct, because of different platforms + test is running under and different situation test + suite must be used. + +2. Usage + + perl conigurator.pl infile outfile templatefile + + infile: + + the input file with the key valies. For more + details see "File format section" + + outfile: + + the output file, that generates from template + and input file. For more details see "File + format section" + + template: + + the template file, that describes the format + of output file. For more details see "File + format section" + +3. File format. + + 3.1 Input file + + The input file format seems to be very easy. + "#" sign in the beginning means comment, empty + lines are ignored. The key features described + as this : + + KeyName = KeyValue + + generator utility searches for such a strings + and inserts Key values into the key names fields + as it describes in the template section. + + 3.2 Template file + + The template file is a simple file, that uses + signs as following to insert the key values + into the text. Here comes the example. + + - Example 1 + + See some text is goes and Oo--oO we will insert + the "here" key value, that goes from the input file + + - + + So, generator will search the string in the input + file like this : + + - Example 2 + + # "Here" key + here = my own value + + - + + The output will be like this : + + - Example 3 + + See some text is goes and Oo- my own value -oO we + will insert the "here" key value, that goes from the + input file + + - + +4. FAQ + + TBD \ No newline at end of file diff --git a/java/plugins/test/utils/example.input b/java/plugins/test/utils/example.input new file mode 100644 index 000000000000..6b01612724cd --- /dev/null +++ b/java/plugins/test/utils/example.input @@ -0,0 +1,8 @@ +# +# example.input +# +# This file shows, how you can use the input key values +# +key1= somebody@mail.1 +key2= noone@mail.2 +key3= anonymous@mail.3 (# This does not seems to be a comment) diff --git a/java/plugins/test/utils/example.out b/java/plugins/test/utils/example.out new file mode 100644 index 000000000000..468e19f60b88 --- /dev/null +++ b/java/plugins/test/utils/example.out @@ -0,0 +1,12 @@ +# +# example.template +# +# This file shows, how you can use the +# template values. +# + +Welcome to the template. You can send a dummy mail to the +one man : somebody@mail.1. If you does like this example you can +send the email to noone@mail.2, anonymous@mail.3 (# This does not seems to be a comment) . Note, that all these +email addresses are in space - there's no such a domains. + diff --git a/java/plugins/test/utils/example.template b/java/plugins/test/utils/example.template new file mode 100644 index 000000000000..0b659d68376f --- /dev/null +++ b/java/plugins/test/utils/example.template @@ -0,0 +1,13 @@ +# +# example.template +# +# This file shows, how you can use the +# template values. +# + +Welcome to the template. You can send a dummy mail to the +one man : . If you does like this example you can +send the email to , . Note, that all these +email addresses are in space - there's no such a domains. + +Thank you. \ No newline at end of file