Author: shankar
Date: Sun Feb 10 21:51:48 2008
New Revision: 620418
URL: http://svn.apache.org/viewvc?rev=620418&view=rev
Log:
support to run scenarios automatically on windows.
Added:
webservices/rampart/trunk/c/samples/secpolicy/deploy.js
webservices/rampart/trunk/c/samples/secpolicy/test_scen.bat
Modified:
webservices/rampart/trunk/c/samples/secpolicy/README
webservices/rampart/trunk/c/samples/secpolicy/deploy.bat
Modified: webservices/rampart/trunk/c/samples/secpolicy/README
URL:
http://svn.apache.org/viewvc/webservices/rampart/trunk/c/samples/secpolicy/README?rev=620418&r1=620417&r2=620418&view=diff
==============================================================================
--- webservices/rampart/trunk/c/samples/secpolicy/README (original)
+++ webservices/rampart/trunk/c/samples/secpolicy/README Sun Feb 10 21:51:48
2008
@@ -4,7 +4,6 @@
E.g. %sh deploy.sh scenario1
Windows users please use the "deploy.bat".
-Once policy files are deployed, Windows user must change path names and file
extension appropriately.
Make sure you have run the
samples/client/sec_echo/deploy_client_repo.sh on Linux or
@@ -74,6 +73,7 @@
If you are in a real hurry and need to try a scenario please use
"test_scen.sh".
Usage : %sh test_scen.sh scenarioX server-port
E.g. %sh test_scen.sh scenario3 8080
+test_scen.bat scenario3 8080
* I need to try all the scenarios
-------------------------------
Modified: webservices/rampart/trunk/c/samples/secpolicy/deploy.bat
URL:
http://svn.apache.org/viewvc/webservices/rampart/trunk/c/samples/secpolicy/deploy.bat?rev=620418&r1=620417&r2=620418&view=diff
==============================================================================
--- webservices/rampart/trunk/c/samples/secpolicy/deploy.bat (original)
+++ webservices/rampart/trunk/c/samples/secpolicy/deploy.bat Sun Feb 10
21:51:48 2008
@@ -5,10 +5,7 @@
echo Deploying %scn%
echo Copying %scn%\client policy file
-copy %scn%\client-policy.xml %AXIS2C_HOME%\client_repo\policy.xml
+deploy.js %scn%\client-policy.xml %AXIS2C_HOME%\client_repo\policy.xml
echo Copying %scn%\services.xml
-copy %scn%\services.xml %AXIS2C_HOME%\services\sec_echo\services.xml
-echo Please change path name settings in following files before running the
client
-echo 1. %AXIS2C_HOME%\client_repo\policy.xml
-echo 2. %AXIS2C_HOME%\services\sec_echo\services.xml
[EMAIL PROTECTED] on
\ No newline at end of file
+deploy.js %scn%\services.xml %AXIS2C_HOME%\services\sec_echo\services.xml
[EMAIL PROTECTED] on
Added: webservices/rampart/trunk/c/samples/secpolicy/deploy.js
URL:
http://svn.apache.org/viewvc/webservices/rampart/trunk/c/samples/secpolicy/deploy.js?rev=620418&view=auto
==============================================================================
--- webservices/rampart/trunk/c/samples/secpolicy/deploy.js (added)
+++ webservices/rampart/trunk/c/samples/secpolicy/deploy.js Sun Feb 10 21:51:48
2008
@@ -0,0 +1,41 @@
+var WshShell = new ActiveXObject("WScript.Shell");
+fso = new ActiveXObject("Scripting.FileSystemObject");
+
+var fso, f, s, re, ss, r;
+var ForReading = 1, ForWriting = 2;
+
+var axis2c_home = WshShell.ExpandEnvironmentStrings("%AXIS2C_HOME%");
+var client_repo = axis2c_home + "\\client_repo";
+var args = WScript.Arguments;
+
+var read_file = args.Item(0);
+var deploy_file = args.Item(1);
+
+// Deploy the client policy file
+f = fso.OpenTextFile(read_file, ForReading);
+s = f.ReadAll();
+f.Close();
+
+f = fso.OpenTextFile(deploy_file, ForWriting, true);
+while (s.search(/AXIS2C_HOME/) != -1) {
+ r = s.replace(/AXIS2C_HOME/, axis2c_home);
+ s = r;
+}
+while (s.search(/libpwcb\.so/) != -1) {
+ r = s.replace(/libpwcb\.so/, "pwcb.dll");
+ s = r;
+}
+while (s.search(/librdflatfile\.so/) != -1) {
+ r = s.replace(/librdflatfile\.so/, "rdflatfile.dll");
+ s = r;
+}
+while (s.search(/libsctprovider\.so/) != -1) {
+ r = s.replace(/libsctprovider\.so/, "sctprovider.dll");
+ s = r;
+}
+while (s.search(/libsctprovider_hashdb\.so/) != -1) {
+ r = s.replace(/libsctprovider_hashdb\.so/, "sctprovider_hashdb.dll");
+ s = r;
+}
+f.write(s);
+f.close();
Added: webservices/rampart/trunk/c/samples/secpolicy/test_scen.bat
URL:
http://svn.apache.org/viewvc/webservices/rampart/trunk/c/samples/secpolicy/test_scen.bat?rev=620418&view=auto
==============================================================================
--- webservices/rampart/trunk/c/samples/secpolicy/test_scen.bat (added)
+++ webservices/rampart/trunk/c/samples/secpolicy/test_scen.bat Sun Feb 10
21:51:48 2008
@@ -0,0 +1,47 @@
[EMAIL PROTECTED] off
+if "%1" == "" goto end
+if "%2" == "" goto end
+
+set _SMPL_DIR=%cd%
+set _SLEEP=3
+
+echo -------------------------------------------------------------------------
+echo Deploying %1
+echo -------------------------------------------------------------------------
+
+call deploy.bat %1
[EMAIL PROTECTED] off
+
+echo Killing server
+taskkill /F /IM axis2_http_server.exe
+
+echo Go to %AXIS2C_HOME%
+cd %AXIS2C_HOME%/bin
+
+echo Start server @ %2
+start /min axis2_http_server.exe -p%2
+
+rem echo Sleeping for %_SLEEP% seconds
+echo waiting.......
+pause %_SLEEP%
+
+echo Go to client directory
+cd %_SMPL_DIR%/../client/sec_echo
+
+echo Run the sample
+call update_n_run.bat
[EMAIL PROTECTED] off
+
+echo Killing server
+taskkill /F /IM axis2_http_server.exe
+
+echo Jump back to samples dir :%_SMPL_DIR%
+cd %_SMPL_DIR%
+
+goto superend
+
+:end
+echo usage %0 scenarioxx server_port
+
+:superend
+if "%3" == "" @echo on