repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/Environment.java | Environment.doHttpFilePost | public void doHttpFilePost(String url, HttpResponse result, Map<String, Object> headers, File file) {
httpClient.post(url, result, headers, file);
} | java | public void doHttpFilePost(String url, HttpResponse result, Map<String, Object> headers, File file) {
httpClient.post(url, result, headers, file);
} | [
"public",
"void",
"doHttpFilePost",
"(",
"String",
"url",
",",
"HttpResponse",
"result",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"headers",
",",
"File",
"file",
")",
"{",
"httpClient",
".",
"post",
"(",
"url",
",",
"result",
",",
"headers",
",",
... | Performs POST to supplied url of a file as binary data.
@param url url to post to.
@param result result containing request, its response will be filled.
@param headers headers to add.
@param file file containing binary data to post. | [
"Performs",
"POST",
"to",
"supplied",
"url",
"of",
"a",
"file",
"as",
"binary",
"data",
"."
] | 4e9018d7386a9aa65bfcbf07eb28ae064edd1732 | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/Environment.java#L296-L298 | train |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/Environment.java | Environment.doHttpFilePut | public void doHttpFilePut(String url, HttpResponse result, Map<String, Object> headers, File file) {
httpClient.put(url, result, headers, file);
} | java | public void doHttpFilePut(String url, HttpResponse result, Map<String, Object> headers, File file) {
httpClient.put(url, result, headers, file);
} | [
"public",
"void",
"doHttpFilePut",
"(",
"String",
"url",
",",
"HttpResponse",
"result",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"headers",
",",
"File",
"file",
")",
"{",
"httpClient",
".",
"put",
"(",
"url",
",",
"result",
",",
"headers",
",",
"... | Performs PUT to supplied url of a file as binary data.
@param url url to post to.
@param result result containing request, its response will be filled.
@param headers headers to add.
@param file file containing binary data to post. | [
"Performs",
"PUT",
"to",
"supplied",
"url",
"of",
"a",
"file",
"as",
"binary",
"data",
"."
] | 4e9018d7386a9aa65bfcbf07eb28ae064edd1732 | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/Environment.java#L307-L309 | train |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/Environment.java | Environment.doHttpPut | public void doHttpPut(String url, String templateName, Object model, HttpResponse result) {
doHttpPut(url, templateName, model, result, null, XmlHttpResponse.CONTENT_TYPE_XML_TEXT_UTF8);
} | java | public void doHttpPut(String url, String templateName, Object model, HttpResponse result) {
doHttpPut(url, templateName, model, result, null, XmlHttpResponse.CONTENT_TYPE_XML_TEXT_UTF8);
} | [
"public",
"void",
"doHttpPut",
"(",
"String",
"url",
",",
"String",
"templateName",
",",
"Object",
"model",
",",
"HttpResponse",
"result",
")",
"{",
"doHttpPut",
"(",
"url",
",",
"templateName",
",",
"model",
",",
"result",
",",
"null",
",",
"XmlHttpResponse... | Performs PUT to supplied url of result of applying template with model.
@param url url to put to.
@param templateName name of template to use.
@param model model for template.
@param result result to populate with response. | [
"Performs",
"PUT",
"to",
"supplied",
"url",
"of",
"result",
"of",
"applying",
"template",
"with",
"model",
"."
] | 4e9018d7386a9aa65bfcbf07eb28ae064edd1732 | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/Environment.java#L318-L320 | train |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/Environment.java | Environment.doHttpPut | public void doHttpPut(String url, HttpResponse result, Map<String, Object> headers, String contentType) {
httpClient.put(url, result, headers, contentType);
} | java | public void doHttpPut(String url, HttpResponse result, Map<String, Object> headers, String contentType) {
httpClient.put(url, result, headers, contentType);
} | [
"public",
"void",
"doHttpPut",
"(",
"String",
"url",
",",
"HttpResponse",
"result",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"headers",
",",
"String",
"contentType",
")",
"{",
"httpClient",
".",
"put",
"(",
"url",
",",
"result",
",",
"headers",
","... | Performs PUT to supplied url of result's request.
@param url url to put to.
@param result result containing request, its response will be filled.
@param headers headers to add.
@param contentType contentType for request. | [
"Performs",
"PUT",
"to",
"supplied",
"url",
"of",
"result",
"s",
"request",
"."
] | 4e9018d7386a9aa65bfcbf07eb28ae064edd1732 | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/Environment.java#L344-L346 | train |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/Environment.java | Environment.doHttpGetXml | public XmlHttpResponse doHttpGetXml(String url) {
XmlHttpResponse response = new XmlHttpResponse();
doGet(url, response);
setContext(response);
return response;
} | java | public XmlHttpResponse doHttpGetXml(String url) {
XmlHttpResponse response = new XmlHttpResponse();
doGet(url, response);
setContext(response);
return response;
} | [
"public",
"XmlHttpResponse",
"doHttpGetXml",
"(",
"String",
"url",
")",
"{",
"XmlHttpResponse",
"response",
"=",
"new",
"XmlHttpResponse",
"(",
")",
";",
"doGet",
"(",
"url",
",",
"response",
")",
";",
"setContext",
"(",
"response",
")",
";",
"return",
"resp... | GETs XML content from URL.
@param url url to get from.
@return response. | [
"GETs",
"XML",
"content",
"from",
"URL",
"."
] | 4e9018d7386a9aa65bfcbf07eb28ae064edd1732 | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/Environment.java#L365-L370 | train |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/Environment.java | Environment.doHead | public void doHead(String url, HttpResponse response, Map<String, Object> headers) {
response.setRequest(url);
httpClient.head(url, response, headers);
} | java | public void doHead(String url, HttpResponse response, Map<String, Object> headers) {
response.setRequest(url);
httpClient.head(url, response, headers);
} | [
"public",
"void",
"doHead",
"(",
"String",
"url",
",",
"HttpResponse",
"response",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"headers",
")",
"{",
"response",
".",
"setRequest",
"(",
"url",
")",
";",
"httpClient",
".",
"head",
"(",
"url",
",",
"res... | HEADs content from URL.
@param url url to get from.
@param response response to store url and response value in.
@param headers http headers to add. | [
"HEADs",
"content",
"from",
"URL",
"."
] | 4e9018d7386a9aa65bfcbf07eb28ae064edd1732 | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/Environment.java#L416-L419 | train |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/Environment.java | Environment.doDelete | public void doDelete(String url, HttpResponse response, Map<String, Object> headers) {
response.setRequest(url);
httpClient.delete(url, response, headers);
} | java | public void doDelete(String url, HttpResponse response, Map<String, Object> headers) {
response.setRequest(url);
httpClient.delete(url, response, headers);
} | [
"public",
"void",
"doDelete",
"(",
"String",
"url",
",",
"HttpResponse",
"response",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"headers",
")",
"{",
"response",
".",
"setRequest",
"(",
"url",
")",
";",
"httpClient",
".",
"delete",
"(",
"url",
",",
... | DELETEs content at URL.
@param url url to send delete to.
@param response response to store url and response value in.
@param headers http headers to add. | [
"DELETEs",
"content",
"at",
"URL",
"."
] | 4e9018d7386a9aa65bfcbf07eb28ae064edd1732 | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/Environment.java#L427-L430 | train |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/Environment.java | Environment.doDelete | public void doDelete(String url, HttpResponse result, Map<String, Object> headers, String contentType) {
httpClient.delete(url, result, headers, contentType);
} | java | public void doDelete(String url, HttpResponse result, Map<String, Object> headers, String contentType) {
httpClient.delete(url, result, headers, contentType);
} | [
"public",
"void",
"doDelete",
"(",
"String",
"url",
",",
"HttpResponse",
"result",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"headers",
",",
"String",
"contentType",
")",
"{",
"httpClient",
".",
"delete",
"(",
"url",
",",
"result",
",",
"headers",
"... | Performs DELETE to supplied url of result's request.
@param url url to delete.
@param result result containing request, its response will be filled.
@param headers headers to add.
@param contentType contentType for request. | [
"Performs",
"DELETE",
"to",
"supplied",
"url",
"of",
"result",
"s",
"request",
"."
] | 4e9018d7386a9aa65bfcbf07eb28ae064edd1732 | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/Environment.java#L454-L456 | train |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/Environment.java | Environment.getHtml | public String getHtml(Formatter formatter, String value) {
String result = null;
if (value != null) {
if ("".equals(value)) {
result = "";
} else {
String formattedResponse = formatter.format(value);
result = "<pre>" + StringEscapeU... | java | public String getHtml(Formatter formatter, String value) {
String result = null;
if (value != null) {
if ("".equals(value)) {
result = "";
} else {
String formattedResponse = formatter.format(value);
result = "<pre>" + StringEscapeU... | [
"public",
"String",
"getHtml",
"(",
"Formatter",
"formatter",
",",
"String",
"value",
")",
"{",
"String",
"result",
"=",
"null",
";",
"if",
"(",
"value",
"!=",
"null",
")",
"{",
"if",
"(",
"\"\"",
".",
"equals",
"(",
"value",
")",
")",
"{",
"result",... | Formats supplied value for display as pre-formatted text in FitNesse page.
@param formatter formatter to use to generate pre-formatted text.
@param value value to format.
@return HTML formatted version of value. | [
"Formats",
"supplied",
"value",
"for",
"display",
"as",
"pre",
"-",
"formatted",
"text",
"in",
"FitNesse",
"page",
"."
] | 4e9018d7386a9aa65bfcbf07eb28ae064edd1732 | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/Environment.java#L526-L537 | train |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/Environment.java | Environment.handleErrorResponse | public static void handleErrorResponse(String msg, String responseText) {
String responseHtml;
Environment instance = getInstance();
try {
responseHtml = instance.getHtmlForXml(responseText);
} catch (Exception e) {
responseHtml = instance.getHtml(value -> value, ... | java | public static void handleErrorResponse(String msg, String responseText) {
String responseHtml;
Environment instance = getInstance();
try {
responseHtml = instance.getHtmlForXml(responseText);
} catch (Exception e) {
responseHtml = instance.getHtml(value -> value, ... | [
"public",
"static",
"void",
"handleErrorResponse",
"(",
"String",
"msg",
",",
"String",
"responseText",
")",
"{",
"String",
"responseHtml",
";",
"Environment",
"instance",
"=",
"getInstance",
"(",
")",
";",
"try",
"{",
"responseHtml",
"=",
"instance",
".",
"ge... | Creates exception that will display nicely in a columnFixture.
@param msg message for exception
@param responseText XML received, which will be shown in wiki table.
@throws FitFailureException always | [
"Creates",
"exception",
"that",
"will",
"display",
"nicely",
"in",
"a",
"columnFixture",
"."
] | 4e9018d7386a9aa65bfcbf07eb28ae064edd1732 | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/Environment.java#L545-L555 | train |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/Environment.java | Environment.invokeProgram | public ProgramResponse invokeProgram(int timeout, String directory, String command,
String... arguments) {
ProgramResponse result = new ProgramResponse();
result.setDirectory(directory);
result.setCommand(command);
result.setArguments(arguments);
... | java | public ProgramResponse invokeProgram(int timeout, String directory, String command,
String... arguments) {
ProgramResponse result = new ProgramResponse();
result.setDirectory(directory);
result.setCommand(command);
result.setArguments(arguments);
... | [
"public",
"ProgramResponse",
"invokeProgram",
"(",
"int",
"timeout",
",",
"String",
"directory",
",",
"String",
"command",
",",
"String",
"...",
"arguments",
")",
"{",
"ProgramResponse",
"result",
"=",
"new",
"ProgramResponse",
"(",
")",
";",
"result",
".",
"s... | Invokes an external program, waits for it to complete,
and returns the result.
@param timeout maximum time (in milliseconds) to wait.
@param directory working directory for program
(may be null if not important).
@param command program to start.
@param arguments arguments for program.
@return response from program. | [
"Invokes",
"an",
"external",
"program",
"waits",
"for",
"it",
"to",
"complete",
"and",
"returns",
"the",
"result",
"."
] | 4e9018d7386a9aa65bfcbf07eb28ae064edd1732 | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/Environment.java#L574-L582 | train |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/Environment.java | Environment.getWikiUrl | public String getWikiUrl(String filePath) {
String wikiUrl = null;
String filesDir = getFitNesseFilesSectionDir();
if (filePath.startsWith(filesDir)) {
String relativeFile = filePath.substring(filesDir.length());
relativeFile = relativeFile.replace('\\', '/');
... | java | public String getWikiUrl(String filePath) {
String wikiUrl = null;
String filesDir = getFitNesseFilesSectionDir();
if (filePath.startsWith(filesDir)) {
String relativeFile = filePath.substring(filesDir.length());
relativeFile = relativeFile.replace('\\', '/');
... | [
"public",
"String",
"getWikiUrl",
"(",
"String",
"filePath",
")",
"{",
"String",
"wikiUrl",
"=",
"null",
";",
"String",
"filesDir",
"=",
"getFitNesseFilesSectionDir",
"(",
")",
";",
"if",
"(",
"filePath",
".",
"startsWith",
"(",
"filesDir",
")",
")",
"{",
... | Converts a file path into a relative wiki path, if the path is insides the wiki's 'files' section.
@param filePath path to file.
@return relative URL pointing to the file (so a hyperlink to it can be created). | [
"Converts",
"a",
"file",
"path",
"into",
"a",
"relative",
"wiki",
"path",
"if",
"the",
"path",
"is",
"insides",
"the",
"wiki",
"s",
"files",
"section",
"."
] | 4e9018d7386a9aa65bfcbf07eb28ae064edd1732 | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/Environment.java#L660-L669 | train |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/Environment.java | Environment.getFilePathFromWikiUrl | public String getFilePathFromWikiUrl(String wikiUrl) {
String url = getHtmlCleaner().getUrl(wikiUrl);
File file;
if (url.startsWith("files/")) {
String relativeFile = url.substring("files".length());
relativeFile = relativeFile.replace('/', File.separatorChar);
... | java | public String getFilePathFromWikiUrl(String wikiUrl) {
String url = getHtmlCleaner().getUrl(wikiUrl);
File file;
if (url.startsWith("files/")) {
String relativeFile = url.substring("files".length());
relativeFile = relativeFile.replace('/', File.separatorChar);
... | [
"public",
"String",
"getFilePathFromWikiUrl",
"(",
"String",
"wikiUrl",
")",
"{",
"String",
"url",
"=",
"getHtmlCleaner",
"(",
")",
".",
"getUrl",
"(",
"wikiUrl",
")",
";",
"File",
"file",
";",
"if",
"(",
"url",
".",
"startsWith",
"(",
"\"files/\"",
")",
... | Gets absolute path from wiki url, if file exists.
@param wikiUrl a relative path that can be used in wiki page, or any file path.
@return absolute path to the target of the url, if such a file exists; null if the target does not exist. | [
"Gets",
"absolute",
"path",
"from",
"wiki",
"url",
"if",
"file",
"exists",
"."
] | 4e9018d7386a9aa65bfcbf07eb28ae064edd1732 | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/Environment.java#L676-L688 | train |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/Environment.java | Environment.addSeleniumCookies | public void addSeleniumCookies(HttpResponse response) {
CookieStore cookieStore = ensureResponseHasCookieStore(response);
CookieConverter converter = getCookieConverter();
Set<Cookie> browserCookies = getSeleniumHelper().getCookies();
converter.copySeleniumCookies(browserCookies, cookieS... | java | public void addSeleniumCookies(HttpResponse response) {
CookieStore cookieStore = ensureResponseHasCookieStore(response);
CookieConverter converter = getCookieConverter();
Set<Cookie> browserCookies = getSeleniumHelper().getCookies();
converter.copySeleniumCookies(browserCookies, cookieS... | [
"public",
"void",
"addSeleniumCookies",
"(",
"HttpResponse",
"response",
")",
"{",
"CookieStore",
"cookieStore",
"=",
"ensureResponseHasCookieStore",
"(",
"response",
")",
";",
"CookieConverter",
"converter",
"=",
"getCookieConverter",
"(",
")",
";",
"Set",
"<",
"Co... | Adds Selenium cookies to response's cookie store.
@param response response to which cookies must be added. | [
"Adds",
"Selenium",
"cookies",
"to",
"response",
"s",
"cookie",
"store",
"."
] | 4e9018d7386a9aa65bfcbf07eb28ae064edd1732 | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/Environment.java#L734-L739 | train |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/slim/TimerFixture.java | TimerFixture.stopTimer | public long stopTimer(String name) {
StopWatch sw = getStopWatch(name);
sw.stop();
STOP_WATCHES.remove(name);
return sw.getTime();
} | java | public long stopTimer(String name) {
StopWatch sw = getStopWatch(name);
sw.stop();
STOP_WATCHES.remove(name);
return sw.getTime();
} | [
"public",
"long",
"stopTimer",
"(",
"String",
"name",
")",
"{",
"StopWatch",
"sw",
"=",
"getStopWatch",
"(",
"name",
")",
";",
"sw",
".",
"stop",
"(",
")",
";",
"STOP_WATCHES",
".",
"remove",
"(",
"name",
")",
";",
"return",
"sw",
".",
"getTime",
"("... | Stops named timer.
@param name name of timer to stop.
@return time in milliseconds since timer was started. | [
"Stops",
"named",
"timer",
"."
] | 4e9018d7386a9aa65bfcbf07eb28ae064edd1732 | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/slim/TimerFixture.java#L48-L53 | train |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/slim/TimerFixture.java | TimerFixture.stopAllTimers | public Map<String, Long> stopAllTimers() {
Map<String, Long> result = allTimerTimes();
STOP_WATCHES.clear();
return result;
} | java | public Map<String, Long> stopAllTimers() {
Map<String, Long> result = allTimerTimes();
STOP_WATCHES.clear();
return result;
} | [
"public",
"Map",
"<",
"String",
",",
"Long",
">",
"stopAllTimers",
"(",
")",
"{",
"Map",
"<",
"String",
",",
"Long",
">",
"result",
"=",
"allTimerTimes",
"(",
")",
";",
"STOP_WATCHES",
".",
"clear",
"(",
")",
";",
"return",
"result",
";",
"}"
] | Stops all running timers.
@return all stopped timers and their current times (in ms). | [
"Stops",
"all",
"running",
"timers",
"."
] | 4e9018d7386a9aa65bfcbf07eb28ae064edd1732 | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/slim/TimerFixture.java#L122-L126 | train |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/slim/FileFixture.java | FileFixture.createContainingValue | public String createContainingValue(String filename, String key) {
Object data = value(key);
if (data == null) {
throw new SlimFixtureException(false, "No value for key: " + key);
}
return createContaining(filename, data);
} | java | public String createContainingValue(String filename, String key) {
Object data = value(key);
if (data == null) {
throw new SlimFixtureException(false, "No value for key: " + key);
}
return createContaining(filename, data);
} | [
"public",
"String",
"createContainingValue",
"(",
"String",
"filename",
",",
"String",
"key",
")",
"{",
"Object",
"data",
"=",
"value",
"(",
"key",
")",
";",
"if",
"(",
"data",
"==",
"null",
")",
"{",
"throw",
"new",
"SlimFixtureException",
"(",
"false",
... | Creates new file, containing value 'key'.
@param filename name of file to create.
@param key key whose value should be used to generate the file.
@return file created. | [
"Creates",
"new",
"file",
"containing",
"value",
"key",
"."
] | 4e9018d7386a9aa65bfcbf07eb28ae064edd1732 | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/slim/FileFixture.java#L54-L60 | train |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/slim/Base64Fixture.java | Base64Fixture.encode | public String encode(String fileUrl) {
String file = getFilePathFromWikiUrl(fileUrl);
try {
byte[] content = IOUtils.toByteArray(new FileInputStream(file));
return base64Encode(content);
} catch (IOException e) {
throw new SlimFixtureException("Unable to read:... | java | public String encode(String fileUrl) {
String file = getFilePathFromWikiUrl(fileUrl);
try {
byte[] content = IOUtils.toByteArray(new FileInputStream(file));
return base64Encode(content);
} catch (IOException e) {
throw new SlimFixtureException("Unable to read:... | [
"public",
"String",
"encode",
"(",
"String",
"fileUrl",
")",
"{",
"String",
"file",
"=",
"getFilePathFromWikiUrl",
"(",
"fileUrl",
")",
";",
"try",
"{",
"byte",
"[",
"]",
"content",
"=",
"IOUtils",
".",
"toByteArray",
"(",
"new",
"FileInputStream",
"(",
"f... | Gets the content of specified file base64 encoded.
@param fileUrl either absolute path, or link to file inside wiki's files section.
@return base64 encoded file content. | [
"Gets",
"the",
"content",
"of",
"specified",
"file",
"base64",
"encoded",
"."
] | 4e9018d7386a9aa65bfcbf07eb28ae064edd1732 | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/slim/Base64Fixture.java#L22-L30 | train |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/slim/Base64Fixture.java | Base64Fixture.createFrom | public String createFrom(String fileName, String base64String) {
String result;
String baseName = FilenameUtils.getBaseName(fileName);
String target = saveBase + baseName;
String ext = FilenameUtils.getExtension(fileName);
byte[] content = base64Decode(base64String);
Stri... | java | public String createFrom(String fileName, String base64String) {
String result;
String baseName = FilenameUtils.getBaseName(fileName);
String target = saveBase + baseName;
String ext = FilenameUtils.getExtension(fileName);
byte[] content = base64Decode(base64String);
Stri... | [
"public",
"String",
"createFrom",
"(",
"String",
"fileName",
",",
"String",
"base64String",
")",
"{",
"String",
"result",
";",
"String",
"baseName",
"=",
"FilenameUtils",
".",
"getBaseName",
"(",
"fileName",
")",
";",
"String",
"target",
"=",
"saveBase",
"+",
... | Creates a new file with content read from base64 encoded string.
@param fileName (base) file name to create (if a file with specified name already exists
a number will be added to make the name unique).
@param base64String base64 encoded string to decode and use as file content.
@return location of created file. | [
"Creates",
"a",
"new",
"file",
"with",
"content",
"read",
"from",
"base64",
"encoded",
"string",
"."
] | 4e9018d7386a9aa65bfcbf07eb28ae064edd1732 | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/slim/Base64Fixture.java#L39-L54 | train |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/util/MapHelper.java | MapHelper.addValueToIn | public void addValueToIn(Object value, String name, Map<String, Object> map) {
Object val = getValue(map, name);
if (val instanceof Collection) {
Object cleanValue = getCleanValue(value);
((Collection) val).add(cleanValue);
} else if (val == null) {
setVa... | java | public void addValueToIn(Object value, String name, Map<String, Object> map) {
Object val = getValue(map, name);
if (val instanceof Collection) {
Object cleanValue = getCleanValue(value);
((Collection) val).add(cleanValue);
} else if (val == null) {
setVa... | [
"public",
"void",
"addValueToIn",
"(",
"Object",
"value",
",",
"String",
"name",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"map",
")",
"{",
"Object",
"val",
"=",
"getValue",
"(",
"map",
",",
"name",
")",
";",
"if",
"(",
"val",
"instanceof",
"Col... | Adds a value to the end of a list.
@param value value to be passed.
@param name name to use this value for.
@param map map to store value in. | [
"Adds",
"a",
"value",
"to",
"the",
"end",
"of",
"a",
"list",
"."
] | 4e9018d7386a9aa65bfcbf07eb28ae064edd1732 | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/util/MapHelper.java#L107-L117 | train |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/util/MapHelper.java | MapHelper.copyValuesFromTo | public void copyValuesFromTo(Map<String, Object> otherMap, Map<String, Object> map) {
map.putAll(otherMap);
} | java | public void copyValuesFromTo(Map<String, Object> otherMap, Map<String, Object> map) {
map.putAll(otherMap);
} | [
"public",
"void",
"copyValuesFromTo",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"otherMap",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"map",
")",
"{",
"map",
".",
"putAll",
"(",
"otherMap",
")",
";",
"}"
] | Adds all values in the otherMap to map.
@param otherMap to obtain values from.
@param map map to store value in. | [
"Adds",
"all",
"values",
"in",
"the",
"otherMap",
"to",
"map",
"."
] | 4e9018d7386a9aa65bfcbf07eb28ae064edd1732 | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/util/MapHelper.java#L124-L126 | train |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/slim/FreemarkerFixture.java | FreemarkerFixture.applyTemplate | public String applyTemplate(String aTemplate) {
String result = getEnvironment().processTemplate(aTemplate, getCurrentValues());
result = postProcess(result);
result = formatResult(aTemplate, result);
return result;
} | java | public String applyTemplate(String aTemplate) {
String result = getEnvironment().processTemplate(aTemplate, getCurrentValues());
result = postProcess(result);
result = formatResult(aTemplate, result);
return result;
} | [
"public",
"String",
"applyTemplate",
"(",
"String",
"aTemplate",
")",
"{",
"String",
"result",
"=",
"getEnvironment",
"(",
")",
".",
"processTemplate",
"(",
"aTemplate",
",",
"getCurrentValues",
"(",
")",
")",
";",
"result",
"=",
"postProcess",
"(",
"result",
... | Applies template to current values.
@param aTemplate name of template file (relative to 'testdata' directory on classpath)
@return template result. | [
"Applies",
"template",
"to",
"current",
"values",
"."
] | 4e9018d7386a9aa65bfcbf07eb28ae064edd1732 | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/slim/FreemarkerFixture.java#L35-L40 | train |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/slim/YamlFileFixture.java | YamlFileFixture.loadValuesFrom | @Override
public boolean loadValuesFrom(String filename) {
String yamlStr = textIn(filename);
Object y = yaml.load(yamlStr);
if (y instanceof Map) {
getCurrentValues().putAll((Map) y);
} else {
getCurrentValues().put("elements", y);
}
return tr... | java | @Override
public boolean loadValuesFrom(String filename) {
String yamlStr = textIn(filename);
Object y = yaml.load(yamlStr);
if (y instanceof Map) {
getCurrentValues().putAll((Map) y);
} else {
getCurrentValues().put("elements", y);
}
return tr... | [
"@",
"Override",
"public",
"boolean",
"loadValuesFrom",
"(",
"String",
"filename",
")",
"{",
"String",
"yamlStr",
"=",
"textIn",
"(",
"filename",
")",
";",
"Object",
"y",
"=",
"yaml",
".",
"load",
"(",
"yamlStr",
")",
";",
"if",
"(",
"y",
"instanceof",
... | Adds the yaml loaded from the specified file to current values.
@param filename YAML file to load
@return true when file is loaded | [
"Adds",
"the",
"yaml",
"loaded",
"from",
"the",
"specified",
"file",
"to",
"current",
"values",
"."
] | 4e9018d7386a9aa65bfcbf07eb28ae064edd1732 | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/slim/YamlFileFixture.java#L19-L29 | train |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/util/selenium/by/IsDisplayedFilter.java | IsDisplayedFilter.apply | @Override
public T apply(T webElement) {
if (firstFound == null) {
firstFound = webElement;
}
return mayPass(webElement) ? webElement : null;
} | java | @Override
public T apply(T webElement) {
if (firstFound == null) {
firstFound = webElement;
}
return mayPass(webElement) ? webElement : null;
} | [
"@",
"Override",
"public",
"T",
"apply",
"(",
"T",
"webElement",
")",
"{",
"if",
"(",
"firstFound",
"==",
"null",
")",
"{",
"firstFound",
"=",
"webElement",
";",
"}",
"return",
"mayPass",
"(",
"webElement",
")",
"?",
"webElement",
":",
"null",
";",
"}"... | Filters out non-displayed elements.
@param webElement element to check.
@return webElement if it is displayed, null otherwise. | [
"Filters",
"out",
"non",
"-",
"displayed",
"elements",
"."
] | 4e9018d7386a9aa65bfcbf07eb28ae064edd1732 | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/util/selenium/by/IsDisplayedFilter.java#L21-L27 | train |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/util/HttpClient.java | HttpClient.buildBodyWithFile | private HttpEntity buildBodyWithFile(File file) {
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
builder.addBinaryBody("file", file,
ContentType.APPLICATION_OCTET_STREAM, file.getName());
HttpEntity multipart = builder.build();
return multipart;
} | java | private HttpEntity buildBodyWithFile(File file) {
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
builder.addBinaryBody("file", file,
ContentType.APPLICATION_OCTET_STREAM, file.getName());
HttpEntity multipart = builder.build();
return multipart;
} | [
"private",
"HttpEntity",
"buildBodyWithFile",
"(",
"File",
"file",
")",
"{",
"MultipartEntityBuilder",
"builder",
"=",
"MultipartEntityBuilder",
".",
"create",
"(",
")",
";",
"builder",
".",
"addBinaryBody",
"(",
"\"file\"",
",",
"file",
",",
"ContentType",
".",
... | Builds request body with a given file
@param file file containing binary data. | [
"Builds",
"request",
"body",
"with",
"a",
"given",
"file"
] | 4e9018d7386a9aa65bfcbf07eb28ae064edd1732 | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/util/HttpClient.java#L126-L132 | train |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/util/HttpClient.java | HttpClient.buildHttpClient | protected static org.apache.http.client.HttpClient buildHttpClient(boolean contentCompression, boolean sslVerification) {
RequestConfig rc = RequestConfig.custom()
.setCookieSpec(CookieSpecs.STANDARD)
.build();
HttpClientBuilder builder = HttpClients.custom()
... | java | protected static org.apache.http.client.HttpClient buildHttpClient(boolean contentCompression, boolean sslVerification) {
RequestConfig rc = RequestConfig.custom()
.setCookieSpec(CookieSpecs.STANDARD)
.build();
HttpClientBuilder builder = HttpClients.custom()
... | [
"protected",
"static",
"org",
".",
"apache",
".",
"http",
".",
"client",
".",
"HttpClient",
"buildHttpClient",
"(",
"boolean",
"contentCompression",
",",
"boolean",
"sslVerification",
")",
"{",
"RequestConfig",
"rc",
"=",
"RequestConfig",
".",
"custom",
"(",
")"... | Builds an apache HttpClient instance
@param contentCompression if true, the returned instance will support content compression
@return an apache HttpClient instance | [
"Builds",
"an",
"apache",
"HttpClient",
"instance"
] | 4e9018d7386a9aa65bfcbf07eb28ae064edd1732 | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/util/HttpClient.java#L242-L267 | train |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/util/StreamUtil.java | StreamUtil.toLinkedMap | public static <T, K, U> Collector<T, ?, LinkedHashMap<K, U>> toLinkedMap(Function<? super T, ? extends K> keyMapper,
Function<? super T, ? extends U> valueMapper) {
BinaryOperator<U> mergeFunction = throwingMerger();
return ... | java | public static <T, K, U> Collector<T, ?, LinkedHashMap<K, U>> toLinkedMap(Function<? super T, ? extends K> keyMapper,
Function<? super T, ? extends U> valueMapper) {
BinaryOperator<U> mergeFunction = throwingMerger();
return ... | [
"public",
"static",
"<",
"T",
",",
"K",
",",
"U",
">",
"Collector",
"<",
"T",
",",
"?",
",",
"LinkedHashMap",
"<",
"K",
",",
"U",
">",
">",
"toLinkedMap",
"(",
"Function",
"<",
"?",
"super",
"T",
",",
"?",
"extends",
"K",
">",
"keyMapper",
",",
... | Collects a stream to a LinkedHashMap, each stream element is expected to produce map entry.
@param keyMapper function to deal with keys.
@param valueMapper function to deal with values.
@param <T> type of element in input stream.
@param <K> type of key for created map.
@param <U> type of value... | [
"Collects",
"a",
"stream",
"to",
"a",
"LinkedHashMap",
"each",
"stream",
"element",
"is",
"expected",
"to",
"produce",
"map",
"entry",
"."
] | 4e9018d7386a9aa65bfcbf07eb28ae064edd1732 | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/util/StreamUtil.java#L27-L31 | train |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/util/StreamUtil.java | StreamUtil.toLinkedMap | public static <T, K, U> Collector<T, ?, LinkedHashMap<K, U>> toLinkedMap(
Function<? super T, ? extends K> keyMapper,
Function<? super T, ? extends U> valueMapper,
BinaryOperator<U> mergeFunction) {
return Collectors.toMap(keyMapper, valueMapper, mergeFunction, LinkedHash... | java | public static <T, K, U> Collector<T, ?, LinkedHashMap<K, U>> toLinkedMap(
Function<? super T, ? extends K> keyMapper,
Function<? super T, ? extends U> valueMapper,
BinaryOperator<U> mergeFunction) {
return Collectors.toMap(keyMapper, valueMapper, mergeFunction, LinkedHash... | [
"public",
"static",
"<",
"T",
",",
"K",
",",
"U",
">",
"Collector",
"<",
"T",
",",
"?",
",",
"LinkedHashMap",
"<",
"K",
",",
"U",
">",
">",
"toLinkedMap",
"(",
"Function",
"<",
"?",
"super",
"T",
",",
"?",
"extends",
"K",
">",
"keyMapper",
",",
... | Collects a stream to a LinkedHashMap.
@param keyMapper function to deal with keys.
@param valueMapper function to deal with values.
@param mergeFunction function to apply one values if keyMapper produces same key multiple times.
@param <T> type of element in input stream.
@param <K> type of key for cr... | [
"Collects",
"a",
"stream",
"to",
"a",
"LinkedHashMap",
"."
] | 4e9018d7386a9aa65bfcbf07eb28ae064edd1732 | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/util/StreamUtil.java#L43-L48 | train |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/util/StreamUtil.java | StreamUtil.throwingMerger | public static <T> BinaryOperator<T> throwingMerger() {
return (u, v) -> {
throw new IllegalArgumentException(String.format("Duplicate key: value %s was already present now %s is added", u, v));
};
} | java | public static <T> BinaryOperator<T> throwingMerger() {
return (u, v) -> {
throw new IllegalArgumentException(String.format("Duplicate key: value %s was already present now %s is added", u, v));
};
} | [
"public",
"static",
"<",
"T",
">",
"BinaryOperator",
"<",
"T",
">",
"throwingMerger",
"(",
")",
"{",
"return",
"(",
"u",
",",
"v",
")",
"->",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"String",
".",
"format",
"(",
"\"Duplicate key: value %s was a... | Throws is same key is produced.
@param <T> type of values.
@throws IllegalArgumentException always | [
"Throws",
"is",
"same",
"key",
"is",
"produced",
"."
] | 4e9018d7386a9aa65bfcbf07eb28ae064edd1732 | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/util/StreamUtil.java#L55-L59 | train |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/util/XMLValidator.java | XMLValidator.validateAgainst | public boolean validateAgainst(String xmlContent, String xsdContent) {
try {
Source xsd = new SAXSource(new InputSource(new StringReader(xsdContent)));
Source xml = new SAXSource(new InputSource(new StringReader(xmlContent)));
SchemaFactory schemaFactory = SchemaFactory
... | java | public boolean validateAgainst(String xmlContent, String xsdContent) {
try {
Source xsd = new SAXSource(new InputSource(new StringReader(xsdContent)));
Source xml = new SAXSource(new InputSource(new StringReader(xmlContent)));
SchemaFactory schemaFactory = SchemaFactory
... | [
"public",
"boolean",
"validateAgainst",
"(",
"String",
"xmlContent",
",",
"String",
"xsdContent",
")",
"{",
"try",
"{",
"Source",
"xsd",
"=",
"new",
"SAXSource",
"(",
"new",
"InputSource",
"(",
"new",
"StringReader",
"(",
"xsdContent",
")",
")",
")",
";",
... | Validate currently loaded xml against an xsd
@param xsdFileName the XSD schema file to use for validation
@return true if the xml validates against the schema.
Throws a descriptive SlimFixtureException when validation fails | [
"Validate",
"currently",
"loaded",
"xml",
"against",
"an",
"xsd"
] | 4e9018d7386a9aa65bfcbf07eb28ae064edd1732 | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/util/XMLValidator.java#L75-L92 | train |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/slim/PropertiesFileFixture.java | PropertiesFileFixture.loadValuesFrom | @Override
public boolean loadValuesFrom(String filename) {
String propContent = textIn(filename);
PropertiesHelper propHelper = getEnvironment().getPropertiesHelper();
Properties properties = propHelper.parsePropertiesString(propContent);
Map<String, Object> propAsMap = propHelper.co... | java | @Override
public boolean loadValuesFrom(String filename) {
String propContent = textIn(filename);
PropertiesHelper propHelper = getEnvironment().getPropertiesHelper();
Properties properties = propHelper.parsePropertiesString(propContent);
Map<String, Object> propAsMap = propHelper.co... | [
"@",
"Override",
"public",
"boolean",
"loadValuesFrom",
"(",
"String",
"filename",
")",
"{",
"String",
"propContent",
"=",
"textIn",
"(",
"filename",
")",
";",
"PropertiesHelper",
"propHelper",
"=",
"getEnvironment",
"(",
")",
".",
"getPropertiesHelper",
"(",
")... | Adds the properties loaded from the specified file to current values.
@param filename .properties file to load
@return true when file is loaded
@throws IOException when unable to load file's content. | [
"Adds",
"the",
"properties",
"loaded",
"from",
"the",
"specified",
"file",
"to",
"current",
"values",
"."
] | 4e9018d7386a9aa65bfcbf07eb28ae064edd1732 | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/slim/PropertiesFileFixture.java#L21-L29 | train |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/slim/web/SeleniumDriverSetup.java | SeleniumDriverSetup.startDriver | public boolean startDriver(String driverClassName, final Map<String, Object> profile) throws Exception {
if (OVERRIDE_ACTIVE) {
return true;
}
DriverFactory driverFactory = new LocalDriverFactory(driverClassName, profile);
WebDriver driver = setAndUseDriverFactory(driverFact... | java | public boolean startDriver(String driverClassName, final Map<String, Object> profile) throws Exception {
if (OVERRIDE_ACTIVE) {
return true;
}
DriverFactory driverFactory = new LocalDriverFactory(driverClassName, profile);
WebDriver driver = setAndUseDriverFactory(driverFact... | [
"public",
"boolean",
"startDriver",
"(",
"String",
"driverClassName",
",",
"final",
"Map",
"<",
"String",
",",
"Object",
">",
"profile",
")",
"throws",
"Exception",
"{",
"if",
"(",
"OVERRIDE_ACTIVE",
")",
"{",
"return",
"true",
";",
"}",
"DriverFactory",
"dr... | Creates an instance of the specified class an injects it into SeleniumHelper, so other fixtures can use it.
@param driverClassName name of Java class of WebDriver to use.
@param profile profile to use (for firefox, chrome mobile and IE only for now)
@return true if instance was created and injected into SeleniumHelper.... | [
"Creates",
"an",
"instance",
"of",
"the",
"specified",
"class",
"an",
"injects",
"it",
"into",
"SeleniumHelper",
"so",
"other",
"fixtures",
"can",
"use",
"it",
"."
] | 4e9018d7386a9aa65bfcbf07eb28ae064edd1732 | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/slim/web/SeleniumDriverSetup.java#L61-L69 | train |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/slim/web/SeleniumDriverSetup.java | SeleniumDriverSetup.connectToDriverForVersionOnAt | public boolean connectToDriverForVersionOnAt(String browser, String version, String platformName, String url)
throws MalformedURLException {
Platform platform = Platform.valueOf(platformName);
DesiredCapabilities desiredCapabilities = new DesiredCapabilities(browser, version, platform);
... | java | public boolean connectToDriverForVersionOnAt(String browser, String version, String platformName, String url)
throws MalformedURLException {
Platform platform = Platform.valueOf(platformName);
DesiredCapabilities desiredCapabilities = new DesiredCapabilities(browser, version, platform);
... | [
"public",
"boolean",
"connectToDriverForVersionOnAt",
"(",
"String",
"browser",
",",
"String",
"version",
",",
"String",
"platformName",
",",
"String",
"url",
")",
"throws",
"MalformedURLException",
"{",
"Platform",
"platform",
"=",
"Platform",
".",
"valueOf",
"(",
... | Connects SeleniumHelper to a remote web driver.
@param browser name of browser to connect to.
@param version version of browser.
@param platformName platform browser must run on.
@param url url to connect to browser.
@return true.
@throws MalformedURLException if supplied url can not be transformed to URL. | [
"Connects",
"SeleniumHelper",
"to",
"a",
"remote",
"web",
"driver",
"."
] | 4e9018d7386a9aa65bfcbf07eb28ae064edd1732 | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/slim/web/SeleniumDriverSetup.java#L138-L144 | train |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/util/FtpFileUtil.java | FtpFileUtil.getFileSizeOnFTPServer | public static Integer getFileSizeOnFTPServer(String hostName, Integer port,
String userName, String password, String filePath) {
Integer result = null;
// get file size
String replyString = executeCommandOnFTPServer(hostName, port, userName, password, "SIZE", filePath);
if ... | java | public static Integer getFileSizeOnFTPServer(String hostName, Integer port,
String userName, String password, String filePath) {
Integer result = null;
// get file size
String replyString = executeCommandOnFTPServer(hostName, port, userName, password, "SIZE", filePath);
if ... | [
"public",
"static",
"Integer",
"getFileSizeOnFTPServer",
"(",
"String",
"hostName",
",",
"Integer",
"port",
",",
"String",
"userName",
",",
"String",
"password",
",",
"String",
"filePath",
")",
"{",
"Integer",
"result",
"=",
"null",
";",
"// get file size",
"Str... | Get size of the FTP file.
@param hostName the FTP server host name to connect
@param port the port to connect
@param userName the user name
@param password the password
@param filePath file to get size for.
@return file's size if found.
@throws RuntimeException in case any exception has been thrown. | [
"Get",
"size",
"of",
"the",
"FTP",
"file",
"."
] | 4e9018d7386a9aa65bfcbf07eb28ae064edd1732 | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/util/FtpFileUtil.java#L28-L42 | train |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/util/FtpFileUtil.java | FtpFileUtil.executeCommandOnFTPServer | public static String executeCommandOnFTPServer(String hostName, Integer port,
String userName, String password, String command, String commandArgs) {
String result = null;
if (StringUtils.isNotBlank(command)) {
FTPClient ftpClient = new FTPClient();
String errorMessa... | java | public static String executeCommandOnFTPServer(String hostName, Integer port,
String userName, String password, String command, String commandArgs) {
String result = null;
if (StringUtils.isNotBlank(command)) {
FTPClient ftpClient = new FTPClient();
String errorMessa... | [
"public",
"static",
"String",
"executeCommandOnFTPServer",
"(",
"String",
"hostName",
",",
"Integer",
"port",
",",
"String",
"userName",
",",
"String",
"password",
",",
"String",
"command",
",",
"String",
"commandArgs",
")",
"{",
"String",
"result",
"=",
"null",... | Execute command with supplied arguments on the FTP server.
@param hostName the FTP server host name to connect
@param port the port to connect
@param userName the user name
@param password the password
@param command the command to execute.
@param commandArgs the command argument(s), if any.
@return reply string from F... | [
"Execute",
"command",
"with",
"supplied",
"arguments",
"on",
"the",
"FTP",
"server",
"."
] | 4e9018d7386a9aa65bfcbf07eb28ae064edd1732 | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/util/FtpFileUtil.java#L55-L82 | train |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/util/FtpFileUtil.java | FtpFileUtil.uploadFileToFTPServer | public static String uploadFileToFTPServer(String hostName, Integer port, String userName,
String password, String localFileFullName, String remotePath) {
String result = null;
FTPClient ftpClient = new FTPClient();
String errorMessage = "Unable to ... | java | public static String uploadFileToFTPServer(String hostName, Integer port, String userName,
String password, String localFileFullName, String remotePath) {
String result = null;
FTPClient ftpClient = new FTPClient();
String errorMessage = "Unable to ... | [
"public",
"static",
"String",
"uploadFileToFTPServer",
"(",
"String",
"hostName",
",",
"Integer",
"port",
",",
"String",
"userName",
",",
"String",
"password",
",",
"String",
"localFileFullName",
",",
"String",
"remotePath",
")",
"{",
"String",
"result",
"=",
"n... | Upload a given file to FTP server.
@param hostName the FTP server host name to connect
@param port the port to connect
@param userName the user name
@param password the password
@param localFileFullName the full name (inclusive path) of the local file.
@param remotePath the path to the file on the FTP.
@return reply st... | [
"Upload",
"a",
"given",
"file",
"to",
"FTP",
"server",
"."
] | 4e9018d7386a9aa65bfcbf07eb28ae064edd1732 | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/util/FtpFileUtil.java#L95-L130 | train |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/util/FtpFileUtil.java | FtpFileUtil.loadFileFromFTPServer | public static String loadFileFromFTPServer(String hostName, Integer port,
String userName, String password, String filePath, int numberOfLines) {
String result = null;
FTPClient ftpClient = new FTPClient();
InputStream inputStream = null;
String errorMessage = "Unable to con... | java | public static String loadFileFromFTPServer(String hostName, Integer port,
String userName, String password, String filePath, int numberOfLines) {
String result = null;
FTPClient ftpClient = new FTPClient();
InputStream inputStream = null;
String errorMessage = "Unable to con... | [
"public",
"static",
"String",
"loadFileFromFTPServer",
"(",
"String",
"hostName",
",",
"Integer",
"port",
",",
"String",
"userName",
",",
"String",
"password",
",",
"String",
"filePath",
",",
"int",
"numberOfLines",
")",
"{",
"String",
"result",
"=",
"null",
"... | Reads content of file on from FTP server to String.
@param hostName the FTP server host name to connect
@param port the port to connect
@param userName the user name
@param password the password
@param filePath file to read.
@return file's content.
@throws RuntimeException in case any exception has been thrown. | [
"Reads",
"content",
"of",
"file",
"on",
"from",
"FTP",
"server",
"to",
"String",
"."
] | 4e9018d7386a9aa65bfcbf07eb28ae064edd1732 | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/util/FtpFileUtil.java#L169-L196 | train |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/util/FtpFileUtil.java | FtpFileUtil.connectAndLoginOnFTPServer | public static void connectAndLoginOnFTPServer(FTPClient ftpClient,
String hostName, Integer port, String userName, String password) {
try {
if (port != null && port.intValue() > 0) {
ftpClient.connect(hostName, port);
} else {
ftpClient.connect... | java | public static void connectAndLoginOnFTPServer(FTPClient ftpClient,
String hostName, Integer port, String userName, String password) {
try {
if (port != null && port.intValue() > 0) {
ftpClient.connect(hostName, port);
} else {
ftpClient.connect... | [
"public",
"static",
"void",
"connectAndLoginOnFTPServer",
"(",
"FTPClient",
"ftpClient",
",",
"String",
"hostName",
",",
"Integer",
"port",
",",
"String",
"userName",
",",
"String",
"password",
")",
"{",
"try",
"{",
"if",
"(",
"port",
"!=",
"null",
"&&",
"po... | Connect and login on given FTP server with provided credentials.
@param hostName the FTP server host name to connect
@param port the port to connect
@param userName the user name
@param password the password | [
"Connect",
"and",
"login",
"on",
"given",
"FTP",
"server",
"with",
"provided",
"credentials",
"."
] | 4e9018d7386a9aa65bfcbf07eb28ae064edd1732 | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/util/FtpFileUtil.java#L205-L225 | train |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/util/FtpFileUtil.java | FtpFileUtil.disconnectAndLogoutFromFTPServer | public static void disconnectAndLogoutFromFTPServer(FTPClient ftpClient, String hostName) {
try {
// logout and disconnect
if (ftpClient != null && ftpClient.isConnected()) {
ftpClient.logout();
ftpClient.disconnect();
}
} catch (IOExce... | java | public static void disconnectAndLogoutFromFTPServer(FTPClient ftpClient, String hostName) {
try {
// logout and disconnect
if (ftpClient != null && ftpClient.isConnected()) {
ftpClient.logout();
ftpClient.disconnect();
}
} catch (IOExce... | [
"public",
"static",
"void",
"disconnectAndLogoutFromFTPServer",
"(",
"FTPClient",
"ftpClient",
",",
"String",
"hostName",
")",
"{",
"try",
"{",
"// logout and disconnect",
"if",
"(",
"ftpClient",
"!=",
"null",
"&&",
"ftpClient",
".",
"isConnected",
"(",
")",
")",
... | Disconnect and logout given FTP client.
@param hostName the FTP server host name | [
"Disconnect",
"and",
"logout",
"given",
"FTP",
"client",
"."
] | 4e9018d7386a9aa65bfcbf07eb28ae064edd1732 | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/util/FtpFileUtil.java#L231-L242 | train |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/util/DatesHelper.java | DatesHelper.addDerivedDates | public void addDerivedDates(Map<String, Object> values) {
Map<String, Object> valuesToAdd = new HashMap<String, Object>();
for (Map.Entry<String, Object> entry : values.entrySet()) {
String key = entry.getKey();
Object object = entry.getValue();
if (object != null) {... | java | public void addDerivedDates(Map<String, Object> values) {
Map<String, Object> valuesToAdd = new HashMap<String, Object>();
for (Map.Entry<String, Object> entry : values.entrySet()) {
String key = entry.getKey();
Object object = entry.getValue();
if (object != null) {... | [
"public",
"void",
"addDerivedDates",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"values",
")",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"valuesToAdd",
"=",
"new",
"HashMap",
"<",
"String",
",",
"Object",
">",
"(",
")",
";",
"for",
"(",
"Map... | Adds derived values for dates in map.
@param values values as provided. | [
"Adds",
"derived",
"values",
"for",
"dates",
"in",
"map",
"."
] | 4e9018d7386a9aa65bfcbf07eb28ae064edd1732 | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/util/DatesHelper.java#L22-L42 | train |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/slim/MapFixture.java | MapFixture.setIntValueForIn | public void setIntValueForIn(int value, String name, Map<String, Object> map) {
setValueForIn(Integer.valueOf(value), name, map);
} | java | public void setIntValueForIn(int value, String name, Map<String, Object> map) {
setValueForIn(Integer.valueOf(value), name, map);
} | [
"public",
"void",
"setIntValueForIn",
"(",
"int",
"value",
",",
"String",
"name",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"map",
")",
"{",
"setValueForIn",
"(",
"Integer",
".",
"valueOf",
"(",
"value",
")",
",",
"name",
",",
"map",
")",
";",
"... | Stores integer value in map.
@param value value to be passed.
@param name name to use this value for.
@param map map to store value in. | [
"Stores",
"integer",
"value",
"in",
"map",
"."
] | 4e9018d7386a9aa65bfcbf07eb28ae064edd1732 | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/slim/MapFixture.java#L55-L57 | train |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/slim/MapFixture.java | MapFixture.setDoubleValueForIn | public void setDoubleValueForIn(double value, String name, Map<String, Object> map) {
setValueForIn(Double.valueOf(value), name, map);
} | java | public void setDoubleValueForIn(double value, String name, Map<String, Object> map) {
setValueForIn(Double.valueOf(value), name, map);
} | [
"public",
"void",
"setDoubleValueForIn",
"(",
"double",
"value",
",",
"String",
"name",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"map",
")",
"{",
"setValueForIn",
"(",
"Double",
".",
"valueOf",
"(",
"value",
")",
",",
"name",
",",
"map",
")",
";"... | Stores double value in map.
@param value value to be passed.
@param name name to use this value for.
@param map map to store value in. | [
"Stores",
"double",
"value",
"in",
"map",
"."
] | 4e9018d7386a9aa65bfcbf07eb28ae064edd1732 | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/slim/MapFixture.java#L65-L67 | train |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/slim/MapFixture.java | MapFixture.setBooleanValueForIn | public void setBooleanValueForIn(boolean value, String name, Map<String, Object> map) {
setValueForIn(Boolean.valueOf(value), name, map);
} | java | public void setBooleanValueForIn(boolean value, String name, Map<String, Object> map) {
setValueForIn(Boolean.valueOf(value), name, map);
} | [
"public",
"void",
"setBooleanValueForIn",
"(",
"boolean",
"value",
",",
"String",
"name",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"map",
")",
"{",
"setValueForIn",
"(",
"Boolean",
".",
"valueOf",
"(",
"value",
")",
",",
"name",
",",
"map",
")",
... | Stores boolean value in map.
@param value value to be passed.
@param name name to use this value for.
@param map map to store value in. | [
"Stores",
"boolean",
"value",
"in",
"map",
"."
] | 4e9018d7386a9aa65bfcbf07eb28ae064edd1732 | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/slim/MapFixture.java#L75-L77 | train |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/slim/MapFixture.java | MapFixture.addValueToIn | public void addValueToIn(Object value, String name, Map<String, Object> map) {
getMapHelper().addValueToIn(value, name, map);
} | java | public void addValueToIn(Object value, String name, Map<String, Object> map) {
getMapHelper().addValueToIn(value, name, map);
} | [
"public",
"void",
"addValueToIn",
"(",
"Object",
"value",
",",
"String",
"name",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"map",
")",
"{",
"getMapHelper",
"(",
")",
".",
"addValueToIn",
"(",
"value",
",",
"name",
",",
"map",
")",
";",
"}"
] | Adds value to a list map.
@param value value to be passed.
@param name name to use this value for.
@param map map to store value in. | [
"Adds",
"value",
"to",
"a",
"list",
"map",
"."
] | 4e9018d7386a9aa65bfcbf07eb28ae064edd1732 | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/slim/MapFixture.java#L95-L97 | train |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/slim/MapFixture.java | MapFixture.copyValuesFromTo | public void copyValuesFromTo(Map<String, Object> otherMap, Map<String, Object> map) {
getMapHelper().copyValuesFromTo(otherMap, map);
} | java | public void copyValuesFromTo(Map<String, Object> otherMap, Map<String, Object> map) {
getMapHelper().copyValuesFromTo(otherMap, map);
} | [
"public",
"void",
"copyValuesFromTo",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"otherMap",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"map",
")",
"{",
"getMapHelper",
"(",
")",
".",
"copyValuesFromTo",
"(",
"otherMap",
",",
"map",
")",
";",
"... | Adds all values in the supplied map to the current values.
@param otherMap to obtain values from.
@param map map to store value in. | [
"Adds",
"all",
"values",
"in",
"the",
"supplied",
"map",
"to",
"the",
"current",
"values",
"."
] | 4e9018d7386a9aa65bfcbf07eb28ae064edd1732 | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/slim/MapFixture.java#L104-L106 | train |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/util/XPathHelper.java | XPathHelper.getXPath | public String getXPath(NamespaceContext context, String xml, String xPathExpr) {
return (String) evaluateXpath(context, xml, xPathExpr, null);
} | java | public String getXPath(NamespaceContext context, String xml, String xPathExpr) {
return (String) evaluateXpath(context, xml, xPathExpr, null);
} | [
"public",
"String",
"getXPath",
"(",
"NamespaceContext",
"context",
",",
"String",
"xml",
",",
"String",
"xPathExpr",
")",
"{",
"return",
"(",
"String",
")",
"evaluateXpath",
"(",
"context",
",",
"xml",
",",
"xPathExpr",
",",
"null",
")",
";",
"}"
] | Evaluates xPathExpr against xml, returning single match.
@param xml xml document to apply XPath to.
@param xPathExpr XPath expression to evaluate.
@return result of evaluation, null if xml is null. | [
"Evaluates",
"xPathExpr",
"against",
"xml",
"returning",
"single",
"match",
"."
] | 4e9018d7386a9aa65bfcbf07eb28ae064edd1732 | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/util/XPathHelper.java#L28-L30 | train |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/util/XPathHelper.java | XPathHelper.getAllXPath | public List<String> getAllXPath(NamespaceContext context, String xml, String xPathExpr) {
List<String> result = null;
NodeList nodes = (NodeList) evaluateXpath(context, xml, xPathExpr, XPathConstants.NODESET);
if (nodes != null) {
result = new ArrayList<String>(nodes.getLeng... | java | public List<String> getAllXPath(NamespaceContext context, String xml, String xPathExpr) {
List<String> result = null;
NodeList nodes = (NodeList) evaluateXpath(context, xml, xPathExpr, XPathConstants.NODESET);
if (nodes != null) {
result = new ArrayList<String>(nodes.getLeng... | [
"public",
"List",
"<",
"String",
">",
"getAllXPath",
"(",
"NamespaceContext",
"context",
",",
"String",
"xml",
",",
"String",
"xPathExpr",
")",
"{",
"List",
"<",
"String",
">",
"result",
"=",
"null",
";",
"NodeList",
"nodes",
"=",
"(",
"NodeList",
")",
"... | Evaluates xPathExpr against xml, returning all matches.
@param xml xml document to apply XPath to.
@param xPathExpr XPath expression to evaluate.
@return text() of all nodes matching XPath, null if xml is null. | [
"Evaluates",
"xPathExpr",
"against",
"xml",
"returning",
"all",
"matches",
"."
] | 4e9018d7386a9aa65bfcbf07eb28ae064edd1732 | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/util/XPathHelper.java#L39-L51 | train |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/util/FirstNonNullHelper.java | FirstNonNullHelper.firstNonNull | @SafeVarargs
public static <T> T firstNonNull(Supplier<T>... suppliers) {
return firstNonNull(Supplier::get, suppliers);
} | java | @SafeVarargs
public static <T> T firstNonNull(Supplier<T>... suppliers) {
return firstNonNull(Supplier::get, suppliers);
} | [
"@",
"SafeVarargs",
"public",
"static",
"<",
"T",
">",
"T",
"firstNonNull",
"(",
"Supplier",
"<",
"T",
">",
"...",
"suppliers",
")",
"{",
"return",
"firstNonNull",
"(",
"Supplier",
"::",
"get",
",",
"suppliers",
")",
";",
"}"
] | Gets first supplier's result which is not null.
Suppliers are called sequentially. Once a non-null result is obtained the remaining suppliers are not called.
@param <T> type of result returned by suppliers.
@param suppliers all possible suppliers that might be able to supply a value.
@return first result obtaine... | [
"Gets",
"first",
"supplier",
"s",
"result",
"which",
"is",
"not",
"null",
".",
"Suppliers",
"are",
"called",
"sequentially",
".",
"Once",
"a",
"non",
"-",
"null",
"result",
"is",
"obtained",
"the",
"remaining",
"suppliers",
"are",
"not",
"called",
"."
] | 4e9018d7386a9aa65bfcbf07eb28ae064edd1732 | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/util/FirstNonNullHelper.java#L21-L24 | train |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/util/FirstNonNullHelper.java | FirstNonNullHelper.firstNonNull | public static <T, R> R firstNonNull(T input, Function<T, R> function, Function<T, R>... functions) {
return firstNonNull(f -> f.apply(input), Stream.concat(Stream.of(function), Stream.of(functions)));
} | java | public static <T, R> R firstNonNull(T input, Function<T, R> function, Function<T, R>... functions) {
return firstNonNull(f -> f.apply(input), Stream.concat(Stream.of(function), Stream.of(functions)));
} | [
"public",
"static",
"<",
"T",
",",
"R",
">",
"R",
"firstNonNull",
"(",
"T",
"input",
",",
"Function",
"<",
"T",
",",
"R",
">",
"function",
",",
"Function",
"<",
"T",
",",
"R",
">",
"...",
"functions",
")",
"{",
"return",
"firstNonNull",
"(",
"f",
... | Gets first result of set of function which is not null.
@param <T> type of values.
@param <R> element to return.
@param input input to provide to all functions.
@param function first function to apply (separate to indicate at least one should be provided)
@param functions all possible functions that m... | [
"Gets",
"first",
"result",
"of",
"set",
"of",
"function",
"which",
"is",
"not",
"null",
"."
] | 4e9018d7386a9aa65bfcbf07eb28ae064edd1732 | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/util/FirstNonNullHelper.java#L81-L83 | train |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/util/FirstNonNullHelper.java | FirstNonNullHelper.firstNonNull | public static <T, R> R firstNonNull(Function<T, R> function, Stream<T> values) {
return values
.map(function)
.filter(Objects::nonNull)
.findFirst()
.orElse(null);
} | java | public static <T, R> R firstNonNull(Function<T, R> function, Stream<T> values) {
return values
.map(function)
.filter(Objects::nonNull)
.findFirst()
.orElse(null);
} | [
"public",
"static",
"<",
"T",
",",
"R",
">",
"R",
"firstNonNull",
"(",
"Function",
"<",
"T",
",",
"R",
">",
"function",
",",
"Stream",
"<",
"T",
">",
"values",
")",
"{",
"return",
"values",
".",
"map",
"(",
"function",
")",
".",
"filter",
"(",
"O... | Gets first element which is not null.
@param <T> type of values.
@param <R> element to return.
@param function function to apply to each value.
@param values all possible values.
@return first result value which was not null, OR <code>null</code> if all values were <code>null</code>. | [
"Gets",
"first",
"element",
"which",
"is",
"not",
"null",
"."
] | 4e9018d7386a9aa65bfcbf07eb28ae064edd1732 | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/util/FirstNonNullHelper.java#L94-L100 | train |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/util/XPathCheckResult.java | XPathCheckResult.parse | public static XPathCheckResult parse(String value) {
XPathCheckResult parsed = new XPathCheckResult();
parsed.result = value;
return parsed;
} | java | public static XPathCheckResult parse(String value) {
XPathCheckResult parsed = new XPathCheckResult();
parsed.result = value;
return parsed;
} | [
"public",
"static",
"XPathCheckResult",
"parse",
"(",
"String",
"value",
")",
"{",
"XPathCheckResult",
"parsed",
"=",
"new",
"XPathCheckResult",
"(",
")",
";",
"parsed",
".",
"result",
"=",
"value",
";",
"return",
"parsed",
";",
"}"
] | Parse method to allow Fitnesse to determine expected values.
@param value expected value from cell.
@return object with supplied value as result. | [
"Parse",
"method",
"to",
"allow",
"Fitnesse",
"to",
"determine",
"expected",
"values",
"."
] | 4e9018d7386a9aa65bfcbf07eb28ae064edd1732 | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/util/XPathCheckResult.java#L31-L35 | train |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/util/XPathCheckResult.java | XPathCheckResult.addMisMatch | public void addMisMatch(String name, String expected, String actual) {
result = "NOK";
Mismatch mismatch = new Mismatch();
mismatch.name = name;
mismatch.expected = expected;
mismatch.actual = actual;
mismatches.add(mismatch);
} | java | public void addMisMatch(String name, String expected, String actual) {
result = "NOK";
Mismatch mismatch = new Mismatch();
mismatch.name = name;
mismatch.expected = expected;
mismatch.actual = actual;
mismatches.add(mismatch);
} | [
"public",
"void",
"addMisMatch",
"(",
"String",
"name",
",",
"String",
"expected",
",",
"String",
"actual",
")",
"{",
"result",
"=",
"\"NOK\"",
";",
"Mismatch",
"mismatch",
"=",
"new",
"Mismatch",
"(",
")",
";",
"mismatch",
".",
"name",
"=",
"name",
";",... | Adds a mismatch to this result.
@param name name of value.
@param expected expected value.
@param actual value of XPath expression. | [
"Adds",
"a",
"mismatch",
"to",
"this",
"result",
"."
] | 4e9018d7386a9aa65bfcbf07eb28ae064edd1732 | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/util/XPathCheckResult.java#L43-L50 | train |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/util/PropertiesHelper.java | PropertiesHelper.parsePropertiesString | public Properties parsePropertiesString(String propertiesAsString) {
final Properties p = new Properties();
try (StringReader reader = new StringReader(propertiesAsString)) {
p.load(reader);
} catch (IOException e) {
throw new IllegalArgumentException("Unable to pars... | java | public Properties parsePropertiesString(String propertiesAsString) {
final Properties p = new Properties();
try (StringReader reader = new StringReader(propertiesAsString)) {
p.load(reader);
} catch (IOException e) {
throw new IllegalArgumentException("Unable to pars... | [
"public",
"Properties",
"parsePropertiesString",
"(",
"String",
"propertiesAsString",
")",
"{",
"final",
"Properties",
"p",
"=",
"new",
"Properties",
"(",
")",
";",
"try",
"(",
"StringReader",
"reader",
"=",
"new",
"StringReader",
"(",
"propertiesAsString",
")",
... | Converts String to Properties.
@param propertiesAsString contents of .properties file.
@return Properties as parsed. | [
"Converts",
"String",
"to",
"Properties",
"."
] | 4e9018d7386a9aa65bfcbf07eb28ae064edd1732 | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/util/PropertiesHelper.java#L20-L28 | train |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/util/PropertiesHelper.java | PropertiesHelper.convertPropertiesToMap | public Map<String, Object> convertPropertiesToMap(Properties properties) {
return properties.entrySet().stream()
.collect(toLinkedMap(
e -> e.getKey().toString(),
e -> e.getValue()));
} | java | public Map<String, Object> convertPropertiesToMap(Properties properties) {
return properties.entrySet().stream()
.collect(toLinkedMap(
e -> e.getKey().toString(),
e -> e.getValue()));
} | [
"public",
"Map",
"<",
"String",
",",
"Object",
">",
"convertPropertiesToMap",
"(",
"Properties",
"properties",
")",
"{",
"return",
"properties",
".",
"entrySet",
"(",
")",
".",
"stream",
"(",
")",
".",
"collect",
"(",
"toLinkedMap",
"(",
"e",
"->",
"e",
... | Converts Properties to Map
@param properties properties to convert.
@return map version of properties. | [
"Converts",
"Properties",
"to",
"Map"
] | 4e9018d7386a9aa65bfcbf07eb28ae064edd1732 | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/util/PropertiesHelper.java#L35-L40 | train |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/slim/SlimFixture.java | SlimFixture.createFile | protected String createFile(String dir, String fileName, byte[] content) {
String baseName = FilenameUtils.getBaseName(fileName);
String ext = FilenameUtils.getExtension(fileName);
String downloadedFile = FileUtil.saveToFile(dir + baseName, ext, content);
return linkToFile(downloadedFile... | java | protected String createFile(String dir, String fileName, byte[] content) {
String baseName = FilenameUtils.getBaseName(fileName);
String ext = FilenameUtils.getExtension(fileName);
String downloadedFile = FileUtil.saveToFile(dir + baseName, ext, content);
return linkToFile(downloadedFile... | [
"protected",
"String",
"createFile",
"(",
"String",
"dir",
",",
"String",
"fileName",
",",
"byte",
"[",
"]",
"content",
")",
"{",
"String",
"baseName",
"=",
"FilenameUtils",
".",
"getBaseName",
"(",
"fileName",
")",
";",
"String",
"ext",
"=",
"FilenameUtils"... | Creates a file using the supplied content.
@param dir directory to create file in.
@param fileName name for file.
@param content content to save.
@return link to created file. | [
"Creates",
"a",
"file",
"using",
"the",
"supplied",
"content",
"."
] | 4e9018d7386a9aa65bfcbf07eb28ae064edd1732 | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/slim/SlimFixture.java#L286-L291 | train |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/slim/SlimFixture.java | SlimFixture.linkToFile | protected String linkToFile(File f) {
String url = getWikiUrl(f.getAbsolutePath());
if (url == null) {
url = f.toURI().toString();
}
return String.format("<a href=\"%s\" target=\"_blank\">%s</a>", url, f.getName());
} | java | protected String linkToFile(File f) {
String url = getWikiUrl(f.getAbsolutePath());
if (url == null) {
url = f.toURI().toString();
}
return String.format("<a href=\"%s\" target=\"_blank\">%s</a>", url, f.getName());
} | [
"protected",
"String",
"linkToFile",
"(",
"File",
"f",
")",
"{",
"String",
"url",
"=",
"getWikiUrl",
"(",
"f",
".",
"getAbsolutePath",
"(",
")",
")",
";",
"if",
"(",
"url",
"==",
"null",
")",
"{",
"url",
"=",
"f",
".",
"toURI",
"(",
")",
".",
"to... | Creates a wiki link to a file.
@param f file.
@return link referencing the file. | [
"Creates",
"a",
"wiki",
"link",
"to",
"a",
"file",
"."
] | 4e9018d7386a9aa65bfcbf07eb28ae064edd1732 | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/slim/SlimFixture.java#L316-L322 | train |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/util/NamespaceContextImpl.java | NamespaceContextImpl.add | public void add(String prefix, String uri) {
if (uri == null) {
namespaces.remove(prefix);
} else {
if (namespaces.containsKey(prefix)) {
String currentUri = namespaces.get(prefix);
if (!currentUri.equals(uri)) {
throw new FitFa... | java | public void add(String prefix, String uri) {
if (uri == null) {
namespaces.remove(prefix);
} else {
if (namespaces.containsKey(prefix)) {
String currentUri = namespaces.get(prefix);
if (!currentUri.equals(uri)) {
throw new FitFa... | [
"public",
"void",
"add",
"(",
"String",
"prefix",
",",
"String",
"uri",
")",
"{",
"if",
"(",
"uri",
"==",
"null",
")",
"{",
"namespaces",
".",
"remove",
"(",
"prefix",
")",
";",
"}",
"else",
"{",
"if",
"(",
"namespaces",
".",
"containsKey",
"(",
"p... | Adds registration for prefix.
@param prefix prefix to register.
@param uri namespace the prefix should map to.
@throws FitFailureException if another uri is already registered for this prefix. | [
"Adds",
"registration",
"for",
"prefix",
"."
] | 4e9018d7386a9aa65bfcbf07eb28ae064edd1732 | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/util/NamespaceContextImpl.java#L24-L39 | train |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/slim/HtmlFixture.java | HtmlFixture.html | public String html(String htmlSource) {
String cleanSource = htmlCleaner.cleanupPreFormatted(htmlSource);
return "<div>" + StringEscapeUtils.unescapeHtml4(cleanSource) + "</div>";
} | java | public String html(String htmlSource) {
String cleanSource = htmlCleaner.cleanupPreFormatted(htmlSource);
return "<div>" + StringEscapeUtils.unescapeHtml4(cleanSource) + "</div>";
} | [
"public",
"String",
"html",
"(",
"String",
"htmlSource",
")",
"{",
"String",
"cleanSource",
"=",
"htmlCleaner",
".",
"cleanupPreFormatted",
"(",
"htmlSource",
")",
";",
"return",
"\"<div>\"",
"+",
"StringEscapeUtils",
".",
"unescapeHtml4",
"(",
"cleanSource",
")",... | Unescapes supplied HTML content so it can be rendered inside a wiki page.
@param htmlSource HTML code to display (possibly surrounded by <pre></pre> tags).
@return unescaped content, enclosed in <div></div> so wiki will not escape it. | [
"Unescapes",
"supplied",
"HTML",
"content",
"so",
"it",
"can",
"be",
"rendered",
"inside",
"a",
"wiki",
"page",
"."
] | 4e9018d7386a9aa65bfcbf07eb28ae064edd1732 | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/slim/HtmlFixture.java#L26-L29 | train |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/junit/JUnitXMLPerPageListener.java | JUnitXMLPerPageListener.generateResultXml | protected String generateResultXml(String testName, Throwable exception, double executionTime) {
int errors = 0;
int failures = 0;
String failureXml = "";
if (exception != null) {
failureXml = "<failure type=\"" + exception.getClass().getName()
+ "\" mess... | java | protected String generateResultXml(String testName, Throwable exception, double executionTime) {
int errors = 0;
int failures = 0;
String failureXml = "";
if (exception != null) {
failureXml = "<failure type=\"" + exception.getClass().getName()
+ "\" mess... | [
"protected",
"String",
"generateResultXml",
"(",
"String",
"testName",
",",
"Throwable",
"exception",
",",
"double",
"executionTime",
")",
"{",
"int",
"errors",
"=",
"0",
";",
"int",
"failures",
"=",
"0",
";",
"String",
"failureXml",
"=",
"\"\"",
";",
"if",
... | Creates XML string describing test outcome.
@param testName name of test.
@param exception exception from test
@param executionTime execution time in seconds
@return XML description of test result | [
"Creates",
"XML",
"string",
"describing",
"test",
"outcome",
"."
] | 4e9018d7386a9aa65bfcbf07eb28ae064edd1732 | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/junit/JUnitXMLPerPageListener.java#L86-L106 | train |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/junit/JUnitXMLPerPageListener.java | JUnitXMLPerPageListener.writeResult | protected void writeResult(String testName, String resultXml) throws IOException {
String finalPath = getXmlFileName(testName);
Writer fw = null;
try {
fw = new BufferedWriter(
new OutputStreamWriter(
new FileOutputStream(finalPath),
... | java | protected void writeResult(String testName, String resultXml) throws IOException {
String finalPath = getXmlFileName(testName);
Writer fw = null;
try {
fw = new BufferedWriter(
new OutputStreamWriter(
new FileOutputStream(finalPath),
... | [
"protected",
"void",
"writeResult",
"(",
"String",
"testName",
",",
"String",
"resultXml",
")",
"throws",
"IOException",
"{",
"String",
"finalPath",
"=",
"getXmlFileName",
"(",
"testName",
")",
";",
"Writer",
"fw",
"=",
"null",
";",
"try",
"{",
"fw",
"=",
... | Writes XML result to disk.
@param testName name of test.
@param resultXml XML description of test outcome.
@throws IOException if unable to write result. | [
"Writes",
"XML",
"result",
"to",
"disk",
"."
] | 4e9018d7386a9aa65bfcbf07eb28ae064edd1732 | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/junit/JUnitXMLPerPageListener.java#L119-L134 | train |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/util/DataUrlHelper.java | DataUrlHelper.getData | public static String getData(String dataUrl) {
int indexOfComma = dataUrl.indexOf(',');
return dataUrl.substring(indexOfComma + 1);
} | java | public static String getData(String dataUrl) {
int indexOfComma = dataUrl.indexOf(',');
return dataUrl.substring(indexOfComma + 1);
} | [
"public",
"static",
"String",
"getData",
"(",
"String",
"dataUrl",
")",
"{",
"int",
"indexOfComma",
"=",
"dataUrl",
".",
"indexOf",
"(",
"'",
"'",
")",
";",
"return",
"dataUrl",
".",
"substring",
"(",
"indexOfComma",
"+",
"1",
")",
";",
"}"
] | Gets data embedded in data url.
@param dataUrl url to extract data from.
@return data part of URL. | [
"Gets",
"data",
"embedded",
"in",
"data",
"url",
"."
] | 4e9018d7386a9aa65bfcbf07eb28ae064edd1732 | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/util/DataUrlHelper.java#L23-L26 | train |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/util/JsonPathHelper.java | JsonPathHelper.getJsonPath | public Object getJsonPath(String json, String jsonPath) {
if (!JsonPath.isPathDefinite(jsonPath)) {
throw new RuntimeException(jsonPath + " returns a list of results, not a single.");
}
return parseJson(json).read(jsonPath);
} | java | public Object getJsonPath(String json, String jsonPath) {
if (!JsonPath.isPathDefinite(jsonPath)) {
throw new RuntimeException(jsonPath + " returns a list of results, not a single.");
}
return parseJson(json).read(jsonPath);
} | [
"public",
"Object",
"getJsonPath",
"(",
"String",
"json",
",",
"String",
"jsonPath",
")",
"{",
"if",
"(",
"!",
"JsonPath",
".",
"isPathDefinite",
"(",
"jsonPath",
")",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
"jsonPath",
"+",
"\" returns a list of re... | Evaluates a JsonPath expression returning a single element.
@param json JSON value.
@param jsonPath expression to evaluate.
@return result result of expression.
@throws java.lang.RuntimeException if jsonPath would return multiple elements. | [
"Evaluates",
"a",
"JsonPath",
"expression",
"returning",
"a",
"single",
"element",
"."
] | 4e9018d7386a9aa65bfcbf07eb28ae064edd1732 | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/util/JsonPathHelper.java#L34-L39 | train |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/util/JsonPathHelper.java | JsonPathHelper.getAllJsonPath | public List<Object> getAllJsonPath(String json, String jsonPath) {
List<Object> result;
if (JsonPath.isPathDefinite(jsonPath)) {
Object val = getJsonPath(json, jsonPath);
if (val == null) {
result = Collections.emptyList();
} else {
res... | java | public List<Object> getAllJsonPath(String json, String jsonPath) {
List<Object> result;
if (JsonPath.isPathDefinite(jsonPath)) {
Object val = getJsonPath(json, jsonPath);
if (val == null) {
result = Collections.emptyList();
} else {
res... | [
"public",
"List",
"<",
"Object",
">",
"getAllJsonPath",
"(",
"String",
"json",
",",
"String",
"jsonPath",
")",
"{",
"List",
"<",
"Object",
">",
"result",
";",
"if",
"(",
"JsonPath",
".",
"isPathDefinite",
"(",
"jsonPath",
")",
")",
"{",
"Object",
"val",
... | Evaluates a JsonPath expression returning a multiple elements.
@param json JSON value.
@param jsonPath expression to evaluate.
@return result results of expression.
@throws java.lang.RuntimeException if jsonPath would return a single element. | [
"Evaluates",
"a",
"JsonPath",
"expression",
"returning",
"a",
"multiple",
"elements",
"."
] | 4e9018d7386a9aa65bfcbf07eb28ae064edd1732 | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/util/JsonPathHelper.java#L48-L61 | train |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/slim/CompareFixture.java | CompareFixture.differenceBetweenAnd | public String differenceBetweenAnd(String first, String second) {
Formatter whitespaceFormatter = new Formatter() {
@Override
public String format(String value) {
return ensureWhitespaceVisible(value);
}
};
return getDifferencesHtml(first, seco... | java | public String differenceBetweenAnd(String first, String second) {
Formatter whitespaceFormatter = new Formatter() {
@Override
public String format(String value) {
return ensureWhitespaceVisible(value);
}
};
return getDifferencesHtml(first, seco... | [
"public",
"String",
"differenceBetweenAnd",
"(",
"String",
"first",
",",
"String",
"second",
")",
"{",
"Formatter",
"whitespaceFormatter",
"=",
"new",
"Formatter",
"(",
")",
"{",
"@",
"Override",
"public",
"String",
"format",
"(",
"String",
"value",
")",
"{",
... | Determines difference between two strings.
@param first first string to compare.
@param second second string to compare.
@return HTML of difference between the two. | [
"Determines",
"difference",
"between",
"two",
"strings",
"."
] | 4e9018d7386a9aa65bfcbf07eb28ae064edd1732 | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/slim/CompareFixture.java#L21-L29 | train |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/slim/CompareFixture.java | CompareFixture.differenceBetweenExplicitWhitespaceAnd | public String differenceBetweenExplicitWhitespaceAnd(String first, String second) {
Formatter whitespaceFormatter = new Formatter() {
@Override
public String format(String value) {
return explicitWhitespace(value);
}
};
return getDifferencesHtm... | java | public String differenceBetweenExplicitWhitespaceAnd(String first, String second) {
Formatter whitespaceFormatter = new Formatter() {
@Override
public String format(String value) {
return explicitWhitespace(value);
}
};
return getDifferencesHtm... | [
"public",
"String",
"differenceBetweenExplicitWhitespaceAnd",
"(",
"String",
"first",
",",
"String",
"second",
")",
"{",
"Formatter",
"whitespaceFormatter",
"=",
"new",
"Formatter",
"(",
")",
"{",
"@",
"Override",
"public",
"String",
"format",
"(",
"String",
"valu... | Determines difference between two strings, visualizing various forms of whitespace.
@param first first string to compare.
@param second second string to compare.
@return HTML of difference between the two. | [
"Determines",
"difference",
"between",
"two",
"strings",
"visualizing",
"various",
"forms",
"of",
"whitespace",
"."
] | 4e9018d7386a9aa65bfcbf07eb28ae064edd1732 | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/slim/CompareFixture.java#L37-L45 | train |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/slim/CompareFixture.java | CompareFixture.differenceBetweenIgnoreWhitespaceAnd | public String differenceBetweenIgnoreWhitespaceAnd(String first, String second) {
String cleanFirst = allWhitespaceToSingleSpace(first);
String cleanSecond = allWhitespaceToSingleSpace(second);
String cleanDiff = differenceBetweenAnd(cleanFirst, cleanSecond);
if (cleanDiff != null) {
... | java | public String differenceBetweenIgnoreWhitespaceAnd(String first, String second) {
String cleanFirst = allWhitespaceToSingleSpace(first);
String cleanSecond = allWhitespaceToSingleSpace(second);
String cleanDiff = differenceBetweenAnd(cleanFirst, cleanSecond);
if (cleanDiff != null) {
... | [
"public",
"String",
"differenceBetweenIgnoreWhitespaceAnd",
"(",
"String",
"first",
",",
"String",
"second",
")",
"{",
"String",
"cleanFirst",
"=",
"allWhitespaceToSingleSpace",
"(",
"first",
")",
";",
"String",
"cleanSecond",
"=",
"allWhitespaceToSingleSpace",
"(",
"... | Determines difference between two strings, ignoring whitespace changes.
@param first first string to compare.
@param second second string to compare.
@return HTML of difference between the two. | [
"Determines",
"difference",
"between",
"two",
"strings",
"ignoring",
"whitespace",
"changes",
"."
] | 4e9018d7386a9aa65bfcbf07eb28ae064edd1732 | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/slim/CompareFixture.java#L106-L118 | train |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/fit/SoapCallMapColumnFixture.java | SoapCallMapColumnFixture.registerNs | protected static void registerNs(String prefix, String url) {
Environment.getInstance().registerNamespace(prefix, url);
} | java | protected static void registerNs(String prefix, String url) {
Environment.getInstance().registerNamespace(prefix, url);
} | [
"protected",
"static",
"void",
"registerNs",
"(",
"String",
"prefix",
",",
"String",
"url",
")",
"{",
"Environment",
".",
"getInstance",
"(",
")",
".",
"registerNamespace",
"(",
"prefix",
",",
"url",
")",
";",
"}"
] | Registers a namespace in the environment, so the prefix can be used in
XPath expressions.
@param prefix prefix to be used in XPath expressions.
@param url namespace URI the prefix should map to. | [
"Registers",
"a",
"namespace",
"in",
"the",
"environment",
"so",
"the",
"prefix",
"can",
"be",
"used",
"in",
"XPath",
"expressions",
"."
] | 4e9018d7386a9aa65bfcbf07eb28ae064edd1732 | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/fit/SoapCallMapColumnFixture.java#L21-L23 | train |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/fit/SoapCallMapColumnFixture.java | SoapCallMapColumnFixture.callServiceImpl | protected Response callServiceImpl(String urlSymbolKey, String soapAction) {
String url = getSymbol(urlSymbolKey).toString();
Response response = getEnvironment().createInstance(getResponseClass());
callSoapService(url, getTemplateName(), soapAction, response);
return response;
} | java | protected Response callServiceImpl(String urlSymbolKey, String soapAction) {
String url = getSymbol(urlSymbolKey).toString();
Response response = getEnvironment().createInstance(getResponseClass());
callSoapService(url, getTemplateName(), soapAction, response);
return response;
} | [
"protected",
"Response",
"callServiceImpl",
"(",
"String",
"urlSymbolKey",
",",
"String",
"soapAction",
")",
"{",
"String",
"url",
"=",
"getSymbol",
"(",
"urlSymbolKey",
")",
".",
"toString",
"(",
")",
";",
"Response",
"response",
"=",
"getEnvironment",
"(",
"... | Creates response, calls service using configured template and current row's values and calls SOAP service.
@param urlSymbolKey key of symbol containing service's URL.
@param soapAction SOAPAction header value (null if no header is required).
@return filled response | [
"Creates",
"response",
"calls",
"service",
"using",
"configured",
"template",
"and",
"current",
"row",
"s",
"values",
"and",
"calls",
"SOAP",
"service",
"."
] | 4e9018d7386a9aa65bfcbf07eb28ae064edd1732 | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/fit/SoapCallMapColumnFixture.java#L56-L61 | train |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/fit/SoapCallMapColumnFixture.java | SoapCallMapColumnFixture.callCheckServiceImpl | protected XmlHttpResponse callCheckServiceImpl(String urlSymbolKey, String soapAction) {
String url = getSymbol(urlSymbolKey).toString();
XmlHttpResponse response = getEnvironment().createInstance(getCheckResponseClass());
callSoapService(url, getCheckTemplateName(), soapAction, response);
... | java | protected XmlHttpResponse callCheckServiceImpl(String urlSymbolKey, String soapAction) {
String url = getSymbol(urlSymbolKey).toString();
XmlHttpResponse response = getEnvironment().createInstance(getCheckResponseClass());
callSoapService(url, getCheckTemplateName(), soapAction, response);
... | [
"protected",
"XmlHttpResponse",
"callCheckServiceImpl",
"(",
"String",
"urlSymbolKey",
",",
"String",
"soapAction",
")",
"{",
"String",
"url",
"=",
"getSymbol",
"(",
"urlSymbolKey",
")",
".",
"toString",
"(",
")",
";",
"XmlHttpResponse",
"response",
"=",
"getEnvir... | Creates check response, calls service using configured check template and current row's values and calls SOAP service.
@param urlSymbolKey key of symbol containing check service's URL.
@param soapAction SOAPAction header value (null if no header is required).
@return filled check response | [
"Creates",
"check",
"response",
"calls",
"service",
"using",
"configured",
"check",
"template",
"and",
"current",
"row",
"s",
"values",
"and",
"calls",
"SOAP",
"service",
"."
] | 4e9018d7386a9aa65bfcbf07eb28ae064edd1732 | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/fit/SoapCallMapColumnFixture.java#L69-L74 | train |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/fit/SoapCallMapColumnFixture.java | SoapCallMapColumnFixture.callSoapService | protected void callSoapService(String url, String templateName, String soapAction, XmlHttpResponse response) {
Map<String, Object> headers = soapAction != null ? Collections.singletonMap("SOAPAction", (Object) soapAction) : null;
getEnvironment().callService(url, templateName, getCurrentRowValues(), res... | java | protected void callSoapService(String url, String templateName, String soapAction, XmlHttpResponse response) {
Map<String, Object> headers = soapAction != null ? Collections.singletonMap("SOAPAction", (Object) soapAction) : null;
getEnvironment().callService(url, templateName, getCurrentRowValues(), res... | [
"protected",
"void",
"callSoapService",
"(",
"String",
"url",
",",
"String",
"templateName",
",",
"String",
"soapAction",
",",
"XmlHttpResponse",
"response",
")",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"headers",
"=",
"soapAction",
"!=",
"null",
"?",
... | Calls SOAP service using template and current row's values.
@param url url of service to call.
@param templateName name of template to use to create POST body.
@param soapAction SOAPAction header value (null if no header is required).
@param response response to fill based on call. | [
"Calls",
"SOAP",
"service",
"using",
"template",
"and",
"current",
"row",
"s",
"values",
"."
] | 4e9018d7386a9aa65bfcbf07eb28ae064edd1732 | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/fit/SoapCallMapColumnFixture.java#L83-L86 | train |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/util/HtmlCleaner.java | HtmlCleaner.getUrl | public String getUrl(String htmlLink) {
String result = htmlLink;
if (htmlLink != null) {
Matcher linkMatcher = LINKPATTERN.matcher(htmlLink);
Matcher imgMatcher = IMAGEPATTERN.matcher(htmlLink);
if (linkMatcher.matches()) {
String href = linkMatcher.g... | java | public String getUrl(String htmlLink) {
String result = htmlLink;
if (htmlLink != null) {
Matcher linkMatcher = LINKPATTERN.matcher(htmlLink);
Matcher imgMatcher = IMAGEPATTERN.matcher(htmlLink);
if (linkMatcher.matches()) {
String href = linkMatcher.g... | [
"public",
"String",
"getUrl",
"(",
"String",
"htmlLink",
")",
"{",
"String",
"result",
"=",
"htmlLink",
";",
"if",
"(",
"htmlLink",
"!=",
"null",
")",
"{",
"Matcher",
"linkMatcher",
"=",
"LINKPATTERN",
".",
"matcher",
"(",
"htmlLink",
")",
";",
"Matcher",
... | Gets a URL from a wiki page value.
@param htmlLink link as present on wiki page.
@return address the link points to (if it is an 'a'), the original link otherwise. | [
"Gets",
"a",
"URL",
"from",
"a",
"wiki",
"page",
"value",
"."
] | 4e9018d7386a9aa65bfcbf07eb28ae064edd1732 | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/util/HtmlCleaner.java#L24-L39 | train |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/util/selenium/by/GridBy.java | GridBy.getXPathForRowByValueInOtherColumn | public static String getXPathForRowByValueInOtherColumn(String selectIndex, String value) {
return String.format("/tr[td[%1$s]/descendant-or-self::text()[normalized(.)='%2$s']]", selectIndex, value);
} | java | public static String getXPathForRowByValueInOtherColumn(String selectIndex, String value) {
return String.format("/tr[td[%1$s]/descendant-or-self::text()[normalized(.)='%2$s']]", selectIndex, value);
} | [
"public",
"static",
"String",
"getXPathForRowByValueInOtherColumn",
"(",
"String",
"selectIndex",
",",
"String",
"value",
")",
"{",
"return",
"String",
".",
"format",
"(",
"\"/tr[td[%1$s]/descendant-or-self::text()[normalized(.)='%2$s']]\"",
",",
"selectIndex",
",",
"value"... | Creates an XPath expression-segment that will find a row, selecting the row based on the
text in a specific column.
@param selectIndex index of the column to find value in (usually obtained via {@link #getXPathForColumnIndex(String)}).
@param value text to find in the column.
@return XPath expression selecting a tr in ... | [
"Creates",
"an",
"XPath",
"expression",
"-",
"segment",
"that",
"will",
"find",
"a",
"row",
"selecting",
"the",
"row",
"based",
"on",
"the",
"text",
"in",
"a",
"specific",
"column",
"."
] | 4e9018d7386a9aa65bfcbf07eb28ae064edd1732 | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/util/selenium/by/GridBy.java#L65-L67 | train |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/util/selenium/by/GridBy.java | GridBy.getXPathForColumnIndex | public static String getXPathForColumnIndex(String columnName) {
// determine how many columns are before the column with the requested name
// the column with the requested name will have an index of the value +1 (since XPath indexes are 1 based)
String headerXPath = getXPathForHeaderCellWithTe... | java | public static String getXPathForColumnIndex(String columnName) {
// determine how many columns are before the column with the requested name
// the column with the requested name will have an index of the value +1 (since XPath indexes are 1 based)
String headerXPath = getXPathForHeaderCellWithTe... | [
"public",
"static",
"String",
"getXPathForColumnIndex",
"(",
"String",
"columnName",
")",
"{",
"// determine how many columns are before the column with the requested name",
"// the column with the requested name will have an index of the value +1 (since XPath indexes are 1 based)",
"String",
... | Creates an XPath expression that will determine, for a row, which index to use to select the cell in the column
with the supplied header text value.
@param columnName name of column in header (th)
@return XPath expression which can be used to select a td in a row | [
"Creates",
"an",
"XPath",
"expression",
"that",
"will",
"determine",
"for",
"a",
"row",
"which",
"index",
"to",
"use",
"to",
"select",
"the",
"cell",
"in",
"the",
"column",
"with",
"the",
"supplied",
"header",
"text",
"value",
"."
] | 4e9018d7386a9aa65bfcbf07eb28ae064edd1732 | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/util/selenium/by/GridBy.java#L75-L80 | train |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/util/selenium/by/GridBy.java | GridBy.getXPathForHeaderRowByHeaders | public static String getXPathForHeaderRowByHeaders(String columnName, String... extraColumnNames) {
String allHeadersPresent;
if (extraColumnNames != null && extraColumnNames.length > 0) {
int extraCount = extraColumnNames.length;
String[] columnNames = new String[extraCount + 1]... | java | public static String getXPathForHeaderRowByHeaders(String columnName, String... extraColumnNames) {
String allHeadersPresent;
if (extraColumnNames != null && extraColumnNames.length > 0) {
int extraCount = extraColumnNames.length;
String[] columnNames = new String[extraCount + 1]... | [
"public",
"static",
"String",
"getXPathForHeaderRowByHeaders",
"(",
"String",
"columnName",
",",
"String",
"...",
"extraColumnNames",
")",
"{",
"String",
"allHeadersPresent",
";",
"if",
"(",
"extraColumnNames",
"!=",
"null",
"&&",
"extraColumnNames",
".",
"length",
... | Creates an XPath expression that will find a header row, selecting the row based on the
header texts present.
@param columnName first header text which must be present.
@param extraColumnNames name of other header texts that must be present in table's header row.
@return XPath expression selecting a tr in the row | [
"Creates",
"an",
"XPath",
"expression",
"that",
"will",
"find",
"a",
"header",
"row",
"selecting",
"the",
"row",
"based",
"on",
"the",
"header",
"texts",
"present",
"."
] | 4e9018d7386a9aa65bfcbf07eb28ae064edd1732 | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/util/selenium/by/GridBy.java#L89-L104 | train |
jlinn/quartz-redis-jobstore | src/main/java/net/joelinn/quartz/jobstore/RedisJobStore.java | RedisJobStore.doWithLock | private <T> T doWithLock(LockCallback<T> callback) throws JobPersistenceException {
return doWithLock(callback, null);
} | java | private <T> T doWithLock(LockCallback<T> callback) throws JobPersistenceException {
return doWithLock(callback, null);
} | [
"private",
"<",
"T",
">",
"T",
"doWithLock",
"(",
"LockCallback",
"<",
"T",
">",
"callback",
")",
"throws",
"JobPersistenceException",
"{",
"return",
"doWithLock",
"(",
"callback",
",",
"null",
")",
";",
"}"
] | Perform Redis operations while possessing lock
@param callback operation(s) to be performed during lock
@param <T> return type
@return response from callback, if any
@throws JobPersistenceException | [
"Perform",
"Redis",
"operations",
"while",
"possessing",
"lock"
] | be9a52ee776d8a09866fe99fd9718bc13a0cb992 | https://github.com/jlinn/quartz-redis-jobstore/blob/be9a52ee776d8a09866fe99fd9718bc13a0cb992/src/main/java/net/joelinn/quartz/jobstore/RedisJobStore.java#L1135-L1137 | train |
jlinn/quartz-redis-jobstore | src/main/java/net/joelinn/quartz/jobstore/RedisJobStore.java | RedisJobStore.doWithLock | private <T> T doWithLock(LockCallback<T> callback, String errorMessage) throws JobPersistenceException {
JedisCommands jedis = null;
try {
jedis = getResource();
try {
storage.waitForLock(jedis);
return callback.doWithLock(jedis);
} cat... | java | private <T> T doWithLock(LockCallback<T> callback, String errorMessage) throws JobPersistenceException {
JedisCommands jedis = null;
try {
jedis = getResource();
try {
storage.waitForLock(jedis);
return callback.doWithLock(jedis);
} cat... | [
"private",
"<",
"T",
">",
"T",
"doWithLock",
"(",
"LockCallback",
"<",
"T",
">",
"callback",
",",
"String",
"errorMessage",
")",
"throws",
"JobPersistenceException",
"{",
"JedisCommands",
"jedis",
"=",
"null",
";",
"try",
"{",
"jedis",
"=",
"getResource",
"(... | Perform a redis operation while lock is acquired
@param callback a callback containing the actions to perform during lock
@param errorMessage optional error message to include in exception should an error arise
@param <T> return class
@return the result of the actions performed while locked, if any
@throws JobPersisten... | [
"Perform",
"a",
"redis",
"operation",
"while",
"lock",
"is",
"acquired"
] | be9a52ee776d8a09866fe99fd9718bc13a0cb992 | https://github.com/jlinn/quartz-redis-jobstore/blob/be9a52ee776d8a09866fe99fd9718bc13a0cb992/src/main/java/net/joelinn/quartz/jobstore/RedisJobStore.java#L1148-L1171 | train |
jlinn/quartz-redis-jobstore | src/main/java/net/joelinn/quartz/jobstore/AbstractRedisStorage.java | AbstractRedisStorage.lock | public boolean lock(T jedis){
UUID lockId = UUID.randomUUID();
final String setResponse = jedis.set(redisSchema.lockKey(), lockId.toString(), "NX", "PX", lockTimeout);
boolean lockAcquired = !isNullOrEmpty(setResponse) && setResponse.equals("OK");
if(lockAcquired){
// save th... | java | public boolean lock(T jedis){
UUID lockId = UUID.randomUUID();
final String setResponse = jedis.set(redisSchema.lockKey(), lockId.toString(), "NX", "PX", lockTimeout);
boolean lockAcquired = !isNullOrEmpty(setResponse) && setResponse.equals("OK");
if(lockAcquired){
// save th... | [
"public",
"boolean",
"lock",
"(",
"T",
"jedis",
")",
"{",
"UUID",
"lockId",
"=",
"UUID",
".",
"randomUUID",
"(",
")",
";",
"final",
"String",
"setResponse",
"=",
"jedis",
".",
"set",
"(",
"redisSchema",
".",
"lockKey",
"(",
")",
",",
"lockId",
".",
"... | Attempt to acquire a lock
@return true if lock was successfully acquired; false otherwise | [
"Attempt",
"to",
"acquire",
"a",
"lock"
] | be9a52ee776d8a09866fe99fd9718bc13a0cb992 | https://github.com/jlinn/quartz-redis-jobstore/blob/be9a52ee776d8a09866fe99fd9718bc13a0cb992/src/main/java/net/joelinn/quartz/jobstore/AbstractRedisStorage.java#L83-L92 | train |
jlinn/quartz-redis-jobstore | src/main/java/net/joelinn/quartz/jobstore/AbstractRedisStorage.java | AbstractRedisStorage.waitForLock | public void waitForLock(T jedis){
while(!lock(jedis)){
try {
logger.debug("Waiting for Redis lock.");
Thread.sleep(randomInt(75, 125));
} catch (InterruptedException e) {
logger.error("Interrupted while waiting for lock.", e);
}... | java | public void waitForLock(T jedis){
while(!lock(jedis)){
try {
logger.debug("Waiting for Redis lock.");
Thread.sleep(randomInt(75, 125));
} catch (InterruptedException e) {
logger.error("Interrupted while waiting for lock.", e);
}... | [
"public",
"void",
"waitForLock",
"(",
"T",
"jedis",
")",
"{",
"while",
"(",
"!",
"lock",
"(",
"jedis",
")",
")",
"{",
"try",
"{",
"logger",
".",
"debug",
"(",
"\"Waiting for Redis lock.\"",
")",
";",
"Thread",
".",
"sleep",
"(",
"randomInt",
"(",
"75",... | Attempt to acquire lock. If lock cannot be acquired, wait until lock is successfully acquired.
@param jedis a thread-safe Redis connection | [
"Attempt",
"to",
"acquire",
"lock",
".",
"If",
"lock",
"cannot",
"be",
"acquired",
"wait",
"until",
"lock",
"is",
"successfully",
"acquired",
"."
] | be9a52ee776d8a09866fe99fd9718bc13a0cb992 | https://github.com/jlinn/quartz-redis-jobstore/blob/be9a52ee776d8a09866fe99fd9718bc13a0cb992/src/main/java/net/joelinn/quartz/jobstore/AbstractRedisStorage.java#L98-L107 | train |
jlinn/quartz-redis-jobstore | src/main/java/net/joelinn/quartz/jobstore/AbstractRedisStorage.java | AbstractRedisStorage.unlock | public boolean unlock(T jedis){
final String currentLock = jedis.get(redisSchema.lockKey());
if(!isNullOrEmpty(currentLock) && UUID.fromString(currentLock).equals(lockValue)){
// This is our lock. We can remove it.
jedis.del(redisSchema.lockKey());
return true;
... | java | public boolean unlock(T jedis){
final String currentLock = jedis.get(redisSchema.lockKey());
if(!isNullOrEmpty(currentLock) && UUID.fromString(currentLock).equals(lockValue)){
// This is our lock. We can remove it.
jedis.del(redisSchema.lockKey());
return true;
... | [
"public",
"boolean",
"unlock",
"(",
"T",
"jedis",
")",
"{",
"final",
"String",
"currentLock",
"=",
"jedis",
".",
"get",
"(",
"redisSchema",
".",
"lockKey",
"(",
")",
")",
";",
"if",
"(",
"!",
"isNullOrEmpty",
"(",
"currentLock",
")",
"&&",
"UUID",
".",... | Attempt to remove lock
@return true if lock was successfully removed; false otherwise | [
"Attempt",
"to",
"remove",
"lock"
] | be9a52ee776d8a09866fe99fd9718bc13a0cb992 | https://github.com/jlinn/quartz-redis-jobstore/blob/be9a52ee776d8a09866fe99fd9718bc13a0cb992/src/main/java/net/joelinn/quartz/jobstore/AbstractRedisStorage.java#L113-L121 | train |
jlinn/quartz-redis-jobstore | src/main/java/net/joelinn/quartz/jobstore/AbstractRedisStorage.java | AbstractRedisStorage.retrieveJob | public JobDetail retrieveJob(JobKey jobKey, T jedis) throws JobPersistenceException, ClassNotFoundException{
final String jobHashKey = redisSchema.jobHashKey(jobKey);
final String jobDataMapHashKey = redisSchema.jobDataMapHashKey(jobKey);
final Map<String, String> jobDetailMap = jedis.hgetAll(j... | java | public JobDetail retrieveJob(JobKey jobKey, T jedis) throws JobPersistenceException, ClassNotFoundException{
final String jobHashKey = redisSchema.jobHashKey(jobKey);
final String jobDataMapHashKey = redisSchema.jobDataMapHashKey(jobKey);
final Map<String, String> jobDetailMap = jedis.hgetAll(j... | [
"public",
"JobDetail",
"retrieveJob",
"(",
"JobKey",
"jobKey",
",",
"T",
"jedis",
")",
"throws",
"JobPersistenceException",
",",
"ClassNotFoundException",
"{",
"final",
"String",
"jobHashKey",
"=",
"redisSchema",
".",
"jobHashKey",
"(",
"jobKey",
")",
";",
"final"... | Retrieve a job from redis
@param jobKey the job key detailing the identity of the job to be retrieved
@param jedis a thread-safe Redis connection
@return the {@link org.quartz.JobDetail} of the desired job
@throws JobPersistenceException if the desired job does not exist
@throws ClassNotFoundException | [
"Retrieve",
"a",
"job",
"from",
"redis"
] | be9a52ee776d8a09866fe99fd9718bc13a0cb992 | https://github.com/jlinn/quartz-redis-jobstore/blob/be9a52ee776d8a09866fe99fd9718bc13a0cb992/src/main/java/net/joelinn/quartz/jobstore/AbstractRedisStorage.java#L186-L206 | train |
jlinn/quartz-redis-jobstore | src/main/java/net/joelinn/quartz/jobstore/AbstractRedisStorage.java | AbstractRedisStorage.retrieveTrigger | public OperableTrigger retrieveTrigger(TriggerKey triggerKey, T jedis) throws JobPersistenceException{
final String triggerHashKey = redisSchema.triggerHashKey(triggerKey);
Map<String, String> triggerMap = jedis.hgetAll(triggerHashKey);
if(triggerMap == null || triggerMap.isEmpty()){
... | java | public OperableTrigger retrieveTrigger(TriggerKey triggerKey, T jedis) throws JobPersistenceException{
final String triggerHashKey = redisSchema.triggerHashKey(triggerKey);
Map<String, String> triggerMap = jedis.hgetAll(triggerHashKey);
if(triggerMap == null || triggerMap.isEmpty()){
... | [
"public",
"OperableTrigger",
"retrieveTrigger",
"(",
"TriggerKey",
"triggerKey",
",",
"T",
"jedis",
")",
"throws",
"JobPersistenceException",
"{",
"final",
"String",
"triggerHashKey",
"=",
"redisSchema",
".",
"triggerHashKey",
"(",
"triggerKey",
")",
";",
"Map",
"<"... | Retrieve a trigger from Redis
@param triggerKey the trigger key
@param jedis a thread-safe Redis connection
@return the requested {@link org.quartz.spi.OperableTrigger} if it exists; null if it does not
@throws JobPersistenceException if the job associated with the retrieved trigger does not exist | [
"Retrieve",
"a",
"trigger",
"from",
"Redis"
] | be9a52ee776d8a09866fe99fd9718bc13a0cb992 | https://github.com/jlinn/quartz-redis-jobstore/blob/be9a52ee776d8a09866fe99fd9718bc13a0cb992/src/main/java/net/joelinn/quartz/jobstore/AbstractRedisStorage.java#L278-L301 | train |
jlinn/quartz-redis-jobstore | src/main/java/net/joelinn/quartz/jobstore/AbstractRedisStorage.java | AbstractRedisStorage.getTriggersForJob | public List<OperableTrigger> getTriggersForJob(JobKey jobKey, T jedis) throws JobPersistenceException {
final String jobTriggerSetKey = redisSchema.jobTriggersSetKey(jobKey);
final Set<String> triggerHashKeys = jedis.smembers(jobTriggerSetKey);
List<OperableTrigger> triggers = new ArrayList<>();... | java | public List<OperableTrigger> getTriggersForJob(JobKey jobKey, T jedis) throws JobPersistenceException {
final String jobTriggerSetKey = redisSchema.jobTriggersSetKey(jobKey);
final Set<String> triggerHashKeys = jedis.smembers(jobTriggerSetKey);
List<OperableTrigger> triggers = new ArrayList<>();... | [
"public",
"List",
"<",
"OperableTrigger",
">",
"getTriggersForJob",
"(",
"JobKey",
"jobKey",
",",
"T",
"jedis",
")",
"throws",
"JobPersistenceException",
"{",
"final",
"String",
"jobTriggerSetKey",
"=",
"redisSchema",
".",
"jobTriggersSetKey",
"(",
"jobKey",
")",
... | Retrieve triggers associated with the given job
@param jobKey the job for which to retrieve triggers
@param jedis a thread-safe Redis connection
@return a list of triggers associated with the given job | [
"Retrieve",
"triggers",
"associated",
"with",
"the",
"given",
"job"
] | be9a52ee776d8a09866fe99fd9718bc13a0cb992 | https://github.com/jlinn/quartz-redis-jobstore/blob/be9a52ee776d8a09866fe99fd9718bc13a0cb992/src/main/java/net/joelinn/quartz/jobstore/AbstractRedisStorage.java#L309-L317 | train |
jlinn/quartz-redis-jobstore | src/main/java/net/joelinn/quartz/jobstore/AbstractRedisStorage.java | AbstractRedisStorage.setTriggerState | public boolean setTriggerState(final RedisTriggerState state, final double score, final String triggerHashKey, T jedis) throws JobPersistenceException{
boolean success = false;
if(state != null){
unsetTriggerState(triggerHashKey, jedis);
success = jedis.zadd(redisSchema.triggerSt... | java | public boolean setTriggerState(final RedisTriggerState state, final double score, final String triggerHashKey, T jedis) throws JobPersistenceException{
boolean success = false;
if(state != null){
unsetTriggerState(triggerHashKey, jedis);
success = jedis.zadd(redisSchema.triggerSt... | [
"public",
"boolean",
"setTriggerState",
"(",
"final",
"RedisTriggerState",
"state",
",",
"final",
"double",
"score",
",",
"final",
"String",
"triggerHashKey",
",",
"T",
"jedis",
")",
"throws",
"JobPersistenceException",
"{",
"boolean",
"success",
"=",
"false",
";"... | Set a trigger state by adding the trigger to the relevant sorted set, using its next fire time as the score.
@param state the new state to be set
@param score the trigger's next fire time
@param triggerHashKey the trigger hash key
@param jedis a thread-safe Redis connection
@return true if set, false if the trigger was... | [
"Set",
"a",
"trigger",
"state",
"by",
"adding",
"the",
"trigger",
"to",
"the",
"relevant",
"sorted",
"set",
"using",
"its",
"next",
"fire",
"time",
"as",
"the",
"score",
"."
] | be9a52ee776d8a09866fe99fd9718bc13a0cb992 | https://github.com/jlinn/quartz-redis-jobstore/blob/be9a52ee776d8a09866fe99fd9718bc13a0cb992/src/main/java/net/joelinn/quartz/jobstore/AbstractRedisStorage.java#L338-L345 | train |
jlinn/quartz-redis-jobstore | src/main/java/net/joelinn/quartz/jobstore/AbstractRedisStorage.java | AbstractRedisStorage.checkExists | public boolean checkExists(JobKey jobKey, T jedis){
return jedis.exists(redisSchema.jobHashKey(jobKey));
} | java | public boolean checkExists(JobKey jobKey, T jedis){
return jedis.exists(redisSchema.jobHashKey(jobKey));
} | [
"public",
"boolean",
"checkExists",
"(",
"JobKey",
"jobKey",
",",
"T",
"jedis",
")",
"{",
"return",
"jedis",
".",
"exists",
"(",
"redisSchema",
".",
"jobHashKey",
"(",
"jobKey",
")",
")",
";",
"}"
] | Check if the job identified by the given key exists in storage
@param jobKey the key of the desired job
@param jedis a thread-safe Redis connection
@return true if the job exists; false otherwise | [
"Check",
"if",
"the",
"job",
"identified",
"by",
"the",
"given",
"key",
"exists",
"in",
"storage"
] | be9a52ee776d8a09866fe99fd9718bc13a0cb992 | https://github.com/jlinn/quartz-redis-jobstore/blob/be9a52ee776d8a09866fe99fd9718bc13a0cb992/src/main/java/net/joelinn/quartz/jobstore/AbstractRedisStorage.java#L353-L355 | train |
jlinn/quartz-redis-jobstore | src/main/java/net/joelinn/quartz/jobstore/AbstractRedisStorage.java | AbstractRedisStorage.checkExists | public boolean checkExists(TriggerKey triggerKey, T jedis){
return jedis.exists(redisSchema.triggerHashKey(triggerKey));
} | java | public boolean checkExists(TriggerKey triggerKey, T jedis){
return jedis.exists(redisSchema.triggerHashKey(triggerKey));
} | [
"public",
"boolean",
"checkExists",
"(",
"TriggerKey",
"triggerKey",
",",
"T",
"jedis",
")",
"{",
"return",
"jedis",
".",
"exists",
"(",
"redisSchema",
".",
"triggerHashKey",
"(",
"triggerKey",
")",
")",
";",
"}"
] | Check if the trigger identified by the given key exists
@param triggerKey the key of the desired trigger
@param jedis a thread-safe Redis connection
@return true if the trigger exists; false otherwise | [
"Check",
"if",
"the",
"trigger",
"identified",
"by",
"the",
"given",
"key",
"exists"
] | be9a52ee776d8a09866fe99fd9718bc13a0cb992 | https://github.com/jlinn/quartz-redis-jobstore/blob/be9a52ee776d8a09866fe99fd9718bc13a0cb992/src/main/java/net/joelinn/quartz/jobstore/AbstractRedisStorage.java#L363-L365 | train |
jlinn/quartz-redis-jobstore | src/main/java/net/joelinn/quartz/jobstore/AbstractRedisStorage.java | AbstractRedisStorage.retrieveCalendar | public Calendar retrieveCalendar(String name, T jedis) throws JobPersistenceException{
final String calendarHashKey = redisSchema.calendarHashKey(name);
Calendar calendar;
try{
final Map<String, String> calendarMap = jedis.hgetAll(calendarHashKey);
if(calendarMap == null ... | java | public Calendar retrieveCalendar(String name, T jedis) throws JobPersistenceException{
final String calendarHashKey = redisSchema.calendarHashKey(name);
Calendar calendar;
try{
final Map<String, String> calendarMap = jedis.hgetAll(calendarHashKey);
if(calendarMap == null ... | [
"public",
"Calendar",
"retrieveCalendar",
"(",
"String",
"name",
",",
"T",
"jedis",
")",
"throws",
"JobPersistenceException",
"{",
"final",
"String",
"calendarHashKey",
"=",
"redisSchema",
".",
"calendarHashKey",
"(",
"name",
")",
";",
"Calendar",
"calendar",
";",... | Retrieve a calendar
@param name the name of the calendar to be retrieved
@param jedis a thread-safe Redis connection
@return the desired calendar if it exists; null otherwise | [
"Retrieve",
"a",
"calendar"
] | be9a52ee776d8a09866fe99fd9718bc13a0cb992 | https://github.com/jlinn/quartz-redis-jobstore/blob/be9a52ee776d8a09866fe99fd9718bc13a0cb992/src/main/java/net/joelinn/quartz/jobstore/AbstractRedisStorage.java#L393-L411 | train |
jlinn/quartz-redis-jobstore | src/main/java/net/joelinn/quartz/jobstore/AbstractRedisStorage.java | AbstractRedisStorage.pauseJob | public void pauseJob(JobKey jobKey, T jedis) throws JobPersistenceException {
for (OperableTrigger trigger : getTriggersForJob(jobKey, jedis)) {
pauseTrigger(trigger.getKey(), jedis);
}
} | java | public void pauseJob(JobKey jobKey, T jedis) throws JobPersistenceException {
for (OperableTrigger trigger : getTriggersForJob(jobKey, jedis)) {
pauseTrigger(trigger.getKey(), jedis);
}
} | [
"public",
"void",
"pauseJob",
"(",
"JobKey",
"jobKey",
",",
"T",
"jedis",
")",
"throws",
"JobPersistenceException",
"{",
"for",
"(",
"OperableTrigger",
"trigger",
":",
"getTriggersForJob",
"(",
"jobKey",
",",
"jedis",
")",
")",
"{",
"pauseTrigger",
"(",
"trigg... | Pause a job by pausing all of its triggers
@param jobKey the key of the job to be paused
@param jedis a thread-safe Redis connection | [
"Pause",
"a",
"job",
"by",
"pausing",
"all",
"of",
"its",
"triggers"
] | be9a52ee776d8a09866fe99fd9718bc13a0cb992 | https://github.com/jlinn/quartz-redis-jobstore/blob/be9a52ee776d8a09866fe99fd9718bc13a0cb992/src/main/java/net/joelinn/quartz/jobstore/AbstractRedisStorage.java#L529-L533 | train |
jlinn/quartz-redis-jobstore | src/main/java/net/joelinn/quartz/jobstore/AbstractRedisStorage.java | AbstractRedisStorage.getPausedTriggerGroups | public Set<String> getPausedTriggerGroups(T jedis){
final Set<String> triggerGroupSetKeys = jedis.smembers(redisSchema.pausedTriggerGroupsSet());
Set<String> names = new HashSet<>(triggerGroupSetKeys.size());
for (String triggerGroupSetKey : triggerGroupSetKeys) {
names.add(redisSche... | java | public Set<String> getPausedTriggerGroups(T jedis){
final Set<String> triggerGroupSetKeys = jedis.smembers(redisSchema.pausedTriggerGroupsSet());
Set<String> names = new HashSet<>(triggerGroupSetKeys.size());
for (String triggerGroupSetKey : triggerGroupSetKeys) {
names.add(redisSche... | [
"public",
"Set",
"<",
"String",
">",
"getPausedTriggerGroups",
"(",
"T",
"jedis",
")",
"{",
"final",
"Set",
"<",
"String",
">",
"triggerGroupSetKeys",
"=",
"jedis",
".",
"smembers",
"(",
"redisSchema",
".",
"pausedTriggerGroupsSet",
"(",
")",
")",
";",
"Set"... | Retrieve all currently paused trigger groups
@param jedis a thread-safe Redis connection
@return a set containing the names of all currently paused trigger groups | [
"Retrieve",
"all",
"currently",
"paused",
"trigger",
"groups"
] | be9a52ee776d8a09866fe99fd9718bc13a0cb992 | https://github.com/jlinn/quartz-redis-jobstore/blob/be9a52ee776d8a09866fe99fd9718bc13a0cb992/src/main/java/net/joelinn/quartz/jobstore/AbstractRedisStorage.java#L603-L610 | train |
jlinn/quartz-redis-jobstore | src/main/java/net/joelinn/quartz/jobstore/AbstractRedisStorage.java | AbstractRedisStorage.isActiveInstance | protected boolean isActiveInstance(String instanceId, T jedis) {
boolean isActive = ( System.currentTimeMillis() - getLastInstanceActiveTime(instanceId, jedis) < clusterCheckInterval);
if (!isActive) {
removeLastInstanceActiveTime(instanceId, jedis);
}
return isActive;
} | java | protected boolean isActiveInstance(String instanceId, T jedis) {
boolean isActive = ( System.currentTimeMillis() - getLastInstanceActiveTime(instanceId, jedis) < clusterCheckInterval);
if (!isActive) {
removeLastInstanceActiveTime(instanceId, jedis);
}
return isActive;
} | [
"protected",
"boolean",
"isActiveInstance",
"(",
"String",
"instanceId",
",",
"T",
"jedis",
")",
"{",
"boolean",
"isActive",
"=",
"(",
"System",
".",
"currentTimeMillis",
"(",
")",
"-",
"getLastInstanceActiveTime",
"(",
"instanceId",
",",
"jedis",
")",
"<",
"c... | Determine if the instance with the given id has been active in the last 4 minutes
@param instanceId the instance to check
@param jedis a thread-safe Redis connection
@return true if the instance with the given id has been active in the last 4 minutes | [
"Determine",
"if",
"the",
"instance",
"with",
"the",
"given",
"id",
"has",
"been",
"active",
"in",
"the",
"last",
"4",
"minutes"
] | be9a52ee776d8a09866fe99fd9718bc13a0cb992 | https://github.com/jlinn/quartz-redis-jobstore/blob/be9a52ee776d8a09866fe99fd9718bc13a0cb992/src/main/java/net/joelinn/quartz/jobstore/AbstractRedisStorage.java#L657-L663 | train |
jlinn/quartz-redis-jobstore | src/main/java/net/joelinn/quartz/jobstore/AbstractRedisStorage.java | AbstractRedisStorage.releaseOrphanedTriggers | protected void releaseOrphanedTriggers(RedisTriggerState currentState, RedisTriggerState newState, T jedis) throws JobPersistenceException {
for (Tuple triggerTuple : jedis.zrangeWithScores(redisSchema.triggerStateKey(currentState), 0, -1)) {
final String lockId = jedis.get(redisSchema.triggerLockKe... | java | protected void releaseOrphanedTriggers(RedisTriggerState currentState, RedisTriggerState newState, T jedis) throws JobPersistenceException {
for (Tuple triggerTuple : jedis.zrangeWithScores(redisSchema.triggerStateKey(currentState), 0, -1)) {
final String lockId = jedis.get(redisSchema.triggerLockKe... | [
"protected",
"void",
"releaseOrphanedTriggers",
"(",
"RedisTriggerState",
"currentState",
",",
"RedisTriggerState",
"newState",
",",
"T",
"jedis",
")",
"throws",
"JobPersistenceException",
"{",
"for",
"(",
"Tuple",
"triggerTuple",
":",
"jedis",
".",
"zrangeWithScores",
... | Release triggers from the given current state to the new state if its locking scheduler has not
registered as alive in the last 10 minutes
@param currentState the current state of the orphaned trigger
@param newState the new state of the orphaned trigger
@param jedis a thread-safe Redis connection | [
"Release",
"triggers",
"from",
"the",
"given",
"current",
"state",
"to",
"the",
"new",
"state",
"if",
"its",
"locking",
"scheduler",
"has",
"not",
"registered",
"as",
"alive",
"in",
"the",
"last",
"10",
"minutes"
] | be9a52ee776d8a09866fe99fd9718bc13a0cb992 | https://github.com/jlinn/quartz-redis-jobstore/blob/be9a52ee776d8a09866fe99fd9718bc13a0cb992/src/main/java/net/joelinn/quartz/jobstore/AbstractRedisStorage.java#L672-L681 | train |
jlinn/quartz-redis-jobstore | src/main/java/net/joelinn/quartz/jobstore/AbstractRedisStorage.java | AbstractRedisStorage.releaseTriggersCron | protected void releaseTriggersCron(T jedis) throws JobPersistenceException {
// has it been more than 10 minutes since we last released orphaned triggers
// or is this the first check upon initialization
if(isTriggerLockTimeoutExceeded(jedis) || !isActiveInstance(schedulerInstanceId, jedis)){
... | java | protected void releaseTriggersCron(T jedis) throws JobPersistenceException {
// has it been more than 10 minutes since we last released orphaned triggers
// or is this the first check upon initialization
if(isTriggerLockTimeoutExceeded(jedis) || !isActiveInstance(schedulerInstanceId, jedis)){
... | [
"protected",
"void",
"releaseTriggersCron",
"(",
"T",
"jedis",
")",
"throws",
"JobPersistenceException",
"{",
"// has it been more than 10 minutes since we last released orphaned triggers",
"// or is this the first check upon initialization",
"if",
"(",
"isTriggerLockTimeoutExceeded",
... | Release triggers currently held by schedulers which have ceased to function
@param jedis a thread-safe Redis connection
@throws JobPersistenceException | [
"Release",
"triggers",
"currently",
"held",
"by",
"schedulers",
"which",
"have",
"ceased",
"to",
"function"
] | be9a52ee776d8a09866fe99fd9718bc13a0cb992 | https://github.com/jlinn/quartz-redis-jobstore/blob/be9a52ee776d8a09866fe99fd9718bc13a0cb992/src/main/java/net/joelinn/quartz/jobstore/AbstractRedisStorage.java#L688-L697 | train |
jlinn/quartz-redis-jobstore | src/main/java/net/joelinn/quartz/jobstore/AbstractRedisStorage.java | AbstractRedisStorage.settLastTriggerReleaseTime | protected void settLastTriggerReleaseTime(long time, T jedis){
jedis.set(redisSchema.lastTriggerReleaseTime(), Long.toString(time));
} | java | protected void settLastTriggerReleaseTime(long time, T jedis){
jedis.set(redisSchema.lastTriggerReleaseTime(), Long.toString(time));
} | [
"protected",
"void",
"settLastTriggerReleaseTime",
"(",
"long",
"time",
",",
"T",
"jedis",
")",
"{",
"jedis",
".",
"set",
"(",
"redisSchema",
".",
"lastTriggerReleaseTime",
"(",
")",
",",
"Long",
".",
"toString",
"(",
"time",
")",
")",
";",
"}"
] | Set the last time at which orphaned triggers were released
@param time a unix timestamp in milliseconds
@param jedis a thread-safe Redis connection | [
"Set",
"the",
"last",
"time",
"at",
"which",
"orphaned",
"triggers",
"were",
"released"
] | be9a52ee776d8a09866fe99fd9718bc13a0cb992 | https://github.com/jlinn/quartz-redis-jobstore/blob/be9a52ee776d8a09866fe99fd9718bc13a0cb992/src/main/java/net/joelinn/quartz/jobstore/AbstractRedisStorage.java#L726-L728 | train |
jlinn/quartz-redis-jobstore | src/main/java/net/joelinn/quartz/jobstore/AbstractRedisStorage.java | AbstractRedisStorage.setLastInstanceActiveTime | protected void setLastInstanceActiveTime(String instanceId, long time, T jedis){
jedis.hset(redisSchema.lastInstanceActiveTime(), instanceId, Long.toString(time));
} | java | protected void setLastInstanceActiveTime(String instanceId, long time, T jedis){
jedis.hset(redisSchema.lastInstanceActiveTime(), instanceId, Long.toString(time));
} | [
"protected",
"void",
"setLastInstanceActiveTime",
"(",
"String",
"instanceId",
",",
"long",
"time",
",",
"T",
"jedis",
")",
"{",
"jedis",
".",
"hset",
"(",
"redisSchema",
".",
"lastInstanceActiveTime",
"(",
")",
",",
"instanceId",
",",
"Long",
".",
"toString",... | Set the last time at which this instance was active
@param time a unix timestamp in milliseconds
@param jedis a thread-safe Redis connection | [
"Set",
"the",
"last",
"time",
"at",
"which",
"this",
"instance",
"was",
"active"
] | be9a52ee776d8a09866fe99fd9718bc13a0cb992 | https://github.com/jlinn/quartz-redis-jobstore/blob/be9a52ee776d8a09866fe99fd9718bc13a0cb992/src/main/java/net/joelinn/quartz/jobstore/AbstractRedisStorage.java#L749-L751 | train |
jlinn/quartz-redis-jobstore | src/main/java/net/joelinn/quartz/jobstore/AbstractRedisStorage.java | AbstractRedisStorage.removeLastInstanceActiveTime | protected void removeLastInstanceActiveTime(String instanceId, T jedis){
jedis.hdel(redisSchema.lastInstanceActiveTime(), instanceId);
} | java | protected void removeLastInstanceActiveTime(String instanceId, T jedis){
jedis.hdel(redisSchema.lastInstanceActiveTime(), instanceId);
} | [
"protected",
"void",
"removeLastInstanceActiveTime",
"(",
"String",
"instanceId",
",",
"T",
"jedis",
")",
"{",
"jedis",
".",
"hdel",
"(",
"redisSchema",
".",
"lastInstanceActiveTime",
"(",
")",
",",
"instanceId",
")",
";",
"}"
] | Remove the given instance from the hash
@param instanceId The instance id to remove
@param jedis a thread-safe Redis connection | [
"Remove",
"the",
"given",
"instance",
"from",
"the",
"hash"
] | be9a52ee776d8a09866fe99fd9718bc13a0cb992 | https://github.com/jlinn/quartz-redis-jobstore/blob/be9a52ee776d8a09866fe99fd9718bc13a0cb992/src/main/java/net/joelinn/quartz/jobstore/AbstractRedisStorage.java#L758-L760 | train |
jlinn/quartz-redis-jobstore | src/main/java/net/joelinn/quartz/jobstore/AbstractRedisStorage.java | AbstractRedisStorage.isBlockedJob | protected boolean isBlockedJob(String jobHashKey, T jedis) {
JobKey jobKey = redisSchema.jobKey(jobHashKey);
return jedis.sismember(redisSchema.blockedJobsSet(), jobHashKey) &&
isActiveInstance(jedis.get(redisSchema.jobBlockedKey(jobKey)), jedis);
} | java | protected boolean isBlockedJob(String jobHashKey, T jedis) {
JobKey jobKey = redisSchema.jobKey(jobHashKey);
return jedis.sismember(redisSchema.blockedJobsSet(), jobHashKey) &&
isActiveInstance(jedis.get(redisSchema.jobBlockedKey(jobKey)), jedis);
} | [
"protected",
"boolean",
"isBlockedJob",
"(",
"String",
"jobHashKey",
",",
"T",
"jedis",
")",
"{",
"JobKey",
"jobKey",
"=",
"redisSchema",
".",
"jobKey",
"(",
"jobHashKey",
")",
";",
"return",
"jedis",
".",
"sismember",
"(",
"redisSchema",
".",
"blockedJobsSet"... | Determine if the given job is blocked by an active instance
@param jobHashKey the job in question
@param jedis a thread-safe Redis connection
@return true if the given job is blocked by an active instance | [
"Determine",
"if",
"the",
"given",
"job",
"is",
"blocked",
"by",
"an",
"active",
"instance"
] | be9a52ee776d8a09866fe99fd9718bc13a0cb992 | https://github.com/jlinn/quartz-redis-jobstore/blob/be9a52ee776d8a09866fe99fd9718bc13a0cb992/src/main/java/net/joelinn/quartz/jobstore/AbstractRedisStorage.java#L768-L772 | train |
jlinn/quartz-redis-jobstore | src/main/java/net/joelinn/quartz/jobstore/AbstractRedisStorage.java | AbstractRedisStorage.lockTrigger | protected boolean lockTrigger(TriggerKey triggerKey, T jedis){
return jedis.set(redisSchema.triggerLockKey(triggerKey), schedulerInstanceId, "NX", "PX", TRIGGER_LOCK_TIMEOUT).equals("OK");
} | java | protected boolean lockTrigger(TriggerKey triggerKey, T jedis){
return jedis.set(redisSchema.triggerLockKey(triggerKey), schedulerInstanceId, "NX", "PX", TRIGGER_LOCK_TIMEOUT).equals("OK");
} | [
"protected",
"boolean",
"lockTrigger",
"(",
"TriggerKey",
"triggerKey",
",",
"T",
"jedis",
")",
"{",
"return",
"jedis",
".",
"set",
"(",
"redisSchema",
".",
"triggerLockKey",
"(",
"triggerKey",
")",
",",
"schedulerInstanceId",
",",
"\"NX\"",
",",
"\"PX\"",
","... | Lock the trigger with the given key to the current jobstore instance
@param triggerKey the key of the desired trigger
@param jedis a thread-safe Redis connection
@return true if lock was acquired successfully; false otherwise | [
"Lock",
"the",
"trigger",
"with",
"the",
"given",
"key",
"to",
"the",
"current",
"jobstore",
"instance"
] | be9a52ee776d8a09866fe99fd9718bc13a0cb992 | https://github.com/jlinn/quartz-redis-jobstore/blob/be9a52ee776d8a09866fe99fd9718bc13a0cb992/src/main/java/net/joelinn/quartz/jobstore/AbstractRedisStorage.java#L789-L791 | train |
jlinn/quartz-redis-jobstore | src/main/java/net/joelinn/quartz/jobstore/RedisJobStoreSchema.java | RedisJobStoreSchema.split | protected List<String> split(final String string){
if (null!=prefix){
//remove prefix before split
return Arrays.asList(string.substring(prefix.length()).split(delimiter));
}else{
return Arrays.asList(string.split(delimiter));
}
} | java | protected List<String> split(final String string){
if (null!=prefix){
//remove prefix before split
return Arrays.asList(string.substring(prefix.length()).split(delimiter));
}else{
return Arrays.asList(string.split(delimiter));
}
} | [
"protected",
"List",
"<",
"String",
">",
"split",
"(",
"final",
"String",
"string",
")",
"{",
"if",
"(",
"null",
"!=",
"prefix",
")",
"{",
"//remove prefix before split",
"return",
"Arrays",
".",
"asList",
"(",
"string",
".",
"substring",
"(",
"prefix",
".... | Split a string on the configured delimiter
@param string the string to split
@return a list comprised of the split parts of the given string | [
"Split",
"a",
"string",
"on",
"the",
"configured",
"delimiter"
] | be9a52ee776d8a09866fe99fd9718bc13a0cb992 | https://github.com/jlinn/quartz-redis-jobstore/blob/be9a52ee776d8a09866fe99fd9718bc13a0cb992/src/main/java/net/joelinn/quartz/jobstore/RedisJobStoreSchema.java#L285-L293 | train |
jlinn/quartz-redis-jobstore | src/main/java/net/joelinn/quartz/jobstore/RedisClusterStorage.java | RedisClusterStorage.storeTrigger | @Override
public void storeTrigger(OperableTrigger trigger, boolean replaceExisting, JedisCluster jedis) throws JobPersistenceException {
final String triggerHashKey = redisSchema.triggerHashKey(trigger.getKey());
final String triggerGroupSetKey = redisSchema.triggerGroupSetKey(trigger.getKey());
... | java | @Override
public void storeTrigger(OperableTrigger trigger, boolean replaceExisting, JedisCluster jedis) throws JobPersistenceException {
final String triggerHashKey = redisSchema.triggerHashKey(trigger.getKey());
final String triggerGroupSetKey = redisSchema.triggerGroupSetKey(trigger.getKey());
... | [
"@",
"Override",
"public",
"void",
"storeTrigger",
"(",
"OperableTrigger",
"trigger",
",",
"boolean",
"replaceExisting",
",",
"JedisCluster",
"jedis",
")",
"throws",
"JobPersistenceException",
"{",
"final",
"String",
"triggerHashKey",
"=",
"redisSchema",
".",
"trigger... | Store a trigger in redis
@param trigger the trigger to be stored
@param replaceExisting true if an existing trigger with the same identity should be replaced
@param jedis a thread-safe Redis connection
@throws JobPersistenceException
@throws ObjectAlreadyExistsException | [
"Store",
"a",
"trigger",
"in",
"redis"
] | be9a52ee776d8a09866fe99fd9718bc13a0cb992 | https://github.com/jlinn/quartz-redis-jobstore/blob/be9a52ee776d8a09866fe99fd9718bc13a0cb992/src/main/java/net/joelinn/quartz/jobstore/RedisClusterStorage.java#L124-L175 | train |
jlinn/quartz-redis-jobstore | src/main/java/net/joelinn/quartz/jobstore/RedisStorage.java | RedisStorage.removeJob | @Override
public boolean removeJob(JobKey jobKey, Jedis jedis) throws JobPersistenceException {
final String jobHashKey = redisSchema.jobHashKey(jobKey);
final String jobBlockedKey = redisSchema.jobBlockedKey(jobKey);
final String jobDataMapHashKey = redisSchema.jobDataMapHashKey(jobKey);
... | java | @Override
public boolean removeJob(JobKey jobKey, Jedis jedis) throws JobPersistenceException {
final String jobHashKey = redisSchema.jobHashKey(jobKey);
final String jobBlockedKey = redisSchema.jobBlockedKey(jobKey);
final String jobDataMapHashKey = redisSchema.jobDataMapHashKey(jobKey);
... | [
"@",
"Override",
"public",
"boolean",
"removeJob",
"(",
"JobKey",
"jobKey",
",",
"Jedis",
"jedis",
")",
"throws",
"JobPersistenceException",
"{",
"final",
"String",
"jobHashKey",
"=",
"redisSchema",
".",
"jobHashKey",
"(",
"jobKey",
")",
";",
"final",
"String",
... | Remove the given job from Redis
@param jobKey the job to be removed
@param jedis a thread-safe Redis connection
@return true if the job was removed; false if it did not exist | [
"Remove",
"the",
"given",
"job",
"from",
"Redis"
] | be9a52ee776d8a09866fe99fd9718bc13a0cb992 | https://github.com/jlinn/quartz-redis-jobstore/blob/be9a52ee776d8a09866fe99fd9718bc13a0cb992/src/main/java/net/joelinn/quartz/jobstore/RedisStorage.java#L40-L90 | train |
jlinn/quartz-redis-jobstore | src/main/java/net/joelinn/quartz/jobstore/RedisStorage.java | RedisStorage.storeJob | @Override
@SuppressWarnings("unchecked")
public void storeJob(JobDetail jobDetail, boolean replaceExisting, Jedis jedis) throws ObjectAlreadyExistsException {
final String jobHashKey = redisSchema.jobHashKey(jobDetail.getKey());
final String jobDataMapHashKey = redisSchema.jobDataMapHashKey(jobD... | java | @Override
@SuppressWarnings("unchecked")
public void storeJob(JobDetail jobDetail, boolean replaceExisting, Jedis jedis) throws ObjectAlreadyExistsException {
final String jobHashKey = redisSchema.jobHashKey(jobDetail.getKey());
final String jobDataMapHashKey = redisSchema.jobDataMapHashKey(jobD... | [
"@",
"Override",
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"void",
"storeJob",
"(",
"JobDetail",
"jobDetail",
",",
"boolean",
"replaceExisting",
",",
"Jedis",
"jedis",
")",
"throws",
"ObjectAlreadyExistsException",
"{",
"final",
"String",
"jobHas... | Store a job in Redis
@param jobDetail the {@link org.quartz.JobDetail} object to be stored
@param replaceExisting if true, any existing job with the same group and name as the given job will be overwritten
@param jedis a thread-safe Redis connection
@throws org.quartz.ObjectAlreadyExistsException | [
"Store",
"a",
"job",
"in",
"Redis"
] | be9a52ee776d8a09866fe99fd9718bc13a0cb992 | https://github.com/jlinn/quartz-redis-jobstore/blob/be9a52ee776d8a09866fe99fd9718bc13a0cb992/src/main/java/net/joelinn/quartz/jobstore/RedisStorage.java#L159-L180 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.