当前位置: 首页>>代码示例>>Java>>正文


Java ArgumentNames类代码示例

本文整理汇总了Java中org.robotframework.javalib.annotation.ArgumentNames的典型用法代码示例。如果您正苦于以下问题:Java ArgumentNames类的具体用法?Java ArgumentNames怎么用?Java ArgumentNames使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ArgumentNames类属于org.robotframework.javalib.annotation包,在下文中一共展示了ArgumentNames类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: patchRequest

import org.robotframework.javalib.annotation.ArgumentNames; //导入依赖的package包/类
@RobotKeyword(" Send a PATCH request on the session object found using the\n\n"
		 + "given `alias`\n\n"
		 + "``alias`` that will be used to identify the Session object in the cache\n\n"
		 + "``uri`` to send the PATCH request to\n\n"
		 + "``data`` a dictionary of key-value pairs that will be urlencoded and sent as PATCH data or binary data that is sent as the raw body content\n\n"
		 + "``headers`` a dictionary of headers to use with the request\n\n"
		 + "``files`` a dictionary of file names containing file data to PATCH to the server\n\n"
		 + "\n\n"
		 + "``allow_redirects`` Boolean. Set to True if redirect following is allowed.\n\n"
		 + "``timeout`` connection timeout")
@ArgumentNames({ "alias", "uri", "data={}", "headers={}", "files={}", "allow_redirects=False", "timeout=0" })
public ResponseData patchRequest(String alias, String uri, String... params) {
	RestClient rc = new RestClient();
	Object dataList = (String) Robot.getParamsValue(params, 0, "");
	if (Robot.isDictionary(dataList.toString())) {
		dataList = (Map<String, String>) Robot.getParamsValue(params, 0,
				(Map<String, String>) new HashMap<String, String>());
	}
	Map<String, String> headers = Robot.getParamsValue(params, 1,
			(Map<String, String>) new HashMap<String, String>());
	Map<String, String> files = Robot.getParamsValue(params, 2,
			(Map<String, String>) new HashMap<String, String>());
	Boolean allowRedirects = Boolean.parseBoolean(Robot.getParamsValue(params, 3, "false"));
	rc.makePatchRequest(alias, uri, dataList, headers, files, allowRedirects);
	return rc.getSession(alias).getResponseData();
}
 
开发者ID:Hi-Fi,项目名称:robotframework-httprequestlibrary,代码行数:27,代码来源:Patch.java

示例2: deleteRequest

import org.robotframework.javalib.annotation.ArgumentNames; //导入依赖的package包/类
@RobotKeyword(" Send a DELETE request on the session object found using the\n\n"
		 + "given `alias`\n\n"
		 + "``alias`` that will be used to identify the Session object in the cache\n\n"
		 + "``uri`` to send the DELETE request to\n\n"
		 + "``data`` a dictionary of key-value pairs that will be urlencoded and sent as DELETE data or binary data that is sent as the raw body content\n\n"
		 + "``params`` url parameters to append to the uri\n\n"
		 + "``headers`` a dictionary of headers to use with the request\n\n"
		 + "\n\n"
		 + "``allow_redirects`` Boolean. Set to True if redirect following is allowed.\n\n"
		 + "``timeout`` connection timeout")
@ArgumentNames({ "alias", "uri", "data={}", "params={}", "headers={}", "allow_redirects=False", "timeout=0" })
public ResponseData deleteRequest(String alias, String uri, String... params) {
	RestClient rc = new RestClient();
	Object dataList = (String) Robot.getParamsValue(params, 0, "");
	if (Robot.isDictionary(dataList.toString())) {
		dataList = (Map<String, String>) Robot.getParamsValue(params, 0,
				(Map<String, String>) new HashMap<String, String>());
	}
	Map<String, String> paramList = Robot.getParamsValue(params, 1,
			(Map<String, String>) new HashMap<String, String>());
	Map<String, String> headers = Robot.getParamsValue(params, 2,
			(Map<String, String>) new HashMap<String, String>());
	Boolean allowRedirects = Boolean.parseBoolean(Robot.getParamsValue(params, 3, "true"));
	rc.makeDeleteRequest(alias, uri, dataList, paramList, headers, allowRedirects);
	return rc.getSession(alias).getResponseData();
}
 
开发者ID:Hi-Fi,项目名称:robotframework-httprequestlibrary,代码行数:27,代码来源:Delete.java

示例3: createSession

import org.robotframework.javalib.annotation.ArgumentNames; //导入依赖的package包/类
@RobotKeyword("Create a HTTP session to a server\n\n"
		 + "``url`` Base url of the server\n\n"
		 + "``alias`` Robot Framework alias to identify the session\n\n"
		 + "``headers`` Dictionary of default headers\n\n"
		 + "``auth`` List of username & password for HTTP Basic Auth\n\n"
		 + "``timeout`` Connection timeout\n\n"
		 + "\n\n"
		 + "``proxy`` Dictionary that contains proxy information. Only one proxy supported per session. Dictionary should contain at least following keys: *protocol*, *host* and *port* of proxy. It can also contain *username* and *password*\n\n"
		 + "``verify`` Whether the SSL cert will be verified. A CA_BUNDLE path can also be provided.\n\n"
		 + "``debug`` Enable http verbosity option more information\n\n")
@ArgumentNames({ "alias", "url", "headers={}", "cookies=None", "auth=None", "timeout=None", "proxy=None",
		"verify=False", "debug=False" })
public void createSession(String alias, String url, String... params) {
	RestClient rc = new RestClient();
	Map<String, String> headers = Robot.getParamsValue(params, 0, new HashMap<String, String>());
	
	Proxy proxy = new Proxy(Robot.getParamsValue(params, 4, new HashMap<String, String>()));
	String verify = Robot.getParamsValue(params, 5, "False");
	Boolean debug = Boolean.parseBoolean(Robot.getParamsValue(params, 6, "False"));
	RobotLogger.setDebugToAll(debug);
	Authentication auth = Authentication
			.getAuthentication(Robot.getParamsValue(params, 2, (List<String>) new ArrayList<String>()));
	rc.createSession(alias, url, headers, auth, verify, debug, proxy);
}
 
开发者ID:Hi-Fi,项目名称:robotframework-httprequestlibrary,代码行数:25,代码来源:Session.java

示例4: createDigestSession

import org.robotframework.javalib.annotation.ArgumentNames; //导入依赖的package包/类
@RobotKeyword("Create a HTTP session to a server\n\n"
		 + "``url`` Base url of the server\n\n"
		 + "``alias`` Robot Framework alias to identify the session\n\n"
		 + "``headers`` Dictionary of default headers\n\n"
		 + "``auth`` List of username & password for HTTP Digest Auth\n\n"
		 + "``timeout`` Connection timeout\n\n"
		 + "\n\n"
		 + "``proxy`` Dictionary that contains proxy information. Only one proxy supported per session. Dictionary should contain at least following keys: *protocol*, *host* and *port* of proxy. It can also contain *username* and *password*\n\n"
		 + "``verify`` Whether the SSL cert will be verified. A CA_BUNDLE path can also be provided.\n\n"
		 + "``debug`` Enable http verbosity option more information\n\n")
@ArgumentNames({ "alias", "url", "headers={}", "cookies=None", "auth=None", "timeout=None", "proxy=None",
		"verify=False", "debug=False" })
public void createDigestSession(String alias, String url, String... params) {
	RestClient rc = new RestClient();
	Map<String, String> headers = Robot.getParamsValue(params, 0, new HashMap<String, String>());
	Proxy proxy = new Proxy(Robot.getParamsValue(params, 4, new HashMap<String, String>()));
	String verify = Robot.getParamsValue(params, 5, "False");
	Boolean debug = Boolean.parseBoolean(Robot.getParamsValue(params, 6, "False"));
	RobotLogger.setDebugToAll(debug);
	Authentication auth = Authentication.getAuthentication(
			Robot.getParamsValue(params, 2, (List<String>) new ArrayList<String>()), Authentication.Type.DIGEST);
	rc.createSession(alias, url, headers, auth, verify, debug, proxy);
}
 
开发者ID:Hi-Fi,项目名称:robotframework-httprequestlibrary,代码行数:24,代码来源:Session.java

示例5: getRequest

import org.robotframework.javalib.annotation.ArgumentNames; //导入依赖的package包/类
@RobotKeyword(" Send a GET request on the session object found using the\n\n"
		 + "given `alias`\n\n"
		 + "``alias`` that will be used to identify the Session object in the cache\n\n"
		 + "``uri`` to send the GET request to\n\n"
		 + "``params`` url parameters to append to the uri\n\n"
		 + "``headers`` a dictionary of headers to use with the request\n\n"
		 + "\n\n"
		 + "``allow_redirects`` Boolean. Set to True if redirect following is allowed.\n\n"
		 + "``timeout`` connection timeout")
@ArgumentNames({ "alias", "uri", "headers={}", "params={}", "allow_redirects=true", "timeout=0" })
public ResponseData getRequest(String alias, String uri, String... params) {
	RestClient rc = new RestClient();
	Boolean allowRedirects = Boolean.parseBoolean(Robot.getParamsValue(params, 2, "true"));
	Map<String, String> paramList = Robot.getParamsValue(params, 1,
			(Map<String, String>) new HashMap<String, String>());
	Map<String, String> headers = Robot.getParamsValue(params, 0,
			(Map<String, String>) new HashMap<String, String>());
	rc.makeGetRequest(alias, uri, headers, paramList, allowRedirects);
	return rc.getSession(alias).getResponseData();
}
 
开发者ID:Hi-Fi,项目名称:robotframework-httprequestlibrary,代码行数:21,代码来源:Get.java

示例6: headRequest

import org.robotframework.javalib.annotation.ArgumentNames; //导入依赖的package包/类
@RobotKeyword(" Send a HEAD request on the session object found using the\n\n"
		 + "given `alias`\n\n"
		 + "``alias`` that will be used to identify the Session object in the cache\n\n"
		 + "``uri`` to send the HEAD request to\n\n"
		 + "``headers`` a dictionary of headers to use with the request\n\n"
		 + "\n\n"
		 + "``allow_redirects`` Boolean. Set to True if redirect following is allowed.\n\n"
		 + "``timeout`` connection timeout")
@ArgumentNames({ "alias", "uri", "headers={}", "allow_redirects=False", "timeout=0" })
public ResponseData headRequest(String alias, String uri, String... params) {
	RestClient rc = new RestClient();
	Map<String, String> headers = Robot.getParamsValue(params, 0,
			(Map<String, String>) new HashMap<String, String>());
	Boolean allowRedirects = Boolean.parseBoolean(Robot.getParamsValue(params, 1, "false"));
	rc.makeHeadRequest(alias, uri, headers, allowRedirects);
	return rc.getSession(alias).getResponseData();
}
 
开发者ID:Hi-Fi,项目名称:robotframework-httprequestlibrary,代码行数:18,代码来源:Head.java

示例7: optionsRequest

import org.robotframework.javalib.annotation.ArgumentNames; //导入依赖的package包/类
@RobotKeyword(" Send a OPTIONS request on the session object found using the\n\n"
		 + "given `alias`\n\n"
		 + "``alias`` that will be used to identify the Session object in the cache\n\n"
		 + "``uri`` to send the OPTIONS request to\n\n"
		 + "``headers`` a dictionary of headers to use with the request\n\n"
		 + "\n\n"
		 + "``allow_redirects`` Boolean. Set to True if redirect following is allowed.\n\n"
		 + "``timeout`` connection timeout")
@ArgumentNames({ "alias", "uri", "headers={}", "allow_redirects=False", "timeout=0" })
public ResponseData optionsRequest(String alias, String uri, String... params) {
	RestClient rc = new RestClient();
	Map<String, String> headers = Robot.getParamsValue(params, 0,
			(Map<String, String>) new HashMap<String, String>());
	Boolean allowRedirects = Boolean.parseBoolean(Robot.getParamsValue(params, 1, "true"));
	rc.makeOptionsRequest(alias, uri, headers, allowRedirects);
	return rc.getSession(alias).getResponseData();
}
 
开发者ID:Hi-Fi,项目名称:robotframework-httprequestlibrary,代码行数:18,代码来源:Options.java

示例8: deleteAllRowsFromTable

import org.robotframework.javalib.annotation.ArgumentNames; //导入依赖的package包/类
@RobotKeyword("Deletes the entire content of the given database table. This keyword is"
		+ "useful to start tests in a clean state. Use this keyword with care as"
		+ "accidently execution of this keyword in a productive system will cause"
		+ "heavy loss of data. There will be no rollback possible.\n\n" + "Example: \n"
		+ "| Delete All Rows From Table | MySampleTable |")
@ArgumentNames({ "Table name" })
public void deleteAllRowsFromTable(String tableName) throws SQLException {
	String sql = "delete from " + tableName;

	Statement stmt = DatabaseConnection.getConnection().createStatement();
	try {
		stmt.execute(sql);
	} finally {
		stmt.close();
	}
}
 
开发者ID:Hi-Fi,项目名称:robotframework-dblibrary,代码行数:17,代码来源:Query.java

示例9: checkPrimaryKeyColumnsForTable

import org.robotframework.javalib.annotation.ArgumentNames; //导入依赖的package包/类
@RobotKeyword("Checks that the primary key columns of a given table match the columns "
		+ "given as a comma-separated list. Note that the given list must be ordered "
		+ "by the name of the columns. Upper and lower case for the columns as such "
		+ "is ignored by comparing the values after converting both to lower case. " + "\n\n"
		+ "*NOTE*: Some database expect the table names to be written all in upper " + "case letters to be found. "
		+ "\n\n" + "Example: \n" + "| Check Primary Key Columns For Table | MySampleTable | Id,Name |")
@ArgumentNames({ "Table name", "Comma separated list of primary key columns to check" })
public void checkPrimaryKeyColumnsForTable(String tableName, String columnList)
		throws SQLException, DatabaseLibraryException {

	String keys = new Information().getPrimaryKeyColumnsForTable(tableName);

	columnList = columnList.toLowerCase();
	keys = keys.toLowerCase();

	if (!columnList.equals(keys)) {
		throw new DatabaseLibraryException("Given column list: " + columnList + " Keys found: " + keys);
	}
}
 
开发者ID:Hi-Fi,项目名称:robotframework-dblibrary,代码行数:20,代码来源:Assert.java

示例10: rowShouldNotExistInTable

import org.robotframework.javalib.annotation.ArgumentNames; //导入依赖的package包/类
@RobotKeyword("This keyword can be used to check the inexistence of content inside a "
		+ "specific row in a database table defined by a where-clause. This can be "
		+ "used to validate an exclusion of specific data from a table. " + "\n\n" + "Example: \n"
		+ "| Row Should Not Exist In Table | MySampleTable | Name='John Doe' | " + "\n\n"
		+ "This keyword was introduced in version 1.1. ")
@ArgumentNames({ "Table to check", "Where clause" })
public void rowShouldNotExistInTable(String tableName, String whereClause)
		throws SQLException, DatabaseLibraryException {

	String sql = "select * from " + tableName + " where " + whereClause;
	Statement stmt = DatabaseConnection.getConnection().createStatement();
	try {
		stmt.executeQuery(sql);
		ResultSet rs = (ResultSet) stmt.getResultSet();
		if (rs.next() == true) {
			throw new DatabaseLibraryException(
					"Row exists (but should not) for where-clause: " + whereClause + " in table: " + tableName);
		}
	} finally {
		stmt.close();
	}
}
 
开发者ID:Hi-Fi,项目名称:robotframework-dblibrary,代码行数:23,代码来源:Assert.java

示例11: transactionIsolationLevelMustBe

import org.robotframework.javalib.annotation.ArgumentNames; //导入依赖的package包/类
@RobotKeyword("Can be used to check that the database connection used for executing "
		+ "tests has the proper transaction isolation level. The string parameter "
		+ "accepts the following values in a case-insensitive manner: "
		+ "TRANSACTION_READ_UNCOMMITTED, TRANSACTION_READ_COMMITTED, "
		+ "TRANSACTION_REPEATABLE_READ, TRANSACTION_SERIALIZABLE or " + "TRANSACTION_NONE. " + "\n\n"
		+ "Example: \n" + "| Transaction Isolation Level Must Be | TRANSACTION_READ_COMMITTED | ")
@ArgumentNames({ "Isolation level" })
public void transactionIsolationLevelMustBe(String levelName) throws SQLException, DatabaseLibraryException {

	String transactionName = new Information().getTransactionIsolationLevel();

	if (!transactionName.equals(levelName)) {
		throw new DatabaseLibraryException(
				"Expected Transaction Isolation Level: " + levelName + " Level found: " + transactionName);
	}

}
 
开发者ID:Hi-Fi,项目名称:robotframework-dblibrary,代码行数:18,代码来源:Assert.java

示例12: verifyNumberOfRowsMatchingWhere

import org.robotframework.javalib.annotation.ArgumentNames; //导入依赖的package包/类
@RobotKeyword("This keyword checks that a given table contains a given amount of rows "
		+ "matching a given WHERE clause. " + "\n\n"
		+ "For the example this means that the table \"MySampleTable\" must contain "
		+ "exactly 2 rows matching the given WHERE, otherwise the teststep will " + "fail. " + "\n\n"
		+ "Example: \n" + "| Verify Number Of Rows Matching Where | MySampleTable | [email protected] | 2 | ")
@ArgumentNames({ "Table to check", "Where clause", "Expected number of rows" })
public void verifyNumberOfRowsMatchingWhere(String tableName, String where, String rowNumValue)
		throws SQLException, DatabaseLibraryException {

	long rowNum = Long.valueOf(rowNumValue);

	long num = getNumberOfRows(tableName, where, (rowNum + 1));
	if (num != rowNum) {
		throw new DatabaseLibraryException("Expecting " + rowNum + " rows, fetched: " + num);
	}
}
 
开发者ID:Hi-Fi,项目名称:robotframework-dblibrary,代码行数:17,代码来源:Assert.java

示例13: logTemplateData

import org.robotframework.javalib.annotation.ArgumentNames; //导入依赖的package包/类
@RobotKeyword("Print all content of the template data as JSON. When an optional file name argument is supplied, the template context is also saved as a JSON File.")
@ArgumentNames("outputFile=")
public String logTemplateData(String outputFilePath) {

	String contextString = TemplateContext.getInstance().toJSON();
	System.out.println("Template context: \n" + contextString);

	if (outputFilePath != null) {
		try {
			File outputFile = new File(outputFilePath);
			FileWriter writer = new FileWriter(outputFile);
			writer.append(TemplateContext.getInstance().toJSON());
			writer.close();
			System.out.println("Created '" + outputFile.getAbsolutePath() + "'");
		} catch (IOException e) {
			throw new FileLibraryException(e);
		}
	}
	return contextString;
}
 
开发者ID:dvanherbergen,项目名称:robotframework-filelibrary,代码行数:21,代码来源:ContextKeywords.java

示例14: disconnectFromDatabase

import org.robotframework.javalib.annotation.ArgumentNames; //导入依赖的package包/类
@RobotKeyword("Releases the existing connection to the database. In addition this"
		+ "keyword will log any SQLWarnings that might have been occurred on the connection.\n"
		+ "If current connection is closed and there's still some open, you have to activate that manually.\n"
		+ "Example:\n" + "| Disconnect from Database | default |")
@ArgumentNames({ "Database alias=default" })
public void disconnectFromDatabase(String... aliasParam) throws SQLException {
	String alias = aliasParam.length > 0 ? aliasParam[0] : defaultAlias;
	Connection disconnectingConnection = getConnection(alias);

	System.out.println(String.format("SQL Warnings on this connection (%s): %s", alias,
			disconnectingConnection.getWarnings()));
	disconnectingConnection.close();
	DatabaseConnection.connectionMap.remove(alias);
	if (alias.equals(DatabaseConnection.currentConnectionAlias)) {
		DatabaseConnection.currentConnectionAlias = "";
	}
}
 
开发者ID:Hi-Fi,项目名称:robotframework-dblibrary,代码行数:18,代码来源:DatabaseConnection.java

示例15: index

import org.robotframework.javalib.annotation.ArgumentNames; //导入依赖的package包/类
@RobotKeyword("Select a row in a result table by content. If the row is not visible, the down button in the scrollbar will be pressed up to 50 times in an attempt to try and locate the row. Specify the index (occurrence) of the scrollbar which should be used for scrolling."
		+ "Example:\n" + "| Scroll To Row | _scrollbarIndex_ | _market_ | _gas_ | \n")
@ArgumentNames({ "scrollbarIndex", "*columnvalues" })
public void scrollToRow(int scrollBarIndex, String... columnValues) {

	VerticalScrollBarOperator scrollOperator = new VerticalScrollBarOperator(scrollBarIndex - 1);

	TableOperator tableOperator = new TableOperator();

	for (int i = 0; i < 50; i++) {
		if (tableOperator.rowExists(columnValues)) {
			tableOperator.selectRow(columnValues);
			return;
		} else {
			scrollOperator.scrollDown(1);
		}
	}
	throw new FormsLibraryException("Row could not be found within the first 50 records.");
}
 
开发者ID:dvanherbergen,项目名称:robotframework-formslibrary,代码行数:20,代码来源:TableKeywords.java


注:本文中的org.robotframework.javalib.annotation.ArgumentNames类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。