id int32 0 165k | 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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
100,000 | Stratio/bdt | src/main/java/com/stratio/qa/utils/ElasticSearchUtils.java | ElasticSearchUtils.indexDocument | public void indexDocument(String indexName, String mappingName, String id, XContentBuilder document)
throws Exception {
client.prepareIndex(indexName, mappingName, id).setSource(document).get();
} | java | public void indexDocument(String indexName, String mappingName, String id, XContentBuilder document)
throws Exception {
client.prepareIndex(indexName, mappingName, id).setSource(document).get();
} | [
"public",
"void",
"indexDocument",
"(",
"String",
"indexName",
",",
"String",
"mappingName",
",",
"String",
"id",
",",
"XContentBuilder",
"document",
")",
"throws",
"Exception",
"{",
"client",
".",
"prepareIndex",
"(",
"indexName",
",",
"mappingName",
",",
"id",... | Indexes a document.
@param indexName
@param mappingName
@param id unique identifier of the document
@param document
@throws Exception | [
"Indexes",
"a",
"document",
"."
] | 55324d19e7497764ad3dd7139923e13eb9841d75 | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/utils/ElasticSearchUtils.java#L273-L276 |
100,001 | Stratio/bdt | src/main/java/com/stratio/qa/utils/ElasticSearchUtils.java | ElasticSearchUtils.deleteDocument | public void deleteDocument(String indexName, String mappingName, String id) {
client.prepareDelete(indexName, mappingName, id).get();
} | java | public void deleteDocument(String indexName, String mappingName, String id) {
client.prepareDelete(indexName, mappingName, id).get();
} | [
"public",
"void",
"deleteDocument",
"(",
"String",
"indexName",
",",
"String",
"mappingName",
",",
"String",
"id",
")",
"{",
"client",
".",
"prepareDelete",
"(",
"indexName",
",",
"mappingName",
",",
"id",
")",
".",
"get",
"(",
")",
";",
"}"
] | Deletes a document by its id.
@param indexName
@param mappingName
@param id | [
"Deletes",
"a",
"document",
"by",
"its",
"id",
"."
] | 55324d19e7497764ad3dd7139923e13eb9841d75 | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/utils/ElasticSearchUtils.java#L285-L287 |
100,002 | Stratio/bdt | src/main/java/com/stratio/qa/specs/HookGSpec.java | HookGSpec.seleniumTeardown | @After(order = ORDER_20, value = {"@mobile or @web"})
public void seleniumTeardown() {
if (commonspec.getDriver() != null) {
commonspec.getLogger().debug("Shutdown Selenium client");
commonspec.getDriver().close();
commonspec.getDriver().quit();
}
} | java | @After(order = ORDER_20, value = {"@mobile or @web"})
public void seleniumTeardown() {
if (commonspec.getDriver() != null) {
commonspec.getLogger().debug("Shutdown Selenium client");
commonspec.getDriver().close();
commonspec.getDriver().quit();
}
} | [
"@",
"After",
"(",
"order",
"=",
"ORDER_20",
",",
"value",
"=",
"{",
"\"@mobile or @web\"",
"}",
")",
"public",
"void",
"seleniumTeardown",
"(",
")",
"{",
"if",
"(",
"commonspec",
".",
"getDriver",
"(",
")",
"!=",
"null",
")",
"{",
"commonspec",
".",
"... | Close selenium web driver. | [
"Close",
"selenium",
"web",
"driver",
"."
] | 55324d19e7497764ad3dd7139923e13eb9841d75 | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/HookGSpec.java#L230-L237 |
100,003 | Stratio/bdt | src/main/java/com/stratio/qa/utils/ThreadProperty.java | ThreadProperty.set | public static void set(String key, String value) {
PROPS.get().setProperty(key, value);
} | java | public static void set(String key, String value) {
PROPS.get().setProperty(key, value);
} | [
"public",
"static",
"void",
"set",
"(",
"String",
"key",
",",
"String",
"value",
")",
"{",
"PROPS",
".",
"get",
"(",
")",
".",
"setProperty",
"(",
"key",
",",
"value",
")",
";",
"}"
] | Set a string to share in other class.
@param key
@param value | [
"Set",
"a",
"string",
"to",
"share",
"in",
"other",
"class",
"."
] | 55324d19e7497764ad3dd7139923e13eb9841d75 | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/utils/ThreadProperty.java#L40-L42 |
100,004 | Stratio/bdt | src/main/java/com/stratio/qa/specs/KafkaSpec.java | KafkaSpec.connectKafka | @Given("^I connect to kafka at '(.+)' using path '(.+)'$")
public void connectKafka(String zkHost, String zkPath) throws UnknownHostException {
String zkPort = zkHost.split(":")[1];
zkHost = zkHost.split(":")[0];
commonspec.getKafkaUtils().setZkHost(zkHost, zkPort, zkPath);
commonspe... | java | @Given("^I connect to kafka at '(.+)' using path '(.+)'$")
public void connectKafka(String zkHost, String zkPath) throws UnknownHostException {
String zkPort = zkHost.split(":")[1];
zkHost = zkHost.split(":")[0];
commonspec.getKafkaUtils().setZkHost(zkHost, zkPort, zkPath);
commonspe... | [
"@",
"Given",
"(",
"\"^I connect to kafka at '(.+)' using path '(.+)'$\"",
")",
"public",
"void",
"connectKafka",
"(",
"String",
"zkHost",
",",
"String",
"zkPath",
")",
"throws",
"UnknownHostException",
"{",
"String",
"zkPort",
"=",
"zkHost",
".",
"split",
"(",
"\":... | Connect to Kafka.
@param zkHost ZK host
@param zkPath ZK port
@throws UnknownHostException exception | [
"Connect",
"to",
"Kafka",
"."
] | 55324d19e7497764ad3dd7139923e13eb9841d75 | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/KafkaSpec.java#L49-L55 |
100,005 | Stratio/bdt | src/main/java/com/stratio/qa/specs/KafkaSpec.java | KafkaSpec.topicToFile | @When("^I copy the kafka topic '(.*?)' to file '(.*?)' with headers '(.*?)'$")
public void topicToFile(String topic_name, String filename, String header) throws Exception {
commonspec.getKafkaUtils().resultsToFile(topic_name, filename, header);
} | java | @When("^I copy the kafka topic '(.*?)' to file '(.*?)' with headers '(.*?)'$")
public void topicToFile(String topic_name, String filename, String header) throws Exception {
commonspec.getKafkaUtils().resultsToFile(topic_name, filename, header);
} | [
"@",
"When",
"(",
"\"^I copy the kafka topic '(.*?)' to file '(.*?)' with headers '(.*?)'$\"",
")",
"public",
"void",
"topicToFile",
"(",
"String",
"topic_name",
",",
"String",
"filename",
",",
"String",
"header",
")",
"throws",
"Exception",
"{",
"commonspec",
".",
"get... | Copy Kafka Topic content to file
@param topic_name
@param filename
@param header
@throws Exception | [
"Copy",
"Kafka",
"Topic",
"content",
"to",
"file"
] | 55324d19e7497764ad3dd7139923e13eb9841d75 | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/KafkaSpec.java#L85-L88 |
100,006 | Stratio/bdt | src/main/java/com/stratio/qa/specs/KafkaSpec.java | KafkaSpec.modifyPartitions | @When("^I increase '(.+?)' partitions in a Kafka topic named '(.+?)'")
public void modifyPartitions(int numPartitions, String topic_name) throws Exception {
commonspec.getKafkaUtils().modifyTopicPartitioning(topic_name, numPartitions);
} | java | @When("^I increase '(.+?)' partitions in a Kafka topic named '(.+?)'")
public void modifyPartitions(int numPartitions, String topic_name) throws Exception {
commonspec.getKafkaUtils().modifyTopicPartitioning(topic_name, numPartitions);
} | [
"@",
"When",
"(",
"\"^I increase '(.+?)' partitions in a Kafka topic named '(.+?)'\"",
")",
"public",
"void",
"modifyPartitions",
"(",
"int",
"numPartitions",
",",
"String",
"topic_name",
")",
"throws",
"Exception",
"{",
"commonspec",
".",
"getKafkaUtils",
"(",
")",
"."... | Modify partitions in a Kafka topic.
@param topic_name topic name
@param numPartitions number of partitions | [
"Modify",
"partitions",
"in",
"a",
"Kafka",
"topic",
"."
] | 55324d19e7497764ad3dd7139923e13eb9841d75 | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/KafkaSpec.java#L96-L99 |
100,007 | Stratio/bdt | src/main/java/com/stratio/qa/specs/KafkaSpec.java | KafkaSpec.sendAMessage | @When("^I send a message '(.+?)' to the kafka topic named '(.+?)'")
public void sendAMessage(String message, String topic_name) throws Exception {
commonspec.getKafkaUtils().sendMessage(message, topic_name);
} | java | @When("^I send a message '(.+?)' to the kafka topic named '(.+?)'")
public void sendAMessage(String message, String topic_name) throws Exception {
commonspec.getKafkaUtils().sendMessage(message, topic_name);
} | [
"@",
"When",
"(",
"\"^I send a message '(.+?)' to the kafka topic named '(.+?)'\"",
")",
"public",
"void",
"sendAMessage",
"(",
"String",
"message",
",",
"String",
"topic_name",
")",
"throws",
"Exception",
"{",
"commonspec",
".",
"getKafkaUtils",
"(",
")",
".",
"sendM... | Sending a message in a Kafka topic.
@param topic_name topic name
@param message string that you send to topic | [
"Sending",
"a",
"message",
"in",
"a",
"Kafka",
"topic",
"."
] | 55324d19e7497764ad3dd7139923e13eb9841d75 | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/KafkaSpec.java#L108-L111 |
100,008 | Stratio/bdt | src/main/java/com/stratio/qa/specs/KafkaSpec.java | KafkaSpec.kafkaTopicExist | @Then("^A kafka topic named '(.+?)' exists")
public void kafkaTopicExist(String topic_name) throws KeeperException, InterruptedException {
assert commonspec.getKafkaUtils().getZkUtils().pathExists("/" + topic_name) : "There is no topic with that name";
} | java | @Then("^A kafka topic named '(.+?)' exists")
public void kafkaTopicExist(String topic_name) throws KeeperException, InterruptedException {
assert commonspec.getKafkaUtils().getZkUtils().pathExists("/" + topic_name) : "There is no topic with that name";
} | [
"@",
"Then",
"(",
"\"^A kafka topic named '(.+?)' exists\"",
")",
"public",
"void",
"kafkaTopicExist",
"(",
"String",
"topic_name",
")",
"throws",
"KeeperException",
",",
"InterruptedException",
"{",
"assert",
"commonspec",
".",
"getKafkaUtils",
"(",
")",
".",
"getZkU... | Check that a kafka topic exist
@param topic_name name of topic | [
"Check",
"that",
"a",
"kafka",
"topic",
"exist"
] | 55324d19e7497764ad3dd7139923e13eb9841d75 | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/KafkaSpec.java#L118-L121 |
100,009 | Stratio/bdt | src/main/java/com/stratio/qa/specs/KafkaSpec.java | KafkaSpec.checkNumberOfPartitions | @Then("^The number of partitions in topic '(.+?)' should be '(.+?)''?$")
public void checkNumberOfPartitions(String topic_name, int numOfPartitions) throws Exception {
Assertions.assertThat(commonspec.getKafkaUtils().getPartitions(topic_name)).isEqualTo(numOfPartitions);
} | java | @Then("^The number of partitions in topic '(.+?)' should be '(.+?)''?$")
public void checkNumberOfPartitions(String topic_name, int numOfPartitions) throws Exception {
Assertions.assertThat(commonspec.getKafkaUtils().getPartitions(topic_name)).isEqualTo(numOfPartitions);
} | [
"@",
"Then",
"(",
"\"^The number of partitions in topic '(.+?)' should be '(.+?)''?$\"",
")",
"public",
"void",
"checkNumberOfPartitions",
"(",
"String",
"topic_name",
",",
"int",
"numOfPartitions",
")",
"throws",
"Exception",
"{",
"Assertions",
".",
"assertThat",
"(",
"c... | Check that the number of partitions is like expected.
@param topic_name Name of kafka topic
@param numOfPartitions Number of partitions
@throws Exception | [
"Check",
"that",
"the",
"number",
"of",
"partitions",
"is",
"like",
"expected",
"."
] | 55324d19e7497764ad3dd7139923e13eb9841d75 | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/KafkaSpec.java#L140-L144 |
100,010 | Stratio/bdt | src/main/java/com/stratio/qa/specs/SeleniumSpec.java | SeleniumSpec.seleniumIdFrame | @Given("^I switch to iframe with '([^:]*?):(.+?)'$")
public void seleniumIdFrame(String method, String idframe) throws IllegalAccessException, NoSuchFieldException, ClassNotFoundException {
assertThat(commonspec.locateElement(method, idframe, 1));
if (method.equals("id") || method.equals("name")) {... | java | @Given("^I switch to iframe with '([^:]*?):(.+?)'$")
public void seleniumIdFrame(String method, String idframe) throws IllegalAccessException, NoSuchFieldException, ClassNotFoundException {
assertThat(commonspec.locateElement(method, idframe, 1));
if (method.equals("id") || method.equals("name")) {... | [
"@",
"Given",
"(",
"\"^I switch to iframe with '([^:]*?):(.+?)'$\"",
")",
"public",
"void",
"seleniumIdFrame",
"(",
"String",
"method",
",",
"String",
"idframe",
")",
"throws",
"IllegalAccessException",
",",
"NoSuchFieldException",
",",
"ClassNotFoundException",
"{",
"ass... | Swith to the iFrame where id matches idframe
@param idframe iframe to swith to
@throws IllegalAccessException exception
@throws NoSuchFieldException exception
@throws ClassNotFoundException exception | [
"Swith",
"to",
"the",
"iFrame",
"where",
"id",
"matches",
"idframe"
] | 55324d19e7497764ad3dd7139923e13eb9841d75 | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/SeleniumSpec.java#L132-L141 |
100,011 | Stratio/bdt | src/main/java/com/stratio/qa/specs/SeleniumSpec.java | SeleniumSpec.seleniumGetwindows | @Given("^a new window is opened$")
public void seleniumGetwindows() {
Set<String> wel = commonspec.getDriver().getWindowHandles();
Assertions.assertThat(wel).as("Element count doesnt match").hasSize(2);
} | java | @Given("^a new window is opened$")
public void seleniumGetwindows() {
Set<String> wel = commonspec.getDriver().getWindowHandles();
Assertions.assertThat(wel).as("Element count doesnt match").hasSize(2);
} | [
"@",
"Given",
"(",
"\"^a new window is opened$\"",
")",
"public",
"void",
"seleniumGetwindows",
"(",
")",
"{",
"Set",
"<",
"String",
">",
"wel",
"=",
"commonspec",
".",
"getDriver",
"(",
")",
".",
"getWindowHandles",
"(",
")",
";",
"Assertions",
".",
"assert... | Get all opened windows and store it. | [
"Get",
"all",
"opened",
"windows",
"and",
"store",
"it",
"."
] | 55324d19e7497764ad3dd7139923e13eb9841d75 | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/SeleniumSpec.java#L162-L167 |
100,012 | Stratio/bdt | src/main/java/com/stratio/qa/specs/SeleniumSpec.java | SeleniumSpec.seleniumDrag | @When("^I drag '([^:]*?):(.+?)' and drop it to '([^:]*?):(.+?)'$")
public void seleniumDrag(String smethod, String source, String dmethod, String destination) throws ClassNotFoundException, NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException {
Actions builder = new Acti... | java | @When("^I drag '([^:]*?):(.+?)' and drop it to '([^:]*?):(.+?)'$")
public void seleniumDrag(String smethod, String source, String dmethod, String destination) throws ClassNotFoundException, NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException {
Actions builder = new Acti... | [
"@",
"When",
"(",
"\"^I drag '([^:]*?):(.+?)' and drop it to '([^:]*?):(.+?)'$\"",
")",
"public",
"void",
"seleniumDrag",
"(",
"String",
"smethod",
",",
"String",
"source",
",",
"String",
"dmethod",
",",
"String",
"destination",
")",
"throws",
"ClassNotFoundException",
... | Searchs for two webelements dragging the first one to the second
@param source
@param destination
@throws IllegalAccessException
@throws IllegalArgumentException
@throws SecurityException
@throws NoSuchFieldException
@throws ClassNotFoundException | [
"Searchs",
"for",
"two",
"webelements",
"dragging",
"the",
"first",
"one",
"to",
"the",
"second"
] | 55324d19e7497764ad3dd7139923e13eb9841d75 | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/SeleniumSpec.java#L180-L188 |
100,013 | Stratio/bdt | src/main/java/com/stratio/qa/specs/SeleniumSpec.java | SeleniumSpec.elementDeSelect | @When("^I de-select every item on the element on index '(\\d+?)'$")
public void elementDeSelect(Integer index) {
Select sel = null;
sel = new Select(commonspec.getPreviousWebElements().getPreviousWebElements().get(index));
if (sel.isMultiple()) {
sel.deselectAll();
}
... | java | @When("^I de-select every item on the element on index '(\\d+?)'$")
public void elementDeSelect(Integer index) {
Select sel = null;
sel = new Select(commonspec.getPreviousWebElements().getPreviousWebElements().get(index));
if (sel.isMultiple()) {
sel.deselectAll();
}
... | [
"@",
"When",
"(",
"\"^I de-select every item on the element on index '(\\\\d+?)'$\"",
")",
"public",
"void",
"elementDeSelect",
"(",
"Integer",
"index",
")",
"{",
"Select",
"sel",
"=",
"null",
";",
"sel",
"=",
"new",
"Select",
"(",
"commonspec",
".",
"getPreviousWeb... | Choose no option from a select webelement found previously
@param index | [
"Choose",
"no",
"option",
"from",
"a",
"select",
"webelement",
"found",
"previously"
] | 55324d19e7497764ad3dd7139923e13eb9841d75 | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/SeleniumSpec.java#L367-L375 |
100,014 | Stratio/bdt | src/main/java/com/stratio/qa/specs/SeleniumSpec.java | SeleniumSpec.seleniumChangeWindow | @When("^I change active window$")
public void seleniumChangeWindow() {
String originalWindowHandle = commonspec.getDriver().getWindowHandle();
Set<String> windowHandles = commonspec.getDriver().getWindowHandles();
for (String window : windowHandles) {
if (!window.equals(original... | java | @When("^I change active window$")
public void seleniumChangeWindow() {
String originalWindowHandle = commonspec.getDriver().getWindowHandle();
Set<String> windowHandles = commonspec.getDriver().getWindowHandles();
for (String window : windowHandles) {
if (!window.equals(original... | [
"@",
"When",
"(",
"\"^I change active window$\"",
")",
"public",
"void",
"seleniumChangeWindow",
"(",
")",
"{",
"String",
"originalWindowHandle",
"=",
"commonspec",
".",
"getDriver",
"(",
")",
".",
"getWindowHandle",
"(",
")",
";",
"Set",
"<",
"String",
">",
"... | Change current window to another opened window. | [
"Change",
"current",
"window",
"to",
"another",
"opened",
"window",
"."
] | 55324d19e7497764ad3dd7139923e13eb9841d75 | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/SeleniumSpec.java#L380-L391 |
100,015 | Stratio/bdt | src/main/java/com/stratio/qa/specs/SeleniumSpec.java | SeleniumSpec.assertSeleniumTextInSource | @Then("^this text exists '(.+?)'$")
public void assertSeleniumTextInSource(String text) {
assertThat(this.commonspec, commonspec.getDriver()).as("Expected text not found at page").contains(text);
} | java | @Then("^this text exists '(.+?)'$")
public void assertSeleniumTextInSource(String text) {
assertThat(this.commonspec, commonspec.getDriver()).as("Expected text not found at page").contains(text);
} | [
"@",
"Then",
"(",
"\"^this text exists '(.+?)'$\"",
")",
"public",
"void",
"assertSeleniumTextInSource",
"(",
"String",
"text",
")",
"{",
"assertThat",
"(",
"this",
".",
"commonspec",
",",
"commonspec",
".",
"getDriver",
"(",
")",
")",
".",
"as",
"(",
"\"Expec... | Checks if a text exists in the source of an already loaded URL.
@param text | [
"Checks",
"if",
"a",
"text",
"exists",
"in",
"the",
"source",
"of",
"an",
"already",
"loaded",
"URL",
"."
] | 55324d19e7497764ad3dd7139923e13eb9841d75 | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/SeleniumSpec.java#L418-L421 |
100,016 | Stratio/bdt | src/main/java/com/stratio/qa/specs/SeleniumSpec.java | SeleniumSpec.checkURL | @Then("^we are in page '(.+?)'$")
public void checkURL(String url) throws Exception {
if (commonspec.getWebHost() == null) {
throw new Exception("Web host has not been set");
}
if (commonspec.getWebPort() == null) {
throw new Exception("Web port has not been set");
... | java | @Then("^we are in page '(.+?)'$")
public void checkURL(String url) throws Exception {
if (commonspec.getWebHost() == null) {
throw new Exception("Web host has not been set");
}
if (commonspec.getWebPort() == null) {
throw new Exception("Web port has not been set");
... | [
"@",
"Then",
"(",
"\"^we are in page '(.+?)'$\"",
")",
"public",
"void",
"checkURL",
"(",
"String",
"url",
")",
"throws",
"Exception",
"{",
"if",
"(",
"commonspec",
".",
"getWebHost",
"(",
")",
"==",
"null",
")",
"{",
"throw",
"new",
"Exception",
"(",
"\"W... | Checks that we are in the URL passed
@param url
@throws Exception | [
"Checks",
"that",
"we",
"are",
"in",
"the",
"URL",
"passed"
] | 55324d19e7497764ad3dd7139923e13eb9841d75 | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/SeleniumSpec.java#L552-L567 |
100,017 | Stratio/bdt | src/main/java/com/stratio/qa/specs/SeleniumSpec.java | SeleniumSpec.getDcosAcsAuthCookie | @Then("^I save selenium dcos acs auth cookie in variable '(.+?)'$")
public void getDcosAcsAuthCookie(String envVar) throws Exception {
if (commonspec.getSeleniumCookies() != null && commonspec.getSeleniumCookies().size() != 0) {
for (Cookie cookie: commonspec.getSeleniumCookies()) {
... | java | @Then("^I save selenium dcos acs auth cookie in variable '(.+?)'$")
public void getDcosAcsAuthCookie(String envVar) throws Exception {
if (commonspec.getSeleniumCookies() != null && commonspec.getSeleniumCookies().size() != 0) {
for (Cookie cookie: commonspec.getSeleniumCookies()) {
... | [
"@",
"Then",
"(",
"\"^I save selenium dcos acs auth cookie in variable '(.+?)'$\"",
")",
"public",
"void",
"getDcosAcsAuthCookie",
"(",
"String",
"envVar",
")",
"throws",
"Exception",
"{",
"if",
"(",
"commonspec",
".",
"getSeleniumCookies",
"(",
")",
"!=",
"null",
"&&... | Get dcos-auth-cookie | [
"Get",
"dcos",
"-",
"auth",
"-",
"cookie"
] | 55324d19e7497764ad3dd7139923e13eb9841d75 | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/SeleniumSpec.java#L581-L594 |
100,018 | Stratio/bdt | src/main/java/com/stratio/qa/specs/SeleniumSpec.java | SeleniumSpec.checkIfCookieExists | @Then("^The cookie '(.+?)' exists in the saved cookies$")
public void checkIfCookieExists(String cookieName) {
Assertions.assertThat(commonspec.cookieExists(cookieName)).isEqualTo(true);
} | java | @Then("^The cookie '(.+?)' exists in the saved cookies$")
public void checkIfCookieExists(String cookieName) {
Assertions.assertThat(commonspec.cookieExists(cookieName)).isEqualTo(true);
} | [
"@",
"Then",
"(",
"\"^The cookie '(.+?)' exists in the saved cookies$\"",
")",
"public",
"void",
"checkIfCookieExists",
"(",
"String",
"cookieName",
")",
"{",
"Assertions",
".",
"assertThat",
"(",
"commonspec",
".",
"cookieExists",
"(",
"cookieName",
")",
")",
".",
... | Check if a cookie exists
@param cookieName string with the name of the cookie | [
"Check",
"if",
"a",
"cookie",
"exists"
] | 55324d19e7497764ad3dd7139923e13eb9841d75 | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/SeleniumSpec.java#L619-L623 |
100,019 | Stratio/bdt | src/main/java/com/stratio/qa/specs/SeleniumSpec.java | SeleniumSpec.getSeleniumCookiesSize | @Then("^I have '(.+?)' selenium cookies saved$")
public void getSeleniumCookiesSize(int numberOfCookies) throws Exception {
Assertions.assertThat(commonspec.getSeleniumCookies().size()).isEqualTo(numberOfCookies);
} | java | @Then("^I have '(.+?)' selenium cookies saved$")
public void getSeleniumCookiesSize(int numberOfCookies) throws Exception {
Assertions.assertThat(commonspec.getSeleniumCookies().size()).isEqualTo(numberOfCookies);
} | [
"@",
"Then",
"(",
"\"^I have '(.+?)' selenium cookies saved$\"",
")",
"public",
"void",
"getSeleniumCookiesSize",
"(",
"int",
"numberOfCookies",
")",
"throws",
"Exception",
"{",
"Assertions",
".",
"assertThat",
"(",
"commonspec",
".",
"getSeleniumCookies",
"(",
")",
"... | Check if the length of the cookie set match with the number of cookies thas must be saved
@param numberOfCookies number of cookies that must be saved | [
"Check",
"if",
"the",
"length",
"of",
"the",
"cookie",
"set",
"match",
"with",
"the",
"number",
"of",
"cookies",
"thas",
"must",
"be",
"saved"
] | 55324d19e7497764ad3dd7139923e13eb9841d75 | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/SeleniumSpec.java#L629-L632 |
100,020 | Stratio/bdt | src/main/java/com/stratio/qa/specs/SeleniumSpec.java | SeleniumSpec.saveContentWebElementInEnvVar | @Then("^I save content of element in index '(\\d+?)' in environment variable '(.+?)'$")
public void saveContentWebElementInEnvVar(Integer index, String envVar) {
assertThat(this.commonspec, commonspec.getPreviousWebElements()).as("There are less found elements than required")
.hasAtLeast(ind... | java | @Then("^I save content of element in index '(\\d+?)' in environment variable '(.+?)'$")
public void saveContentWebElementInEnvVar(Integer index, String envVar) {
assertThat(this.commonspec, commonspec.getPreviousWebElements()).as("There are less found elements than required")
.hasAtLeast(ind... | [
"@",
"Then",
"(",
"\"^I save content of element in index '(\\\\d+?)' in environment variable '(.+?)'$\"",
")",
"public",
"void",
"saveContentWebElementInEnvVar",
"(",
"Integer",
"index",
",",
"String",
"envVar",
")",
"{",
"assertThat",
"(",
"this",
".",
"commonspec",
",",
... | Takes the content of a webElement and stores it in the thread environment variable passed as parameter
@param index position of the element in the array of webElements found
@param envVar name of the thread environment variable where to store the text | [
"Takes",
"the",
"content",
"of",
"a",
"webElement",
"and",
"stores",
"it",
"in",
"the",
"thread",
"environment",
"variable",
"passed",
"as",
"parameter"
] | 55324d19e7497764ad3dd7139923e13eb9841d75 | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/SeleniumSpec.java#L640-L646 |
100,021 | Stratio/bdt | src/main/java/com/stratio/qa/specs/MiscSpec.java | MiscSpec.saveInEnvironment | @Given("^I save \'(.+?)\' in variable \'(.+?)\'$")
public void saveInEnvironment(String value, String envVar) {
ThreadProperty.set(envVar, value);
} | java | @Given("^I save \'(.+?)\' in variable \'(.+?)\'$")
public void saveInEnvironment(String value, String envVar) {
ThreadProperty.set(envVar, value);
} | [
"@",
"Given",
"(",
"\"^I save \\'(.+?)\\' in variable \\'(.+?)\\'$\"",
")",
"public",
"void",
"saveInEnvironment",
"(",
"String",
"value",
",",
"String",
"envVar",
")",
"{",
"ThreadProperty",
".",
"set",
"(",
"envVar",
",",
"value",
")",
";",
"}"
] | Save value for future use.
@param value value to be saved
@param envVar thread environment variable where to store the value | [
"Save",
"value",
"for",
"future",
"use",
"."
] | 55324d19e7497764ad3dd7139923e13eb9841d75 | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/MiscSpec.java#L105-L108 |
100,022 | Stratio/bdt | src/main/java/com/stratio/qa/specs/MiscSpec.java | MiscSpec.sortElements | @When("^I sort elements in '(.+?)' by '(.+?)' criteria in '(.+?)' order$")
public void sortElements(String envVar, String criteria, String order) {
String value = ThreadProperty.get(envVar);
JsonArray jsonArr = JsonValue.readHjson(value).asArray();
List<JsonValue> jsonValues = new ArrayLis... | java | @When("^I sort elements in '(.+?)' by '(.+?)' criteria in '(.+?)' order$")
public void sortElements(String envVar, String criteria, String order) {
String value = ThreadProperty.get(envVar);
JsonArray jsonArr = JsonValue.readHjson(value).asArray();
List<JsonValue> jsonValues = new ArrayLis... | [
"@",
"When",
"(",
"\"^I sort elements in '(.+?)' by '(.+?)' criteria in '(.+?)' order$\"",
")",
"public",
"void",
"sortElements",
"(",
"String",
"envVar",
",",
"String",
"criteria",
",",
"String",
"order",
")",
"{",
"String",
"value",
"=",
"ThreadProperty",
".",
"get"... | Sort elements in envVar by a criteria and order.
@param envVar Environment variable to be sorted
@param criteria alphabetical,...
@param order ascending or descending | [
"Sort",
"elements",
"in",
"envVar",
"by",
"a",
"criteria",
"and",
"order",
"."
] | 55324d19e7497764ad3dd7139923e13eb9841d75 | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/MiscSpec.java#L128-L165 |
100,023 | Stratio/bdt | src/main/java/com/stratio/qa/specs/MiscSpec.java | MiscSpec.assertExceptionNotThrown | @Then("^an exception '(.+?)' thrown( with class '(.+?)'( and message like '(.+?)')?)?")
public void assertExceptionNotThrown(String exception, String foo, String clazz, String bar, String exceptionMsg)
throws ClassNotFoundException {
List<Exception> exceptions = commonspec.getExceptions();
... | java | @Then("^an exception '(.+?)' thrown( with class '(.+?)'( and message like '(.+?)')?)?")
public void assertExceptionNotThrown(String exception, String foo, String clazz, String bar, String exceptionMsg)
throws ClassNotFoundException {
List<Exception> exceptions = commonspec.getExceptions();
... | [
"@",
"Then",
"(",
"\"^an exception '(.+?)' thrown( with class '(.+?)'( and message like '(.+?)')?)?\"",
")",
"public",
"void",
"assertExceptionNotThrown",
"(",
"String",
"exception",
",",
"String",
"foo",
",",
"String",
"clazz",
",",
"String",
"bar",
",",
"String",
"excep... | Checks if an exception has been thrown.
@param exception : "IS NOT" | "IS"
@param foo
@param clazz
@param bar
@param exceptionMsg | [
"Checks",
"if",
"an",
"exception",
"has",
"been",
"thrown",
"."
] | 55324d19e7497764ad3dd7139923e13eb9841d75 | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/MiscSpec.java#L176-L195 |
100,024 | Stratio/bdt | src/main/java/com/stratio/qa/specs/RestSpec.java | RestSpec.sendRequest | @When("^I send a '(.+?)' request to '(.+?)'( with user and password '(.+:.+?)')? based on '([^:]+?)'( as '(json|string|gov)')? with:$")
public void sendRequest(String requestType, String endPoint, String foo, String loginInfo, String baseData, String baz, String type, DataTable modifications) throws Exception {
... | java | @When("^I send a '(.+?)' request to '(.+?)'( with user and password '(.+:.+?)')? based on '([^:]+?)'( as '(json|string|gov)')? with:$")
public void sendRequest(String requestType, String endPoint, String foo, String loginInfo, String baseData, String baz, String type, DataTable modifications) throws Exception {
... | [
"@",
"When",
"(",
"\"^I send a '(.+?)' request to '(.+?)'( with user and password '(.+:.+?)')? based on '([^:]+?)'( as '(json|string|gov)')? with:$\"",
")",
"public",
"void",
"sendRequest",
"(",
"String",
"requestType",
",",
"String",
"endPoint",
",",
"String",
"foo",
",",
"Strin... | Send a request of the type specified
@param requestType type of request to be sent. Possible values:
GET|DELETE|POST|PUT|CONNECT|PATCH|HEAD|OPTIONS|REQUEST|TRACE
@param endPoint end point to be used
@param foo parameter generated by cucumber because of the optional expression
@param baseData path... | [
"Send",
"a",
"request",
"of",
"the",
"type",
"specified"
] | 55324d19e7497764ad3dd7139923e13eb9841d75 | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/RestSpec.java#L204-L227 |
100,025 | Stratio/bdt | src/main/java/com/stratio/qa/specs/RestSpec.java | RestSpec.sendRequestNoDataTable | @When("^I send a '(.+?)' request to '(.+?)'( with user and password '(.+:.+?)')?( based on '([^:]+?)')?( as '(json|string|gov)')?$")
public void sendRequestNoDataTable(String requestType, String endPoint, String foo, String loginInfo, String bar, String baseData, String baz, String type) throws Exception {
... | java | @When("^I send a '(.+?)' request to '(.+?)'( with user and password '(.+:.+?)')?( based on '([^:]+?)')?( as '(json|string|gov)')?$")
public void sendRequestNoDataTable(String requestType, String endPoint, String foo, String loginInfo, String bar, String baseData, String baz, String type) throws Exception {
... | [
"@",
"When",
"(",
"\"^I send a '(.+?)' request to '(.+?)'( with user and password '(.+:.+?)')?( based on '([^:]+?)')?( as '(json|string|gov)')?$\"",
")",
"public",
"void",
"sendRequestNoDataTable",
"(",
"String",
"requestType",
",",
"String",
"endPoint",
",",
"String",
"foo",
",",
... | Same sendRequest, but in this case, we do not receive a data table with modifications.
Besides, the data and request header are optional as well.
In case we want to simulate sending a json request with empty data, we just to avoid baseData
@param requestType
@param endPoint
@param foo
@param baseData
@param bar
@param... | [
"Same",
"sendRequest",
"but",
"in",
"this",
"case",
"we",
"do",
"not",
"receive",
"a",
"data",
"table",
"with",
"modifications",
".",
"Besides",
"the",
"data",
"and",
"request",
"header",
"are",
"optional",
"as",
"well",
".",
"In",
"case",
"we",
"want",
... | 55324d19e7497764ad3dd7139923e13eb9841d75 | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/RestSpec.java#L242-L265 |
100,026 | Stratio/bdt | src/main/java/com/stratio/qa/utils/RemoteSSHConnection.java | RemoteSSHConnection.copyTo | public void copyTo(String localPath, String remotePath) throws Exception {
FileInputStream fis = null;
String rfile = remotePath;
String localfile = localPath;
boolean ptimestamp = true;
// exec 'scp -t rfile' remotely
String command = "scp " + (ptimestamp ? "-p" : "") +... | java | public void copyTo(String localPath, String remotePath) throws Exception {
FileInputStream fis = null;
String rfile = remotePath;
String localfile = localPath;
boolean ptimestamp = true;
// exec 'scp -t rfile' remotely
String command = "scp " + (ptimestamp ? "-p" : "") +... | [
"public",
"void",
"copyTo",
"(",
"String",
"localPath",
",",
"String",
"remotePath",
")",
"throws",
"Exception",
"{",
"FileInputStream",
"fis",
"=",
"null",
";",
"String",
"rfile",
"=",
"remotePath",
";",
"String",
"localfile",
"=",
"localPath",
";",
"boolean"... | Copy localPath to remotePath using the session created
@param localPath
@param remotePath | [
"Copy",
"localPath",
"to",
"remotePath",
"using",
"the",
"session",
"created"
] | 55324d19e7497764ad3dd7139923e13eb9841d75 | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/utils/RemoteSSHConnection.java#L106-L191 |
100,027 | Stratio/bdt | src/main/java/com/stratio/qa/utils/RemoteSSHConnection.java | RemoteSSHConnection.runCommand | public void runCommand(String command) throws Exception {
String result = "";
String extras = "export PYTHONWARNINGS=\"ignore:Unverified HTTPS request\" && ";
Channel channel = session.openChannel("exec");
((ChannelExec) channel).setCommand(extras + command);
channel.setInputSt... | java | public void runCommand(String command) throws Exception {
String result = "";
String extras = "export PYTHONWARNINGS=\"ignore:Unverified HTTPS request\" && ";
Channel channel = session.openChannel("exec");
((ChannelExec) channel).setCommand(extras + command);
channel.setInputSt... | [
"public",
"void",
"runCommand",
"(",
"String",
"command",
")",
"throws",
"Exception",
"{",
"String",
"result",
"=",
"\"\"",
";",
"String",
"extras",
"=",
"\"export PYTHONWARNINGS=\\\"ignore:Unverified HTTPS request\\\" && \"",
";",
"Channel",
"channel",
"=",
"session",
... | Execute the command in the session created
@param command | [
"Execute",
"the",
"command",
"in",
"the",
"session",
"created"
] | 55324d19e7497764ad3dd7139923e13eb9841d75 | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/utils/RemoteSSHConnection.java#L199-L241 |
100,028 | Stratio/bdt | src/main/java/com/stratio/qa/specs/DcosSpec.java | DcosSpec.authenticateDCOSpem | @Given("^I authenticate to DCOS cluster '(.+?)' using email '(.+?)'( with user '(.+?)'( and password '(.+?)'| and pem file '(.+?)'))?$")
public void authenticateDCOSpem(String remoteHost, String email, String foo, String user, String bar, String password, String pemFile) throws Exception {
String DCOSsecret... | java | @Given("^I authenticate to DCOS cluster '(.+?)' using email '(.+?)'( with user '(.+?)'( and password '(.+?)'| and pem file '(.+?)'))?$")
public void authenticateDCOSpem(String remoteHost, String email, String foo, String user, String bar, String password, String pemFile) throws Exception {
String DCOSsecret... | [
"@",
"Given",
"(",
"\"^I authenticate to DCOS cluster '(.+?)' using email '(.+?)'( with user '(.+?)'( and password '(.+?)'| and pem file '(.+?)'))?$\"",
")",
"public",
"void",
"authenticateDCOSpem",
"(",
"String",
"remoteHost",
",",
"String",
"email",
",",
"String",
"foo",
",",
"... | Authenticate in a DCOS cluster
@param remoteHost remote host
@param email email for JWT singing
@param user remote user
@param password (required if pemFile null)
@param pemFile (required if password null)
@throws Exception exception | [
"Authenticate",
"in",
"a",
"DCOS",
"cluster"
] | 55324d19e7497764ad3dd7139923e13eb9841d75 | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/DcosSpec.java#L63-L74 |
100,029 | Stratio/bdt | src/main/java/com/stratio/qa/specs/DcosSpec.java | DcosSpec.setGoSecSSOCookie | @Given("^I( do not)? set sso token using host '(.+?)' with user '(.+?)' and password '(.+?)'( and tenant '(.+?)')?$")
public void setGoSecSSOCookie(String set, String ssoHost, String userName, String passWord, String foo, String tenant) throws Exception {
if (set == null) {
HashMap<String, Strin... | java | @Given("^I( do not)? set sso token using host '(.+?)' with user '(.+?)' and password '(.+?)'( and tenant '(.+?)')?$")
public void setGoSecSSOCookie(String set, String ssoHost, String userName, String passWord, String foo, String tenant) throws Exception {
if (set == null) {
HashMap<String, Strin... | [
"@",
"Given",
"(",
"\"^I( do not)? set sso token using host '(.+?)' with user '(.+?)' and password '(.+?)'( and tenant '(.+?)')?$\"",
")",
"public",
"void",
"setGoSecSSOCookie",
"(",
"String",
"set",
",",
"String",
"ssoHost",
",",
"String",
"userName",
",",
"String",
"passWord"... | Generate token to authenticate in gosec SSO
@param ssoHost current sso host
@param userName username
@param passWord password
@throws Exception exception | [
"Generate",
"token",
"to",
"authenticate",
"in",
"gosec",
"SSO"
] | 55324d19e7497764ad3dd7139923e13eb9841d75 | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/DcosSpec.java#L96-L105 |
100,030 | Stratio/bdt | src/main/java/com/stratio/qa/specs/DcosSpec.java | DcosSpec.getUnusedNode | @Given("^I save the IP of an unused node in hosts '(.+?)' in the in environment variable '(.+?)'?$")
public void getUnusedNode(String hosts, String envVar) throws Exception {
Set<String> hostList = new HashSet(Arrays.asList(hosts.split(",")));
//Get the list of currently used hosts
commonsp... | java | @Given("^I save the IP of an unused node in hosts '(.+?)' in the in environment variable '(.+?)'?$")
public void getUnusedNode(String hosts, String envVar) throws Exception {
Set<String> hostList = new HashSet(Arrays.asList(hosts.split(",")));
//Get the list of currently used hosts
commonsp... | [
"@",
"Given",
"(",
"\"^I save the IP of an unused node in hosts '(.+?)' in the in environment variable '(.+?)'?$\"",
")",
"public",
"void",
"getUnusedNode",
"(",
"String",
"hosts",
",",
"String",
"envVar",
")",
"throws",
"Exception",
"{",
"Set",
"<",
"String",
">",
"hostL... | Checks if there are any unused nodes in the cluster and returns the IP of one of them.
REQUIRES A PREVIOUSLY-ESTABLISHED SSH CONNECTION TO DCOS-CLI TO WORK
@param hosts: list of IPs that will be investigated
@param envVar: environment variable name
@throws Exception | [
"Checks",
"if",
"there",
"are",
"any",
"unused",
"nodes",
"in",
"the",
"cluster",
"and",
"returns",
"the",
"IP",
"of",
"one",
"of",
"them",
".",
"REQUIRES",
"A",
"PREVIOUSLY",
"-",
"ESTABLISHED",
"SSH",
"CONNECTION",
"TO",
"DCOS",
"-",
"CLI",
"TO",
"WORK... | 55324d19e7497764ad3dd7139923e13eb9841d75 | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/DcosSpec.java#L126-L144 |
100,031 | Stratio/bdt | src/main/java/com/stratio/qa/specs/DcosSpec.java | DcosSpec.convertJSONSchemaToJSON | @Given("^I convert jsonSchema '(.+?)' to json and save it in variable '(.+?)'")
public void convertJSONSchemaToJSON(String jsonSchema, String envVar) throws Exception {
String json = commonspec.parseJSONSchema(new JSONObject(jsonSchema)).toString();
ThreadProperty.set(envVar, json);
} | java | @Given("^I convert jsonSchema '(.+?)' to json and save it in variable '(.+?)'")
public void convertJSONSchemaToJSON(String jsonSchema, String envVar) throws Exception {
String json = commonspec.parseJSONSchema(new JSONObject(jsonSchema)).toString();
ThreadProperty.set(envVar, json);
} | [
"@",
"Given",
"(",
"\"^I convert jsonSchema '(.+?)' to json and save it in variable '(.+?)'\"",
")",
"public",
"void",
"convertJSONSchemaToJSON",
"(",
"String",
"jsonSchema",
",",
"String",
"envVar",
")",
"throws",
"Exception",
"{",
"String",
"json",
"=",
"commonspec",
".... | Convert jsonSchema to json
@param jsonSchema jsonSchema to be converted to json
@param envVar environment variable where to store json
@throws Exception exception * | [
"Convert",
"jsonSchema",
"to",
"json"
] | 55324d19e7497764ad3dd7139923e13eb9841d75 | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/DcosSpec.java#L307-L311 |
100,032 | Stratio/bdt | src/main/java/com/stratio/qa/specs/DcosSpec.java | DcosSpec.jsonMatchesSchema | @Given("^json (.+?) matches schema (.+?)$")
public void jsonMatchesSchema(String json, String schema) throws Exception {
JSONObject jsonschema = new JSONObject(schema);
JSONObject jsondeploy = new JSONObject(json);
commonspec.matchJsonToSchema(jsonschema, jsondeploy);
} | java | @Given("^json (.+?) matches schema (.+?)$")
public void jsonMatchesSchema(String json, String schema) throws Exception {
JSONObject jsonschema = new JSONObject(schema);
JSONObject jsondeploy = new JSONObject(json);
commonspec.matchJsonToSchema(jsonschema, jsondeploy);
} | [
"@",
"Given",
"(",
"\"^json (.+?) matches schema (.+?)$\"",
")",
"public",
"void",
"jsonMatchesSchema",
"(",
"String",
"json",
",",
"String",
"schema",
")",
"throws",
"Exception",
"{",
"JSONObject",
"jsonschema",
"=",
"new",
"JSONObject",
"(",
"schema",
")",
";",
... | Check if json is validated against a schema
@param json json to be validated against schema
@param schema schema to be validated against
@throws Exception exception * | [
"Check",
"if",
"json",
"is",
"validated",
"against",
"a",
"schema"
] | 55324d19e7497764ad3dd7139923e13eb9841d75 | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/DcosSpec.java#L320-L326 |
100,033 | Stratio/bdt | src/main/java/com/stratio/qa/specs/DcosSpec.java | DcosSpec.getServiceHealthStatus | @Given("^I get service '(.+?)' health status in cluster '(.+?)' and save it in variable '(.+?)'")
public void getServiceHealthStatus(String service, String cluster, String envVar) throws Exception {
String health = commonspec.retrieveHealthServiceStatus(service, cluster);
ThreadProperty.set(envVar,... | java | @Given("^I get service '(.+?)' health status in cluster '(.+?)' and save it in variable '(.+?)'")
public void getServiceHealthStatus(String service, String cluster, String envVar) throws Exception {
String health = commonspec.retrieveHealthServiceStatus(service, cluster);
ThreadProperty.set(envVar,... | [
"@",
"Given",
"(",
"\"^I get service '(.+?)' health status in cluster '(.+?)' and save it in variable '(.+?)'\"",
")",
"public",
"void",
"getServiceHealthStatus",
"(",
"String",
"service",
",",
"String",
"cluster",
",",
"String",
"envVar",
")",
"throws",
"Exception",
"{",
"... | Get service health status
@param service name of the service to be checked
@param cluster URI of the cluster
@param envVar environment variable where to store result
@throws Exception exception * | [
"Get",
"service",
"health",
"status"
] | 55324d19e7497764ad3dd7139923e13eb9841d75 | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/DcosSpec.java#L351-L356 |
100,034 | Stratio/bdt | src/main/java/com/stratio/qa/specs/DcosSpec.java | DcosSpec.destroyService | @Given("^I destroy service '(.+?)' in cluster '(.+?)'")
public void destroyService(String service, String cluster) throws Exception {
String endPoint = "/service/deploy-api/deploy/uninstall?app=" + service;
Future response;
this.commonspec.setRestProtocol("https://");
this.commonspe... | java | @Given("^I destroy service '(.+?)' in cluster '(.+?)'")
public void destroyService(String service, String cluster) throws Exception {
String endPoint = "/service/deploy-api/deploy/uninstall?app=" + service;
Future response;
this.commonspec.setRestProtocol("https://");
this.commonspe... | [
"@",
"Given",
"(",
"\"^I destroy service '(.+?)' in cluster '(.+?)'\"",
")",
"public",
"void",
"destroyService",
"(",
"String",
"service",
",",
"String",
"cluster",
")",
"throws",
"Exception",
"{",
"String",
"endPoint",
"=",
"\"/service/deploy-api/deploy/uninstall?app=\"",
... | Destroy specified service
@param service name of the service to be destroyed
@param cluster URI of the cluster
@throws Exception exception * | [
"Destroy",
"specified",
"service"
] | 55324d19e7497764ad3dd7139923e13eb9841d75 | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/DcosSpec.java#L365-L378 |
100,035 | Stratio/bdt | src/main/java/com/stratio/qa/specs/DcosSpec.java | DcosSpec.checkResources | @When("^All resources from service '(.+?)' have been freed$")
public void checkResources(String service) throws Exception {
Future<Response> response = commonspec.generateRequest("GET", true, null, null, "/mesos/state-summary", null, null);
String json = "[" + response.get().getResponseBody() + "]"... | java | @When("^All resources from service '(.+?)' have been freed$")
public void checkResources(String service) throws Exception {
Future<Response> response = commonspec.generateRequest("GET", true, null, null, "/mesos/state-summary", null, null);
String json = "[" + response.get().getResponseBody() + "]"... | [
"@",
"When",
"(",
"\"^All resources from service '(.+?)' have been freed$\"",
")",
"public",
"void",
"checkResources",
"(",
"String",
"service",
")",
"throws",
"Exception",
"{",
"Future",
"<",
"Response",
">",
"response",
"=",
"commonspec",
".",
"generateRequest",
"("... | Check if resources are released after uninstall and framework doesn't appear as inactive on mesos
@param service service
@throws Exception exception | [
"Check",
"if",
"resources",
"are",
"released",
"after",
"uninstall",
"and",
"framework",
"doesn",
"t",
"appear",
"as",
"inactive",
"on",
"mesos"
] | 55324d19e7497764ad3dd7139923e13eb9841d75 | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/DcosSpec.java#L386-L395 |
100,036 | Stratio/bdt | src/main/java/com/stratio/qa/specs/DcosSpec.java | DcosSpec.sendAppendRequest | @Then("^I add a new DCOS label with key '(.+?)' and value '(.+?)' to the service '(.+?)'?$")
public void sendAppendRequest(String key, String value, String service) throws Exception {
commonspec.runCommandAndGetResult("touch " + service + ".json && dcos marathon app show " + service + " > /dcos/" + service ... | java | @Then("^I add a new DCOS label with key '(.+?)' and value '(.+?)' to the service '(.+?)'?$")
public void sendAppendRequest(String key, String value, String service) throws Exception {
commonspec.runCommandAndGetResult("touch " + service + ".json && dcos marathon app show " + service + " > /dcos/" + service ... | [
"@",
"Then",
"(",
"\"^I add a new DCOS label with key '(.+?)' and value '(.+?)' to the service '(.+?)'?$\"",
")",
"public",
"void",
"sendAppendRequest",
"(",
"String",
"key",
",",
"String",
"value",
",",
"String",
"service",
")",
"throws",
"Exception",
"{",
"commonspec",
... | A PUT request over the body value.
@param key
@param value
@param service
@throws Exception | [
"A",
"PUT",
"request",
"over",
"the",
"body",
"value",
"."
] | 55324d19e7497764ad3dd7139923e13eb9841d75 | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/DcosSpec.java#L405-L426 |
100,037 | Stratio/bdt | src/main/java/com/stratio/qa/specs/DcosSpec.java | DcosSpec.setMarathonProperty | @Then("^I modify marathon environment variable '(.+?)' with value '(.+?)' for service '(.+?)'?$")
public void setMarathonProperty(String key, String value, String service) throws Exception {
commonspec.runCommandAndGetResult("touch " + service + "-env.json && dcos marathon app show " + service + " > /dcos/"... | java | @Then("^I modify marathon environment variable '(.+?)' with value '(.+?)' for service '(.+?)'?$")
public void setMarathonProperty(String key, String value, String service) throws Exception {
commonspec.runCommandAndGetResult("touch " + service + "-env.json && dcos marathon app show " + service + " > /dcos/"... | [
"@",
"Then",
"(",
"\"^I modify marathon environment variable '(.+?)' with value '(.+?)' for service '(.+?)'?$\"",
")",
"public",
"void",
"setMarathonProperty",
"(",
"String",
"key",
",",
"String",
"value",
",",
"String",
"service",
")",
"throws",
"Exception",
"{",
"commonsp... | Set a environment variable in marathon and deploy again.
@param key
@param value
@param service
@throws Exception | [
"Set",
"a",
"environment",
"variable",
"in",
"marathon",
"and",
"deploy",
"again",
"."
] | 55324d19e7497764ad3dd7139923e13eb9841d75 | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/DcosSpec.java#L436-L449 |
100,038 | Stratio/bdt | src/main/java/com/stratio/qa/specs/DcosSpec.java | DcosSpec.serviceStatusCheck | @Then("^service '(.+?)' status in cluster '(.+?)' is '(suspended|running|deploying)'( in less than '(\\d+?)' seconds checking every '(\\d+?)' seconds)?")
public void serviceStatusCheck(String service, String cluster, String status, String foo, Integer totalWait, Integer interval) throws Exception {
String r... | java | @Then("^service '(.+?)' status in cluster '(.+?)' is '(suspended|running|deploying)'( in less than '(\\d+?)' seconds checking every '(\\d+?)' seconds)?")
public void serviceStatusCheck(String service, String cluster, String status, String foo, Integer totalWait, Integer interval) throws Exception {
String r... | [
"@",
"Then",
"(",
"\"^service '(.+?)' status in cluster '(.+?)' is '(suspended|running|deploying)'( in less than '(\\\\d+?)' seconds checking every '(\\\\d+?)' seconds)?\"",
")",
"public",
"void",
"serviceStatusCheck",
"(",
"String",
"service",
",",
"String",
"cluster",
",",
"String",
... | Check service status has value specified
@param service name of the service to be checked
@param cluster URI of the cluster
@param status status expected
@throws Exception exception * | [
"Check",
"service",
"status",
"has",
"value",
"specified"
] | 55324d19e7497764ad3dd7139923e13eb9841d75 | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/DcosSpec.java#L459-L479 |
100,039 | Stratio/bdt | src/main/java/com/stratio/qa/specs/DcosSpec.java | DcosSpec.checkComponentConstraints | @Then("^The role '(.+?)' of the service '(.+?)' with instance '(.+?)' complies the constraints '(.+?)'$")
public void checkComponentConstraints(String role, String service, String instance, String constraints) throws Exception {
checkComponentConstraint(role, service, instance, constraints.split(","));
... | java | @Then("^The role '(.+?)' of the service '(.+?)' with instance '(.+?)' complies the constraints '(.+?)'$")
public void checkComponentConstraints(String role, String service, String instance, String constraints) throws Exception {
checkComponentConstraint(role, service, instance, constraints.split(","));
... | [
"@",
"Then",
"(",
"\"^The role '(.+?)' of the service '(.+?)' with instance '(.+?)' complies the constraints '(.+?)'$\"",
")",
"public",
"void",
"checkComponentConstraints",
"(",
"String",
"role",
",",
"String",
"service",
",",
"String",
"instance",
",",
"String",
"constraints"... | Check if a role of a service complies the established constraints
@param role name of role of a service
@param service name of service of exhibitor
@param instance name of instance of a service
@param constraints all stablished contraints separated by a semicolumn.
Example: constraint1,constraint2,...
@t... | [
"Check",
"if",
"a",
"role",
"of",
"a",
"service",
"complies",
"the",
"established",
"constraints"
] | 55324d19e7497764ad3dd7139923e13eb9841d75 | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/DcosSpec.java#L536-L539 |
100,040 | Stratio/bdt | src/main/java/com/stratio/qa/specs/CommandExecutionSpec.java | CommandExecutionSpec.openSSHConnection | @Given("^I open a ssh connection to '(.+?)'( in port '(.+?)')? with user '(.+?)'( and password '(.+?)')?( using pem file '(.+?)')?$")
public void openSSHConnection(String remoteHost, String tmp, String remotePort, String user, String foo, String password, String bar, String pemFile) throws Exception {
if ((... | java | @Given("^I open a ssh connection to '(.+?)'( in port '(.+?)')? with user '(.+?)'( and password '(.+?)')?( using pem file '(.+?)')?$")
public void openSSHConnection(String remoteHost, String tmp, String remotePort, String user, String foo, String password, String bar, String pemFile) throws Exception {
if ((... | [
"@",
"Given",
"(",
"\"^I open a ssh connection to '(.+?)'( in port '(.+?)')? with user '(.+?)'( and password '(.+?)')?( using pem file '(.+?)')?$\"",
")",
"public",
"void",
"openSSHConnection",
"(",
"String",
"remoteHost",
",",
"String",
"tmp",
",",
"String",
"remotePort",
",",
"... | Opens a ssh connection to remote host
@param remoteHost remote host
@param user remote user
@param password (required if pemFile null)
@param pemFile (required if password null)
@throws Exception exception | [
"Opens",
"a",
"ssh",
"connection",
"to",
"remote",
"host"
] | 55324d19e7497764ad3dd7139923e13eb9841d75 | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/CommandExecutionSpec.java#L52-L68 |
100,041 | Stratio/bdt | src/main/java/com/stratio/qa/specs/CommandExecutionSpec.java | CommandExecutionSpec.executeLocalCommand | @Given("^I run '(.+?)' locally( with exit status '(.+?)')?( and save the value in environment variable '(.+?)')?$")
public void executeLocalCommand(String command, String foo, Integer exitStatus, String bar, String envVar) throws Exception {
if (exitStatus == null) {
exitStatus = 0;
}
... | java | @Given("^I run '(.+?)' locally( with exit status '(.+?)')?( and save the value in environment variable '(.+?)')?$")
public void executeLocalCommand(String command, String foo, Integer exitStatus, String bar, String envVar) throws Exception {
if (exitStatus == null) {
exitStatus = 0;
}
... | [
"@",
"Given",
"(",
"\"^I run '(.+?)' locally( with exit status '(.+?)')?( and save the value in environment variable '(.+?)')?$\"",
")",
"public",
"void",
"executeLocalCommand",
"(",
"String",
"command",
",",
"String",
"foo",
",",
"Integer",
"exitStatus",
",",
"String",
"bar",
... | Executes the command specified in local system
@param command command to be run locally
@param foo regex needed to match method
@param exitStatus command exit status
@param bar regex needed to match method
@param envVar environment variable name
@throws Exception exception | [
"Executes",
"the",
"command",
"specified",
"in",
"local",
"system"
] | 55324d19e7497764ad3dd7139923e13eb9841d75 | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/CommandExecutionSpec.java#L107-L117 |
100,042 | Stratio/bdt | src/main/java/com/stratio/qa/specs/CommandExecutionSpec.java | CommandExecutionSpec.findShellOutput | @Then("^the command output contains '(.+?)'$")
public void findShellOutput(String search) throws Exception {
assertThat(commonspec.getCommandResult()).as("Contains " + search + ".").contains(search);
} | java | @Then("^the command output contains '(.+?)'$")
public void findShellOutput(String search) throws Exception {
assertThat(commonspec.getCommandResult()).as("Contains " + search + ".").contains(search);
} | [
"@",
"Then",
"(",
"\"^the command output contains '(.+?)'$\"",
")",
"public",
"void",
"findShellOutput",
"(",
"String",
"search",
")",
"throws",
"Exception",
"{",
"assertThat",
"(",
"commonspec",
".",
"getCommandResult",
"(",
")",
")",
".",
"as",
"(",
"\"Contains ... | Check the existence of a text at a command output
@param search | [
"Check",
"the",
"existence",
"of",
"a",
"text",
"at",
"a",
"command",
"output"
] | 55324d19e7497764ad3dd7139923e13eb9841d75 | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/CommandExecutionSpec.java#L187-L190 |
100,043 | Stratio/bdt | src/main/java/com/stratio/qa/specs/CommandExecutionSpec.java | CommandExecutionSpec.notFindShellOutput | @Then("^the command output does not contain '(.+?)'$")
public void notFindShellOutput(String search) throws Exception {
assertThat(commonspec.getCommandResult()).as("NotContains " + search + ".").doesNotContain(search);
} | java | @Then("^the command output does not contain '(.+?)'$")
public void notFindShellOutput(String search) throws Exception {
assertThat(commonspec.getCommandResult()).as("NotContains " + search + ".").doesNotContain(search);
} | [
"@",
"Then",
"(",
"\"^the command output does not contain '(.+?)'$\"",
")",
"public",
"void",
"notFindShellOutput",
"(",
"String",
"search",
")",
"throws",
"Exception",
"{",
"assertThat",
"(",
"commonspec",
".",
"getCommandResult",
"(",
")",
")",
".",
"as",
"(",
"... | Check the non existence of a text at a command output
@param search | [
"Check",
"the",
"non",
"existence",
"of",
"a",
"text",
"at",
"a",
"command",
"output"
] | 55324d19e7497764ad3dd7139923e13eb9841d75 | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/CommandExecutionSpec.java#L206-L209 |
100,044 | Stratio/bdt | src/main/java/com/stratio/qa/specs/CommandExecutionSpec.java | CommandExecutionSpec.checkShellExitStatus | @Deprecated
@Then("^the command exit status is '(.+?)'$")
public void checkShellExitStatus(int expectedExitStatus) throws Exception {
assertThat(commonspec.getCommandExitStatus()).as("Is equal to " + expectedExitStatus + ".").isEqualTo(expectedExitStatus);
} | java | @Deprecated
@Then("^the command exit status is '(.+?)'$")
public void checkShellExitStatus(int expectedExitStatus) throws Exception {
assertThat(commonspec.getCommandExitStatus()).as("Is equal to " + expectedExitStatus + ".").isEqualTo(expectedExitStatus);
} | [
"@",
"Deprecated",
"@",
"Then",
"(",
"\"^the command exit status is '(.+?)'$\"",
")",
"public",
"void",
"checkShellExitStatus",
"(",
"int",
"expectedExitStatus",
")",
"throws",
"Exception",
"{",
"assertThat",
"(",
"commonspec",
".",
"getCommandExitStatus",
"(",
")",
"... | Check the exitStatus of previous command execution matches the expected one
@param expectedExitStatus
@deprecated Success exit status is directly checked in the "execute remote command" method, so this is not
needed anymore. | [
"Check",
"the",
"exitStatus",
"of",
"previous",
"command",
"execution",
"matches",
"the",
"expected",
"one"
] | 55324d19e7497764ad3dd7139923e13eb9841d75 | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/CommandExecutionSpec.java#L218-L222 |
100,045 | Stratio/bdt | src/main/java/com/stratio/qa/specs/DatabaseSpec.java | DatabaseSpec.createBasicMapping | @Given("^I create a Cassandra index named '(.+?)' in table '(.+?)' using magic_column '(.+?)' using keyspace '(.+?)'$")
public void createBasicMapping(String index_name, String table, String column, String keyspace) throws Exception {
String query = "CREATE INDEX " + index_name + " ON " + table + " (" + col... | java | @Given("^I create a Cassandra index named '(.+?)' in table '(.+?)' using magic_column '(.+?)' using keyspace '(.+?)'$")
public void createBasicMapping(String index_name, String table, String column, String keyspace) throws Exception {
String query = "CREATE INDEX " + index_name + " ON " + table + " (" + col... | [
"@",
"Given",
"(",
"\"^I create a Cassandra index named '(.+?)' in table '(.+?)' using magic_column '(.+?)' using keyspace '(.+?)'$\"",
")",
"public",
"void",
"createBasicMapping",
"(",
"String",
"index_name",
",",
"String",
"table",
",",
"String",
"column",
",",
"String",
"key... | Create a basic Index.
@param index_name index name
@param table the table where index will be created.
@param column the column where index will be saved
@param keyspace keyspace used
@throws Exception exception | [
"Create",
"a",
"basic",
"Index",
"."
] | 55324d19e7497764ad3dd7139923e13eb9841d75 | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/DatabaseSpec.java#L80-L84 |
100,046 | Stratio/bdt | src/main/java/com/stratio/qa/specs/DatabaseSpec.java | DatabaseSpec.connect | @Given("^I( securely)? connect to '(Cassandra|Mongo|Elasticsearch)' cluster at '(.+)'$")
public void connect(String secured, String clusterType, String url) throws DBException, UnknownHostException {
switch (clusterType) {
case "Cassandra":
commonspec.getCassandraClient().setHost... | java | @Given("^I( securely)? connect to '(Cassandra|Mongo|Elasticsearch)' cluster at '(.+)'$")
public void connect(String secured, String clusterType, String url) throws DBException, UnknownHostException {
switch (clusterType) {
case "Cassandra":
commonspec.getCassandraClient().setHost... | [
"@",
"Given",
"(",
"\"^I( securely)? connect to '(Cassandra|Mongo|Elasticsearch)' cluster at '(.+)'$\"",
")",
"public",
"void",
"connect",
"(",
"String",
"secured",
",",
"String",
"clusterType",
",",
"String",
"url",
")",
"throws",
"DBException",
",",
"UnknownHostException"... | Connect to cluster.
@param clusterType DB type (Cassandra|Mongo|Elasticsearch)
@param url url where is started Cassandra cluster | [
"Connect",
"to",
"cluster",
"."
] | 55324d19e7497764ad3dd7139923e13eb9841d75 | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/DatabaseSpec.java#L102-L121 |
100,047 | Stratio/bdt | src/main/java/com/stratio/qa/specs/DatabaseSpec.java | DatabaseSpec.connectToElasticSearch | @Given("^I connect to Elasticsearch cluster at host '(.+?)'( using native port '(.+?)')?( using cluster name '(.+?)')?$")
public void connectToElasticSearch(String host, String foo, String nativePort, String bar, String clusterName) throws DBException, UnknownHostException, NumberFormatException {
LinkedHas... | java | @Given("^I connect to Elasticsearch cluster at host '(.+?)'( using native port '(.+?)')?( using cluster name '(.+?)')?$")
public void connectToElasticSearch(String host, String foo, String nativePort, String bar, String clusterName) throws DBException, UnknownHostException, NumberFormatException {
LinkedHas... | [
"@",
"Given",
"(",
"\"^I connect to Elasticsearch cluster at host '(.+?)'( using native port '(.+?)')?( using cluster name '(.+?)')?$\"",
")",
"public",
"void",
"connectToElasticSearch",
"(",
"String",
"host",
",",
"String",
"foo",
",",
"String",
"nativePort",
",",
"String",
"b... | Connect to ElasticSearch using custom parameters
@param host ES host
@param foo regex needed to match method
@param nativePort ES port
@param bar regex needed to match method
@param clusterName ES clustername
@throws DBException exception
@throws UnknownHostException exception
@throw... | [
"Connect",
"to",
"ElasticSearch",
"using",
"custom",
"parameters"
] | 55324d19e7497764ad3dd7139923e13eb9841d75 | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/DatabaseSpec.java#L135-L151 |
100,048 | Stratio/bdt | src/main/java/com/stratio/qa/specs/DatabaseSpec.java | DatabaseSpec.saveElasticCluster | @Given("^I obtain elasticsearch cluster name in '([^:]+?)(:.+?)?' and save it in variable '(.+?)'?$")
public void saveElasticCluster(String host, String port, String envVar) throws Exception {
commonspec.setRestProtocol("http://");
commonspec.setRestHost(host);
commonspec.setRestPort(port);... | java | @Given("^I obtain elasticsearch cluster name in '([^:]+?)(:.+?)?' and save it in variable '(.+?)'?$")
public void saveElasticCluster(String host, String port, String envVar) throws Exception {
commonspec.setRestProtocol("http://");
commonspec.setRestHost(host);
commonspec.setRestPort(port);... | [
"@",
"Given",
"(",
"\"^I obtain elasticsearch cluster name in '([^:]+?)(:.+?)?' and save it in variable '(.+?)'?$\"",
")",
"public",
"void",
"saveElasticCluster",
"(",
"String",
"host",
",",
"String",
"port",
",",
"String",
"envVar",
")",
"throws",
"Exception",
"{",
"common... | Save clustername of elasticsearch in an environment varible for future use.
@param host elasticsearch connection
@param port elasticsearch port
@param envVar thread variable where to store the value
@throws IllegalAccessException exception
@throws IllegalArgumentException exception
@throws SecurityException ... | [
"Save",
"clustername",
"of",
"elasticsearch",
"in",
"an",
"environment",
"varible",
"for",
"future",
"use",
"."
] | 55324d19e7497764ad3dd7139923e13eb9841d75 | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/DatabaseSpec.java#L229-L254 |
100,049 | Stratio/bdt | src/main/java/com/stratio/qa/specs/DatabaseSpec.java | DatabaseSpec.insertOnMongoTable | @Given("^I insert into a MongoDB database '(.+?)' and table '(.+?)' this values:$")
public void insertOnMongoTable(String dataBase, String tabName, DataTable table) {
commonspec.getMongoDBClient().connectToMongoDBDataBase(dataBase);
commonspec.getMongoDBClient().insertIntoMongoDBCollection(tabName, ... | java | @Given("^I insert into a MongoDB database '(.+?)' and table '(.+?)' this values:$")
public void insertOnMongoTable(String dataBase, String tabName, DataTable table) {
commonspec.getMongoDBClient().connectToMongoDBDataBase(dataBase);
commonspec.getMongoDBClient().insertIntoMongoDBCollection(tabName, ... | [
"@",
"Given",
"(",
"\"^I insert into a MongoDB database '(.+?)' and table '(.+?)' this values:$\"",
")",
"public",
"void",
"insertOnMongoTable",
"(",
"String",
"dataBase",
",",
"String",
"tabName",
",",
"DataTable",
"table",
")",
"{",
"commonspec",
".",
"getMongoDBClient",
... | Insert data in a MongoDB table.
@param dataBase Mongo database
@param tabName Mongo table
@param table Datatable used for insert elements | [
"Insert",
"data",
"in",
"a",
"MongoDB",
"table",
"."
] | 55324d19e7497764ad3dd7139923e13eb9841d75 | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/DatabaseSpec.java#L313-L317 |
100,050 | Stratio/bdt | src/main/java/com/stratio/qa/specs/DatabaseSpec.java | DatabaseSpec.truncateTableInMongo | @Given("^I drop every document at a MongoDB database '(.+?)' and table '(.+?)'")
public void truncateTableInMongo(String database, String table) {
commonspec.getMongoDBClient().connectToMongoDBDataBase(database);
commonspec.getMongoDBClient().dropAllDataMongoDBCollection(table);
} | java | @Given("^I drop every document at a MongoDB database '(.+?)' and table '(.+?)'")
public void truncateTableInMongo(String database, String table) {
commonspec.getMongoDBClient().connectToMongoDBDataBase(database);
commonspec.getMongoDBClient().dropAllDataMongoDBCollection(table);
} | [
"@",
"Given",
"(",
"\"^I drop every document at a MongoDB database '(.+?)' and table '(.+?)'\"",
")",
"public",
"void",
"truncateTableInMongo",
"(",
"String",
"database",
",",
"String",
"table",
")",
"{",
"commonspec",
".",
"getMongoDBClient",
"(",
")",
".",
"connectToMon... | Truncate table in MongoDB.
@param database Mongo database
@param table Mongo table | [
"Truncate",
"table",
"in",
"MongoDB",
"."
] | 55324d19e7497764ad3dd7139923e13eb9841d75 | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/DatabaseSpec.java#L325-L329 |
100,051 | Stratio/bdt | src/main/java/com/stratio/qa/specs/DatabaseSpec.java | DatabaseSpec.insertOnMongoTable | @Given("^I insert into MongoDB database '(.+?)' and collection '(.+?)' the document from schema '(.+?)'$")
public void insertOnMongoTable(String dataBase, String collection, String document) throws Exception {
String retrievedDoc = commonspec.retrieveData(document, "json");
commonspec.getMongoDBClie... | java | @Given("^I insert into MongoDB database '(.+?)' and collection '(.+?)' the document from schema '(.+?)'$")
public void insertOnMongoTable(String dataBase, String collection, String document) throws Exception {
String retrievedDoc = commonspec.retrieveData(document, "json");
commonspec.getMongoDBClie... | [
"@",
"Given",
"(",
"\"^I insert into MongoDB database '(.+?)' and collection '(.+?)' the document from schema '(.+?)'$\"",
")",
"public",
"void",
"insertOnMongoTable",
"(",
"String",
"dataBase",
",",
"String",
"collection",
",",
"String",
"document",
")",
"throws",
"Exception",... | Insert document in a MongoDB table.
@param dataBase Mongo database
@param collection Mongo collection
@param document document used for schema | [
"Insert",
"document",
"in",
"a",
"MongoDB",
"table",
"."
] | 55324d19e7497764ad3dd7139923e13eb9841d75 | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/DatabaseSpec.java#L338-L343 |
100,052 | Stratio/bdt | src/main/java/com/stratio/qa/specs/DatabaseSpec.java | DatabaseSpec.sendQueryOfType | @When("^I execute a query over fields '(.+?)' with schema '(.+?)' of type '(json|string)' with magic_column '(.+?)' from table: '(.+?)' using keyspace: '(.+?)' with:$")
public void sendQueryOfType(String fields, String schema, String type, String magic_column, String table, String keyspace, DataTable modifications)... | java | @When("^I execute a query over fields '(.+?)' with schema '(.+?)' of type '(json|string)' with magic_column '(.+?)' from table: '(.+?)' using keyspace: '(.+?)' with:$")
public void sendQueryOfType(String fields, String schema, String type, String magic_column, String table, String keyspace, DataTable modifications)... | [
"@",
"When",
"(",
"\"^I execute a query over fields '(.+?)' with schema '(.+?)' of type '(json|string)' with magic_column '(.+?)' from table: '(.+?)' using keyspace: '(.+?)' with:$\"",
")",
"public",
"void",
"sendQueryOfType",
"(",
"String",
"fields",
",",
"String",
"schema",
",",
"Str... | Execute a query with schema over a cluster
@param fields columns on which the query is executed. Example: "latitude,longitude" or "*" or "count(*)"
@param schema the file of configuration (.conf) with the options of mappin. If schema is the word "empty", method will not add a where clause.
@param type ... | [
"Execute",
"a",
"query",
"with",
"schema",
"over",
"a",
"cluster"
] | 55324d19e7497764ad3dd7139923e13eb9841d75 | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/DatabaseSpec.java#L389-L424 |
100,053 | Stratio/bdt | src/main/java/com/stratio/qa/specs/DatabaseSpec.java | DatabaseSpec.elasticSearchQueryWithFilter | @When("^I execute an elasticsearch query over index '(.*?)' and mapping '(.*?)' and column '(.*?)' with value '(.*?)' to '(.*?)'$")
public void elasticSearchQueryWithFilter(String indexName, String mappingName, String
columnName, String filterType, String value) {
try {
commonspec.se... | java | @When("^I execute an elasticsearch query over index '(.*?)' and mapping '(.*?)' and column '(.*?)' with value '(.*?)' to '(.*?)'$")
public void elasticSearchQueryWithFilter(String indexName, String mappingName, String
columnName, String filterType, String value) {
try {
commonspec.se... | [
"@",
"When",
"(",
"\"^I execute an elasticsearch query over index '(.*?)' and mapping '(.*?)' and column '(.*?)' with value '(.*?)' to '(.*?)'$\"",
")",
"public",
"void",
"elasticSearchQueryWithFilter",
"(",
"String",
"indexName",
",",
"String",
"mappingName",
",",
"String",
"columnN... | Execute query with filter over elasticsearch
@param indexName
@param mappingName
@param columnName
@param filterType it could be equals, gt, gte, lt and lte.
@param value value of the column to be filtered. | [
"Execute",
"query",
"with",
"filter",
"over",
"elasticsearch"
] | 55324d19e7497764ad3dd7139923e13eb9841d75 | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/DatabaseSpec.java#L459-L474 |
100,054 | Stratio/bdt | src/main/java/com/stratio/qa/specs/DatabaseSpec.java | DatabaseSpec.createCustomMapping | @When("^I create a Cassandra index named '(.+?)' with schema '(.+?)' of type '(json|string)' in table '(.+?)' using magic_column '(.+?)' using keyspace '(.+?)' with:$")
public void createCustomMapping(String index_name, String schema, String type, String table, String magic_column, String keyspace, DataTable modifi... | java | @When("^I create a Cassandra index named '(.+?)' with schema '(.+?)' of type '(json|string)' in table '(.+?)' using magic_column '(.+?)' using keyspace '(.+?)' with:$")
public void createCustomMapping(String index_name, String schema, String type, String table, String magic_column, String keyspace, DataTable modifi... | [
"@",
"When",
"(",
"\"^I create a Cassandra index named '(.+?)' with schema '(.+?)' of type '(json|string)' in table '(.+?)' using magic_column '(.+?)' using keyspace '(.+?)' with:$\"",
")",
"public",
"void",
"createCustomMapping",
"(",
"String",
"index_name",
",",
"String",
"schema",
","... | Create a Cassandra index.
@param index_name index name
@param schema the file of configuration (.conf) with the options of mappin
@param type type of the changes in schema (string or json)
@param table table for create the index
@param magic_column magic column where index will be saved
@pa... | [
"Create",
"a",
"Cassandra",
"index",
"."
] | 55324d19e7497764ad3dd7139923e13eb9841d75 | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/DatabaseSpec.java#L488-L496 |
100,055 | Stratio/bdt | src/main/java/com/stratio/qa/specs/DatabaseSpec.java | DatabaseSpec.createElasticsearchIndex | @When("^I create an elasticsearch index named '(.+?)'( removing existing index if exist)?$")
public void createElasticsearchIndex(String index, String removeIndex) {
if (removeIndex != null && commonspec.getElasticSearchClient().indexExists(index)) {
commonspec.getElasticSearchClient().dropSingl... | java | @When("^I create an elasticsearch index named '(.+?)'( removing existing index if exist)?$")
public void createElasticsearchIndex(String index, String removeIndex) {
if (removeIndex != null && commonspec.getElasticSearchClient().indexExists(index)) {
commonspec.getElasticSearchClient().dropSingl... | [
"@",
"When",
"(",
"\"^I create an elasticsearch index named '(.+?)'( removing existing index if exist)?$\"",
")",
"public",
"void",
"createElasticsearchIndex",
"(",
"String",
"index",
",",
"String",
"removeIndex",
")",
"{",
"if",
"(",
"removeIndex",
"!=",
"null",
"&&",
"c... | Create an elasticsearch index.
@param index | [
"Create",
"an",
"elasticsearch",
"index",
"."
] | 55324d19e7497764ad3dd7139923e13eb9841d75 | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/DatabaseSpec.java#L539-L545 |
100,056 | Stratio/bdt | src/main/java/com/stratio/qa/specs/DatabaseSpec.java | DatabaseSpec.indexElasticsearchDocument | @When("^I index a document in the index named '(.+?)' using the mapping named '(.+?)' with key '(.+?)' and value '(.+?)'$")
public void indexElasticsearchDocument(String indexName, String mappingName, String key, String value) throws Exception {
ArrayList<XContentBuilder> mappingsource = new ArrayList<XCont... | java | @When("^I index a document in the index named '(.+?)' using the mapping named '(.+?)' with key '(.+?)' and value '(.+?)'$")
public void indexElasticsearchDocument(String indexName, String mappingName, String key, String value) throws Exception {
ArrayList<XContentBuilder> mappingsource = new ArrayList<XCont... | [
"@",
"When",
"(",
"\"^I index a document in the index named '(.+?)' using the mapping named '(.+?)' with key '(.+?)' and value '(.+?)'$\"",
")",
"public",
"void",
"indexElasticsearchDocument",
"(",
"String",
"indexName",
",",
"String",
"mappingName",
",",
"String",
"key",
",",
"S... | Index a document within a mapping type.
@param indexName
@param mappingName
@param key
@param value
@throws Exception | [
"Index",
"a",
"document",
"within",
"a",
"mapping",
"type",
"."
] | 55324d19e7497764ad3dd7139923e13eb9841d75 | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/DatabaseSpec.java#L556-L562 |
100,057 | Stratio/bdt | src/main/java/com/stratio/qa/specs/DatabaseSpec.java | DatabaseSpec.assertKeyspaceOnCassandraExists | @Then("^a Cassandra keyspace '(.+?)' exists$")
public void assertKeyspaceOnCassandraExists(String keyspace) {
assertThat(commonspec.getCassandraClient().getKeyspaces()).as("The keyspace " + keyspace + " exists on cassandra").contains(keyspace);
} | java | @Then("^a Cassandra keyspace '(.+?)' exists$")
public void assertKeyspaceOnCassandraExists(String keyspace) {
assertThat(commonspec.getCassandraClient().getKeyspaces()).as("The keyspace " + keyspace + " exists on cassandra").contains(keyspace);
} | [
"@",
"Then",
"(",
"\"^a Cassandra keyspace '(.+?)' exists$\"",
")",
"public",
"void",
"assertKeyspaceOnCassandraExists",
"(",
"String",
"keyspace",
")",
"{",
"assertThat",
"(",
"commonspec",
".",
"getCassandraClient",
"(",
")",
".",
"getKeyspaces",
"(",
")",
")",
".... | Checks if a keyspaces exists in Cassandra.
@param keyspace | [
"Checks",
"if",
"a",
"keyspaces",
"exists",
"in",
"Cassandra",
"."
] | 55324d19e7497764ad3dd7139923e13eb9841d75 | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/DatabaseSpec.java#L636-L639 |
100,058 | Stratio/bdt | src/main/java/com/stratio/qa/specs/DatabaseSpec.java | DatabaseSpec.assertKeyspaceOnCassandraDoesNotExist | @Then("^a Cassandra keyspace '(.+?)' does not exist$")
public void assertKeyspaceOnCassandraDoesNotExist(String keyspace) {
assertThat(commonspec.getCassandraClient().getKeyspaces()).as("The keyspace " + keyspace + " does not exist on cassandra").doesNotContain(keyspace);
} | java | @Then("^a Cassandra keyspace '(.+?)' does not exist$")
public void assertKeyspaceOnCassandraDoesNotExist(String keyspace) {
assertThat(commonspec.getCassandraClient().getKeyspaces()).as("The keyspace " + keyspace + " does not exist on cassandra").doesNotContain(keyspace);
} | [
"@",
"Then",
"(",
"\"^a Cassandra keyspace '(.+?)' does not exist$\"",
")",
"public",
"void",
"assertKeyspaceOnCassandraDoesNotExist",
"(",
"String",
"keyspace",
")",
"{",
"assertThat",
"(",
"commonspec",
".",
"getCassandraClient",
"(",
")",
".",
"getKeyspaces",
"(",
")... | Checks a keyspace does not exist in Cassandra.
@param keyspace | [
"Checks",
"a",
"keyspace",
"does",
"not",
"exist",
"in",
"Cassandra",
"."
] | 55324d19e7497764ad3dd7139923e13eb9841d75 | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/DatabaseSpec.java#L646-L649 |
100,059 | Stratio/bdt | src/main/java/com/stratio/qa/specs/DatabaseSpec.java | DatabaseSpec.assertTableExistsOnCassandraKeyspace | @Then("^a Cassandra keyspace '(.+?)' contains a table '(.+?)'$")
public void assertTableExistsOnCassandraKeyspace(String keyspace, String tableName) {
assertThat(commonspec.getCassandraClient().getTables(keyspace)).as("The table " + tableName + "exists on cassandra").contains(tableName);
} | java | @Then("^a Cassandra keyspace '(.+?)' contains a table '(.+?)'$")
public void assertTableExistsOnCassandraKeyspace(String keyspace, String tableName) {
assertThat(commonspec.getCassandraClient().getTables(keyspace)).as("The table " + tableName + "exists on cassandra").contains(tableName);
} | [
"@",
"Then",
"(",
"\"^a Cassandra keyspace '(.+?)' contains a table '(.+?)'$\"",
")",
"public",
"void",
"assertTableExistsOnCassandraKeyspace",
"(",
"String",
"keyspace",
",",
"String",
"tableName",
")",
"{",
"assertThat",
"(",
"commonspec",
".",
"getCassandraClient",
"(",
... | Checks if a cassandra keyspace contains a table.
@param keyspace
@param tableName | [
"Checks",
"if",
"a",
"cassandra",
"keyspace",
"contains",
"a",
"table",
"."
] | 55324d19e7497764ad3dd7139923e13eb9841d75 | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/DatabaseSpec.java#L657-L660 |
100,060 | Stratio/bdt | src/main/java/com/stratio/qa/specs/DatabaseSpec.java | DatabaseSpec.assertTableDoesNotExistOnCassandraKeyspace | @Then("^a Cassandra keyspace '(.+?)' does not contain a table '(.+?)'$")
public void assertTableDoesNotExistOnCassandraKeyspace(String keyspace, String tableName) {
assertThat(commonspec.getCassandraClient().getTables(keyspace)).as("The table " + tableName + "exists on cassandra").doesNotContain(tableName);... | java | @Then("^a Cassandra keyspace '(.+?)' does not contain a table '(.+?)'$")
public void assertTableDoesNotExistOnCassandraKeyspace(String keyspace, String tableName) {
assertThat(commonspec.getCassandraClient().getTables(keyspace)).as("The table " + tableName + "exists on cassandra").doesNotContain(tableName);... | [
"@",
"Then",
"(",
"\"^a Cassandra keyspace '(.+?)' does not contain a table '(.+?)'$\"",
")",
"public",
"void",
"assertTableDoesNotExistOnCassandraKeyspace",
"(",
"String",
"keyspace",
",",
"String",
"tableName",
")",
"{",
"assertThat",
"(",
"commonspec",
".",
"getCassandraCl... | Checks a cassandra keyspace does not contain a table.
@param keyspace
@param tableName | [
"Checks",
"a",
"cassandra",
"keyspace",
"does",
"not",
"contain",
"a",
"table",
"."
] | 55324d19e7497764ad3dd7139923e13eb9841d75 | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/DatabaseSpec.java#L668-L671 |
100,061 | Stratio/bdt | src/main/java/com/stratio/qa/specs/DatabaseSpec.java | DatabaseSpec.assertRowNumberOfTableOnCassandraKeyspace | @Then("^a Cassandra keyspace '(.+?)' contains a table '(.+?)' with '(.+?)' rows$")
public void assertRowNumberOfTableOnCassandraKeyspace(String keyspace, String tableName, String numberRows) {
Long numberRowsLong = Long.parseLong(numberRows);
commonspec.getCassandraClient().useKeyspace(keyspace);
... | java | @Then("^a Cassandra keyspace '(.+?)' contains a table '(.+?)' with '(.+?)' rows$")
public void assertRowNumberOfTableOnCassandraKeyspace(String keyspace, String tableName, String numberRows) {
Long numberRowsLong = Long.parseLong(numberRows);
commonspec.getCassandraClient().useKeyspace(keyspace);
... | [
"@",
"Then",
"(",
"\"^a Cassandra keyspace '(.+?)' contains a table '(.+?)' with '(.+?)' rows$\"",
")",
"public",
"void",
"assertRowNumberOfTableOnCassandraKeyspace",
"(",
"String",
"keyspace",
",",
"String",
"tableName",
",",
"String",
"numberRows",
")",
"{",
"Long",
"number... | Checks the number of rows in a cassandra table.
@param keyspace
@param tableName
@param numberRows | [
"Checks",
"the",
"number",
"of",
"rows",
"in",
"a",
"cassandra",
"table",
"."
] | 55324d19e7497764ad3dd7139923e13eb9841d75 | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/DatabaseSpec.java#L680-L686 |
100,062 | Stratio/bdt | src/main/java/com/stratio/qa/specs/DatabaseSpec.java | DatabaseSpec.assertValuesOfTable | @Then("^a Cassandra keyspace '(.+?)' contains a table '(.+?)' with values:$")
public void assertValuesOfTable(String keyspace, String tableName, DataTable data) throws InterruptedException {
// USE of Keyspace
commonspec.getCassandraClient().useKeyspace(keyspace);
// Obtain the types and co... | java | @Then("^a Cassandra keyspace '(.+?)' contains a table '(.+?)' with values:$")
public void assertValuesOfTable(String keyspace, String tableName, DataTable data) throws InterruptedException {
// USE of Keyspace
commonspec.getCassandraClient().useKeyspace(keyspace);
// Obtain the types and co... | [
"@",
"Then",
"(",
"\"^a Cassandra keyspace '(.+?)' contains a table '(.+?)' with values:$\"",
")",
"public",
"void",
"assertValuesOfTable",
"(",
"String",
"keyspace",
",",
"String",
"tableName",
",",
"DataTable",
"data",
")",
"throws",
"InterruptedException",
"{",
"// USE ... | Checks if a cassandra table contains the values of a DataTable.
@param keyspace
@param tableName
@param data
@throws InterruptedException | [
"Checks",
"if",
"a",
"cassandra",
"table",
"contains",
"the",
"values",
"of",
"a",
"DataTable",
"."
] | 55324d19e7497764ad3dd7139923e13eb9841d75 | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/DatabaseSpec.java#L696-L720 |
100,063 | Stratio/bdt | src/main/java/com/stratio/qa/specs/DatabaseSpec.java | DatabaseSpec.assertValuesOfTableMongo | @Then("^a Mongo dataBase '(.+?)' contains a table '(.+?)' with values:")
public void assertValuesOfTableMongo(String dataBase, String tableName, DataTable data) {
commonspec.getMongoDBClient().connectToMongoDBDataBase(dataBase);
ArrayList<DBObject> result = (ArrayList<DBObject>) commonspec.getMongoD... | java | @Then("^a Mongo dataBase '(.+?)' contains a table '(.+?)' with values:")
public void assertValuesOfTableMongo(String dataBase, String tableName, DataTable data) {
commonspec.getMongoDBClient().connectToMongoDBDataBase(dataBase);
ArrayList<DBObject> result = (ArrayList<DBObject>) commonspec.getMongoD... | [
"@",
"Then",
"(",
"\"^a Mongo dataBase '(.+?)' contains a table '(.+?)' with values:\"",
")",
"public",
"void",
"assertValuesOfTableMongo",
"(",
"String",
"dataBase",
",",
"String",
"tableName",
",",
"DataTable",
"data",
")",
"{",
"commonspec",
".",
"getMongoDBClient",
"(... | Checks the values of a MongoDB table.
@param dataBase
@param tableName
@param data | [
"Checks",
"the",
"values",
"of",
"a",
"MongoDB",
"table",
"."
] | 55324d19e7497764ad3dd7139923e13eb9841d75 | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/DatabaseSpec.java#L786-L793 |
100,064 | Stratio/bdt | src/main/java/com/stratio/qa/specs/DatabaseSpec.java | DatabaseSpec.aMongoDataBaseContainsaTable | @Then("^a Mongo dataBase '(.+?)' doesnt contains a table '(.+?)'$")
public void aMongoDataBaseContainsaTable(String database, String tableName) {
commonspec.getMongoDBClient().connectToMongoDBDataBase(database);
Set<String> collectionsNames = commonspec.getMongoDBClient().getMongoDBCollections();
... | java | @Then("^a Mongo dataBase '(.+?)' doesnt contains a table '(.+?)'$")
public void aMongoDataBaseContainsaTable(String database, String tableName) {
commonspec.getMongoDBClient().connectToMongoDBDataBase(database);
Set<String> collectionsNames = commonspec.getMongoDBClient().getMongoDBCollections();
... | [
"@",
"Then",
"(",
"\"^a Mongo dataBase '(.+?)' doesnt contains a table '(.+?)'$\"",
")",
"public",
"void",
"aMongoDataBaseContainsaTable",
"(",
"String",
"database",
",",
"String",
"tableName",
")",
"{",
"commonspec",
".",
"getMongoDBClient",
"(",
")",
".",
"connectToMong... | Checks if a MongoDB database contains a table.
@param database
@param tableName | [
"Checks",
"if",
"a",
"MongoDB",
"database",
"contains",
"a",
"table",
"."
] | 55324d19e7497764ad3dd7139923e13eb9841d75 | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/DatabaseSpec.java#L801-L806 |
100,065 | Stratio/bdt | src/main/java/com/stratio/qa/specs/DatabaseSpec.java | DatabaseSpec.resultsMustBe | @Then("^There are results found with:$")
public void resultsMustBe(DataTable expectedResults) throws Exception {
String type = commonspec.getResultsType();
assertThat(type).isNotEqualTo("").overridingErrorMessage("It's necessary to define the result type");
switch (type) {
case ... | java | @Then("^There are results found with:$")
public void resultsMustBe(DataTable expectedResults) throws Exception {
String type = commonspec.getResultsType();
assertThat(type).isNotEqualTo("").overridingErrorMessage("It's necessary to define the result type");
switch (type) {
case ... | [
"@",
"Then",
"(",
"\"^There are results found with:$\"",
")",
"public",
"void",
"resultsMustBe",
"(",
"DataTable",
"expectedResults",
")",
"throws",
"Exception",
"{",
"String",
"type",
"=",
"commonspec",
".",
"getResultsType",
"(",
")",
";",
"assertThat",
"(",
"ty... | Checks the different results of a previous query
@param expectedResults A DataTable Object with all data needed for check the results. The DataTable must contains at least 2 columns:
a) A field column from the result
b) Occurrences column (Integer type)
<p>
Example:
|latitude| longitude|place |occurrences|
|12.5 ... | [
"Checks",
"the",
"different",
"results",
"of",
"a",
"previous",
"query"
] | 55324d19e7497764ad3dd7139923e13eb9841d75 | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/DatabaseSpec.java#L823-L844 |
100,066 | Stratio/bdt | src/main/java/com/stratio/qa/specs/DatabaseSpec.java | DatabaseSpec.elasticSearchIndexContainsDocument | @Then("^The Elasticsearch index named '(.+?)' and mapping '(.+?)' contains a column named '(.+?)' with the value '(.+?)'$")
public void elasticSearchIndexContainsDocument(String indexName, String mappingName, String columnName, String columnValue) throws Exception {
Assertions.assertThat((commonspec.getElas... | java | @Then("^The Elasticsearch index named '(.+?)' and mapping '(.+?)' contains a column named '(.+?)' with the value '(.+?)'$")
public void elasticSearchIndexContainsDocument(String indexName, String mappingName, String columnName, String columnValue) throws Exception {
Assertions.assertThat((commonspec.getElas... | [
"@",
"Then",
"(",
"\"^The Elasticsearch index named '(.+?)' and mapping '(.+?)' contains a column named '(.+?)' with the value '(.+?)'$\"",
")",
"public",
"void",
"elasticSearchIndexContainsDocument",
"(",
"String",
"indexName",
",",
"String",
"mappingName",
",",
"String",
"columnNam... | Check that an elasticsearch index contains a specific document
@param indexName
@param columnName
@param columnValue | [
"Check",
"that",
"an",
"elasticsearch",
"index",
"contains",
"a",
"specific",
"document"
] | 55324d19e7497764ad3dd7139923e13eb9841d75 | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/DatabaseSpec.java#L873-L882 |
100,067 | Stratio/bdt | src/main/java/com/stratio/qa/specs/LdapSpec.java | LdapSpec.searchLDAP | @When("^I search in LDAP using the filter '(.+?)' and the baseDn '(.+?)'$")
public void searchLDAP(String filter, String baseDn) throws Exception {
this.commonspec.setPreviousLdapResults(commonspec.getLdapUtils().search(new SearchRequest(baseDn, filter)));
} | java | @When("^I search in LDAP using the filter '(.+?)' and the baseDn '(.+?)'$")
public void searchLDAP(String filter, String baseDn) throws Exception {
this.commonspec.setPreviousLdapResults(commonspec.getLdapUtils().search(new SearchRequest(baseDn, filter)));
} | [
"@",
"When",
"(",
"\"^I search in LDAP using the filter '(.+?)' and the baseDn '(.+?)'$\"",
")",
"public",
"void",
"searchLDAP",
"(",
"String",
"filter",
",",
"String",
"baseDn",
")",
"throws",
"Exception",
"{",
"this",
".",
"commonspec",
".",
"setPreviousLdapResults",
... | Search for a LDAP object | [
"Search",
"for",
"a",
"LDAP",
"object"
] | 55324d19e7497764ad3dd7139923e13eb9841d75 | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/LdapSpec.java#L53-L56 |
100,068 | Stratio/bdt | src/main/java/com/stratio/qa/specs/LdapSpec.java | LdapSpec.ldapEntryContains | @Then("^the LDAP entry contains the attribute '(.+?)' with the value '(.+?)'$")
public void ldapEntryContains(String attributeName, String expectedValue) {
if (this.commonspec.getPreviousLdapResults().isPresent()) {
Assertions.assertThat(this.commonspec.getPreviousLdapResults().get().getEntry().... | java | @Then("^the LDAP entry contains the attribute '(.+?)' with the value '(.+?)'$")
public void ldapEntryContains(String attributeName, String expectedValue) {
if (this.commonspec.getPreviousLdapResults().isPresent()) {
Assertions.assertThat(this.commonspec.getPreviousLdapResults().get().getEntry().... | [
"@",
"Then",
"(",
"\"^the LDAP entry contains the attribute '(.+?)' with the value '(.+?)'$\"",
")",
"public",
"void",
"ldapEntryContains",
"(",
"String",
"attributeName",
",",
"String",
"expectedValue",
")",
"{",
"if",
"(",
"this",
".",
"commonspec",
".",
"getPreviousLda... | Checks if the previous LDAP search contained a single Entry with a specific attribute and an expected value
@param attributeName The name of the attribute to look for in the LdapEntry
@param expectedValue The expected value of the attribute | [
"Checks",
"if",
"the",
"previous",
"LDAP",
"search",
"contained",
"a",
"single",
"Entry",
"with",
"a",
"specific",
"attribute",
"and",
"an",
"expected",
"value"
] | 55324d19e7497764ad3dd7139923e13eb9841d75 | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/LdapSpec.java#L64-L71 |
100,069 | Stratio/bdt | src/main/java/com/stratio/qa/data/BrowsersDataProvider.java | BrowsersDataProvider.availableBrowsers | @DataProvider(parallel = true)
public static Iterator<String[]> availableBrowsers(ITestContext context, Constructor<?> testConstructor)
throws Exception {
Map<String, String> map = new HashMap<String, String>();
List<String> browsers = gridBrowsers(map);
return buildIterator(br... | java | @DataProvider(parallel = true)
public static Iterator<String[]> availableBrowsers(ITestContext context, Constructor<?> testConstructor)
throws Exception {
Map<String, String> map = new HashMap<String, String>();
List<String> browsers = gridBrowsers(map);
return buildIterator(br... | [
"@",
"DataProvider",
"(",
"parallel",
"=",
"true",
")",
"public",
"static",
"Iterator",
"<",
"String",
"[",
"]",
">",
"availableBrowsers",
"(",
"ITestContext",
"context",
",",
"Constructor",
"<",
"?",
">",
"testConstructor",
")",
"throws",
"Exception",
"{",
... | Get the browsers available in a selenium grid.
@param context context
@param testConstructor testConstructor
@return an iterator
@throws Exception exception | [
"Get",
"the",
"browsers",
"available",
"in",
"a",
"selenium",
"grid",
"."
] | 55324d19e7497764ad3dd7139923e13eb9841d75 | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/data/BrowsersDataProvider.java#L55-L63 |
100,070 | Stratio/bdt | src/main/java/com/stratio/qa/data/BrowsersDataProvider.java | BrowsersDataProvider.availableUniqueBrowsers | @DataProvider(parallel = true)
public static Iterator<String[]> availableUniqueBrowsers(ITestContext context, Constructor<?> testConstructor)
throws Exception {
Map<String, String> map = new HashMap<String, String>();
List<String> browsers = gridBrowsers(map);
HashSet<String> h... | java | @DataProvider(parallel = true)
public static Iterator<String[]> availableUniqueBrowsers(ITestContext context, Constructor<?> testConstructor)
throws Exception {
Map<String, String> map = new HashMap<String, String>();
List<String> browsers = gridBrowsers(map);
HashSet<String> h... | [
"@",
"DataProvider",
"(",
"parallel",
"=",
"true",
")",
"public",
"static",
"Iterator",
"<",
"String",
"[",
"]",
">",
"availableUniqueBrowsers",
"(",
"ITestContext",
"context",
",",
"Constructor",
"<",
"?",
">",
"testConstructor",
")",
"throws",
"Exception",
"... | Get unique browsers available in a selenium grid.
@param context context
@param testConstructor testConstructor
@return an iterator
@throws Exception exception | [
"Get",
"unique",
"browsers",
"available",
"in",
"a",
"selenium",
"grid",
"."
] | 55324d19e7497764ad3dd7139923e13eb9841d75 | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/data/BrowsersDataProvider.java#L74-L87 |
100,071 | Stratio/bdt | src/main/java/com/stratio/qa/data/BrowsersDataProvider.java | BrowsersDataProvider.buildIterator | private static Iterator<String[]> buildIterator(List<String> browsers) {
List<String[]> lData = Lists.newArrayList();
for (String s : browsers) {
lData.add(new String[]{s});
}
if (lData.size() == 0) {
lData.add(new String[]{""});
}
return lData... | java | private static Iterator<String[]> buildIterator(List<String> browsers) {
List<String[]> lData = Lists.newArrayList();
for (String s : browsers) {
lData.add(new String[]{s});
}
if (lData.size() == 0) {
lData.add(new String[]{""});
}
return lData... | [
"private",
"static",
"Iterator",
"<",
"String",
"[",
"]",
">",
"buildIterator",
"(",
"List",
"<",
"String",
">",
"browsers",
")",
"{",
"List",
"<",
"String",
"[",
"]",
">",
"lData",
"=",
"Lists",
".",
"newArrayList",
"(",
")",
";",
"for",
"(",
"Strin... | Build an String Iterator from String List.
@param browsers browsers
@return an iterator | [
"Build",
"an",
"String",
"Iterator",
"from",
"String",
"List",
"."
] | 55324d19e7497764ad3dd7139923e13eb9841d75 | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/data/BrowsersDataProvider.java#L133-L146 |
100,072 | Stratio/bdt | src/main/java/com/stratio/qa/aspects/BrowsersDataProviderAspect.java | BrowsersDataProviderAspect.availableBrowsersCalls | @Around(value = "availableBrowsersCallPointcut()")
public Object availableBrowsersCalls(ProceedingJoinPoint pjp)
throws Throwable {
if (pjp.getArgs().length > 0) {
if (pjp.getArgs()[0] instanceof ITestContext) {
if (Arrays.asList(((ITestContext) pjp.getArgs()[0]).get... | java | @Around(value = "availableBrowsersCallPointcut()")
public Object availableBrowsersCalls(ProceedingJoinPoint pjp)
throws Throwable {
if (pjp.getArgs().length > 0) {
if (pjp.getArgs()[0] instanceof ITestContext) {
if (Arrays.asList(((ITestContext) pjp.getArgs()[0]).get... | [
"@",
"Around",
"(",
"value",
"=",
"\"availableBrowsersCallPointcut()\"",
")",
"public",
"Object",
"availableBrowsersCalls",
"(",
"ProceedingJoinPoint",
"pjp",
")",
"throws",
"Throwable",
"{",
"if",
"(",
"pjp",
".",
"getArgs",
"(",
")",
".",
"length",
">",
"0",
... | If a System property with FORCE_BROWSER exists then Methods in
BrowsersDataProvider will return its value.
@param pjp ProceedingJoinPoint
@return Object
@throws Throwable exception | [
"If",
"a",
"System",
"property",
"with",
"FORCE_BROWSER",
"exists",
"then",
"Methods",
"in",
"BrowsersDataProvider",
"will",
"return",
"its",
"value",
"."
] | 55324d19e7497764ad3dd7139923e13eb9841d75 | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/aspects/BrowsersDataProviderAspect.java#L50-L70 |
100,073 | Stratio/bdt | src/main/java/com/stratio/qa/specs/ZookeeperSpec.java | ZookeeperSpec.connectToZk | @Given("^I connect to Zookeeper at '(.+)'$")
public void connectToZk(String zookeeperHosts) throws InterruptedException {
commonspec.getZookeeperSecClient().setZookeeperSecConnection(zookeeperHosts, 3000);
commonspec.getZookeeperSecClient().connectZk();
} | java | @Given("^I connect to Zookeeper at '(.+)'$")
public void connectToZk(String zookeeperHosts) throws InterruptedException {
commonspec.getZookeeperSecClient().setZookeeperSecConnection(zookeeperHosts, 3000);
commonspec.getZookeeperSecClient().connectZk();
} | [
"@",
"Given",
"(",
"\"^I connect to Zookeeper at '(.+)'$\"",
")",
"public",
"void",
"connectToZk",
"(",
"String",
"zookeeperHosts",
")",
"throws",
"InterruptedException",
"{",
"commonspec",
".",
"getZookeeperSecClient",
"(",
")",
".",
"setZookeeperSecConnection",
"(",
"... | Connect to zookeeper.
@param zookeeperHosts as host:port (comma separated)
@throws InterruptedException exception | [
"Connect",
"to",
"zookeeper",
"."
] | 55324d19e7497764ad3dd7139923e13eb9841d75 | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/ZookeeperSpec.java#L44-L48 |
100,074 | Stratio/bdt | src/main/java/com/stratio/qa/specs/ZookeeperSpec.java | ZookeeperSpec.createZNode | @When("^I create the zNode '(.+?)'( with content '(.+?)')? which (IS|IS NOT) ephemeral$")
public void createZNode(String path, String foo, String content, boolean ephemeral) throws Exception {
if (content != null) {
commonspec.getZookeeperSecClient().zCreate(path, content, ephemeral);
} ... | java | @When("^I create the zNode '(.+?)'( with content '(.+?)')? which (IS|IS NOT) ephemeral$")
public void createZNode(String path, String foo, String content, boolean ephemeral) throws Exception {
if (content != null) {
commonspec.getZookeeperSecClient().zCreate(path, content, ephemeral);
} ... | [
"@",
"When",
"(",
"\"^I create the zNode '(.+?)'( with content '(.+?)')? which (IS|IS NOT) ephemeral$\"",
")",
"public",
"void",
"createZNode",
"(",
"String",
"path",
",",
"String",
"foo",
",",
"String",
"content",
",",
"boolean",
"ephemeral",
")",
"throws",
"Exception",
... | Create zPath and domcument
@param path path at zookeeper
@param foo a dummy match group
@param content if it has content it should be defined
@param ephemeral if it's created as ephemeral or not | [
"Create",
"zPath",
"and",
"domcument"
] | 55324d19e7497764ad3dd7139923e13eb9841d75 | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/ZookeeperSpec.java#L78-L85 |
100,075 | Stratio/bdt | src/main/java/com/stratio/qa/utils/CassandraUtils.java | CassandraUtils.connect | public void connect(String secured) {
buildCluster(secured);
this.cassandraqueryUtils = new CassandraQueryUtils();
this.metadata = this.cluster.getMetadata();
LOGGER.debug("Connected to cluster (" + host + "): "
+ metadata.getClusterName() + "\n");
this.session = ... | java | public void connect(String secured) {
buildCluster(secured);
this.cassandraqueryUtils = new CassandraQueryUtils();
this.metadata = this.cluster.getMetadata();
LOGGER.debug("Connected to cluster (" + host + "): "
+ metadata.getClusterName() + "\n");
this.session = ... | [
"public",
"void",
"connect",
"(",
"String",
"secured",
")",
"{",
"buildCluster",
"(",
"secured",
")",
";",
"this",
".",
"cassandraqueryUtils",
"=",
"new",
"CassandraQueryUtils",
"(",
")",
";",
"this",
".",
"metadata",
"=",
"this",
".",
"cluster",
".",
"get... | Connect to Cassandra host. | [
"Connect",
"to",
"Cassandra",
"host",
"."
] | 55324d19e7497764ad3dd7139923e13eb9841d75 | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/utils/CassandraUtils.java#L68-L75 |
100,076 | Stratio/bdt | src/main/java/com/stratio/qa/utils/CassandraUtils.java | CassandraUtils.executeQueriesList | public void executeQueriesList(List<String> queriesList) {
for (String query : queriesList) {
this.session.execute(query);
}
} | java | public void executeQueriesList(List<String> queriesList) {
for (String query : queriesList) {
this.session.execute(query);
}
} | [
"public",
"void",
"executeQueriesList",
"(",
"List",
"<",
"String",
">",
"queriesList",
")",
"{",
"for",
"(",
"String",
"query",
":",
"queriesList",
")",
"{",
"this",
".",
"session",
".",
"execute",
"(",
"query",
")",
";",
"}",
"}"
] | Execute a list of queries over Cassandra.
@param queriesList | [
"Execute",
"a",
"list",
"of",
"queries",
"over",
"Cassandra",
"."
] | 55324d19e7497764ad3dd7139923e13eb9841d75 | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/utils/CassandraUtils.java#L92-L97 |
100,077 | Stratio/bdt | src/main/java/com/stratio/qa/utils/CassandraUtils.java | CassandraUtils.reconnect | public void reconnect() {
metadata = cluster.getMetadata();
LOGGER.debug("Connected to cluster (" + host + "): "
+ metadata.getClusterName() + "\n");
this.session = this.cluster.connect();
} | java | public void reconnect() {
metadata = cluster.getMetadata();
LOGGER.debug("Connected to cluster (" + host + "): "
+ metadata.getClusterName() + "\n");
this.session = this.cluster.connect();
} | [
"public",
"void",
"reconnect",
"(",
")",
"{",
"metadata",
"=",
"cluster",
".",
"getMetadata",
"(",
")",
";",
"LOGGER",
".",
"debug",
"(",
"\"Connected to cluster (\"",
"+",
"host",
"+",
"\"): \"",
"+",
"metadata",
".",
"getClusterName",
"(",
")",
"+",
"\"\... | Reconnect to Cassandra host. | [
"Reconnect",
"to",
"Cassandra",
"host",
"."
] | 55324d19e7497764ad3dd7139923e13eb9841d75 | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/utils/CassandraUtils.java#L102-L107 |
100,078 | Stratio/bdt | src/main/java/com/stratio/qa/utils/CassandraUtils.java | CassandraUtils.disconnect | public void disconnect() throws DBException {
if (this.session == null) {
throw new DBException("The Cassandra is null");
}
if (this.cluster.isClosed()) {
throw new DBException("The cluster has been closed");
}
this.session.close();
this.cluster.cl... | java | public void disconnect() throws DBException {
if (this.session == null) {
throw new DBException("The Cassandra is null");
}
if (this.cluster.isClosed()) {
throw new DBException("The cluster has been closed");
}
this.session.close();
this.cluster.cl... | [
"public",
"void",
"disconnect",
"(",
")",
"throws",
"DBException",
"{",
"if",
"(",
"this",
".",
"session",
"==",
"null",
")",
"{",
"throw",
"new",
"DBException",
"(",
"\"The Cassandra is null\"",
")",
";",
"}",
"if",
"(",
"this",
".",
"cluster",
".",
"is... | Disconnect from Cassandra host.
@throws DBException | [
"Disconnect",
"from",
"Cassandra",
"host",
"."
] | 55324d19e7497764ad3dd7139923e13eb9841d75 | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/utils/CassandraUtils.java#L114-L123 |
100,079 | Stratio/bdt | src/main/java/com/stratio/qa/utils/CassandraUtils.java | CassandraUtils.getMetadata | public Metadata getMetadata() throws DBException {
if (!this.cluster.isClosed()) {
this.metadata = cluster.getMetadata();
return this.metadata;
} else {
throw new DBException("The cluster has been closed");
}
} | java | public Metadata getMetadata() throws DBException {
if (!this.cluster.isClosed()) {
this.metadata = cluster.getMetadata();
return this.metadata;
} else {
throw new DBException("The cluster has been closed");
}
} | [
"public",
"Metadata",
"getMetadata",
"(",
")",
"throws",
"DBException",
"{",
"if",
"(",
"!",
"this",
".",
"cluster",
".",
"isClosed",
"(",
")",
")",
"{",
"this",
".",
"metadata",
"=",
"cluster",
".",
"getMetadata",
"(",
")",
";",
"return",
"this",
".",... | Get the metadata of the Cassandra Cluster.
@return Metadata
@throws DBException | [
"Get",
"the",
"metadata",
"of",
"the",
"Cassandra",
"Cluster",
"."
] | 55324d19e7497764ad3dd7139923e13eb9841d75 | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/utils/CassandraUtils.java#L131-L138 |
100,080 | Stratio/bdt | src/main/java/com/stratio/qa/utils/CassandraUtils.java | CassandraUtils.buildCluster | public void buildCluster(String secured) {
if (secured == null) {
this.cluster = Cluster.builder().addContactPoint(this.host).build();
this.cluster.getConfiguration().getQueryOptions()
.setConsistencyLevel(ConsistencyLevel.ONE);
} else {
try {
... | java | public void buildCluster(String secured) {
if (secured == null) {
this.cluster = Cluster.builder().addContactPoint(this.host).build();
this.cluster.getConfiguration().getQueryOptions()
.setConsistencyLevel(ConsistencyLevel.ONE);
} else {
try {
... | [
"public",
"void",
"buildCluster",
"(",
"String",
"secured",
")",
"{",
"if",
"(",
"secured",
"==",
"null",
")",
"{",
"this",
".",
"cluster",
"=",
"Cluster",
".",
"builder",
"(",
")",
".",
"addContactPoint",
"(",
"this",
".",
"host",
")",
".",
"build",
... | Build a Cassandra cluster. | [
"Build",
"a",
"Cassandra",
"cluster",
"."
] | 55324d19e7497764ad3dd7139923e13eb9841d75 | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/utils/CassandraUtils.java#L144-L156 |
100,081 | Stratio/bdt | src/main/java/com/stratio/qa/utils/CassandraUtils.java | CassandraUtils.createKeyspace | public void createKeyspace(String keyspace) {
Map<String, String> replicationSimpleOneExtra = new HashMap<>();
replicationSimpleOneExtra.put("'class'", "'SimpleStrategy'");
replicationSimpleOneExtra.put("'replication_factor'", "1");
String query = this.cassandraqueryUtils.createKeyspaceQ... | java | public void createKeyspace(String keyspace) {
Map<String, String> replicationSimpleOneExtra = new HashMap<>();
replicationSimpleOneExtra.put("'class'", "'SimpleStrategy'");
replicationSimpleOneExtra.put("'replication_factor'", "1");
String query = this.cassandraqueryUtils.createKeyspaceQ... | [
"public",
"void",
"createKeyspace",
"(",
"String",
"keyspace",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"replicationSimpleOneExtra",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
"replicationSimpleOneExtra",
".",
"put",
"(",
"\"'class'\"",
",",
"\"'Si... | Create a keyspace in Cassandra.
@param keyspace | [
"Create",
"a",
"keyspace",
"in",
"Cassandra",
"."
] | 55324d19e7497764ad3dd7139923e13eb9841d75 | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/utils/CassandraUtils.java#L172-L182 |
100,082 | Stratio/bdt | src/main/java/com/stratio/qa/utils/CassandraUtils.java | CassandraUtils.createTableWithData | public void createTableWithData(String table, Map<String, String> colums, ArrayList<String> pk) {
String query = this.cassandraqueryUtils.createTable(table, colums, pk);
LOGGER.debug(query);
executeQuery(query);
} | java | public void createTableWithData(String table, Map<String, String> colums, ArrayList<String> pk) {
String query = this.cassandraqueryUtils.createTable(table, colums, pk);
LOGGER.debug(query);
executeQuery(query);
} | [
"public",
"void",
"createTableWithData",
"(",
"String",
"table",
",",
"Map",
"<",
"String",
",",
"String",
">",
"colums",
",",
"ArrayList",
"<",
"String",
">",
"pk",
")",
"{",
"String",
"query",
"=",
"this",
".",
"cassandraqueryUtils",
".",
"createTable",
... | Create a table in Cassandra.
@param table
@param colums | [
"Create",
"a",
"table",
"in",
"Cassandra",
"."
] | 55324d19e7497764ad3dd7139923e13eb9841d75 | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/utils/CassandraUtils.java#L190-L194 |
100,083 | Stratio/bdt | src/main/java/com/stratio/qa/utils/CassandraUtils.java | CassandraUtils.insertData | public void insertData(String table, Map<String, Object> fields) {
String query = this.cassandraqueryUtils.insertData(table, fields);
LOGGER.debug(query);
executeQuery(query);
} | java | public void insertData(String table, Map<String, Object> fields) {
String query = this.cassandraqueryUtils.insertData(table, fields);
LOGGER.debug(query);
executeQuery(query);
} | [
"public",
"void",
"insertData",
"(",
"String",
"table",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"fields",
")",
"{",
"String",
"query",
"=",
"this",
".",
"cassandraqueryUtils",
".",
"insertData",
"(",
"table",
",",
"fields",
")",
";",
"LOGGER",
"."... | Insert data in a keyspace.
@param table
@param fields | [
"Insert",
"data",
"in",
"a",
"keyspace",
"."
] | 55324d19e7497764ad3dd7139923e13eb9841d75 | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/utils/CassandraUtils.java#L202-L206 |
100,084 | Stratio/bdt | src/main/java/com/stratio/qa/utils/CassandraUtils.java | CassandraUtils.existsKeyspace | public boolean existsKeyspace(String keyspace, boolean showLog) {
this.metadata = cluster.getMetadata();
if (!(this.metadata.getKeyspaces().isEmpty())) {
for (KeyspaceMetadata k : metadata.getKeyspaces()) {
if (k.getName().equals(keyspace)) {
return true;
... | java | public boolean existsKeyspace(String keyspace, boolean showLog) {
this.metadata = cluster.getMetadata();
if (!(this.metadata.getKeyspaces().isEmpty())) {
for (KeyspaceMetadata k : metadata.getKeyspaces()) {
if (k.getName().equals(keyspace)) {
return true;
... | [
"public",
"boolean",
"existsKeyspace",
"(",
"String",
"keyspace",
",",
"boolean",
"showLog",
")",
"{",
"this",
".",
"metadata",
"=",
"cluster",
".",
"getMetadata",
"(",
")",
";",
"if",
"(",
"!",
"(",
"this",
".",
"metadata",
".",
"getKeyspaces",
"(",
")"... | Checks if a keyspace exists in Cassandra.
@param keyspace
@param showLog
@return boolean | [
"Checks",
"if",
"a",
"keyspace",
"exists",
"in",
"Cassandra",
"."
] | 55324d19e7497764ad3dd7139923e13eb9841d75 | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/utils/CassandraUtils.java#L215-L225 |
100,085 | Stratio/bdt | src/main/java/com/stratio/qa/utils/CassandraUtils.java | CassandraUtils.getKeyspaces | public List<String> getKeyspaces() {
ArrayList<String> result = new ArrayList<String>();
this.metadata = this.cluster.getMetadata();
if (!(metadata.getKeyspaces().isEmpty())) {
for (KeyspaceMetadata k : this.metadata.getKeyspaces()) {
result.add(k.getName());
... | java | public List<String> getKeyspaces() {
ArrayList<String> result = new ArrayList<String>();
this.metadata = this.cluster.getMetadata();
if (!(metadata.getKeyspaces().isEmpty())) {
for (KeyspaceMetadata k : this.metadata.getKeyspaces()) {
result.add(k.getName());
... | [
"public",
"List",
"<",
"String",
">",
"getKeyspaces",
"(",
")",
"{",
"ArrayList",
"<",
"String",
">",
"result",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
";",
"this",
".",
"metadata",
"=",
"this",
".",
"cluster",
".",
"getMetadata",
"(",
... | Get a list of the existing keyspaces in Cassandra.
@return {@code List<String>} | [
"Get",
"a",
"list",
"of",
"the",
"existing",
"keyspaces",
"in",
"Cassandra",
"."
] | 55324d19e7497764ad3dd7139923e13eb9841d75 | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/utils/CassandraUtils.java#L232-L241 |
100,086 | Stratio/bdt | src/main/java/com/stratio/qa/utils/CassandraUtils.java | CassandraUtils.existsTable | public boolean existsTable(String keyspace, String table, boolean showLog) {
this.metadata = this.cluster.getMetadata();
if (!(this.metadata.getKeyspace(keyspace).getTables().isEmpty())) {
for (TableMetadata t : this.metadata.getKeyspace(keyspace).getTables()) {
if (t.getNam... | java | public boolean existsTable(String keyspace, String table, boolean showLog) {
this.metadata = this.cluster.getMetadata();
if (!(this.metadata.getKeyspace(keyspace).getTables().isEmpty())) {
for (TableMetadata t : this.metadata.getKeyspace(keyspace).getTables()) {
if (t.getNam... | [
"public",
"boolean",
"existsTable",
"(",
"String",
"keyspace",
",",
"String",
"table",
",",
"boolean",
"showLog",
")",
"{",
"this",
".",
"metadata",
"=",
"this",
".",
"cluster",
".",
"getMetadata",
"(",
")",
";",
"if",
"(",
"!",
"(",
"this",
".",
"meta... | Checks if a keyspace contains an especific table.
@param keyspace
@param table
@param showLog
@return boolean | [
"Checks",
"if",
"a",
"keyspace",
"contains",
"an",
"especific",
"table",
"."
] | 55324d19e7497764ad3dd7139923e13eb9841d75 | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/utils/CassandraUtils.java#L281-L292 |
100,087 | Stratio/bdt | src/main/java/com/stratio/qa/utils/CassandraUtils.java | CassandraUtils.getTables | public List<String> getTables(String keyspace) {
ArrayList<String> result = new ArrayList<String>();
this.metadata = this.cluster.getMetadata();
if ((!existsKeyspace(keyspace, false)) || (this.metadata.getKeyspace(keyspace).getTables().isEmpty())) {
return result;
}
f... | java | public List<String> getTables(String keyspace) {
ArrayList<String> result = new ArrayList<String>();
this.metadata = this.cluster.getMetadata();
if ((!existsKeyspace(keyspace, false)) || (this.metadata.getKeyspace(keyspace).getTables().isEmpty())) {
return result;
}
f... | [
"public",
"List",
"<",
"String",
">",
"getTables",
"(",
"String",
"keyspace",
")",
"{",
"ArrayList",
"<",
"String",
">",
"result",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
";",
"this",
".",
"metadata",
"=",
"this",
".",
"cluster",
".",
... | Get tables of a keyspace.
@param keyspace
@return {@code List<String>} | [
"Get",
"tables",
"of",
"a",
"keyspace",
"."
] | 55324d19e7497764ad3dd7139923e13eb9841d75 | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/utils/CassandraUtils.java#L300-L310 |
100,088 | Stratio/bdt | src/main/java/com/stratio/qa/utils/CassandraUtils.java | CassandraUtils.loadScript | public static List<String> loadScript(String path) {
List<String> result = new ArrayList<String>();
URL url = CassandraUtils.class.getResource(path);
LOGGER.debug(url.toString());
LOGGER.info("Loading script from: " + url);
try (BufferedReader br = new BufferedReader(new InputStr... | java | public static List<String> loadScript(String path) {
List<String> result = new ArrayList<String>();
URL url = CassandraUtils.class.getResource(path);
LOGGER.debug(url.toString());
LOGGER.info("Loading script from: " + url);
try (BufferedReader br = new BufferedReader(new InputStr... | [
"public",
"static",
"List",
"<",
"String",
">",
"loadScript",
"(",
"String",
"path",
")",
"{",
"List",
"<",
"String",
">",
"result",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
";",
"URL",
"url",
"=",
"CassandraUtils",
".",
"class",
".",
"... | Load the lines of a CQL script containing one statement per line into a
list. l
@param path The path of the CQL script.
@return The contents of the script. | [
"Load",
"the",
"lines",
"of",
"a",
"CQL",
"script",
"containing",
"one",
"statement",
"per",
"line",
"into",
"a",
"list",
".",
"l"
] | 55324d19e7497764ad3dd7139923e13eb9841d75 | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/utils/CassandraUtils.java#L361-L378 |
100,089 | Stratio/bdt | src/main/java/com/stratio/qa/specs/CommonG.java | CommonG.matchesOrContains | public static Pattern matchesOrContains(String expectedMessage) {
Pattern pattern;
if (expectedMessage.startsWith("regex:")) {
String regex = expectedMessage.substring(expectedMessage.indexOf("regex:") + 6, expectedMessage.length());
pattern = Pattern.compile(regex);
} el... | java | public static Pattern matchesOrContains(String expectedMessage) {
Pattern pattern;
if (expectedMessage.startsWith("regex:")) {
String regex = expectedMessage.substring(expectedMessage.indexOf("regex:") + 6, expectedMessage.length());
pattern = Pattern.compile(regex);
} el... | [
"public",
"static",
"Pattern",
"matchesOrContains",
"(",
"String",
"expectedMessage",
")",
"{",
"Pattern",
"pattern",
";",
"if",
"(",
"expectedMessage",
".",
"startsWith",
"(",
"\"regex:\"",
")",
")",
"{",
"String",
"regex",
"=",
"expectedMessage",
".",
"substri... | Checks if a given string matches a regular expression or contains a string
@param expectedMessage message used for comparing
@return boolean | [
"Checks",
"if",
"a",
"given",
"string",
"matches",
"a",
"regular",
"expression",
"or",
"contains",
"a",
"string"
] | 55324d19e7497764ad3dd7139923e13eb9841d75 | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/CommonG.java#L148-L157 |
100,090 | Stratio/bdt | src/main/java/com/stratio/qa/specs/CommonG.java | CommonG.retrieveData | public String retrieveData(String baseData, String type) {
String result;
InputStream stream = getClass().getClassLoader().getResourceAsStream(baseData);
Writer writer = new StringWriter();
char[] buffer = new char[1024];
Reader reader;
if (stream == null) {
... | java | public String retrieveData(String baseData, String type) {
String result;
InputStream stream = getClass().getClassLoader().getResourceAsStream(baseData);
Writer writer = new StringWriter();
char[] buffer = new char[1024];
Reader reader;
if (stream == null) {
... | [
"public",
"String",
"retrieveData",
"(",
"String",
"baseData",
",",
"String",
"type",
")",
"{",
"String",
"result",
";",
"InputStream",
"stream",
"=",
"getClass",
"(",
")",
".",
"getClassLoader",
"(",
")",
".",
"getResourceAsStream",
"(",
"baseData",
")",
";... | Returns the information contained in file passed as parameter
@param baseData path to file to be read
@param type type of information, it can be: json|string
@return String | [
"Returns",
"the",
"information",
"contained",
"in",
"file",
"passed",
"as",
"parameter"
] | 55324d19e7497764ad3dd7139923e13eb9841d75 | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/CommonG.java#L669-L709 |
100,091 | Stratio/bdt | src/main/java/com/stratio/qa/specs/CommonG.java | CommonG.removeNulls | public JsonObject removeNulls(JsonObject object) {
for (int j = 0; j < object.names().size(); j++) {
if (JsonType.OBJECT.equals(object.get(object.names().get(j)).getType())) {
removeNulls(object.get(object.names().get(j)).asObject());
} else {
if (object.g... | java | public JsonObject removeNulls(JsonObject object) {
for (int j = 0; j < object.names().size(); j++) {
if (JsonType.OBJECT.equals(object.get(object.names().get(j)).getType())) {
removeNulls(object.get(object.names().get(j)).asObject());
} else {
if (object.g... | [
"public",
"JsonObject",
"removeNulls",
"(",
"JsonObject",
"object",
")",
"{",
"for",
"(",
"int",
"j",
"=",
"0",
";",
"j",
"<",
"object",
".",
"names",
"(",
")",
".",
"size",
"(",
")",
";",
"j",
"++",
")",
"{",
"if",
"(",
"JsonType",
".",
"OBJECT"... | Eliminates null occurrences, replacing them with "TO_BE_NULL"
@param object JsonObject containing json where to replace null ocurrences
@return JsonObject | [
"Eliminates",
"null",
"occurrences",
"replacing",
"them",
"with",
"TO_BE_NULL"
] | 55324d19e7497764ad3dd7139923e13eb9841d75 | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/CommonG.java#L1060-L1071 |
100,092 | Stratio/bdt | src/main/java/com/stratio/qa/specs/CommonG.java | CommonG.setPreviousElement | public void setPreviousElement(String element, String value) throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException, InstantiationException, ClassNotFoundException, NoSuchMethodException, InvocationTargetException {
Reflections reflections = new Reflections("com.stratio... | java | public void setPreviousElement(String element, String value) throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException, InstantiationException, ClassNotFoundException, NoSuchMethodException, InvocationTargetException {
Reflections reflections = new Reflections("com.stratio... | [
"public",
"void",
"setPreviousElement",
"(",
"String",
"element",
",",
"String",
"value",
")",
"throws",
"NoSuchFieldException",
",",
"SecurityException",
",",
"IllegalArgumentException",
",",
"IllegalAccessException",
",",
"InstantiationException",
",",
"ClassNotFoundExcep... | Saves the value in the attribute in class extending CommonG.
@param element attribute in class where to store the value
@param value value to be stored
@throws NoSuchFieldException exception
@throws SecurityException exception
@throws IllegalArgumentException exception
@throws IllegalAccessException ... | [
"Saves",
"the",
"value",
"in",
"the",
"attribute",
"in",
"class",
"extending",
"CommonG",
"."
] | 55324d19e7497764ad3dd7139923e13eb9841d75 | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/CommonG.java#L1361-L1372 |
100,093 | Stratio/bdt | src/main/java/com/stratio/qa/specs/CommonG.java | CommonG.isUUID | private boolean isUUID(String uuid) {
try {
UUID.fromString(uuid);
return true;
} catch (Exception ex) {
return false;
}
} | java | private boolean isUUID(String uuid) {
try {
UUID.fromString(uuid);
return true;
} catch (Exception ex) {
return false;
}
} | [
"private",
"boolean",
"isUUID",
"(",
"String",
"uuid",
")",
"{",
"try",
"{",
"UUID",
".",
"fromString",
"(",
"uuid",
")",
";",
"return",
"true",
";",
"}",
"catch",
"(",
"Exception",
"ex",
")",
"{",
"return",
"false",
";",
"}",
"}"
] | Check if a string is a UUID
@param uuid - UUID value
@return true if it is a UUID or false if it is not an UUID | [
"Check",
"if",
"a",
"string",
"is",
"a",
"UUID"
] | 55324d19e7497764ad3dd7139923e13eb9841d75 | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/CommonG.java#L1511-L1518 |
100,094 | Stratio/bdt | src/main/java/com/stratio/qa/specs/CommonG.java | CommonG.isThisDateValid | private boolean isThisDateValid(String dateToValidate, String dateFromat) {
if (dateToValidate == null) {
return false;
}
SimpleDateFormat sdf = new SimpleDateFormat(dateFromat);
sdf.setLenient(false);
try {
//if not valid, it will throw ParseException
... | java | private boolean isThisDateValid(String dateToValidate, String dateFromat) {
if (dateToValidate == null) {
return false;
}
SimpleDateFormat sdf = new SimpleDateFormat(dateFromat);
sdf.setLenient(false);
try {
//if not valid, it will throw ParseException
... | [
"private",
"boolean",
"isThisDateValid",
"(",
"String",
"dateToValidate",
",",
"String",
"dateFromat",
")",
"{",
"if",
"(",
"dateToValidate",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"SimpleDateFormat",
"sdf",
"=",
"new",
"SimpleDateFormat",
"(",
"... | Check is a String is a valid timestamp format
@param dateToValidate
@param dateFromat
@return true/false | [
"Check",
"is",
"a",
"String",
"is",
"a",
"valid",
"timestamp",
"format"
] | 55324d19e7497764ad3dd7139923e13eb9841d75 | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/CommonG.java#L1526-L1540 |
100,095 | Stratio/bdt | src/main/java/com/stratio/qa/specs/CommonG.java | CommonG.resultsMustBeElasticsearch | public void resultsMustBeElasticsearch(DataTable expectedResults) throws Exception {
if (getElasticsearchResults() != null) {
List<List<String>> expectedResultList = expectedResults.raw();
//Check size
assertThat(expectedResultList.size() - 1).overridingErrorMessage(
... | java | public void resultsMustBeElasticsearch(DataTable expectedResults) throws Exception {
if (getElasticsearchResults() != null) {
List<List<String>> expectedResultList = expectedResults.raw();
//Check size
assertThat(expectedResultList.size() - 1).overridingErrorMessage(
... | [
"public",
"void",
"resultsMustBeElasticsearch",
"(",
"DataTable",
"expectedResults",
")",
"throws",
"Exception",
"{",
"if",
"(",
"getElasticsearchResults",
"(",
")",
"!=",
"null",
")",
"{",
"List",
"<",
"List",
"<",
"String",
">>",
"expectedResultList",
"=",
"ex... | Checks the different results of a previous query to Elasticsearch database
@param expectedResults A DataTable Object with all data needed for check the results. The DataTable must contains at least 2 columns:
a) A field column from the result
b) Occurrences column (Integer type)
<p>
Example:
|latitude| longitude|place... | [
"Checks",
"the",
"different",
"results",
"of",
"a",
"previous",
"query",
"to",
"Elasticsearch",
"database"
] | 55324d19e7497764ad3dd7139923e13eb9841d75 | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/CommonG.java#L1732-L1755 |
100,096 | Stratio/bdt | src/main/java/com/stratio/qa/specs/CommonG.java | CommonG.runLocalCommand | public void runLocalCommand(String command) throws Exception {
String result = "";
String line;
Process p;
try {
p = Runtime.getRuntime().exec(new String[]{"/bin/sh", "-c", command});
p.waitFor();
} catch (java.io.IOException e) {
this.command... | java | public void runLocalCommand(String command) throws Exception {
String result = "";
String line;
Process p;
try {
p = Runtime.getRuntime().exec(new String[]{"/bin/sh", "-c", command});
p.waitFor();
} catch (java.io.IOException e) {
this.command... | [
"public",
"void",
"runLocalCommand",
"(",
"String",
"command",
")",
"throws",
"Exception",
"{",
"String",
"result",
"=",
"\"\"",
";",
"String",
"line",
";",
"Process",
"p",
";",
"try",
"{",
"p",
"=",
"Runtime",
".",
"getRuntime",
"(",
")",
".",
"exec",
... | Runs a command locally
@param command command used to be run locally | [
"Runs",
"a",
"command",
"locally"
] | 55324d19e7497764ad3dd7139923e13eb9841d75 | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/CommonG.java#L1762-L1791 |
100,097 | Stratio/bdt | src/main/java/com/stratio/qa/specs/CommonG.java | CommonG.removeJSONPathElement | public String removeJSONPathElement(String jsonString, String expr) {
Configuration conf = Configuration.builder().jsonProvider(new GsonJsonProvider()).mappingProvider(new GsonMappingProvider()).build();
DocumentContext context = JsonPath.using(conf).parse(jsonString);
context.delete(expr);
... | java | public String removeJSONPathElement(String jsonString, String expr) {
Configuration conf = Configuration.builder().jsonProvider(new GsonJsonProvider()).mappingProvider(new GsonMappingProvider()).build();
DocumentContext context = JsonPath.using(conf).parse(jsonString);
context.delete(expr);
... | [
"public",
"String",
"removeJSONPathElement",
"(",
"String",
"jsonString",
",",
"String",
"expr",
")",
"{",
"Configuration",
"conf",
"=",
"Configuration",
".",
"builder",
"(",
")",
".",
"jsonProvider",
"(",
"new",
"GsonJsonProvider",
"(",
")",
")",
".",
"mappin... | Remove a subelement in a JsonPath
@param jsonString String of the json
@param expr regex to be removed | [
"Remove",
"a",
"subelement",
"in",
"a",
"JsonPath"
] | 55324d19e7497764ad3dd7139923e13eb9841d75 | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/CommonG.java#L1911-L1917 |
100,098 | Stratio/bdt | src/main/java/com/stratio/qa/specs/CommonG.java | CommonG.replaceJSONPathElement | public String replaceJSONPathElement(String jsonString, String key, String value) {
return JsonPath.parse(jsonString).set(key, value).jsonString();
} | java | public String replaceJSONPathElement(String jsonString, String key, String value) {
return JsonPath.parse(jsonString).set(key, value).jsonString();
} | [
"public",
"String",
"replaceJSONPathElement",
"(",
"String",
"jsonString",
",",
"String",
"key",
",",
"String",
"value",
")",
"{",
"return",
"JsonPath",
".",
"parse",
"(",
"jsonString",
")",
".",
"set",
"(",
"key",
",",
"value",
")",
".",
"jsonString",
"("... | The function searches over the array by certain field value,
and replaces occurences with the parameter provided.
@param jsonString Original json object
@param key Key to search
@param value Value to replace key with | [
"The",
"function",
"searches",
"over",
"the",
"array",
"by",
"certain",
"field",
"value",
"and",
"replaces",
"occurences",
"with",
"the",
"parameter",
"provided",
"."
] | 55324d19e7497764ad3dd7139923e13eb9841d75 | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/CommonG.java#L1927-L1929 |
100,099 | Stratio/bdt | src/main/java/com/stratio/qa/specs/CommonG.java | CommonG.parseJSONSchema | public JSONObject parseJSONSchema(JSONObject schema) throws Exception {
JSONObject json = new JSONObject();
String name = "";
JSONObject properties = schema;
// Check if key 'properties' exists
if (schema.has("properties")) {
// Obtain properties
properti... | java | public JSONObject parseJSONSchema(JSONObject schema) throws Exception {
JSONObject json = new JSONObject();
String name = "";
JSONObject properties = schema;
// Check if key 'properties' exists
if (schema.has("properties")) {
// Obtain properties
properti... | [
"public",
"JSONObject",
"parseJSONSchema",
"(",
"JSONObject",
"schema",
")",
"throws",
"Exception",
"{",
"JSONObject",
"json",
"=",
"new",
"JSONObject",
"(",
")",
";",
"String",
"name",
"=",
"\"\"",
";",
"JSONObject",
"properties",
"=",
"schema",
";",
"// Chec... | Generate deployment json from schema
@param schema schema obtained from deploy-api
@return JSONObject deployment json | [
"Generate",
"deployment",
"json",
"from",
"schema"
] | 55324d19e7497764ad3dd7139923e13eb9841d75 | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/CommonG.java#L2184-L2233 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.