You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-dev@jakarta.apache.org by ju...@apache.org on 2002/01/31 12:57:39 UTC
cvs commit: jakarta-slide/testsuite/bin TProcessor.CMD
juergen 02/01/31 03:57:38
Modified: testsuite/testsuite/junit/src/org/apache/slide/testsuite/testtools/tprocessor
TProcessors.java
testsuite/bin TProcessor.CMD
Log:
added the possibility to set the userid and password from the t-processor command line.
Revision Changes Path
1.4 +22 -21 jakarta-slide/testsuite/testsuite/junit/src/org/apache/slide/testsuite/testtools/tprocessor/TProcessors.java
Index: TProcessors.java
===================================================================
RCS file: /home/cvs/jakarta-slide/testsuite/testsuite/junit/src/org/apache/slide/testsuite/testtools/tprocessor/TProcessors.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- TProcessors.java 8 Jan 2002 14:36:38 -0000 1.3
+++ TProcessors.java 31 Jan 2002 11:57:38 -0000 1.4
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-slide/testsuite/testsuite/junit/src/org/apache/slide/testsuite/testtools/tprocessor/TProcessors.java,v 1.3 2002/01/08 14:36:38 juergen Exp $
- * $Revision: 1.3 $
- * $Date: 2002/01/08 14:36:38 $
+ * $Header: /home/cvs/jakarta-slide/testsuite/testsuite/junit/src/org/apache/slide/testsuite/testtools/tprocessor/TProcessors.java,v 1.4 2002/01/31 11:57:38 juergen Exp $
+ * $Revision: 1.4 $
+ * $Date: 2002/01/31 11:57:38 $
*
* ====================================================================
*
@@ -83,7 +83,7 @@
* Main class to performe a test case and check and report the results
*
* @author Software AG
- * @version $Revision: 1.3 $
+ * @version $Revision: 1.4 $
*/
public class TProcessors {
@@ -102,6 +102,12 @@
/** host */
String host;
+ /** user */
+ String defaultUser;
+
+ /** password */
+ String defaultPassword;
+
/** hold all the variable defined **/
KnownVariablesHashtable knownVariables = new KnownVariablesHashtable();
@@ -131,6 +137,14 @@
xdavhome = System.getProperty("xdav.home");
host = System.getProperty("xdav.host");
port = System.getProperty("xdav.port");
+ defaultUser = System.getProperty("xdav.user");
+ defaultPassword = System.getProperty("xdav.password");
+ if (defaultUser == null) {
+ defaultUser = "guest";
+ }
+ if (defaultPassword == null) {
+ defaultPassword = "guest";
+ }
if (host == null) {
System.out.println("xdav.host is not set!");
throw new Error("xdav.host is not set!");
@@ -148,7 +162,6 @@
startUp = new Hashtable();
startUp.put("host", host);
startUp.put("port", new Integer(port));
- startUp.put("user", "guest");
try { xdavConfiguration = new XConf(new File(xdavhome +
@@ -235,8 +248,6 @@
*
* -host [the host to connect to]</br>
* -port [the port the host is running webdav on]<br>
- * -u [username]<br>
- * -p [password]<br>
*
* There are default set if anything is missing.<br>
*
@@ -278,15 +289,7 @@
ready = true;
}
- if (arg.isOptionSet( "u" ) ) {
- startUp.put("user", arg.get("u") );
- ready = true;
- }
- if (arg.isOptionSet( "p" ) ){
- startUp.put("password", arg.get("password") );
- ready = true;
- }
if (arg.isOptionSet( "name" ) ){
ready = true;
@@ -305,8 +308,6 @@
System.out.println(" -name <The name of testcase, full path should be given>");
System.out.println(" -host <host to connect to>");
System.out.println(" -port <post to conect on>");
- System.out.println(" -u <username>");
- System.out.println(" -p <password>");
System.out.println(" -help");
@@ -482,16 +483,16 @@
assignVariables(elt.getChildren("assign"));
- String user = replaceKnownVariable(elt.getChild("user"), (String)startUp.get("user"));
- String password = replaceKnownVariable(elt.getChild("password"), (String)startUp.get("password"));
+ String user = replaceKnownVariable(elt.getChild("user"), defaultUser);
+ String password = replaceKnownVariable(elt.getChild("password"), defaultPassword);
HttpClient client = new HttpClient();
client.startSession((String)startUp.get("host"), ((Integer)startUp.get("port") ).intValue());
client.setCredentials(new Credentials(user, password));
client.setState(new WebdavState()); // neede in the next version of Slide !!!! [jpl]
client.setDebug(0);
- // System.out.println("############### user " + user);
- // System.out.println("############### pwd " + password);
+ System.out.println("############### user " + user);
+ System.out.println("############### pwd " + password);
xmlresult.writeElementStart("exceuteStep");
1.4 +31 -8 jakarta-slide/testsuite/bin/TProcessor.CMD
Index: TProcessor.CMD
===================================================================
RCS file: /home/cvs/jakarta-slide/testsuite/bin/TProcessor.CMD,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- TProcessor.CMD 21 Dec 2001 16:03:53 -0000 1.3
+++ TProcessor.CMD 31 Jan 2002 11:57:38 -0000 1.4
@@ -10,7 +10,10 @@
rem (3) TP_STORE identifies the Slide store for the TProcessor to operate on.
rem (4) TP_USERS is the number of concurrent users for the multiuser testcases.
rem (5) TP_ITERATIONS is the number of iterations each concurrent user performs an action.
+rem (6) DAV_USER and DAV_PASSWORD are used for authentification against the web server.
set DAV_HOST=localhost
+set DAV_USER=guest
+set DAV_PASSWORD=guest
set DAV_PORT=8080
set DAV_NAME=slide
set TP_STORE=files
@@ -30,6 +33,8 @@
if "%1" == "-help" goto HELP
if "%1" == "-home" goto SET_HOME
if "%1" == "-davhost" goto SET_HOST
+if "%1" == "-davuser" goto SET_USER
+if "%1" == "-davpassword" goto SET_PASSWORD
if "%1" == "-davport" goto SET_PORT
if "%1" == "-davname" goto SET_NAME
if "%1" == "-store" goto SET_STORE
@@ -56,6 +61,20 @@
shift
goto LOOP
+
+:SET_USER
+shift
+set DAV_USER=%1
+shift
+goto LOOP
+
+
+:SET_PASSWORD
+shift
+set DAV_PASSWORD=%1
+shift
+goto LOOP
+
:SET_PORT
shift
set DAV_PORT=%1
@@ -104,6 +123,8 @@
set OPTS=
set OPTS=%OPTS% -Dxdav.home="%TP_HOME%"
set OPTS=%OPTS% -Dxdav.host=%DAV_HOST%
+set OPTS=%OPTS% -Dxdav.host=%DAV_USER%
+set OPTS=%OPTS% -Dxdav.host=%DAV_PASSWORD%
set OPTS=%OPTS% -Dxdav.port=%DAV_PORT%
set OPTS=%OPTS% -Dxdav.globalVariableServerName=%DAV_NAME%
set OPTS=%OPTS% -Dxdav.globalVariableCollection=%TP_STORE%
@@ -144,14 +165,16 @@
echo Usage: tprocessor [options]
echo.
echo Options:
-echo -davhost ^<webdavserver_host^> (default: localhost)
-echo -davport ^<webdavserver_port^> (default: 8080)
-echo -davname ^<webdavserver_name^> (default: slide)
-echo -store ^<store_to_operate_on^> (default: files)
-echo -users ^<number_of_users^> (default: 10)
-echo -iterations ^<number_of_iterations^> (default: 10)
-echo -testcase ^<xmltestcase_path^> (relative to the home directory)
-echo -pattern ^<xmltestcase_pattern^> (wildard is *, file separator is \\)
+echo -davuser ^<webdavserver_user^> (default: guest)
+echo -davpassword ^<webdavserver_password^> (default: guest)
+echo -davhost ^<webdavserver_host^> (default: localhost)
+echo -davport ^<webdavserver_port^> (default: 8080)
+echo -davname ^<webdavserver_name^> (default: slide)
+echo -store ^<store_to_operate_on^> (default: files)
+echo -users ^<number_of_users^> (default: 10)
+echo -iterations ^<number_of_iterations^> (default: 10)
+echo -testcase ^<xmltestcase_path^> (relative to the home directory)
+echo -pattern ^<xmltestcase_pattern^> (wildard is *, file separator is \\)
echo.
echo If both, -testcase and -pattern are omitted, all testcases are executed.
echo.
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>