repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
partition
stringclasses
1 value
paypal/SeLion
dataproviders/src/main/java/com/paypal/selion/platform/dataprovider/impl/ExcelDataProviderImpl.java
ExcelDataProviderImpl.getSingleExcelRow
protected Object getSingleExcelRow(Object userObj, String key, boolean isExternalCall) { logger.entering(new Object[] { userObj, key, isExternalCall }); Class<?> cls; try { cls = Class.forName(userObj.getClass().getName()); } catch (ClassNotFoundException e) { thr...
java
protected Object getSingleExcelRow(Object userObj, String key, boolean isExternalCall) { logger.entering(new Object[] { userObj, key, isExternalCall }); Class<?> cls; try { cls = Class.forName(userObj.getClass().getName()); } catch (ClassNotFoundException e) { thr...
[ "protected", "Object", "getSingleExcelRow", "(", "Object", "userObj", ",", "String", "key", ",", "boolean", "isExternalCall", ")", "{", "logger", ".", "entering", "(", "new", "Object", "[", "]", "{", "userObj", ",", "key", ",", "isExternalCall", "}", ")", ...
This method fetches a specific row from an excel sheet which can be identified using a key and returns the data as an Object which can be cast back into the user's actual data type. @param userObj An Object into which data is to be packed into @param key A string that represents a key to search for in the excel sheet ...
[ "This", "method", "fetches", "a", "specific", "row", "from", "an", "excel", "sheet", "which", "can", "be", "identified", "using", "a", "key", "and", "returns", "the", "data", "as", "an", "Object", "which", "can", "be", "cast", "back", "into", "the", "use...
694d12d0df76db48d0360b16192770c6a4fbdfd2
https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/dataproviders/src/main/java/com/paypal/selion/platform/dataprovider/impl/ExcelDataProviderImpl.java#L388-L405
train
paypal/SeLion
dataproviders/src/main/java/com/paypal/selion/platform/dataprovider/impl/ExcelDataProviderImpl.java
ExcelDataProviderImpl.setValueForArrayType
private void setValueForArrayType(DataMemberInformation memberInfo) throws IllegalAccessException, ArrayIndexOutOfBoundsException, IllegalArgumentException, InstantiationException { logger.entering(memberInfo); Field eachField = memberInfo.getField(); Object objectToSetDataInto = mem...
java
private void setValueForArrayType(DataMemberInformation memberInfo) throws IllegalAccessException, ArrayIndexOutOfBoundsException, IllegalArgumentException, InstantiationException { logger.entering(memberInfo); Field eachField = memberInfo.getField(); Object objectToSetDataInto = mem...
[ "private", "void", "setValueForArrayType", "(", "DataMemberInformation", "memberInfo", ")", "throws", "IllegalAccessException", ",", "ArrayIndexOutOfBoundsException", ",", "IllegalArgumentException", ",", "InstantiationException", "{", "logger", ".", "entering", "(", "memberI...
A utility method that setups up data members which are arrays. @param memberInfo A {@link DataMemberInformation} object that represents values pertaining to every data member. @throws IllegalAccessException @throws ArrayIndexOutOfBoundsException @throws IllegalArgumentException @throws InstantiationException
[ "A", "utility", "method", "that", "setups", "up", "data", "members", "which", "are", "arrays", "." ]
694d12d0df76db48d0360b16192770c6a4fbdfd2
https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/dataproviders/src/main/java/com/paypal/selion/platform/dataprovider/impl/ExcelDataProviderImpl.java#L585-L627
train
paypal/SeLion
dataproviders/src/main/java/com/paypal/selion/platform/dataprovider/impl/ExcelDataProviderImpl.java
ExcelDataProviderImpl.setValueForNonArrayType
private void setValueForNonArrayType(DataMemberInformation memberInfo) throws IllegalAccessException, InstantiationException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException { logger.entering(memberInfo); Field eachField = memberInfo....
java
private void setValueForNonArrayType(DataMemberInformation memberInfo) throws IllegalAccessException, InstantiationException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException { logger.entering(memberInfo); Field eachField = memberInfo....
[ "private", "void", "setValueForNonArrayType", "(", "DataMemberInformation", "memberInfo", ")", "throws", "IllegalAccessException", ",", "InstantiationException", ",", "IllegalArgumentException", ",", "InvocationTargetException", ",", "NoSuchMethodException", ",", "SecurityExcepti...
A utility method that setups up data members which are NOT arrays. @param memberInfo A {@link DataMemberInformation} object that represents values pertaining to every data member. @throws IllegalAccessException @throws InstantiationException @throws IllegalArgumentException @throws InvocationTargetException @throws N...
[ "A", "utility", "method", "that", "setups", "up", "data", "members", "which", "are", "NOT", "arrays", "." ]
694d12d0df76db48d0360b16192770c6a4fbdfd2
https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/dataproviders/src/main/java/com/paypal/selion/platform/dataprovider/impl/ExcelDataProviderImpl.java#L642-L685
train
paypal/SeLion
dataproviders/src/main/java/com/paypal/selion/platform/dataprovider/impl/ExcelDataProviderImpl.java
ExcelDataProviderImpl.getHeaderRowContents
public List<String> getHeaderRowContents(String sheetName, int size) { return excelReader.getHeaderRowContents(sheetName, size); }
java
public List<String> getHeaderRowContents(String sheetName, int size) { return excelReader.getHeaderRowContents(sheetName, size); }
[ "public", "List", "<", "String", ">", "getHeaderRowContents", "(", "String", "sheetName", ",", "int", "size", ")", "{", "return", "excelReader", ".", "getHeaderRowContents", "(", "sheetName", ",", "size", ")", ";", "}" ]
Utility to get the header row contents of the excel sheet @param sheetName The excel sheet name where the data is to be fetched @param size The number of columns to read, including empty and blank column. @return the header row data.
[ "Utility", "to", "get", "the", "header", "row", "contents", "of", "the", "excel", "sheet" ]
694d12d0df76db48d0360b16192770c6a4fbdfd2
https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/dataproviders/src/main/java/com/paypal/selion/platform/dataprovider/impl/ExcelDataProviderImpl.java#L714-L716
train
paypal/SeLion
client/src/main/java/com/paypal/selion/platform/html/Image.java
Image.getWidth
public int getWidth() { try { return ((RemoteWebElement) getElement()).getSize().width; } catch (NumberFormatException e) { throw new WebElementException("Attribute " + WIDTH + " not found for Image " + getLocator(), e); } }
java
public int getWidth() { try { return ((RemoteWebElement) getElement()).getSize().width; } catch (NumberFormatException e) { throw new WebElementException("Attribute " + WIDTH + " not found for Image " + getLocator(), e); } }
[ "public", "int", "getWidth", "(", ")", "{", "try", "{", "return", "(", "(", "RemoteWebElement", ")", "getElement", "(", ")", ")", ".", "getSize", "(", ")", ".", "width", ";", "}", "catch", "(", "NumberFormatException", "e", ")", "{", "throw", "new", ...
This function is to get image's width. @return the image's width @throws WebElementException
[ "This", "function", "is", "to", "get", "image", "s", "width", "." ]
694d12d0df76db48d0360b16192770c6a4fbdfd2
https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/client/src/main/java/com/paypal/selion/platform/html/Image.java#L97-L103
train
paypal/SeLion
client/src/main/java/com/paypal/selion/platform/html/Image.java
Image.getHeight
public int getHeight() { try { return ((RemoteWebElement) getElement()).getSize().height; } catch (NumberFormatException e) { throw new WebElementException("Attribute " + HEIGHT + " not found for Image " + getLocator(), e); } }
java
public int getHeight() { try { return ((RemoteWebElement) getElement()).getSize().height; } catch (NumberFormatException e) { throw new WebElementException("Attribute " + HEIGHT + " not found for Image " + getLocator(), e); } }
[ "public", "int", "getHeight", "(", ")", "{", "try", "{", "return", "(", "(", "RemoteWebElement", ")", "getElement", "(", ")", ")", ".", "getSize", "(", ")", ".", "height", ";", "}", "catch", "(", "NumberFormatException", "e", ")", "{", "throw", "new", ...
This function is to get image's height. @return the image's height @throws WebElementException
[ "This", "function", "is", "to", "get", "image", "s", "height", "." ]
694d12d0df76db48d0360b16192770c6a4fbdfd2
https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/client/src/main/java/com/paypal/selion/platform/html/Image.java#L112-L118
train
paypal/SeLion
client/src/main/java/com/paypal/selion/internal/platform/grid/AbstractBaseLocalServerComponent.java
AbstractBaseLocalServerComponent.checkPort
void checkPort(int port, String msg) { StringBuilder message = new StringBuilder().append(" ").append(msg); String portInUseError = String.format("Port %d is already in use. Please shutdown the service " + "listening on this port or configure a different port%s.", port, message); ...
java
void checkPort(int port, String msg) { StringBuilder message = new StringBuilder().append(" ").append(msg); String portInUseError = String.format("Port %d is already in use. Please shutdown the service " + "listening on this port or configure a different port%s.", port, message); ...
[ "void", "checkPort", "(", "int", "port", ",", "String", "msg", ")", "{", "StringBuilder", "message", "=", "new", "StringBuilder", "(", ")", ".", "append", "(", "\" \"", ")", ".", "append", "(", "msg", ")", ";", "String", "portInUseError", "=", "String", ...
Check the port availability @param port the port to check @param msg the text to append to the end of the error message displayed when the port is not available. @throws IllegalArgumentException when the port is not available.
[ "Check", "the", "port", "availability" ]
694d12d0df76db48d0360b16192770c6a4fbdfd2
https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/client/src/main/java/com/paypal/selion/internal/platform/grid/AbstractBaseLocalServerComponent.java#L112-L126
train
paypal/SeLion
dataproviders/src/main/java/com/paypal/selion/platform/dataprovider/impl/YamlDataProviderImpl.java
YamlDataProviderImpl.getDataByIndex
@Override public Object[][] getDataByIndex(String indexes) throws IOException, DataProviderException { logger.entering(indexes); int[] arrayIndex = DataProviderHelper.parseIndexString(indexes); Object[][] yamlObjRequested = getDataByIndex(arrayIndex); logger.exiting((Obj...
java
@Override public Object[][] getDataByIndex(String indexes) throws IOException, DataProviderException { logger.entering(indexes); int[] arrayIndex = DataProviderHelper.parseIndexString(indexes); Object[][] yamlObjRequested = getDataByIndex(arrayIndex); logger.exiting((Obj...
[ "@", "Override", "public", "Object", "[", "]", "[", "]", "getDataByIndex", "(", "String", "indexes", ")", "throws", "IOException", ",", "DataProviderException", "{", "logger", ".", "entering", "(", "indexes", ")", ";", "int", "[", "]", "arrayIndex", "=", "...
Gets yaml data for requested indexes. @param indexes the input string represent the indexes to be parse @return Object[][] Two dimensional object to be used with TestNG DataProvider @throws IOException
[ "Gets", "yaml", "data", "for", "requested", "indexes", "." ]
694d12d0df76db48d0360b16192770c6a4fbdfd2
https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/dataproviders/src/main/java/com/paypal/selion/platform/dataprovider/impl/YamlDataProviderImpl.java#L398-L407
train
paypal/SeLion
client/src/main/java/com/paypal/selion/platform/html/SelectList.java
SelectList.selectByValue
public void selectByValue(String value) { getDispatcher().beforeSelect(this, value); new Select(getElement()).selectByValue(value); if (Config.getBoolConfigProperty(ConfigProperty.ENABLE_GUI_LOGGING)) { logUIActions(UIActions.SELECTED, value); } getD...
java
public void selectByValue(String value) { getDispatcher().beforeSelect(this, value); new Select(getElement()).selectByValue(value); if (Config.getBoolConfigProperty(ConfigProperty.ENABLE_GUI_LOGGING)) { logUIActions(UIActions.SELECTED, value); } getD...
[ "public", "void", "selectByValue", "(", "String", "value", ")", "{", "getDispatcher", "(", ")", ".", "beforeSelect", "(", "this", ",", "value", ")", ";", "new", "Select", "(", "getElement", "(", ")", ")", ".", "selectByValue", "(", "value", ")", ";", "...
Select all options that have a value matching the argument. @param value the value to select
[ "Select", "all", "options", "that", "have", "a", "value", "matching", "the", "argument", "." ]
694d12d0df76db48d0360b16192770c6a4fbdfd2
https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/client/src/main/java/com/paypal/selion/platform/html/SelectList.java#L170-L179
train
paypal/SeLion
client/src/main/java/com/paypal/selion/platform/html/SelectList.java
SelectList.selectByLabel
public void selectByLabel(String label) { getDispatcher().beforeSelect(this, label); new Select(getElement()).selectByVisibleText(label); if (Config.getBoolConfigProperty(ConfigProperty.ENABLE_GUI_LOGGING)) { logUIActions(UIActions.SELECTED, label); } ...
java
public void selectByLabel(String label) { getDispatcher().beforeSelect(this, label); new Select(getElement()).selectByVisibleText(label); if (Config.getBoolConfigProperty(ConfigProperty.ENABLE_GUI_LOGGING)) { logUIActions(UIActions.SELECTED, label); } ...
[ "public", "void", "selectByLabel", "(", "String", "label", ")", "{", "getDispatcher", "(", ")", ".", "beforeSelect", "(", "this", ",", "label", ")", ";", "new", "Select", "(", "getElement", "(", ")", ")", ".", "selectByVisibleText", "(", "label", ")", ";...
Select all options that display text matching the argument. @param label the label to select
[ "Select", "all", "options", "that", "display", "text", "matching", "the", "argument", "." ]
694d12d0df76db48d0360b16192770c6a4fbdfd2
https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/client/src/main/java/com/paypal/selion/platform/html/SelectList.java#L187-L196
train
paypal/SeLion
client/src/main/java/com/paypal/selion/platform/html/SelectList.java
SelectList.selectByValue
public void selectByValue(String[] values) { for (int i = 0; i < values.length; i++) { selectByValue(values[i]); } }
java
public void selectByValue(String[] values) { for (int i = 0; i < values.length; i++) { selectByValue(values[i]); } }
[ "public", "void", "selectByValue", "(", "String", "[", "]", "values", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "values", ".", "length", ";", "i", "++", ")", "{", "selectByValue", "(", "values", "[", "i", "]", ")", ";", "}", "}...
Select all options that have a value matching any arguments. @param values the values to select
[ "Select", "all", "options", "that", "have", "a", "value", "matching", "any", "arguments", "." ]
694d12d0df76db48d0360b16192770c6a4fbdfd2
https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/client/src/main/java/com/paypal/selion/platform/html/SelectList.java#L222-L226
train
paypal/SeLion
client/src/main/java/com/paypal/selion/platform/html/SelectList.java
SelectList.selectByLabel
public void selectByLabel(String[] labels) { for (int i = 0; i < labels.length; i++) { selectByLabel(labels[i]); } }
java
public void selectByLabel(String[] labels) { for (int i = 0; i < labels.length; i++) { selectByLabel(labels[i]); } }
[ "public", "void", "selectByLabel", "(", "String", "[", "]", "labels", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "labels", ".", "length", ";", "i", "++", ")", "{", "selectByLabel", "(", "labels", "[", "i", "]", ")", ";", "}", "}...
Select all options that display text matching any arguments. @param labels the labels to select
[ "Select", "all", "options", "that", "display", "text", "matching", "any", "arguments", "." ]
694d12d0df76db48d0360b16192770c6a4fbdfd2
https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/client/src/main/java/com/paypal/selion/platform/html/SelectList.java#L234-L238
train
paypal/SeLion
client/src/main/java/com/paypal/selion/platform/html/SelectList.java
SelectList.selectByIndex
public void selectByIndex(String[] indexes) { for (int i = 0; i < indexes.length; i++) { selectByIndex(Integer.parseInt(indexes[i])); } }
java
public void selectByIndex(String[] indexes) { for (int i = 0; i < indexes.length; i++) { selectByIndex(Integer.parseInt(indexes[i])); } }
[ "public", "void", "selectByIndex", "(", "String", "[", "]", "indexes", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "indexes", ".", "length", ";", "i", "++", ")", "{", "selectByIndex", "(", "Integer", ".", "parseInt", "(", "indexes", ...
Select the option at the given indexes. This is done by examing the "index" attribute of an element, and not merely by counting. @param indexes the indexes to select
[ "Select", "the", "option", "at", "the", "given", "indexes", ".", "This", "is", "done", "by", "examing", "the", "index", "attribute", "of", "an", "element", "and", "not", "merely", "by", "counting", "." ]
694d12d0df76db48d0360b16192770c6a4fbdfd2
https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/client/src/main/java/com/paypal/selion/platform/html/SelectList.java#L247-L251
train
paypal/SeLion
client/src/main/java/com/paypal/selion/platform/html/SelectList.java
SelectList.getSelectOptions
public String[] getSelectOptions() { List<WebElement> optionList = getElement().findElements(By.tagName("option")); String[] optionArray = new String[optionList.size()]; for (int i = 0; i < optionList.size(); i++) { optionArray[i] = optionList.get(i).getText(); } retu...
java
public String[] getSelectOptions() { List<WebElement> optionList = getElement().findElements(By.tagName("option")); String[] optionArray = new String[optionList.size()]; for (int i = 0; i < optionList.size(); i++) { optionArray[i] = optionList.get(i).getText(); } retu...
[ "public", "String", "[", "]", "getSelectOptions", "(", ")", "{", "List", "<", "WebElement", ">", "optionList", "=", "getElement", "(", ")", ".", "findElements", "(", "By", ".", "tagName", "(", "\"option\"", ")", ")", ";", "String", "[", "]", "optionArray...
Returns all options currently selected. @return All options currently selected.
[ "Returns", "all", "options", "currently", "selected", "." ]
694d12d0df76db48d0360b16192770c6a4fbdfd2
https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/client/src/main/java/com/paypal/selion/platform/html/SelectList.java#L288-L295
train
paypal/SeLion
client/src/main/java/com/paypal/selion/platform/html/SelectList.java
SelectList.getSelectedLabel
public String getSelectedLabel() { List<WebElement> options = getElement().findElements(By.tagName("option")); for (WebElement option : options) { if (option.isSelected()) { return option.getText(); } } return null; }
java
public String getSelectedLabel() { List<WebElement> options = getElement().findElements(By.tagName("option")); for (WebElement option : options) { if (option.isSelected()) { return option.getText(); } } return null; }
[ "public", "String", "getSelectedLabel", "(", ")", "{", "List", "<", "WebElement", ">", "options", "=", "getElement", "(", ")", ".", "findElements", "(", "By", ".", "tagName", "(", "\"option\"", ")", ")", ";", "for", "(", "WebElement", "option", ":", "opt...
Get a single selected label. If multiple options are selected, then the first one is returned. @return A single selected label.
[ "Get", "a", "single", "selected", "label", ".", "If", "multiple", "options", "are", "selected", "then", "the", "first", "one", "is", "returned", "." ]
694d12d0df76db48d0360b16192770c6a4fbdfd2
https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/client/src/main/java/com/paypal/selion/platform/html/SelectList.java#L302-L310
train
paypal/SeLion
client/src/main/java/com/paypal/selion/platform/html/SelectList.java
SelectList.getSelectedValue
public String getSelectedValue() { List<WebElement> options = getElement().findElements(By.tagName("option")); for (WebElement option : options) { if (option.isSelected()) { return option.getAttribute("value"); } } return null; }
java
public String getSelectedValue() { List<WebElement> options = getElement().findElements(By.tagName("option")); for (WebElement option : options) { if (option.isSelected()) { return option.getAttribute("value"); } } return null; }
[ "public", "String", "getSelectedValue", "(", ")", "{", "List", "<", "WebElement", ">", "options", "=", "getElement", "(", ")", ".", "findElements", "(", "By", ".", "tagName", "(", "\"option\"", ")", ")", ";", "for", "(", "WebElement", "option", ":", "opt...
Get a single selected value. If multiple options are selected, then the first one is returned. @return A single selected value.
[ "Get", "a", "single", "selected", "value", ".", "If", "multiple", "options", "are", "selected", "then", "the", "first", "one", "is", "returned", "." ]
694d12d0df76db48d0360b16192770c6a4fbdfd2
https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/client/src/main/java/com/paypal/selion/platform/html/SelectList.java#L317-L325
train
paypal/SeLion
client/src/main/java/com/paypal/selion/platform/html/SelectList.java
SelectList.getSelectedLabels
public String[] getSelectedLabels() { List<WebElement> options = getElement().findElements(By.tagName("option")); List<String> selected = new ArrayList<String>(); for (WebElement option : options) { if (option.isSelected()) { selected.add(option.getText()); ...
java
public String[] getSelectedLabels() { List<WebElement> options = getElement().findElements(By.tagName("option")); List<String> selected = new ArrayList<String>(); for (WebElement option : options) { if (option.isSelected()) { selected.add(option.getText()); ...
[ "public", "String", "[", "]", "getSelectedLabels", "(", ")", "{", "List", "<", "WebElement", ">", "options", "=", "getElement", "(", ")", ".", "findElements", "(", "By", ".", "tagName", "(", "\"option\"", ")", ")", ";", "List", "<", "String", ">", "sel...
Gets multiple selected labels. @return All selected labels.
[ "Gets", "multiple", "selected", "labels", "." ]
694d12d0df76db48d0360b16192770c6a4fbdfd2
https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/client/src/main/java/com/paypal/selion/platform/html/SelectList.java#L332-L341
train
paypal/SeLion
client/src/main/java/com/paypal/selion/platform/html/SelectList.java
SelectList.getSelectedValues
public String[] getSelectedValues() { List<WebElement> options = getElement().findElements(By.tagName("option")); List<String> selected = new ArrayList<String>(); for (WebElement option : options) { if (option.isSelected()) { selected.add(option.getAttribute("value"))...
java
public String[] getSelectedValues() { List<WebElement> options = getElement().findElements(By.tagName("option")); List<String> selected = new ArrayList<String>(); for (WebElement option : options) { if (option.isSelected()) { selected.add(option.getAttribute("value"))...
[ "public", "String", "[", "]", "getSelectedValues", "(", ")", "{", "List", "<", "WebElement", ">", "options", "=", "getElement", "(", ")", ".", "findElements", "(", "By", ".", "tagName", "(", "\"option\"", ")", ")", ";", "List", "<", "String", ">", "sel...
Gets multiple selected values. @return All selected values.
[ "Gets", "multiple", "selected", "values", "." ]
694d12d0df76db48d0360b16192770c6a4fbdfd2
https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/client/src/main/java/com/paypal/selion/platform/html/SelectList.java#L348-L357
train
paypal/SeLion
client/src/main/java/com/paypal/selion/platform/html/SelectList.java
SelectList.getContentLabel
public String[] getContentLabel() { List<WebElement> options = getElement().findElements(By.tagName("option")); List<String> contents = new ArrayList<String>(); for (WebElement option : options) { contents.add(option.getText()); } return (String[]) contents.toArray(...
java
public String[] getContentLabel() { List<WebElement> options = getElement().findElements(By.tagName("option")); List<String> contents = new ArrayList<String>(); for (WebElement option : options) { contents.add(option.getText()); } return (String[]) contents.toArray(...
[ "public", "String", "[", "]", "getContentLabel", "(", ")", "{", "List", "<", "WebElement", ">", "options", "=", "getElement", "(", ")", ".", "findElements", "(", "By", ".", "tagName", "(", "\"option\"", ")", ")", ";", "List", "<", "String", ">", "conte...
Get all labels, whether they are selected or not. @return All labels, selected or not.
[ "Get", "all", "labels", "whether", "they", "are", "selected", "or", "not", "." ]
694d12d0df76db48d0360b16192770c6a4fbdfd2
https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/client/src/main/java/com/paypal/selion/platform/html/SelectList.java#L364-L373
train
paypal/SeLion
client/src/main/java/com/paypal/selion/platform/html/SelectList.java
SelectList.getContentValue
public String[] getContentValue() { List<WebElement> options = getElement().findElements(By.tagName("option")); List<String> contents = new ArrayList<String>(); for (WebElement option : options) { contents.add(option.getAttribute("value")); } return (String[]) conte...
java
public String[] getContentValue() { List<WebElement> options = getElement().findElements(By.tagName("option")); List<String> contents = new ArrayList<String>(); for (WebElement option : options) { contents.add(option.getAttribute("value")); } return (String[]) conte...
[ "public", "String", "[", "]", "getContentValue", "(", ")", "{", "List", "<", "WebElement", ">", "options", "=", "getElement", "(", ")", ".", "findElements", "(", "By", ".", "tagName", "(", "\"option\"", ")", ")", ";", "List", "<", "String", ">", "conte...
Get all values, whether they are selected or not. @return All values, selected or not.
[ "Get", "all", "values", "whether", "they", "are", "selected", "or", "not", "." ]
694d12d0df76db48d0360b16192770c6a4fbdfd2
https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/client/src/main/java/com/paypal/selion/platform/html/SelectList.java#L380-L389
train
paypal/SeLion
client/src/main/java/com/paypal/selion/platform/html/SelectList.java
SelectList.deselectByValue
public void deselectByValue(String value) { getDispatcher().beforeDeselect(this, value); new Select(getElement()).deselectByValue(value); if (Config.getBoolConfigProperty(ConfigProperty.ENABLE_GUI_LOGGING)) { logUIActions(UIActions.CLEARED, value); } ...
java
public void deselectByValue(String value) { getDispatcher().beforeDeselect(this, value); new Select(getElement()).deselectByValue(value); if (Config.getBoolConfigProperty(ConfigProperty.ENABLE_GUI_LOGGING)) { logUIActions(UIActions.CLEARED, value); } ...
[ "public", "void", "deselectByValue", "(", "String", "value", ")", "{", "getDispatcher", "(", ")", ".", "beforeDeselect", "(", "this", ",", "value", ")", ";", "new", "Select", "(", "getElement", "(", ")", ")", ".", "deselectByValue", "(", "value", ")", ";...
Deselect all options that have a value matching the argument. @param value the value to deselect
[ "Deselect", "all", "options", "that", "have", "a", "value", "matching", "the", "argument", "." ]
694d12d0df76db48d0360b16192770c6a4fbdfd2
https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/client/src/main/java/com/paypal/selion/platform/html/SelectList.java#L414-L423
train
paypal/SeLion
client/src/main/java/com/paypal/selion/platform/html/SelectList.java
SelectList.deselectByIndex
public void deselectByIndex(int index) { getDispatcher().beforeDeselect(this, index); new Select(getElement()).deselectByIndex(index); if (Config.getBoolConfigProperty(ConfigProperty.ENABLE_GUI_LOGGING)) { logUIActions(UIActions.CLEARED, Integer.toString(index)); } ...
java
public void deselectByIndex(int index) { getDispatcher().beforeDeselect(this, index); new Select(getElement()).deselectByIndex(index); if (Config.getBoolConfigProperty(ConfigProperty.ENABLE_GUI_LOGGING)) { logUIActions(UIActions.CLEARED, Integer.toString(index)); } ...
[ "public", "void", "deselectByIndex", "(", "int", "index", ")", "{", "getDispatcher", "(", ")", ".", "beforeDeselect", "(", "this", ",", "index", ")", ";", "new", "Select", "(", "getElement", "(", ")", ")", ".", "deselectByIndex", "(", "index", ")", ";", ...
Deselect the option at the given index. This is done by examing the "index" attribute of an element, and not merely by counting. @param index the index to deselect
[ "Deselect", "the", "option", "at", "the", "given", "index", ".", "This", "is", "done", "by", "examing", "the", "index", "attribute", "of", "an", "element", "and", "not", "merely", "by", "counting", "." ]
694d12d0df76db48d0360b16192770c6a4fbdfd2
https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/client/src/main/java/com/paypal/selion/platform/html/SelectList.java#L432-L441
train
paypal/SeLion
client/src/main/java/com/paypal/selion/platform/html/SelectList.java
SelectList.deselectByLabel
public void deselectByLabel(String label) { getDispatcher().beforeDeselect(this, label); new Select(getElement()).deselectByVisibleText(label); if (Config.getBoolConfigProperty(ConfigProperty.ENABLE_GUI_LOGGING)) { logUIActions(UIActions.CLEARED, label); } ...
java
public void deselectByLabel(String label) { getDispatcher().beforeDeselect(this, label); new Select(getElement()).deselectByVisibleText(label); if (Config.getBoolConfigProperty(ConfigProperty.ENABLE_GUI_LOGGING)) { logUIActions(UIActions.CLEARED, label); } ...
[ "public", "void", "deselectByLabel", "(", "String", "label", ")", "{", "getDispatcher", "(", ")", ".", "beforeDeselect", "(", "this", ",", "label", ")", ";", "new", "Select", "(", "getElement", "(", ")", ")", ".", "deselectByVisibleText", "(", "label", ")"...
Deselect all options that display text matching the argument. @param label the label to deselect
[ "Deselect", "all", "options", "that", "display", "text", "matching", "the", "argument", "." ]
694d12d0df76db48d0360b16192770c6a4fbdfd2
https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/client/src/main/java/com/paypal/selion/platform/html/SelectList.java#L449-L458
train
paypal/SeLion
client/src/main/java/com/paypal/selion/platform/html/RadioButton.java
RadioButton.click
public void click(String locator) { getDispatcher().beforeClick(this, locator); getElement().click(); validatePresenceOfAlert(); if (Config.getBoolConfigProperty(ConfigProperty.ENABLE_GUI_LOGGING)) { logUIAction(UIActions.CLICKED); } WebDriverWaitUtil...
java
public void click(String locator) { getDispatcher().beforeClick(this, locator); getElement().click(); validatePresenceOfAlert(); if (Config.getBoolConfigProperty(ConfigProperty.ENABLE_GUI_LOGGING)) { logUIAction(UIActions.CLICKED); } WebDriverWaitUtil...
[ "public", "void", "click", "(", "String", "locator", ")", "{", "getDispatcher", "(", ")", ".", "beforeClick", "(", "this", ",", "locator", ")", ";", "getElement", "(", ")", ".", "click", "(", ")", ";", "validatePresenceOfAlert", "(", ")", ";", "if", "(...
The RadioButton click function and wait for object to load
[ "The", "RadioButton", "click", "function", "and", "wait", "for", "object", "to", "load" ]
694d12d0df76db48d0360b16192770c6a4fbdfd2
https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/client/src/main/java/com/paypal/selion/platform/html/RadioButton.java#L125-L136
train
paypal/SeLion
client/src/main/java/com/paypal/selion/internal/reports/runtimereport/MethodInfo.java
MethodInfo.parseResults
private void parseResults() { logger.entering(); if (result.getStatus() == ITestResult.SUCCESS) { this.status = "Passed"; } else if (result.getStatus() == ITestResult.FAILURE) { this.status = "Failed"; } else if (result.getStatus() == ITestResult.SKIP) { ...
java
private void parseResults() { logger.entering(); if (result.getStatus() == ITestResult.SUCCESS) { this.status = "Passed"; } else if (result.getStatus() == ITestResult.FAILURE) { this.status = "Failed"; } else if (result.getStatus() == ITestResult.SKIP) { ...
[ "private", "void", "parseResults", "(", ")", "{", "logger", ".", "entering", "(", ")", ";", "if", "(", "result", ".", "getStatus", "(", ")", "==", "ITestResult", ".", "SUCCESS", ")", "{", "this", ".", "status", "=", "\"Passed\"", ";", "}", "else", "i...
Parse the test results and convert to the MethodInfo fields
[ "Parse", "the", "test", "results", "and", "convert", "to", "the", "MethodInfo", "fields" ]
694d12d0df76db48d0360b16192770c6a4fbdfd2
https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/client/src/main/java/com/paypal/selion/internal/reports/runtimereport/MethodInfo.java#L85-L117
train
paypal/SeLion
client/src/main/java/com/paypal/selion/internal/reports/runtimereport/MethodInfo.java
MethodInfo.getStackTraceInfo
public String getStackTraceInfo(Throwable aThrowable) { final Writer localWriter = new StringWriter(); final PrintWriter printWriter = new PrintWriter(localWriter); aThrowable.printStackTrace(printWriter); return localWriter.toString(); }
java
public String getStackTraceInfo(Throwable aThrowable) { final Writer localWriter = new StringWriter(); final PrintWriter printWriter = new PrintWriter(localWriter); aThrowable.printStackTrace(printWriter); return localWriter.toString(); }
[ "public", "String", "getStackTraceInfo", "(", "Throwable", "aThrowable", ")", "{", "final", "Writer", "localWriter", "=", "new", "StringWriter", "(", ")", ";", "final", "PrintWriter", "printWriter", "=", "new", "PrintWriter", "(", "localWriter", ")", ";", "aThro...
Used to return StackTrace of an Exception as String. @param aThrowable @return StackTrace as String
[ "Used", "to", "return", "StackTrace", "of", "an", "Exception", "as", "String", "." ]
694d12d0df76db48d0360b16192770c6a4fbdfd2
https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/client/src/main/java/com/paypal/selion/internal/reports/runtimereport/MethodInfo.java#L153-L158
train
paypal/SeLion
client/src/main/java/com/paypal/selion/internal/reports/runtimereport/MethodInfo.java
MethodInfo.toJson
public String toJson() { logger.entering(); parseResults(); Gson gson = new GsonBuilder().setPrettyPrinting().create(); String json = gson.toJson(this); logger.exiting(json); return json; }
java
public String toJson() { logger.entering(); parseResults(); Gson gson = new GsonBuilder().setPrettyPrinting().create(); String json = gson.toJson(this); logger.exiting(json); return json; }
[ "public", "String", "toJson", "(", ")", "{", "logger", ".", "entering", "(", ")", ";", "parseResults", "(", ")", ";", "Gson", "gson", "=", "new", "GsonBuilder", "(", ")", ".", "setPrettyPrinting", "(", ")", ".", "create", "(", ")", ";", "String", "js...
This method generate the JSON string for the instance. GSON builder helps to build JSON string and it will exclude the static and transient variable during generation. @return JSON string
[ "This", "method", "generate", "the", "JSON", "string", "for", "the", "instance", ".", "GSON", "builder", "helps", "to", "build", "JSON", "string", "and", "it", "will", "exclude", "the", "static", "and", "transient", "variable", "during", "generation", "." ]
694d12d0df76db48d0360b16192770c6a4fbdfd2
https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/client/src/main/java/com/paypal/selion/internal/reports/runtimereport/MethodInfo.java#L175-L184
train
paypal/SeLion
server/src/main/java/com/paypal/selion/utils/ConfigParser.java
ConfigParser.setConfigFile
public static synchronized ConfigParser setConfigFile(String file) { LOGGER.entering(file); if (configuration == null) { configFile = file; } LOGGER.exiting(parser.toString()); return parser; }
java
public static synchronized ConfigParser setConfigFile(String file) { LOGGER.entering(file); if (configuration == null) { configFile = file; } LOGGER.exiting(parser.toString()); return parser; }
[ "public", "static", "synchronized", "ConfigParser", "setConfigFile", "(", "String", "file", ")", "{", "LOGGER", ".", "entering", "(", "file", ")", ";", "if", "(", "configuration", "==", "null", ")", "{", "configFile", "=", "file", ";", "}", "LOGGER", ".", ...
Set the config file @param file the SeLion Grid config file to use
[ "Set", "the", "config", "file" ]
694d12d0df76db48d0360b16192770c6a4fbdfd2
https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/server/src/main/java/com/paypal/selion/utils/ConfigParser.java#L70-L77
train
paypal/SeLion
dataproviders/src/main/java/com/paypal/selion/platform/dataprovider/impl/ExcelReader.java
ExcelReader.getRowContents
public List<String> getRowContents(Row row, int size) { logger.entering(new Object[] { row, size }); List<String> rowData = new ArrayList<String>(); if (row != null) { for (int i = 1; i <= size; i++) { String data = null; if (row.getCell(i) != null) { ...
java
public List<String> getRowContents(Row row, int size) { logger.entering(new Object[] { row, size }); List<String> rowData = new ArrayList<String>(); if (row != null) { for (int i = 1; i <= size; i++) { String data = null; if (row.getCell(i) != null) { ...
[ "public", "List", "<", "String", ">", "getRowContents", "(", "Row", "row", ",", "int", "size", ")", "{", "logger", ".", "entering", "(", "new", "Object", "[", "]", "{", "row", ",", "size", "}", ")", ";", "List", "<", "String", ">", "rowData", "=", ...
Return the row contents of the specified row in a list of string format. @param size - The number of columns to read, including empty and blank column. @return List<String> String array contains the read data.
[ "Return", "the", "row", "contents", "of", "the", "specified", "row", "in", "a", "list", "of", "string", "format", "." ]
694d12d0df76db48d0360b16192770c6a4fbdfd2
https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/dataproviders/src/main/java/com/paypal/selion/platform/dataprovider/impl/ExcelReader.java#L212-L226
train
paypal/SeLion
dataproviders/src/main/java/com/paypal/selion/platform/dataprovider/impl/ExcelReader.java
ExcelReader.getRowIndex
public int getRowIndex(String sheetName, String key) { logger.entering(new Object[] { sheetName, key }); int index = -1; Sheet sheet = fetchSheet(sheetName); int rowCount = sheet.getPhysicalNumberOfRows(); for (int i = 0; i < rowCount; i++) { Row row = sheet.getRow(i...
java
public int getRowIndex(String sheetName, String key) { logger.entering(new Object[] { sheetName, key }); int index = -1; Sheet sheet = fetchSheet(sheetName); int rowCount = sheet.getPhysicalNumberOfRows(); for (int i = 0; i < rowCount; i++) { Row row = sheet.getRow(i...
[ "public", "int", "getRowIndex", "(", "String", "sheetName", ",", "String", "key", ")", "{", "logger", ".", "entering", "(", "new", "Object", "[", "]", "{", "sheetName", ",", "key", "}", ")", ";", "int", "index", "=", "-", "1", ";", "Sheet", "sheet", ...
Search for the input key from the specified sheet name and return the index position of the row that contained the key @param sheetName - A String that represents the Sheet name from which data is to be read @param key - A String that represents the key for the row for which search is being done. @return - An int that...
[ "Search", "for", "the", "input", "key", "from", "the", "specified", "sheet", "name", "and", "return", "the", "index", "position", "of", "the", "row", "that", "contained", "the", "key" ]
694d12d0df76db48d0360b16192770c6a4fbdfd2
https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/dataproviders/src/main/java/com/paypal/selion/platform/dataprovider/impl/ExcelReader.java#L240-L259
train
paypal/SeLion
server/src/main/java/com/paypal/selion/grid/FileExtractor.java
FileExtractor.getExecutableNames
static List<String> getExecutableNames() { List<String> executableNames = new ArrayList<>(); if (Platform.getCurrent().is(Platform.WINDOWS)) { Collections.addAll(executableNames, ProcessNames.PHANTOMJS.getWindowsImageName(), ProcessNames.CHROMEDRIVER.getWindowsImageName()...
java
static List<String> getExecutableNames() { List<String> executableNames = new ArrayList<>(); if (Platform.getCurrent().is(Platform.WINDOWS)) { Collections.addAll(executableNames, ProcessNames.PHANTOMJS.getWindowsImageName(), ProcessNames.CHROMEDRIVER.getWindowsImageName()...
[ "static", "List", "<", "String", ">", "getExecutableNames", "(", ")", "{", "List", "<", "String", ">", "executableNames", "=", "new", "ArrayList", "<>", "(", ")", ";", "if", "(", "Platform", ".", "getCurrent", "(", ")", ".", "is", "(", "Platform", ".",...
Utility method to return the executable names for the specified platform. @return {@link List} of {@link String} containing the executable file names.
[ "Utility", "method", "to", "return", "the", "executable", "names", "for", "the", "specified", "platform", "." ]
694d12d0df76db48d0360b16192770c6a4fbdfd2
https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/server/src/main/java/com/paypal/selion/grid/FileExtractor.java#L62-L73
train
paypal/SeLion
server/src/main/java/com/paypal/selion/grid/FileExtractor.java
FileExtractor.extractMsi
static String extractMsi(String msiFile) { LOGGER.entering(msiFile); Process process = null; String exeFilePath = null; boolean isMsiExtracted = true; try { process = Runtime.getRuntime().exec( new String[] { "msiexec", "/a", msiFile, "/qn", "TARG...
java
static String extractMsi(String msiFile) { LOGGER.entering(msiFile); Process process = null; String exeFilePath = null; boolean isMsiExtracted = true; try { process = Runtime.getRuntime().exec( new String[] { "msiexec", "/a", msiFile, "/qn", "TARG...
[ "static", "String", "extractMsi", "(", "String", "msiFile", ")", "{", "LOGGER", ".", "entering", "(", "msiFile", ")", ";", "Process", "process", "=", "null", ";", "String", "exeFilePath", "=", "null", ";", "boolean", "isMsiExtracted", "=", "true", ";", "tr...
Installs MicrosoftWebDriver.msi file as administrator in SELION_HOME_DIR and also deletes unwanted file and directory created by Msiexec. @param msiFile the .msi file to extract @return The path of installed MicrosoftWebDriver
[ "Installs", "MicrosoftWebDriver", ".", "msi", "file", "as", "administrator", "in", "SELION_HOME_DIR", "and", "also", "deletes", "unwanted", "file", "and", "directory", "created", "by", "Msiexec", "." ]
694d12d0df76db48d0360b16192770c6a4fbdfd2
https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/server/src/main/java/com/paypal/selion/grid/FileExtractor.java#L187-L216
train
paypal/SeLion
client/src/main/java/com/paypal/selion/platform/grid/MobileProviderService.java
MobileProviderService.createDriver
public RemoteWebDriver createDriver(MobileNodeType nodeType, WebDriverPlatform platform, CommandExecutor command, URL url, Capabilities caps) { if (mobileProviders.containsKey(nodeType)) { logger.log(Level.FINE, "Found mobile driver provider that supports " +...
java
public RemoteWebDriver createDriver(MobileNodeType nodeType, WebDriverPlatform platform, CommandExecutor command, URL url, Capabilities caps) { if (mobileProviders.containsKey(nodeType)) { logger.log(Level.FINE, "Found mobile driver provider that supports " +...
[ "public", "RemoteWebDriver", "createDriver", "(", "MobileNodeType", "nodeType", ",", "WebDriverPlatform", "platform", ",", "CommandExecutor", "command", ",", "URL", "url", ",", "Capabilities", "caps", ")", "{", "if", "(", "mobileProviders", ".", "containsKey", "(", ...
Creates a new RemoteWebDriver instance from the first MobileProvider that supports the specified nodeType. @param nodeType - The {@link MobileNodeType} to use for creating this mobile remote driver. @param platform - The {@link WebDriverPlatform}. @param command - The commandExecutor. @param url - The URL to use...
[ "Creates", "a", "new", "RemoteWebDriver", "instance", "from", "the", "first", "MobileProvider", "that", "supports", "the", "specified", "nodeType", "." ]
694d12d0df76db48d0360b16192770c6a4fbdfd2
https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/client/src/main/java/com/paypal/selion/platform/grid/MobileProviderService.java#L71-L80
train
paypal/SeLion
client/src/main/java/com/paypal/selion/platform/utilities/WebDriverWaitUtils.java
WebDriverWaitUtils.waitUntilElementIsClickable
public static void waitUntilElementIsClickable(final String elementLocator) { logger.entering(elementLocator); By by = HtmlElementUtils.resolveByType(elementLocator); ExpectedCondition<WebElement> condition = ExpectedConditions.elementToBeClickable(by); waitForCondition(condition); ...
java
public static void waitUntilElementIsClickable(final String elementLocator) { logger.entering(elementLocator); By by = HtmlElementUtils.resolveByType(elementLocator); ExpectedCondition<WebElement> condition = ExpectedConditions.elementToBeClickable(by); waitForCondition(condition); ...
[ "public", "static", "void", "waitUntilElementIsClickable", "(", "final", "String", "elementLocator", ")", "{", "logger", ".", "entering", "(", "elementLocator", ")", ";", "By", "by", "=", "HtmlElementUtils", ".", "resolveByType", "(", "elementLocator", ")", ";", ...
Waits until element is cickable. @param elementLocator identifier of element to be cickable
[ "Waits", "until", "element", "is", "cickable", "." ]
694d12d0df76db48d0360b16192770c6a4fbdfd2
https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/client/src/main/java/com/paypal/selion/platform/utilities/WebDriverWaitUtils.java#L87-L93
train
paypal/SeLion
client/src/main/java/com/paypal/selion/platform/utilities/WebDriverWaitUtils.java
WebDriverWaitUtils.waitUntilElementIsInvisible
public static void waitUntilElementIsInvisible(final String elementLocator) { logger.entering(elementLocator); By by = HtmlElementUtils.resolveByType(elementLocator); ExpectedCondition<Boolean> condition = ExpectedConditions.invisibilityOfElementLocated(by); waitForCondition(condition); ...
java
public static void waitUntilElementIsInvisible(final String elementLocator) { logger.entering(elementLocator); By by = HtmlElementUtils.resolveByType(elementLocator); ExpectedCondition<Boolean> condition = ExpectedConditions.invisibilityOfElementLocated(by); waitForCondition(condition); ...
[ "public", "static", "void", "waitUntilElementIsInvisible", "(", "final", "String", "elementLocator", ")", "{", "logger", ".", "entering", "(", "elementLocator", ")", ";", "By", "by", "=", "HtmlElementUtils", ".", "resolveByType", "(", "elementLocator", ")", ";", ...
Waits until element is either invisible or not present on the DOM. @param elementLocator identifier of element to be found
[ "Waits", "until", "element", "is", "either", "invisible", "or", "not", "present", "on", "the", "DOM", "." ]
694d12d0df76db48d0360b16192770c6a4fbdfd2
https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/client/src/main/java/com/paypal/selion/platform/utilities/WebDriverWaitUtils.java#L111-L117
train
paypal/SeLion
client/src/main/java/com/paypal/selion/platform/utilities/WebDriverWaitUtils.java
WebDriverWaitUtils.waitUntilElementIsPresent
public static void waitUntilElementIsPresent(final String elementLocator) { logger.entering(elementLocator); By by = HtmlElementUtils.resolveByType(elementLocator); ExpectedCondition<WebElement> condition = ExpectedConditions.presenceOfElementLocated(by); waitForCondition(condition); ...
java
public static void waitUntilElementIsPresent(final String elementLocator) { logger.entering(elementLocator); By by = HtmlElementUtils.resolveByType(elementLocator); ExpectedCondition<WebElement> condition = ExpectedConditions.presenceOfElementLocated(by); waitForCondition(condition); ...
[ "public", "static", "void", "waitUntilElementIsPresent", "(", "final", "String", "elementLocator", ")", "{", "logger", ".", "entering", "(", "elementLocator", ")", ";", "By", "by", "=", "HtmlElementUtils", ".", "resolveByType", "(", "elementLocator", ")", ";", "...
Waits until element is present on the DOM of a page. This does not necessarily mean that the element is visible. @param elementLocator identifier of element to be found
[ "Waits", "until", "element", "is", "present", "on", "the", "DOM", "of", "a", "page", ".", "This", "does", "not", "necessarily", "mean", "that", "the", "element", "is", "visible", "." ]
694d12d0df76db48d0360b16192770c6a4fbdfd2
https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/client/src/main/java/com/paypal/selion/platform/utilities/WebDriverWaitUtils.java#L137-L143
train
paypal/SeLion
client/src/main/java/com/paypal/selion/platform/utilities/WebDriverWaitUtils.java
WebDriverWaitUtils.waitUntilElementIsVisible
public static void waitUntilElementIsVisible(final String elementLocator) { logger.entering(elementLocator); By by = HtmlElementUtils.resolveByType(elementLocator); ExpectedCondition<WebElement> condition = ExpectedConditions.visibilityOfElementLocated(by); waitForCondition(condition); ...
java
public static void waitUntilElementIsVisible(final String elementLocator) { logger.entering(elementLocator); By by = HtmlElementUtils.resolveByType(elementLocator); ExpectedCondition<WebElement> condition = ExpectedConditions.visibilityOfElementLocated(by); waitForCondition(condition); ...
[ "public", "static", "void", "waitUntilElementIsVisible", "(", "final", "String", "elementLocator", ")", "{", "logger", ".", "entering", "(", "elementLocator", ")", ";", "By", "by", "=", "HtmlElementUtils", ".", "resolveByType", "(", "elementLocator", ")", ";", "...
Waits until element is present on the DOM of a page and visible. Visibility means that the element is not only displayed but also has a height and width that is greater than 0. @param elementLocator identifier of element to be visible
[ "Waits", "until", "element", "is", "present", "on", "the", "DOM", "of", "a", "page", "and", "visible", ".", "Visibility", "means", "that", "the", "element", "is", "not", "only", "displayed", "but", "also", "has", "a", "height", "and", "width", "that", "i...
694d12d0df76db48d0360b16192770c6a4fbdfd2
https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/client/src/main/java/com/paypal/selion/platform/utilities/WebDriverWaitUtils.java#L163-L169
train
paypal/SeLion
client/src/main/java/com/paypal/selion/platform/utilities/WebDriverWaitUtils.java
WebDriverWaitUtils.waitUntilPageTitleContains
public static void waitUntilPageTitleContains(final String pageTitle) { logger.entering(pageTitle); Preconditions .checkArgument(StringUtils.isNotEmpty(pageTitle), "Expected Page title cannot be null (or) empty."); ExpectedCondition<Boolean> condition = ExpectedConditions.titleCo...
java
public static void waitUntilPageTitleContains(final String pageTitle) { logger.entering(pageTitle); Preconditions .checkArgument(StringUtils.isNotEmpty(pageTitle), "Expected Page title cannot be null (or) empty."); ExpectedCondition<Boolean> condition = ExpectedConditions.titleCo...
[ "public", "static", "void", "waitUntilPageTitleContains", "(", "final", "String", "pageTitle", ")", "{", "logger", ".", "entering", "(", "pageTitle", ")", ";", "Preconditions", ".", "checkArgument", "(", "StringUtils", ".", "isNotEmpty", "(", "pageTitle", ")", "...
Waits until the current page's title contains a case-sensitive substring of the given title. @param pageTitle title of page expected to appear
[ "Waits", "until", "the", "current", "page", "s", "title", "contains", "a", "case", "-", "sensitive", "substring", "of", "the", "given", "title", "." ]
694d12d0df76db48d0360b16192770c6a4fbdfd2
https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/client/src/main/java/com/paypal/selion/platform/utilities/WebDriverWaitUtils.java#L177-L184
train
paypal/SeLion
client/src/main/java/com/paypal/selion/platform/utilities/WebDriverWaitUtils.java
WebDriverWaitUtils.waitUntilTextPresent
public static void waitUntilTextPresent(final String searchString) { logger.entering(searchString); Preconditions.checkArgument(StringUtils.isNotEmpty(searchString), "Search string cannot be null (or) empty."); ExpectedCondition<Boolean> conditionToCheck = new ExpectedCondition<Boolean>() { ...
java
public static void waitUntilTextPresent(final String searchString) { logger.entering(searchString); Preconditions.checkArgument(StringUtils.isNotEmpty(searchString), "Search string cannot be null (or) empty."); ExpectedCondition<Boolean> conditionToCheck = new ExpectedCondition<Boolean>() { ...
[ "public", "static", "void", "waitUntilTextPresent", "(", "final", "String", "searchString", ")", "{", "logger", ".", "entering", "(", "searchString", ")", ";", "Preconditions", ".", "checkArgument", "(", "StringUtils", ".", "isNotEmpty", "(", "searchString", ")", ...
Waits until text appears anywhere within the current page's &lt;body&gt; tag. @param searchString text will be waited for
[ "Waits", "until", "text", "appears", "anywhere", "within", "the", "current", "page", "s", "&lt", ";", "body&gt", ";", "tag", "." ]
694d12d0df76db48d0360b16192770c6a4fbdfd2
https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/client/src/main/java/com/paypal/selion/platform/utilities/WebDriverWaitUtils.java#L192-L203
train
paypal/SeLion
client/src/main/java/com/paypal/selion/platform/utilities/WebDriverWaitUtils.java
WebDriverWaitUtils.waitUntilAllElementsArePresent
public static void waitUntilAllElementsArePresent(final String... locators) { logger.entering(new Object[] { Arrays.toString(locators) }); Preconditions.checkArgument(locators != null, "Please provide a valid set of locators."); for (String eachLocator : locators) { waitUntilElementI...
java
public static void waitUntilAllElementsArePresent(final String... locators) { logger.entering(new Object[] { Arrays.toString(locators) }); Preconditions.checkArgument(locators != null, "Please provide a valid set of locators."); for (String eachLocator : locators) { waitUntilElementI...
[ "public", "static", "void", "waitUntilAllElementsArePresent", "(", "final", "String", "...", "locators", ")", "{", "logger", ".", "entering", "(", "new", "Object", "[", "]", "{", "Arrays", ".", "toString", "(", "locators", ")", "}", ")", ";", "Preconditions"...
Waits until both two elements appear at the page Waits until all the elements are present on the DOM of a page. This does not necessarily mean that the element is visible. @param locators an array of strings that represents the list of elements to check.
[ "Waits", "until", "both", "two", "elements", "appear", "at", "the", "page", "Waits", "until", "all", "the", "elements", "are", "present", "on", "the", "DOM", "of", "a", "page", ".", "This", "does", "not", "necessarily", "mean", "that", "the", "element", ...
694d12d0df76db48d0360b16192770c6a4fbdfd2
https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/client/src/main/java/com/paypal/selion/platform/utilities/WebDriverWaitUtils.java#L213-L220
train
paypal/SeLion
server/src/main/java/com/paypal/selion/utils/AuthenticationHelper.java
AuthenticationHelper.changePassword
public static boolean changePassword(String userName, String newPassword) { LOGGER.entering(userName, newPassword.replaceAll(".", "*")); boolean changeSucceeded = false; File authFile = new File(AUTH_FILE_LOCATION); try { authFile.delete(); authFile.createNewFile(...
java
public static boolean changePassword(String userName, String newPassword) { LOGGER.entering(userName, newPassword.replaceAll(".", "*")); boolean changeSucceeded = false; File authFile = new File(AUTH_FILE_LOCATION); try { authFile.delete(); authFile.createNewFile(...
[ "public", "static", "boolean", "changePassword", "(", "String", "userName", ",", "String", "newPassword", ")", "{", "LOGGER", ".", "entering", "(", "userName", ",", "newPassword", ".", "replaceAll", "(", "\".\"", ",", "\"*\"", ")", ")", ";", "boolean", "chan...
Changes the password for the given user to the new password @param userName @param newPassword @return <code>true</code> if the password was successfully changed.
[ "Changes", "the", "password", "for", "the", "given", "user", "to", "the", "new", "password" ]
694d12d0df76db48d0360b16192770c6a4fbdfd2
https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/server/src/main/java/com/paypal/selion/utils/AuthenticationHelper.java#L99-L113
train
paypal/SeLion
client/src/main/java/com/paypal/selion/internal/reports/model/BaseLog.java
BaseLog.parse
protected void parse(String json) { logger.entering(json); try { Gson gson = new Gson(); BaseLog baseLog = gson.fromJson(json, this.getClass()); this.msg = baseLog.msg; this.screen = baseLog.screen; this.location = baseLog.location; ...
java
protected void parse(String json) { logger.entering(json); try { Gson gson = new Gson(); BaseLog baseLog = gson.fromJson(json, this.getClass()); this.msg = baseLog.msg; this.screen = baseLog.screen; this.location = baseLog.location; ...
[ "protected", "void", "parse", "(", "String", "json", ")", "{", "logger", ".", "entering", "(", "json", ")", ";", "try", "{", "Gson", "gson", "=", "new", "Gson", "(", ")", ";", "BaseLog", "baseLog", "=", "gson", ".", "fromJson", "(", "json", ",", "t...
Parsing the JSON string using Gson library. @param json JSON String
[ "Parsing", "the", "JSON", "string", "using", "Gson", "library", "." ]
694d12d0df76db48d0360b16192770c6a4fbdfd2
https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/client/src/main/java/com/paypal/selion/internal/reports/model/BaseLog.java#L87-L103
train
paypal/SeLion
server/src/main/java/com/paypal/selion/grid/SeLionGridLauncherV3.java
SeLionGridLauncherV3.shutdown
public void shutdown() throws Exception { if (type == null) { return; } if (type instanceof Hub) { ((Hub) type).stop(); } if (type instanceof SelfRegisteringRemote) { ((SelfRegisteringRemote) type).stopRemoteServer(); } if (type...
java
public void shutdown() throws Exception { if (type == null) { return; } if (type instanceof Hub) { ((Hub) type).stop(); } if (type instanceof SelfRegisteringRemote) { ((SelfRegisteringRemote) type).stopRemoteServer(); } if (type...
[ "public", "void", "shutdown", "(", ")", "throws", "Exception", "{", "if", "(", "type", "==", "null", ")", "{", "return", ";", "}", "if", "(", "type", "instanceof", "Hub", ")", "{", "(", "(", "Hub", ")", "type", ")", ".", "stop", "(", ")", ";", ...
Shutdown the instance @throws Exception
[ "Shutdown", "the", "instance" ]
694d12d0df76db48d0360b16192770c6a4fbdfd2
https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/server/src/main/java/com/paypal/selion/grid/SeLionGridLauncherV3.java#L239-L253
train
paypal/SeLion
server/src/main/java/com/paypal/selion/grid/SeLionGridLauncherV3.java
SeLionGridLauncherV3.boot
public void boot(String[] args) throws Exception { SeLionStandaloneConfiguration configuration = new SeLionStandaloneConfiguration(); JCommander commander = new JCommander(); commander.setAcceptUnknownOptions(true); commander.addObject(configuration); commander.parse(args); ...
java
public void boot(String[] args) throws Exception { SeLionStandaloneConfiguration configuration = new SeLionStandaloneConfiguration(); JCommander commander = new JCommander(); commander.setAcceptUnknownOptions(true); commander.addObject(configuration); commander.parse(args); ...
[ "public", "void", "boot", "(", "String", "[", "]", "args", ")", "throws", "Exception", "{", "SeLionStandaloneConfiguration", "configuration", "=", "new", "SeLionStandaloneConfiguration", "(", ")", ";", "JCommander", "commander", "=", "new", "JCommander", "(", ")",...
Boot the instance base on the arguments supplied @param args the arguments to use @throws Exception
[ "Boot", "the", "instance", "base", "on", "the", "arguments", "supplied" ]
694d12d0df76db48d0360b16192770c6a4fbdfd2
https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/server/src/main/java/com/paypal/selion/grid/SeLionGridLauncherV3.java#L271-L309
train
paypal/SeLion
client/src/main/java/com/paypal/selion/platform/mobile/android/UiSlider.java
UiSlider.dragToValue
@Override public void dragToValue(double value) { logger.entering(value); WebElement webElement = findElement(locator); Point currentLocation = webElement.getLocation(); Dimension elementSize = webElement.getSize(); int x = currentLocation.getX(); int y = currentLocat...
java
@Override public void dragToValue(double value) { logger.entering(value); WebElement webElement = findElement(locator); Point currentLocation = webElement.getLocation(); Dimension elementSize = webElement.getSize(); int x = currentLocation.getX(); int y = currentLocat...
[ "@", "Override", "public", "void", "dragToValue", "(", "double", "value", ")", "{", "logger", ".", "entering", "(", "value", ")", ";", "WebElement", "webElement", "=", "findElement", "(", "locator", ")", ";", "Point", "currentLocation", "=", "webElement", "....
it is not accurate and is best to used only for setting value to 0 or 1, otherwise the result is close to parameter @param value The desired decimal value from 0 to 1, inclusive. 0 represents far left and 1 represent far right.
[ "it", "is", "not", "accurate", "and", "is", "best", "to", "used", "only", "for", "setting", "value", "to", "0", "or", "1", "otherwise", "the", "result", "is", "close", "to", "parameter" ]
694d12d0df76db48d0360b16192770c6a4fbdfd2
https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/client/src/main/java/com/paypal/selion/platform/mobile/android/UiSlider.java#L44-L72
train
paypal/SeLion
server/src/main/java/com/paypal/selion/logging/SeLionGridLogger.java
SeLionGridLogger.exiting
public void exiting(Object object) { if (!getLogger().isLoggable(Level.FINER)) { return; } FrameInfo fi = getLoggingFrame(); getLogger().exiting(fi.className, fi.methodName, object); }
java
public void exiting(Object object) { if (!getLogger().isLoggable(Level.FINER)) { return; } FrameInfo fi = getLoggingFrame(); getLogger().exiting(fi.className, fi.methodName, object); }
[ "public", "void", "exiting", "(", "Object", "object", ")", "{", "if", "(", "!", "getLogger", "(", ")", ".", "isLoggable", "(", "Level", ".", "FINER", ")", ")", "{", "return", ";", "}", "FrameInfo", "fi", "=", "getLoggingFrame", "(", ")", ";", "getLog...
Function exit log convenience method. @param object return value
[ "Function", "exit", "log", "convenience", "method", "." ]
694d12d0df76db48d0360b16192770c6a4fbdfd2
https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/server/src/main/java/com/paypal/selion/logging/SeLionGridLogger.java#L120-L126
train
paypal/SeLion
server/src/main/java/com/paypal/selion/logging/SeLionGridLogger.java
SeLionGridLogger.getLoggingFrame
private static FrameInfo getLoggingFrame() { StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace(); StackTraceElement loggingFrame = null; /* * We need to dig through all the frames until we get to a frame that contains this class, then dig through all * frame...
java
private static FrameInfo getLoggingFrame() { StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace(); StackTraceElement loggingFrame = null; /* * We need to dig through all the frames until we get to a frame that contains this class, then dig through all * frame...
[ "private", "static", "FrameInfo", "getLoggingFrame", "(", ")", "{", "StackTraceElement", "[", "]", "stackTrace", "=", "Thread", ".", "currentThread", "(", ")", ".", "getStackTrace", "(", ")", ";", "StackTraceElement", "loggingFrame", "=", "null", ";", "/*\n ...
Calculate the logging frame's class name and method name. @return FrameInfo with className and methodName.
[ "Calculate", "the", "logging", "frame", "s", "class", "name", "and", "method", "name", "." ]
694d12d0df76db48d0360b16192770c6a4fbdfd2
https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/server/src/main/java/com/paypal/selion/logging/SeLionGridLogger.java#L133-L154
train
paypal/SeLion
client/src/main/java/com/paypal/selion/internal/platform/grid/SeleniumGridListener.java
SeleniumGridListener.onStart
@Override public void onStart(ISuite suite) { logger.entering(suite); if (ListenerManager.isCurrentMethodSkipped(this)) { logger.exiting(ListenerManager.THREAD_EXCLUSION_MSG); return; } // Nothing should query for SeLionConfig values before this point. ...
java
@Override public void onStart(ISuite suite) { logger.entering(suite); if (ListenerManager.isCurrentMethodSkipped(this)) { logger.exiting(ListenerManager.THREAD_EXCLUSION_MSG); return; } // Nothing should query for SeLionConfig values before this point. ...
[ "@", "Override", "public", "void", "onStart", "(", "ISuite", "suite", ")", "{", "logger", ".", "entering", "(", "suite", ")", ";", "if", "(", "ListenerManager", ".", "isCurrentMethodSkipped", "(", "this", ")", ")", "{", "logger", ".", "exiting", "(", "Li...
Initiate config on suite start @see org.testng.ISuiteListener#onStart(org.testng.ISuite)
[ "Initiate", "config", "on", "suite", "start" ]
694d12d0df76db48d0360b16192770c6a4fbdfd2
https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/client/src/main/java/com/paypal/selion/internal/platform/grid/SeleniumGridListener.java#L371-L394
train
paypal/SeLion
client/src/main/java/com/paypal/selion/internal/platform/grid/SeleniumGridListener.java
SeleniumGridListener.filterOutputDirectory
public static String filterOutputDirectory(String base, String suiteName) { logger.entering(new Object[] { base, suiteName }); int index = base.lastIndexOf(suiteName); String outputFolderWithoutName = base.substring(0, index); logger.exiting(outputFolderWithoutName + File.separator); ...
java
public static String filterOutputDirectory(String base, String suiteName) { logger.entering(new Object[] { base, suiteName }); int index = base.lastIndexOf(suiteName); String outputFolderWithoutName = base.substring(0, index); logger.exiting(outputFolderWithoutName + File.separator); ...
[ "public", "static", "String", "filterOutputDirectory", "(", "String", "base", ",", "String", "suiteName", ")", "{", "logger", ".", "entering", "(", "new", "Object", "[", "]", "{", "base", ",", "suiteName", "}", ")", ";", "int", "index", "=", "base", ".",...
Generates and returns output directory string path @param base String shows path to the suiteName @param suiteName String suiteName specified by config file @return String - path to output directory for that particular suite
[ "Generates", "and", "returns", "output", "directory", "string", "path" ]
694d12d0df76db48d0360b16192770c6a4fbdfd2
https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/client/src/main/java/com/paypal/selion/internal/platform/grid/SeleniumGridListener.java#L405-L411
train
paypal/SeLion
client/src/main/java/com/paypal/selion/internal/platform/grid/SeleniumGridListener.java
SeleniumGridListener.onFinish
@Override public void onFinish(ISuite suite) { logger.entering(suite); if (ListenerManager.isCurrentMethodSkipped(this)) { logger.exiting(ListenerManager.THREAD_EXCLUSION_MSG); return; } LocalGridManager.shutDownHub(); logger.exiting(); }
java
@Override public void onFinish(ISuite suite) { logger.entering(suite); if (ListenerManager.isCurrentMethodSkipped(this)) { logger.exiting(ListenerManager.THREAD_EXCLUSION_MSG); return; } LocalGridManager.shutDownHub(); logger.exiting(); }
[ "@", "Override", "public", "void", "onFinish", "(", "ISuite", "suite", ")", "{", "logger", ".", "entering", "(", "suite", ")", ";", "if", "(", "ListenerManager", ".", "isCurrentMethodSkipped", "(", "this", ")", ")", "{", "logger", ".", "exiting", "(", "L...
Closes selenium session when suite finished to run @see org.testng.ISuiteListener#onFinish(org.testng.ISuite)
[ "Closes", "selenium", "session", "when", "suite", "finished", "to", "run" ]
694d12d0df76db48d0360b16192770c6a4fbdfd2
https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/client/src/main/java/com/paypal/selion/internal/platform/grid/SeleniumGridListener.java#L418-L427
train
paypal/SeLion
client/src/main/java/com/paypal/selion/internal/platform/grid/SeleniumGridListener.java
SeleniumGridListener.onStart
@Override public void onStart(ITestContext context) { logger.entering(context); if (ListenerManager.isCurrentMethodSkipped(this)) { logger.exiting(ListenerManager.THREAD_EXCLUSION_MSG); return; } String testName = context.getCurrentXmlTest().getName(); ...
java
@Override public void onStart(ITestContext context) { logger.entering(context); if (ListenerManager.isCurrentMethodSkipped(this)) { logger.exiting(ListenerManager.THREAD_EXCLUSION_MSG); return; } String testName = context.getCurrentXmlTest().getName(); ...
[ "@", "Override", "public", "void", "onStart", "(", "ITestContext", "context", ")", "{", "logger", ".", "entering", "(", "context", ")", ";", "if", "(", "ListenerManager", ".", "isCurrentMethodSkipped", "(", "this", ")", ")", "{", "logger", ".", "exiting", ...
On start each suite initialize config object and report object
[ "On", "start", "each", "suite", "initialize", "config", "object", "and", "report", "object" ]
694d12d0df76db48d0360b16192770c6a4fbdfd2
https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/client/src/main/java/com/paypal/selion/internal/platform/grid/SeleniumGridListener.java#L446-L484
train
paypal/SeLion
client/src/main/java/com/paypal/selion/internal/platform/grid/SeleniumGridListener.java
SeleniumGridListener.invokeInitializersBasedOnPriority
private void invokeInitializersBasedOnPriority(ITestContext context) { ServiceLoader<Initializer> serviceLoader = ServiceLoader.load(Initializer.class); List<AbstractConfigInitializer> loader = new ArrayList<AbstractConfigInitializer>(); for (Initializer l : serviceLoader) { loader.a...
java
private void invokeInitializersBasedOnPriority(ITestContext context) { ServiceLoader<Initializer> serviceLoader = ServiceLoader.load(Initializer.class); List<AbstractConfigInitializer> loader = new ArrayList<AbstractConfigInitializer>(); for (Initializer l : serviceLoader) { loader.a...
[ "private", "void", "invokeInitializersBasedOnPriority", "(", "ITestContext", "context", ")", "{", "ServiceLoader", "<", "Initializer", ">", "serviceLoader", "=", "ServiceLoader", ".", "load", "(", "Initializer", ".", "class", ")", ";", "List", "<", "AbstractConfigIn...
This method facilitates initialization of all configurations from the current project as well as downstream consumers. @param context
[ "This", "method", "facilitates", "initialization", "of", "all", "configurations", "from", "the", "current", "project", "as", "well", "as", "downstream", "consumers", "." ]
694d12d0df76db48d0360b16192770c6a4fbdfd2
https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/client/src/main/java/com/paypal/selion/internal/platform/grid/SeleniumGridListener.java#L540-L550
train
paypal/SeLion
dataproviders/src/main/java/com/paypal/selion/platform/dataprovider/filter/CustomKeyFilter.java
CustomKeyFilter.filter
@Override public boolean filter(Object data) { logger.entering(data); String[] keyValues = filterKeyValues.split(","); String tempKey = null; Field field; try { field = data.getClass().getDeclaredField(filterKeyName); field.setAccessible(true); ...
java
@Override public boolean filter(Object data) { logger.entering(data); String[] keyValues = filterKeyValues.split(","); String tempKey = null; Field field; try { field = data.getClass().getDeclaredField(filterKeyName); field.setAccessible(true); ...
[ "@", "Override", "public", "boolean", "filter", "(", "Object", "data", ")", "{", "logger", ".", "entering", "(", "data", ")", ";", "String", "[", "]", "keyValues", "=", "filterKeyValues", ".", "split", "(", "\",\"", ")", ";", "String", "tempKey", "=", ...
This function identifies whether the object falls in the filtering criteria or not based on the filterKeyName and its corresponding filterKeyValues. @param data the object to be filtered. @return boolean - true if object falls in the filter criteria.
[ "This", "function", "identifies", "whether", "the", "object", "falls", "in", "the", "filtering", "criteria", "or", "not", "based", "on", "the", "filterKeyName", "and", "its", "corresponding", "filterKeyValues", "." ]
694d12d0df76db48d0360b16192770c6a4fbdfd2
https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/dataproviders/src/main/java/com/paypal/selion/platform/dataprovider/filter/CustomKeyFilter.java#L60-L83
train
paypal/SeLion
client/src/main/java/com/paypal/selion/platform/html/support/HtmlElementUtils.java
HtmlElementUtils.isValidXpath
public static void isValidXpath(String locator) { logger.entering(locator); Preconditions.checkArgument(StringUtils.isNotBlank(locator), INVALID_LOCATOR_ERR_MSG); if (locator.startsWith("xpath=/") || locator.startsWith("/")) { throw new UnsupportedOperationException( ...
java
public static void isValidXpath(String locator) { logger.entering(locator); Preconditions.checkArgument(StringUtils.isNotBlank(locator), INVALID_LOCATOR_ERR_MSG); if (locator.startsWith("xpath=/") || locator.startsWith("/")) { throw new UnsupportedOperationException( ...
[ "public", "static", "void", "isValidXpath", "(", "String", "locator", ")", "{", "logger", ".", "entering", "(", "locator", ")", ";", "Preconditions", ".", "checkArgument", "(", "StringUtils", ".", "isNotBlank", "(", "locator", ")", ",", "INVALID_LOCATOR_ERR_MSG"...
Validates a child locator to have the xpath dot notation. @param locator String that represents the xpath locator for an element.
[ "Validates", "a", "child", "locator", "to", "have", "the", "xpath", "dot", "notation", "." ]
694d12d0df76db48d0360b16192770c6a4fbdfd2
https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/client/src/main/java/com/paypal/selion/platform/html/support/HtmlElementUtils.java#L145-L153
train
paypal/SeLion
client/src/main/java/com/paypal/selion/platform/html/support/HtmlElementUtils.java
HtmlElementUtils.isElementPresent
public static boolean isElementPresent(String locator) { logger.entering(locator); boolean flag = false; try { flag = HtmlElementUtils.locateElement(locator) != null; } catch (NoSuchElementException e) { // NOSONAR } logger.exiting(flag); return flag; ...
java
public static boolean isElementPresent(String locator) { logger.entering(locator); boolean flag = false; try { flag = HtmlElementUtils.locateElement(locator) != null; } catch (NoSuchElementException e) { // NOSONAR } logger.exiting(flag); return flag; ...
[ "public", "static", "boolean", "isElementPresent", "(", "String", "locator", ")", "{", "logger", ".", "entering", "(", "locator", ")", ";", "boolean", "flag", "=", "false", ";", "try", "{", "flag", "=", "HtmlElementUtils", ".", "locateElement", "(", "locator...
Checks if the provided element is present on the page based on the locator provided @param locator String that represents the means to locate this element (could be id/name/xpath/css locator). @return boolean indicating if the element was found.
[ "Checks", "if", "the", "provided", "element", "is", "present", "on", "the", "page", "based", "on", "the", "locator", "provided" ]
694d12d0df76db48d0360b16192770c6a4fbdfd2
https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/client/src/main/java/com/paypal/selion/platform/html/support/HtmlElementUtils.java#L237-L246
train
paypal/SeLion
server/src/main/java/com/paypal/selion/grid/servlets/transfer/DefaultManagedArtifact.java
DefaultManagedArtifact.getSubFolderName
String getSubFolderName() { if (subFolderName == null) { String relPath = getAbsolutePath().replace(REPO_ABSOLUTE_PATH, ""); relPath = relPath.substring(relPath.indexOf(SystemUtils.FILE_SEPARATOR) + 1); String[] parts = relPath.split("[\\\\/]"); subFolderName = ((...
java
String getSubFolderName() { if (subFolderName == null) { String relPath = getAbsolutePath().replace(REPO_ABSOLUTE_PATH, ""); relPath = relPath.substring(relPath.indexOf(SystemUtils.FILE_SEPARATOR) + 1); String[] parts = relPath.split("[\\\\/]"); subFolderName = ((...
[ "String", "getSubFolderName", "(", ")", "{", "if", "(", "subFolderName", "==", "null", ")", "{", "String", "relPath", "=", "getAbsolutePath", "(", ")", ".", "replace", "(", "REPO_ABSOLUTE_PATH", ",", "\"\"", ")", ";", "relPath", "=", "relPath", ".", "subst...
Returns the optional sub folder for the artifact @return the folder name or <code>""</code> if not specified
[ "Returns", "the", "optional", "sub", "folder", "for", "the", "artifact" ]
694d12d0df76db48d0360b16192770c6a4fbdfd2
https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/server/src/main/java/com/paypal/selion/grid/servlets/transfer/DefaultManagedArtifact.java#L152-L160
train
paypal/SeLion
server/src/main/java/com/paypal/selion/grid/AppiumSpawner.java
AppiumSpawner.createCommandForChildProcess
private CommandLine createCommandForChildProcess() throws IOException { LOGGER.entering(); CommandLine cmdLine = CommandLine.parse("appium"); // add the program argument / dash options cmdLine.addArguments(getProgramArguments()); LOGGER.exiting(cmdLine.toString()); ret...
java
private CommandLine createCommandForChildProcess() throws IOException { LOGGER.entering(); CommandLine cmdLine = CommandLine.parse("appium"); // add the program argument / dash options cmdLine.addArguments(getProgramArguments()); LOGGER.exiting(cmdLine.toString()); ret...
[ "private", "CommandLine", "createCommandForChildProcess", "(", ")", "throws", "IOException", "{", "LOGGER", ".", "entering", "(", ")", ";", "CommandLine", "cmdLine", "=", "CommandLine", ".", "parse", "(", "\"appium\"", ")", ";", "// add the program argument / dash opt...
This method loads the default arguments required to spawn appium @return {@link CommandLine} @throws IOException
[ "This", "method", "loads", "the", "default", "arguments", "required", "to", "spawn", "appium" ]
694d12d0df76db48d0360b16192770c6a4fbdfd2
https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/server/src/main/java/com/paypal/selion/grid/AppiumSpawner.java#L68-L78
train
RestComm/media-core
control/mgcp/src/main/java/org/restcomm/media/core/control/mgcp/pkg/MgcpSignalProvider.java
MgcpSignalProvider.provide
public MgcpSignal provide(String pkg, String signal, int requestId, NotifiedEntity notifiedEntity, Map<String, String> parameters, MgcpEndpoint endpoint) throws UnrecognizedMgcpPackageException, UnsupportedMgcpSignalException { switch (pkg) { case AudioPackage.PACKAGE_NAME: ...
java
public MgcpSignal provide(String pkg, String signal, int requestId, NotifiedEntity notifiedEntity, Map<String, String> parameters, MgcpEndpoint endpoint) throws UnrecognizedMgcpPackageException, UnsupportedMgcpSignalException { switch (pkg) { case AudioPackage.PACKAGE_NAME: ...
[ "public", "MgcpSignal", "provide", "(", "String", "pkg", ",", "String", "signal", ",", "int", "requestId", ",", "NotifiedEntity", "notifiedEntity", ",", "Map", "<", "String", ",", "String", ">", "parameters", ",", "MgcpEndpoint", "endpoint", ")", "throws", "Un...
Provides an MGCP Signal to be executed. @param pkg The package name. @param signal The signal name. @param requestId The request identifier. @param notifiedEntity The entity that requested to be notified about events resulting from signal completion. May be null. @param parameters The parameters that configure the sig...
[ "Provides", "an", "MGCP", "Signal", "to", "be", "executed", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/control/mgcp/src/main/java/org/restcomm/media/core/control/mgcp/pkg/MgcpSignalProvider.java#L69-L78
train
RestComm/media-core
spi/src/main/java/org/restcomm/media/core/spi/format/Formats.java
Formats.contains
public boolean contains(Format format) { for (Format f : list) { if (f.matches(format)) return true; } return false; }
java
public boolean contains(Format format) { for (Format f : list) { if (f.matches(format)) return true; } return false; }
[ "public", "boolean", "contains", "(", "Format", "format", ")", "{", "for", "(", "Format", "f", ":", "list", ")", "{", "if", "(", "f", ".", "matches", "(", "format", ")", ")", "return", "true", ";", "}", "return", "false", ";", "}" ]
Checks that collection has specified format. @param format the format to be checked @return true if collection contains specified format and false otherwise
[ "Checks", "that", "collection", "has", "specified", "format", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/spi/src/main/java/org/restcomm/media/core/spi/format/Formats.java#L98-L103
train
RestComm/media-core
spi/src/main/java/org/restcomm/media/core/spi/format/Formats.java
Formats.intersection
public void intersection(Formats other, Formats intersection) { intersection.list.clear(); for (Format f1 : list) { for (Format f2 : other.list) { if (f1.matches(f2)) intersection.list.add(f2); } } }
java
public void intersection(Formats other, Formats intersection) { intersection.list.clear(); for (Format f1 : list) { for (Format f2 : other.list) { if (f1.matches(f2)) intersection.list.add(f2); } } }
[ "public", "void", "intersection", "(", "Formats", "other", ",", "Formats", "intersection", ")", "{", "intersection", ".", "list", ".", "clear", "(", ")", ";", "for", "(", "Format", "f1", ":", "list", ")", "{", "for", "(", "Format", "f2", ":", "other", ...
Find the intersection between this collection and other @param other the other collection @param intersection the resulting collection.
[ "Find", "the", "intersection", "between", "this", "collection", "and", "other" ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/spi/src/main/java/org/restcomm/media/core/spi/format/Formats.java#L136-L143
train
RestComm/media-core
scheduler/src/main/java/org/restcomm/media/core/scheduler/TaskChain.java
TaskChain.add
public void add(Task task) { synchronized(LOCK) { //terminated task will be selected immediately before start task.setListener(this); this.task[wi] = task; wi++; } }
java
public void add(Task task) { synchronized(LOCK) { //terminated task will be selected immediately before start task.setListener(this); this.task[wi] = task; wi++; } }
[ "public", "void", "add", "(", "Task", "task", ")", "{", "synchronized", "(", "LOCK", ")", "{", "//terminated task will be selected immediately before start", "task", ".", "setListener", "(", "this", ")", ";", "this", ".", "task", "[", "wi", "]", "=", "task", ...
Adds task to the chain. @param task @param offset
[ "Adds", "task", "to", "the", "chain", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/scheduler/src/main/java/org/restcomm/media/core/scheduler/TaskChain.java#L70-L79
train
RestComm/media-core
scheduler/src/main/java/org/restcomm/media/core/scheduler/TaskChain.java
TaskChain.continueExecution
private void continueExecution() { //increment task index i++; //submit next if the end of the chain not reached yet if (i < task.length && task[i] != null) { scheduler.submit(task[i]); } else if (listener != null) { listener.onTerminatio...
java
private void continueExecution() { //increment task index i++; //submit next if the end of the chain not reached yet if (i < task.length && task[i] != null) { scheduler.submit(task[i]); } else if (listener != null) { listener.onTerminatio...
[ "private", "void", "continueExecution", "(", ")", "{", "//increment task index", "i", "++", ";", "//submit next if the end of the chain not reached yet", "if", "(", "i", "<", "task", ".", "length", "&&", "task", "[", "i", "]", "!=", "null", ")", "{", "scheduler"...
Submits next task for the execution
[ "Submits", "next", "task", "for", "the", "execution" ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/scheduler/src/main/java/org/restcomm/media/core/scheduler/TaskChain.java#L94-L104
train
RestComm/media-core
stun/src/main/java/org/restcomm/media/core/stun/messages/StunMessage.java
StunMessage.getDataLength
public char getDataLength() { char length = 0; List<StunAttribute> attrs = getAttributes(); for (StunAttribute att : attrs) { int attLen = att.getDataLength() + StunAttribute.HEADER_LENGTH; // take attribute padding into account: attLen += (4 - (attLen % 4)) % 4; length += attLen; } return leng...
java
public char getDataLength() { char length = 0; List<StunAttribute> attrs = getAttributes(); for (StunAttribute att : attrs) { int attLen = att.getDataLength() + StunAttribute.HEADER_LENGTH; // take attribute padding into account: attLen += (4 - (attLen % 4)) % 4; length += attLen; } return leng...
[ "public", "char", "getDataLength", "(", ")", "{", "char", "length", "=", "0", ";", "List", "<", "StunAttribute", ">", "attrs", "=", "getAttributes", "(", ")", ";", "for", "(", "StunAttribute", "att", ":", "attrs", ")", "{", "int", "attLen", "=", "att",...
Returns the length of this message's body. @return the length of the data in this message.
[ "Returns", "the", "length", "of", "this", "message", "s", "body", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/stun/src/main/java/org/restcomm/media/core/stun/messages/StunMessage.java#L292-L305
train
RestComm/media-core
stun/src/main/java/org/restcomm/media/core/stun/messages/StunMessage.java
StunMessage.addAttribute
public void addAttribute(StunAttribute attribute) throws IllegalArgumentException { if (getAttributePresentity(attribute.getAttributeType()) == N_A) { throw new IllegalArgumentException("The attribute " + attribute.getName() + " is not allowed in a " + getName()); } synchronized (attributes) { attributes.p...
java
public void addAttribute(StunAttribute attribute) throws IllegalArgumentException { if (getAttributePresentity(attribute.getAttributeType()) == N_A) { throw new IllegalArgumentException("The attribute " + attribute.getName() + " is not allowed in a " + getName()); } synchronized (attributes) { attributes.p...
[ "public", "void", "addAttribute", "(", "StunAttribute", "attribute", ")", "throws", "IllegalArgumentException", "{", "if", "(", "getAttributePresentity", "(", "attribute", ".", "getAttributeType", "(", ")", ")", "==", "N_A", ")", "{", "throw", "new", "IllegalArgum...
Adds the specified attribute to this message. If an attribute with that name was already added, it would be replaced. @param attribute the attribute to add to this message. @throws IllegalArgumentException if the message cannot contain such an attribute.
[ "Adds", "the", "specified", "attribute", "to", "this", "message", ".", "If", "an", "attribute", "with", "that", "name", "was", "already", "added", "it", "would", "be", "replaced", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/stun/src/main/java/org/restcomm/media/core/stun/messages/StunMessage.java#L335-L343
train
RestComm/media-core
stun/src/main/java/org/restcomm/media/core/stun/messages/StunMessage.java
StunMessage.setTransactionID
public void setTransactionID(byte[] tranID) throws StunException { if (tranID == null || (tranID.length != TRANSACTION_ID_LENGTH && tranID.length != RFC3489_TRANSACTION_ID_LENGTH)) throw new StunException(StunException.ILLEGAL_ARGUMENT, "Invalid transaction id length"); int tranIDLength = tranID.length; this....
java
public void setTransactionID(byte[] tranID) throws StunException { if (tranID == null || (tranID.length != TRANSACTION_ID_LENGTH && tranID.length != RFC3489_TRANSACTION_ID_LENGTH)) throw new StunException(StunException.ILLEGAL_ARGUMENT, "Invalid transaction id length"); int tranIDLength = tranID.length; this....
[ "public", "void", "setTransactionID", "(", "byte", "[", "]", "tranID", ")", "throws", "StunException", "{", "if", "(", "tranID", "==", "null", "||", "(", "tranID", ".", "length", "!=", "TRANSACTION_ID_LENGTH", "&&", "tranID", ".", "length", "!=", "RFC3489_TR...
Copies the specified tranID and sets it as this message's transactionID. @param tranID the transaction id to set in this message. @throws StunException ILLEGAL_ARGUMENT if the transaction id is not valid.
[ "Copies", "the", "specified", "tranID", "and", "sets", "it", "as", "this", "message", "s", "transactionID", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/stun/src/main/java/org/restcomm/media/core/stun/messages/StunMessage.java#L439-L446
train
RestComm/media-core
stun/src/main/java/org/restcomm/media/core/stun/messages/StunMessage.java
StunMessage.getAttributePresentity
protected byte getAttributePresentity(char attributeType) { if (!rfc3489CompatibilityMode) { return O; } byte msgIndex = -1; byte attributeIndex = -1; switch (messageType) { case BINDING_REQUEST: msgIndex = BINDING_REQUEST_PRESENTITY_INDEX; break; case BINDING_SUCCESS_RESPONSE: msgIndex = BI...
java
protected byte getAttributePresentity(char attributeType) { if (!rfc3489CompatibilityMode) { return O; } byte msgIndex = -1; byte attributeIndex = -1; switch (messageType) { case BINDING_REQUEST: msgIndex = BINDING_REQUEST_PRESENTITY_INDEX; break; case BINDING_SUCCESS_RESPONSE: msgIndex = BI...
[ "protected", "byte", "getAttributePresentity", "(", "char", "attributeType", ")", "{", "if", "(", "!", "rfc3489CompatibilityMode", ")", "{", "return", "O", ";", "}", "byte", "msgIndex", "=", "-", "1", ";", "byte", "attributeIndex", "=", "-", "1", ";", "swi...
Returns whether an attribute could be present in this message. @param attributeType the id of the attribute to check . @return Message.N_A - for not applicable <br/> Message.C - for case depending <br/> Message.N_A - for not applicable <br/>
[ "Returns", "whether", "an", "attribute", "could", "be", "present", "in", "this", "message", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/stun/src/main/java/org/restcomm/media/core/stun/messages/StunMessage.java#L467-L604
train
RestComm/media-core
stun/src/main/java/org/restcomm/media/core/stun/messages/StunMessage.java
StunMessage.getName
public String getName() { switch (messageType) { case ALLOCATE_REQUEST: return "ALLOCATE-REQUEST"; case ALLOCATE_RESPONSE: return "ALLOCATE-RESPONSE"; case ALLOCATE_ERROR_RESPONSE: return "ALLOCATE-ERROR-RESPONSE"; case BINDING_REQUEST: return "BINDING-REQUEST"; case BINDING_SUCCESS_RESPONSE: ...
java
public String getName() { switch (messageType) { case ALLOCATE_REQUEST: return "ALLOCATE-REQUEST"; case ALLOCATE_RESPONSE: return "ALLOCATE-RESPONSE"; case ALLOCATE_ERROR_RESPONSE: return "ALLOCATE-ERROR-RESPONSE"; case BINDING_REQUEST: return "BINDING-REQUEST"; case BINDING_SUCCESS_RESPONSE: ...
[ "public", "String", "getName", "(", ")", "{", "switch", "(", "messageType", ")", "{", "case", "ALLOCATE_REQUEST", ":", "return", "\"ALLOCATE-REQUEST\"", ";", "case", "ALLOCATE_RESPONSE", ":", "return", "\"ALLOCATE-RESPONSE\"", ";", "case", "ALLOCATE_ERROR_RESPONSE", ...
Returns the human readable name of this message. Message names do not really matter from the protocol point of view. They are only used for debugging and readability. @return this message's name.
[ "Returns", "the", "human", "readable", "name", "of", "this", "message", ".", "Message", "names", "do", "not", "really", "matter", "from", "the", "protocol", "point", "of", "view", ".", "They", "are", "only", "used", "for", "debugging", "and", "readability", ...
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/stun/src/main/java/org/restcomm/media/core/stun/messages/StunMessage.java#L613-L652
train
RestComm/media-core
stun/src/main/java/org/restcomm/media/core/stun/messages/StunMessage.java
StunMessage.encode
public byte[] encode() throws IllegalStateException { prepareForEncoding(); // make sure we have everything necessary to encode a proper message validateAttributePresentity(); final char dataLength = getDataLength(); byte binMsg[] = new byte[HEADER_LENGTH + dataLength]; int offset = 0; // STUN Message...
java
public byte[] encode() throws IllegalStateException { prepareForEncoding(); // make sure we have everything necessary to encode a proper message validateAttributePresentity(); final char dataLength = getDataLength(); byte binMsg[] = new byte[HEADER_LENGTH + dataLength]; int offset = 0; // STUN Message...
[ "public", "byte", "[", "]", "encode", "(", ")", "throws", "IllegalStateException", "{", "prepareForEncoding", "(", ")", ";", "// make sure we have everything necessary to encode a proper message", "validateAttributePresentity", "(", ")", ";", "final", "char", "dataLength", ...
Returns a binary representation of this message. @return a binary representation of this message. @throws IllegalStateException if the message does not have all required attributes.
[ "Returns", "a", "binary", "representation", "of", "this", "message", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/stun/src/main/java/org/restcomm/media/core/stun/messages/StunMessage.java#L699-L780
train
RestComm/media-core
stun/src/main/java/org/restcomm/media/core/stun/messages/StunMessage.java
StunMessage.prepareForEncoding
private void prepareForEncoding() { // remove MESSAGE-INTEGRITY and FINGERPRINT attributes so that we can // make sure they are added at the end. StunAttribute msgIntAttr = removeAttribute(StunAttribute.MESSAGE_INTEGRITY); StunAttribute fingerprint = removeAttribute(StunAttribute.FINGERPRINT); // add a SOFTW...
java
private void prepareForEncoding() { // remove MESSAGE-INTEGRITY and FINGERPRINT attributes so that we can // make sure they are added at the end. StunAttribute msgIntAttr = removeAttribute(StunAttribute.MESSAGE_INTEGRITY); StunAttribute fingerprint = removeAttribute(StunAttribute.FINGERPRINT); // add a SOFTW...
[ "private", "void", "prepareForEncoding", "(", ")", "{", "// remove MESSAGE-INTEGRITY and FINGERPRINT attributes so that we can", "// make sure they are added at the end.", "StunAttribute", "msgIntAttr", "=", "removeAttribute", "(", "StunAttribute", ".", "MESSAGE_INTEGRITY", ")", ";...
Adds attributes that have been requested vis configuration properties. Asserts attribute order where necessary.
[ "Adds", "attributes", "that", "have", "been", "requested", "vis", "configuration", "properties", ".", "Asserts", "attribute", "order", "where", "necessary", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/stun/src/main/java/org/restcomm/media/core/stun/messages/StunMessage.java#L786-L814
train
RestComm/media-core
stun/src/main/java/org/restcomm/media/core/stun/messages/StunMessage.java
StunMessage.performAttributeSpecificActions
private static void performAttributeSpecificActions(StunAttribute attribute, byte[] binMessage, int offset, int msgLen) throws StunException { // check finger print CRC if (attribute instanceof FingerprintAttribute) { if (!validateFingerprint((FingerprintAttribute) attribute, binMessage, offset, msgLen)) { ...
java
private static void performAttributeSpecificActions(StunAttribute attribute, byte[] binMessage, int offset, int msgLen) throws StunException { // check finger print CRC if (attribute instanceof FingerprintAttribute) { if (!validateFingerprint((FingerprintAttribute) attribute, binMessage, offset, msgLen)) { ...
[ "private", "static", "void", "performAttributeSpecificActions", "(", "StunAttribute", "attribute", ",", "byte", "[", "]", "binMessage", ",", "int", "offset", ",", "int", "msgLen", ")", "throws", "StunException", "{", "// check finger print CRC", "if", "(", "attribut...
Executes actions related specific attributes like asserting proper fingerprint checksum. @param attribute the <tt>StunAttribute</tt> we'd like to process. @param binMessage the byte array that the message arrived with. @param offset the index where data starts in <tt>binMessage</tt>. @param msgLen the number of messag...
[ "Executes", "actions", "related", "specific", "attributes", "like", "asserting", "proper", "fingerprint", "checksum", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/stun/src/main/java/org/restcomm/media/core/stun/messages/StunMessage.java#L926-L936
train
RestComm/media-core
stun/src/main/java/org/restcomm/media/core/stun/messages/StunMessage.java
StunMessage.validateAttributePresentity
protected void validateAttributePresentity() throws IllegalStateException { if (!rfc3489CompatibilityMode) { return; } for (char i = StunAttribute.MAPPED_ADDRESS; i < StunAttribute.REFLECTED_FROM; i++) { if (getAttributePresentity(i) == M && getAttribute(i) == null) { throw new IllegalStateException("A...
java
protected void validateAttributePresentity() throws IllegalStateException { if (!rfc3489CompatibilityMode) { return; } for (char i = StunAttribute.MAPPED_ADDRESS; i < StunAttribute.REFLECTED_FROM; i++) { if (getAttributePresentity(i) == M && getAttribute(i) == null) { throw new IllegalStateException("A...
[ "protected", "void", "validateAttributePresentity", "(", ")", "throws", "IllegalStateException", "{", "if", "(", "!", "rfc3489CompatibilityMode", ")", "{", "return", ";", "}", "for", "(", "char", "i", "=", "StunAttribute", ".", "MAPPED_ADDRESS", ";", "i", "<", ...
Verify that the message has all obligatory attributes and throw an exception if this is not the case. @throws IllegalStateException if the message does not have all required attributes.
[ "Verify", "that", "the", "message", "has", "all", "obligatory", "attributes", "and", "throw", "an", "exception", "if", "this", "is", "not", "the", "case", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/stun/src/main/java/org/restcomm/media/core/stun/messages/StunMessage.java#L982-L992
train
RestComm/media-core
rtp/src/main/java/org/restcomm/media/core/rtp/sdp/SdpFactory.java
SdpFactory.buildSdp
public static SessionDescription buildSdp(boolean offer, String localAddress, String externalAddress, MediaChannel... channels) { // Session-level fields SessionDescription sd = new SessionDescription(); sd.setVersion(new VersionField((short) 0)); String originAddress = (externalAddress == null || externalAddre...
java
public static SessionDescription buildSdp(boolean offer, String localAddress, String externalAddress, MediaChannel... channels) { // Session-level fields SessionDescription sd = new SessionDescription(); sd.setVersion(new VersionField((short) 0)); String originAddress = (externalAddress == null || externalAddre...
[ "public", "static", "SessionDescription", "buildSdp", "(", "boolean", "offer", ",", "String", "localAddress", ",", "String", "externalAddress", ",", "MediaChannel", "...", "channels", ")", "{", "// Session-level fields", "SessionDescription", "sd", "=", "new", "Sessio...
Builds a Session Description object to be sent to a remote peer. @param offer if the SDP is for an answer or answer. @param localAddress The local address of the media server. @param externalAddress The public address of the media server. @param channels The media channels to be included in the session description. @r...
[ "Builds", "a", "Session", "Description", "object", "to", "be", "sent", "to", "a", "remote", "peer", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/rtp/src/main/java/org/restcomm/media/core/rtp/sdp/SdpFactory.java#L68-L97
train
RestComm/media-core
rtp/src/main/java/org/restcomm/media/core/rtp/sdp/SdpFactory.java
SdpFactory.rejectMediaField
public static void rejectMediaField(SessionDescription answer, MediaDescriptionField media) { MediaDescriptionField rejected = new MediaDescriptionField(); rejected.setMedia(media.getMedia()); rejected.setPort(0); rejected.setProtocol(media.getProtocol()); rejected.setPayloadTypes(media.getPayloadTypes()); ...
java
public static void rejectMediaField(SessionDescription answer, MediaDescriptionField media) { MediaDescriptionField rejected = new MediaDescriptionField(); rejected.setMedia(media.getMedia()); rejected.setPort(0); rejected.setProtocol(media.getProtocol()); rejected.setPayloadTypes(media.getPayloadTypes()); ...
[ "public", "static", "void", "rejectMediaField", "(", "SessionDescription", "answer", ",", "MediaDescriptionField", "media", ")", "{", "MediaDescriptionField", "rejected", "=", "new", "MediaDescriptionField", "(", ")", ";", "rejected", ".", "setMedia", "(", "media", ...
Rejects a media description from an SDP offer. @param answer The SDP answer to include the rejected media @param media The offered media description to be rejected
[ "Rejects", "a", "media", "description", "from", "an", "SDP", "offer", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/rtp/src/main/java/org/restcomm/media/core/rtp/sdp/SdpFactory.java#L107-L116
train
RestComm/media-core
rtp/src/main/java/org/restcomm/media/core/rtp/sdp/MediaDescriptorField.java
MediaDescriptorField.setDescriptor
protected void setDescriptor(Text line) throws ParseException { line.trim(); try { //split using equal sign Iterator<Text> it = line.split('=').iterator(); //skip first token (m) Text t = it.next(); //select second token (media_type port prof...
java
protected void setDescriptor(Text line) throws ParseException { line.trim(); try { //split using equal sign Iterator<Text> it = line.split('=').iterator(); //skip first token (m) Text t = it.next(); //select second token (media_type port prof...
[ "protected", "void", "setDescriptor", "(", "Text", "line", ")", "throws", "ParseException", "{", "line", ".", "trim", "(", ")", ";", "try", "{", "//split using equal sign", "Iterator", "<", "Text", ">", "it", "=", "line", ".", "split", "(", "'", "'", ")"...
Reads values from specified text line @param line the text description of the media. @throws ParseException
[ "Reads", "values", "from", "specified", "text", "line" ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/rtp/src/main/java/org/restcomm/media/core/rtp/sdp/MediaDescriptorField.java#L79-L120
train
RestComm/media-core
rtp/src/main/java/org/restcomm/media/core/rtp/sdp/MediaDescriptorField.java
MediaDescriptorField.addAttribute
protected void addAttribute(Text attribute) { if (attribute.startsWith(SessionDescription.RTPMAP)) { addRtpMapAttribute(attribute); return; } if (attribute.startsWith(SessionDescription.FMTP)) { addFmtAttribute(attribute); return; } ...
java
protected void addAttribute(Text attribute) { if (attribute.startsWith(SessionDescription.RTPMAP)) { addRtpMapAttribute(attribute); return; } if (attribute.startsWith(SessionDescription.FMTP)) { addFmtAttribute(attribute); return; } ...
[ "protected", "void", "addAttribute", "(", "Text", "attribute", ")", "{", "if", "(", "attribute", ".", "startsWith", "(", "SessionDescription", ".", "RTPMAP", ")", ")", "{", "addRtpMapAttribute", "(", "attribute", ")", ";", "return", ";", "}", "if", "(", "a...
Parses attribute. @param attribute the attribute to parse
[ "Parses", "attribute", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/rtp/src/main/java/org/restcomm/media/core/rtp/sdp/MediaDescriptorField.java#L127-L165
train
RestComm/media-core
rtp/src/main/java/org/restcomm/media/core/rtp/sdp/MediaDescriptorField.java
MediaDescriptorField.addCandidate
private void addCandidate(Text attribute) { // Copy and trim the attribute Text attr = new Text(); attribute.copy(attr); attr.trim(); // Parse the candidate field and add it to list of candidates CandidateField candidateField = new CandidateField(attr); this.candidates.add(candidateField); // Candida...
java
private void addCandidate(Text attribute) { // Copy and trim the attribute Text attr = new Text(); attribute.copy(attr); attr.trim(); // Parse the candidate field and add it to list of candidates CandidateField candidateField = new CandidateField(attr); this.candidates.add(candidateField); // Candida...
[ "private", "void", "addCandidate", "(", "Text", "attribute", ")", "{", "// Copy and trim the attribute", "Text", "attr", "=", "new", "Text", "(", ")", ";", "attribute", ".", "copy", "(", "attr", ")", ";", "attr", ".", "trim", "(", ")", ";", "// Parse the c...
Parses a candidate field for ICE and register it on internal list. @param attribute
[ "Parses", "a", "candidate", "field", "for", "ICE", "and", "register", "it", "on", "internal", "list", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/rtp/src/main/java/org/restcomm/media/core/rtp/sdp/MediaDescriptorField.java#L209-L220
train
RestComm/media-core
rtp/src/main/java/org/restcomm/media/core/rtp/sdp/MediaDescriptorField.java
MediaDescriptorField.setConnection
protected void setConnection(Text line) throws ParseException { connection = new ConnectionField(); connection.strain(line); Collections.sort(this.candidates); }
java
protected void setConnection(Text line) throws ParseException { connection = new ConnectionField(); connection.strain(line); Collections.sort(this.candidates); }
[ "protected", "void", "setConnection", "(", "Text", "line", ")", "throws", "ParseException", "{", "connection", "=", "new", "ConnectionField", "(", ")", ";", "connection", ".", "strain", "(", "line", ")", ";", "Collections", ".", "sort", "(", "this", ".", "...
Modify connection attribute. @param line the text view of attribute. @throws ParseException
[ "Modify", "connection", "attribute", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/rtp/src/main/java/org/restcomm/media/core/rtp/sdp/MediaDescriptorField.java#L332-L336
train
RestComm/media-core
rtp/src/main/java/org/restcomm/media/core/rtp/sdp/MediaDescriptorField.java
MediaDescriptorField.createFormat
private RTPFormat createFormat(int payload, Text description) { MediaType mtype = MediaType.fromDescription(mediaType); switch (mtype) { case AUDIO: return createAudioFormat(payload, description); case VIDEO: return createVideoFormat(payload, description); case APPLICATION: return createApplicationFo...
java
private RTPFormat createFormat(int payload, Text description) { MediaType mtype = MediaType.fromDescription(mediaType); switch (mtype) { case AUDIO: return createAudioFormat(payload, description); case VIDEO: return createVideoFormat(payload, description); case APPLICATION: return createApplicationFo...
[ "private", "RTPFormat", "createFormat", "(", "int", "payload", ",", "Text", "description", ")", "{", "MediaType", "mtype", "=", "MediaType", ".", "fromDescription", "(", "mediaType", ")", ";", "switch", "(", "mtype", ")", "{", "case", "AUDIO", ":", "return",...
Creates or updates format using payload number and text format description. @param payload the payload number of the format. @param description text description of the format @return format object
[ "Creates", "or", "updates", "format", "using", "payload", "number", "and", "text", "format", "description", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/rtp/src/main/java/org/restcomm/media/core/rtp/sdp/MediaDescriptorField.java#L400-L412
train
RestComm/media-core
rtp/src/main/java/org/restcomm/media/core/rtp/sdp/MediaDescriptorField.java
MediaDescriptorField.createAudioFormat
private RTPFormat createAudioFormat(int payload, Text description) { Iterator<Text> it = description.split('/').iterator(); //encoding name Text token = it.next(); token.trim(); EncodingName name = new EncodingName(token); //clock rate //TODO : convert to sample...
java
private RTPFormat createAudioFormat(int payload, Text description) { Iterator<Text> it = description.split('/').iterator(); //encoding name Text token = it.next(); token.trim(); EncodingName name = new EncodingName(token); //clock rate //TODO : convert to sample...
[ "private", "RTPFormat", "createAudioFormat", "(", "int", "payload", ",", "Text", "description", ")", "{", "Iterator", "<", "Text", ">", "it", "=", "description", ".", "split", "(", "'", "'", ")", ".", "iterator", "(", ")", ";", "//encoding name", "Text", ...
Creates or updates audio format using payload number and text format description. @param payload the payload number of the format. @param description text description of the format @return format object
[ "Creates", "or", "updates", "audio", "format", "using", "payload", "number", "and", "text", "format", "description", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/rtp/src/main/java/org/restcomm/media/core/rtp/sdp/MediaDescriptorField.java#L421-L454
train
RestComm/media-core
rtp/src/main/java/org/restcomm/media/core/rtp/sdp/MediaDescriptorField.java
MediaDescriptorField.createVideoFormat
private RTPFormat createVideoFormat(int payload, Text description) { Iterator<Text> it = description.split('/').iterator(); //encoding name Text token = it.next(); token.trim(); EncodingName name = new EncodingName(token); //clock rate //TODO : convert to frame ...
java
private RTPFormat createVideoFormat(int payload, Text description) { Iterator<Text> it = description.split('/').iterator(); //encoding name Text token = it.next(); token.trim(); EncodingName name = new EncodingName(token); //clock rate //TODO : convert to frame ...
[ "private", "RTPFormat", "createVideoFormat", "(", "int", "payload", ",", "Text", "description", ")", "{", "Iterator", "<", "Text", ">", "it", "=", "description", ".", "split", "(", "'", "'", ")", ".", "iterator", "(", ")", ";", "//encoding name", "Text", ...
Creates or updates video format using payload number and text format description. @param payload the payload number of the format. @param description text description of the format @return format object
[ "Creates", "or", "updates", "video", "format", "using", "payload", "number", "and", "text", "format", "description", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/rtp/src/main/java/org/restcomm/media/core/rtp/sdp/MediaDescriptorField.java#L463-L487
train
RestComm/media-core
rtp/src/main/java/org/restcomm/media/core/rtp/sdp/MediaDescriptorField.java
MediaDescriptorField.createApplicationFormat
private RTPFormat createApplicationFormat(int payload, Text description) { Iterator<Text> it = description.split('/').iterator(); //encoding name Text token = it.next(); token.trim(); EncodingName name = new EncodingName(token); //clock rate token = it.next(); ...
java
private RTPFormat createApplicationFormat(int payload, Text description) { Iterator<Text> it = description.split('/').iterator(); //encoding name Text token = it.next(); token.trim(); EncodingName name = new EncodingName(token); //clock rate token = it.next(); ...
[ "private", "RTPFormat", "createApplicationFormat", "(", "int", "payload", ",", "Text", "description", ")", "{", "Iterator", "<", "Text", ">", "it", "=", "description", ".", "split", "(", "'", "'", ")", ".", "iterator", "(", ")", ";", "//encoding name", "Te...
Creates or updates application format using payload number and text format description. @param payload the payload number of the format. @param description text description of the format @return format object
[ "Creates", "or", "updates", "application", "format", "using", "payload", "number", "and", "text", "format", "description", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/rtp/src/main/java/org/restcomm/media/core/rtp/sdp/MediaDescriptorField.java#L496-L515
train
RestComm/media-core
stun/src/main/java/org/restcomm/media/core/stun/messages/attributes/address/AddressAttribute.java
AddressAttribute.isTypeValid
private boolean isTypeValid(char type) { return (type == MAPPED_ADDRESS || type == RESPONSE_ADDRESS || type == SOURCE_ADDRESS || type == CHANGED_ADDRESS || type == REFLECTED_FROM || type == XOR_MAPPED_ADDRESS || type == ALTERNATE_SERVER || type == XOR_PEER_ADDRESS || type == XOR_RELAYED_ADDRESS || typ...
java
private boolean isTypeValid(char type) { return (type == MAPPED_ADDRESS || type == RESPONSE_ADDRESS || type == SOURCE_ADDRESS || type == CHANGED_ADDRESS || type == REFLECTED_FROM || type == XOR_MAPPED_ADDRESS || type == ALTERNATE_SERVER || type == XOR_PEER_ADDRESS || type == XOR_RELAYED_ADDRESS || typ...
[ "private", "boolean", "isTypeValid", "(", "char", "type", ")", "{", "return", "(", "type", "==", "MAPPED_ADDRESS", "||", "type", "==", "RESPONSE_ADDRESS", "||", "type", "==", "SOURCE_ADDRESS", "||", "type", "==", "CHANGED_ADDRESS", "||", "type", "==", "REFLECT...
Verifies that type is a valid address attribute type. @param type the type to test @return true if the type is a valid address attribute type and false otherwise
[ "Verifies", "that", "type", "is", "a", "valid", "address", "attribute", "type", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/stun/src/main/java/org/restcomm/media/core/stun/messages/attributes/address/AddressAttribute.java#L81-L87
train
RestComm/media-core
client/jsr-309/driver/src/main/java/org/restcomm/sdp/FormatUtils.java
FormatUtils.isSubclass
public static boolean isSubclass(Class a, Class b) { if (a == b) return false; if (!(b.isAssignableFrom(a))) return false; return true; }
java
public static boolean isSubclass(Class a, Class b) { if (a == b) return false; if (!(b.isAssignableFrom(a))) return false; return true; }
[ "public", "static", "boolean", "isSubclass", "(", "Class", "a", ",", "Class", "b", ")", "{", "if", "(", "a", "==", "b", ")", "return", "false", ";", "if", "(", "!", "(", "b", ".", "isAssignableFrom", "(", "a", ")", ")", ")", "return", "false", ";...
Is a a subclass of b? Strict.
[ "Is", "a", "a", "subclass", "of", "b?", "Strict", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/client/jsr-309/driver/src/main/java/org/restcomm/sdp/FormatUtils.java#L31-L37
train
RestComm/media-core
rtp/src/main/java/org/restcomm/media/core/rtp/crypto/RawPacket.java
RawPacket.append
public void append(byte[] data, int len) { if (data == null || len <= 0 || len > data.length) { throw new IllegalArgumentException("Invalid combination of parameters data and length to append()"); } int oldLimit = buffer.limit(); // grow buffer if necessary grow(len...
java
public void append(byte[] data, int len) { if (data == null || len <= 0 || len > data.length) { throw new IllegalArgumentException("Invalid combination of parameters data and length to append()"); } int oldLimit = buffer.limit(); // grow buffer if necessary grow(len...
[ "public", "void", "append", "(", "byte", "[", "]", "data", ",", "int", "len", ")", "{", "if", "(", "data", "==", "null", "||", "len", "<=", "0", "||", "len", ">", "data", ".", "length", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"...
Append a byte array to the end of the packet. This may change the data buffer of this packet. @param data byte array to append @param len the number of bytes to append
[ "Append", "a", "byte", "array", "to", "the", "end", "of", "the", "packet", ".", "This", "may", "change", "the", "data", "buffer", "of", "this", "packet", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/rtp/src/main/java/org/restcomm/media/core/rtp/crypto/RawPacket.java#L93-L107
train
RestComm/media-core
rtp/src/main/java/org/restcomm/media/core/rtp/crypto/RawPacket.java
RawPacket.readInt
public int readInt(int off) { this.buffer.rewind(); return ((buffer.get(off++) & 0xFF) << 24) | ((buffer.get(off++) & 0xFF) << 16) | ((buffer.get(off++) & 0xFF) << 8) | (buffer.get(off++) & 0xFF); }
java
public int readInt(int off) { this.buffer.rewind(); return ((buffer.get(off++) & 0xFF) << 24) | ((buffer.get(off++) & 0xFF) << 16) | ((buffer.get(off++) & 0xFF) << 8) | (buffer.get(off++) & 0xFF); }
[ "public", "int", "readInt", "(", "int", "off", ")", "{", "this", ".", "buffer", ".", "rewind", "(", ")", ";", "return", "(", "(", "buffer", ".", "get", "(", "off", "++", ")", "&", "0xFF", ")", "<<", "24", ")", "|", "(", "(", "buffer", ".", "g...
Read a integer from this packet at specified offset @param off start offset of the integer to be read @return the integer to be read
[ "Read", "a", "integer", "from", "this", "packet", "at", "specified", "offset" ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/rtp/src/main/java/org/restcomm/media/core/rtp/crypto/RawPacket.java#L305-L311
train
RestComm/media-core
rtp/src/main/java/org/restcomm/media/core/rtp/crypto/RawPacket.java
RawPacket.readRegion
public byte[] readRegion(int off, int len) { this.buffer.rewind(); if (off < 0 || len <= 0 || off + len > this.buffer.limit()) { return null; } byte[] region = new byte[len]; this.buffer.get(region, off, len); return region; }
java
public byte[] readRegion(int off, int len) { this.buffer.rewind(); if (off < 0 || len <= 0 || off + len > this.buffer.limit()) { return null; } byte[] region = new byte[len]; this.buffer.get(region, off, len); return region; }
[ "public", "byte", "[", "]", "readRegion", "(", "int", "off", ",", "int", "len", ")", "{", "this", ".", "buffer", ".", "rewind", "(", ")", ";", "if", "(", "off", "<", "0", "||", "len", "<=", "0", "||", "off", "+", "len", ">", "this", ".", "buf...
Read a byte region from specified offset with specified length @param off start offset of the region to be read @param len length of the region to be read @return byte array of [offset, offset + length)
[ "Read", "a", "byte", "region", "from", "specified", "offset", "with", "specified", "length" ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/rtp/src/main/java/org/restcomm/media/core/rtp/crypto/RawPacket.java#L320-L329
train
RestComm/media-core
rtp/src/main/java/org/restcomm/media/core/rtp/crypto/RawPacket.java
RawPacket.readRegionToBuff
public void readRegionToBuff(int off, int len, byte[] outBuff) { assert off >= 0; assert len > 0; assert outBuff != null; assert outBuff.length >= len; assert buffer.limit() >= off + len; buffer.position(off); buffer.get(outBuff, 0, len); }
java
public void readRegionToBuff(int off, int len, byte[] outBuff) { assert off >= 0; assert len > 0; assert outBuff != null; assert outBuff.length >= len; assert buffer.limit() >= off + len; buffer.position(off); buffer.get(outBuff, 0, len); }
[ "public", "void", "readRegionToBuff", "(", "int", "off", ",", "int", "len", ",", "byte", "[", "]", "outBuff", ")", "{", "assert", "off", ">=", "0", ";", "assert", "len", ">", "0", ";", "assert", "outBuff", "!=", "null", ";", "assert", "outBuff", ".",...
Read a byte region from specified offset in the RTP packet and with specified length into a given buffer @param off start offset in the RTP packet of the region to be read @param len length of the region to be read @param outBuff output buffer
[ "Read", "a", "byte", "region", "from", "specified", "offset", "in", "the", "RTP", "packet", "and", "with", "specified", "length", "into", "a", "given", "buffer" ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/rtp/src/main/java/org/restcomm/media/core/rtp/crypto/RawPacket.java#L342-L351
train
RestComm/media-core
rtp/src/main/java/org/restcomm/media/core/rtp/crypto/RawPacket.java
RawPacket.readUnsignedShortAsInt
public int readUnsignedShortAsInt(int off) { this.buffer.position(off); int b1 = (0x000000FF & (this.buffer.get())); int b2 = (0x000000FF & (this.buffer.get())); int val = b1 << 8 | b2; return val; }
java
public int readUnsignedShortAsInt(int off) { this.buffer.position(off); int b1 = (0x000000FF & (this.buffer.get())); int b2 = (0x000000FF & (this.buffer.get())); int val = b1 << 8 | b2; return val; }
[ "public", "int", "readUnsignedShortAsInt", "(", "int", "off", ")", "{", "this", ".", "buffer", ".", "position", "(", "off", ")", ";", "int", "b1", "=", "(", "0x000000FF", "&", "(", "this", ".", "buffer", ".", "get", "(", ")", ")", ")", ";", "int", ...
Read an unsigned short at specified offset as a int @param off start offset of the unsigned short @return the int value of the unsigned short at offset
[ "Read", "an", "unsigned", "short", "at", "specified", "offset", "as", "a", "int" ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/rtp/src/main/java/org/restcomm/media/core/rtp/crypto/RawPacket.java#L359-L365
train
RestComm/media-core
rtp/src/main/java/org/restcomm/media/core/rtp/crypto/RawPacket.java
RawPacket.readUnsignedIntAsLong
public long readUnsignedIntAsLong(int off) { buffer.position(off); return (((long)(buffer.get() & 0xff) << 24) | ((long)(buffer.get() & 0xff) << 16) | ((long)(buffer.get() & 0xff) << 8) | ((long)(buffer.get() & 0xff))) & 0xFFFFFFFFL; }
java
public long readUnsignedIntAsLong(int off) { buffer.position(off); return (((long)(buffer.get() & 0xff) << 24) | ((long)(buffer.get() & 0xff) << 16) | ((long)(buffer.get() & 0xff) << 8) | ((long)(buffer.get() & 0xff))) & 0xFFFFFFFFL; }
[ "public", "long", "readUnsignedIntAsLong", "(", "int", "off", ")", "{", "buffer", ".", "position", "(", "off", ")", ";", "return", "(", "(", "(", "long", ")", "(", "buffer", ".", "get", "(", ")", "&", "0xff", ")", "<<", "24", ")", "|", "(", "(", ...
Read an unsigned integer as long at specified offset @param off start offset of this unsigned integer @return unsigned integer as long at offset
[ "Read", "an", "unsigned", "integer", "as", "long", "at", "specified", "offset" ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/rtp/src/main/java/org/restcomm/media/core/rtp/crypto/RawPacket.java#L373-L379
train
RestComm/media-core
rtp/src/main/java/org/restcomm/media/core/rtp/crypto/RawPacket.java
RawPacket.shrink
public void shrink(int delta) { if (delta <= 0) { return; } int newLimit = buffer.limit() - delta; if (newLimit <= 0) { newLimit = 0; } this.buffer.limit(newLimit); }
java
public void shrink(int delta) { if (delta <= 0) { return; } int newLimit = buffer.limit() - delta; if (newLimit <= 0) { newLimit = 0; } this.buffer.limit(newLimit); }
[ "public", "void", "shrink", "(", "int", "delta", ")", "{", "if", "(", "delta", "<=", "0", ")", "{", "return", ";", "}", "int", "newLimit", "=", "buffer", ".", "limit", "(", ")", "-", "delta", ";", "if", "(", "newLimit", "<=", "0", ")", "{", "ne...
Shrink the buffer of this packet by specified length @param len length to shrink
[ "Shrink", "the", "buffer", "of", "this", "packet", "by", "specified", "length" ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/rtp/src/main/java/org/restcomm/media/core/rtp/crypto/RawPacket.java#L386-L396
train
RestComm/media-core
component/src/main/java/org/restcomm/media/core/component/audio/AudioInput.java
AudioInput.recycle
public void recycle() { while(buffer.size()>0) buffer.poll().recycle(); if(activeFrame!=null) activeFrame.recycle(); activeFrame=null; activeData=null; byteIndex=0; }
java
public void recycle() { while(buffer.size()>0) buffer.poll().recycle(); if(activeFrame!=null) activeFrame.recycle(); activeFrame=null; activeData=null; byteIndex=0; }
[ "public", "void", "recycle", "(", ")", "{", "while", "(", "buffer", ".", "size", "(", ")", ">", "0", ")", "buffer", ".", "poll", "(", ")", ".", "recycle", "(", ")", ";", "if", "(", "activeFrame", "!=", "null", ")", "activeFrame", ".", "recycle", ...
Recycles input stream
[ "Recycles", "input", "stream" ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/component/src/main/java/org/restcomm/media/core/component/audio/AudioInput.java#L137-L147
train
RestComm/media-core
rtp/src/main/java/org/restcomm/media/core/rtp/RTPDataChannel.java
RTPDataChannel.bind
public void bind(boolean isLocal) throws IOException, SocketException { try { rtpChannel = udpManager.open(rtpHandler); // if control enabled open rtcp channel as well if (channelsManager.getIsControlEnabled()) { rtcpChannel = udpManager.open(new RTCPHandler()); } } catch (IOException e) { throw...
java
public void bind(boolean isLocal) throws IOException, SocketException { try { rtpChannel = udpManager.open(rtpHandler); // if control enabled open rtcp channel as well if (channelsManager.getIsControlEnabled()) { rtcpChannel = udpManager.open(new RTCPHandler()); } } catch (IOException e) { throw...
[ "public", "void", "bind", "(", "boolean", "isLocal", ")", "throws", "IOException", ",", "SocketException", "{", "try", "{", "rtpChannel", "=", "udpManager", ".", "open", "(", "rtpHandler", ")", ";", "// if control enabled open rtcp channel as well", "if", "(", "ch...
Binds channel to the first available port. @throws SocketException
[ "Binds", "channel", "to", "the", "first", "available", "port", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/rtp/src/main/java/org/restcomm/media/core/rtp/RTPDataChannel.java#L297-L328
train
RestComm/media-core
rtp/src/main/java/org/restcomm/media/core/rtp/RTPDataChannel.java
RTPDataChannel.setPeer
public void setPeer(SocketAddress address) { this.remotePeer = address; boolean connectImmediately = false; if (rtpChannel != null) { if (rtpChannel.isConnected()) try { rtpChannel.disconnect(); } catch (IOException e) { logger.error(e); } connectImmediately = udpManager .connect...
java
public void setPeer(SocketAddress address) { this.remotePeer = address; boolean connectImmediately = false; if (rtpChannel != null) { if (rtpChannel.isConnected()) try { rtpChannel.disconnect(); } catch (IOException e) { logger.error(e); } connectImmediately = udpManager .connect...
[ "public", "void", "setPeer", "(", "SocketAddress", "address", ")", "{", "this", ".", "remotePeer", "=", "address", ";", "boolean", "connectImmediately", "=", "false", ";", "if", "(", "rtpChannel", "!=", "null", ")", "{", "if", "(", "rtpChannel", ".", "isCo...
Sets the address of remote peer. @param address the address object.
[ "Sets", "the", "address", "of", "remote", "peer", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/rtp/src/main/java/org/restcomm/media/core/rtp/RTPDataChannel.java#L359-L389
train
RestComm/media-core
rtp/src/main/java/org/restcomm/media/core/rtp/RTPDataChannel.java
RTPDataChannel.close
public void close() { if (rtpChannel != null) { if (rtpChannel.isConnected()) { try { rtpChannel.disconnect(); } catch (IOException e) { logger.error(e); } try { rtpChannel.socket().close(); rtpChannel.close(); } catch (IOException e) { logger.error(e); } } } ...
java
public void close() { if (rtpChannel != null) { if (rtpChannel.isConnected()) { try { rtpChannel.disconnect(); } catch (IOException e) { logger.error(e); } try { rtpChannel.socket().close(); rtpChannel.close(); } catch (IOException e) { logger.error(e); } } } ...
[ "public", "void", "close", "(", ")", "{", "if", "(", "rtpChannel", "!=", "null", ")", "{", "if", "(", "rtpChannel", ".", "isConnected", "(", ")", ")", "{", "try", "{", "rtpChannel", ".", "disconnect", "(", ")", ";", "}", "catch", "(", "IOException", ...
Closes this socket.
[ "Closes", "this", "socket", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/rtp/src/main/java/org/restcomm/media/core/rtp/RTPDataChannel.java#L394-L427
train
RestComm/media-core
rtp/src/main/java/org/restcomm/media/core/rtp/RTPDataChannel.java
RTPDataChannel.isAvailable
public boolean isAvailable() { // The channel is available is is connected boolean available = this.rtpChannel != null && this.rtpChannel.isConnected(); // In case of WebRTC calls the DTLS handshake must be completed if(this.isWebRtc) { available = available && this.webRtcHandler.isHandshakeComplete(); } ...
java
public boolean isAvailable() { // The channel is available is is connected boolean available = this.rtpChannel != null && this.rtpChannel.isConnected(); // In case of WebRTC calls the DTLS handshake must be completed if(this.isWebRtc) { available = available && this.webRtcHandler.isHandshakeComplete(); } ...
[ "public", "boolean", "isAvailable", "(", ")", "{", "// The channel is available is is connected", "boolean", "available", "=", "this", ".", "rtpChannel", "!=", "null", "&&", "this", ".", "rtpChannel", ".", "isConnected", "(", ")", ";", "// In case of WebRTC calls the ...
Checks whether the data channel is available for media exchange. @return
[ "Checks", "whether", "the", "data", "channel", "is", "available", "for", "media", "exchange", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/rtp/src/main/java/org/restcomm/media/core/rtp/RTPDataChannel.java#L473-L481
train
RestComm/media-core
rtp/src/main/java/org/restcomm/media/core/rtp/RTPDataChannel.java
RTPDataChannel.enableWebRTC
public void enableWebRTC(Text remotePeerFingerprint) { this.isWebRtc = true; if (this.webRtcHandler == null) { this.webRtcHandler = new DtlsHandler(this.dtlsServerProvider); } this.webRtcHandler.setRemoteFingerprint("sha-256", remotePeerFingerprint.toString()); }
java
public void enableWebRTC(Text remotePeerFingerprint) { this.isWebRtc = true; if (this.webRtcHandler == null) { this.webRtcHandler = new DtlsHandler(this.dtlsServerProvider); } this.webRtcHandler.setRemoteFingerprint("sha-256", remotePeerFingerprint.toString()); }
[ "public", "void", "enableWebRTC", "(", "Text", "remotePeerFingerprint", ")", "{", "this", ".", "isWebRtc", "=", "true", ";", "if", "(", "this", ".", "webRtcHandler", "==", "null", ")", "{", "this", ".", "webRtcHandler", "=", "new", "DtlsHandler", "(", "thi...
Enables WebRTC encryption for the RTP channel. @param remotePeerFingerprint
[ "Enables", "WebRTC", "encryption", "for", "the", "RTP", "channel", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/rtp/src/main/java/org/restcomm/media/core/rtp/RTPDataChannel.java#L835-L841
train
RestComm/media-core
rtp/src/main/java/org/restcomm/media/core/rtp/channels/MediaChannel.java
MediaChannel.open
public void open() { // generate a new unique identifier for the channel this.ssrc = SsrcGenerator.generateSsrc(); this.statistics.setSsrc(this.ssrc); this.open = true; if(logger.isDebugEnabled()) { logger.debug(this.mediaType + " channel " + this.ssrc + " is open"); } }
java
public void open() { // generate a new unique identifier for the channel this.ssrc = SsrcGenerator.generateSsrc(); this.statistics.setSsrc(this.ssrc); this.open = true; if(logger.isDebugEnabled()) { logger.debug(this.mediaType + " channel " + this.ssrc + " is open"); } }
[ "public", "void", "open", "(", ")", "{", "// generate a new unique identifier for the channel", "this", ".", "ssrc", "=", "SsrcGenerator", ".", "generateSsrc", "(", ")", ";", "this", ".", "statistics", ".", "setSsrc", "(", "this", ".", "ssrc", ")", ";", "this"...
Enables the channel and activates it's resources.
[ "Enables", "the", "channel", "and", "activates", "it", "s", "resources", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/rtp/src/main/java/org/restcomm/media/core/rtp/channels/MediaChannel.java#L253-L262
train
RestComm/media-core
rtp/src/main/java/org/restcomm/media/core/rtp/channels/MediaChannel.java
MediaChannel.close
public void close() throws IllegalStateException { if (this.open) { // Close channels this.rtpChannel.close(); if (!this.rtcpMux) { this.rtcpChannel.close(); } if(logger.isDebugEnabled()) { logger.debug(this.mediaType + " channel " + this.ssrc + " is closed"); } // Reset state res...
java
public void close() throws IllegalStateException { if (this.open) { // Close channels this.rtpChannel.close(); if (!this.rtcpMux) { this.rtcpChannel.close(); } if(logger.isDebugEnabled()) { logger.debug(this.mediaType + " channel " + this.ssrc + " is closed"); } // Reset state res...
[ "public", "void", "close", "(", ")", "throws", "IllegalStateException", "{", "if", "(", "this", ".", "open", ")", "{", "// Close channels", "this", ".", "rtpChannel", ".", "close", "(", ")", ";", "if", "(", "!", "this", ".", "rtcpMux", ")", "{", "this"...
Disables the channel and deactivates it's resources. @throws IllegalStateException When an attempt is done to deactivate the channel while inactive.
[ "Disables", "the", "channel", "and", "deactivates", "it", "s", "resources", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/rtp/src/main/java/org/restcomm/media/core/rtp/channels/MediaChannel.java#L271-L289
train
RestComm/media-core
rtp/src/main/java/org/restcomm/media/core/rtp/channels/MediaChannel.java
MediaChannel.reset
private void reset() { // Reset codecs resetFormats(); // Reset channels if (this.rtcpMux) { this.rtcpMux = false; } // Reset ICE if (this.ice) { disableICE(); } // Reset WebRTC if (this.dtls) { disableDTLS(); } // Reset statistics this.statistics.reset(); this.cname = ""; ...
java
private void reset() { // Reset codecs resetFormats(); // Reset channels if (this.rtcpMux) { this.rtcpMux = false; } // Reset ICE if (this.ice) { disableICE(); } // Reset WebRTC if (this.dtls) { disableDTLS(); } // Reset statistics this.statistics.reset(); this.cname = ""; ...
[ "private", "void", "reset", "(", ")", "{", "// Reset codecs", "resetFormats", "(", ")", ";", "// Reset channels", "if", "(", "this", ".", "rtcpMux", ")", "{", "this", ".", "rtcpMux", "=", "false", ";", "}", "// Reset ICE", "if", "(", "this", ".", "ice", ...
Resets the state of the channel. Should be invoked whenever there is intention of reusing the same channel for different calls.
[ "Resets", "the", "state", "of", "the", "channel", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/rtp/src/main/java/org/restcomm/media/core/rtp/channels/MediaChannel.java#L297-L320
train
RestComm/media-core
rtp/src/main/java/org/restcomm/media/core/rtp/channels/MediaChannel.java
MediaChannel.setFormats
protected void setFormats(RTPFormats formats) { try { this.rtpChannel.setFormatMap(formats); this.rtpChannel.setOutputFormats(formats.getFormats()); } catch (FormatNotSupportedException e) { // Never happens logger.warn("Could not set output formats", e); } }
java
protected void setFormats(RTPFormats formats) { try { this.rtpChannel.setFormatMap(formats); this.rtpChannel.setOutputFormats(formats.getFormats()); } catch (FormatNotSupportedException e) { // Never happens logger.warn("Could not set output formats", e); } }
[ "protected", "void", "setFormats", "(", "RTPFormats", "formats", ")", "{", "try", "{", "this", ".", "rtpChannel", ".", "setFormatMap", "(", "formats", ")", ";", "this", ".", "rtpChannel", ".", "setOutputFormats", "(", "formats", ".", "getFormats", "(", ")", ...
Sets the supported codecs of the RTP components. @param formats The supported codecs resulting from SDP negotiation
[ "Sets", "the", "supported", "codecs", "of", "the", "RTP", "components", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/rtp/src/main/java/org/restcomm/media/core/rtp/channels/MediaChannel.java#L402-L410
train