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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
santhosh-tekuri/jlibs | core/src/main/java/jlibs/core/lang/StringUtil.java | StringUtil.getTokens | public static String[] getTokens(String str, String delim, boolean trim){
StringTokenizer stok = new StringTokenizer(str, delim);
String tokens[] = new String[stok.countTokens()];
for(int i=0; i<tokens.length; i++){
tokens[i] = stok.nextToken();
if(trim)
t... | java | public static String[] getTokens(String str, String delim, boolean trim){
StringTokenizer stok = new StringTokenizer(str, delim);
String tokens[] = new String[stok.countTokens()];
for(int i=0; i<tokens.length; i++){
tokens[i] = stok.nextToken();
if(trim)
t... | [
"public",
"static",
"String",
"[",
"]",
"getTokens",
"(",
"String",
"str",
",",
"String",
"delim",
",",
"boolean",
"trim",
")",
"{",
"StringTokenizer",
"stok",
"=",
"new",
"StringTokenizer",
"(",
"str",
",",
"delim",
")",
";",
"String",
"tokens",
"[",
"]... | Splits given string into tokens with delimiters specified.
It uses StringTokenizer for tokenizing.
@param str string to be tokenized
@param delim delimiters used for tokenizing
@param trim trim the tokens
@return non-null token array | [
"Splits",
"given",
"string",
"into",
"tokens",
"with",
"delimiters",
"specified",
".",
"It",
"uses",
"StringTokenizer",
"for",
"tokenizing",
"."
] | 59c28719f054123cf778278154e1b92e943ad232 | https://github.com/santhosh-tekuri/jlibs/blob/59c28719f054123cf778278154e1b92e943ad232/core/src/main/java/jlibs/core/lang/StringUtil.java#L79-L88 | train |
santhosh-tekuri/jlibs | core/src/main/java/jlibs/core/lang/StringUtil.java | StringUtil.ordinalize | public static String ordinalize(int number){
int modulo = number%100;
if(modulo>=11 && modulo<=13)
return number+"th";
switch(number%10){
case 1:
return number+"st";
case 2:
return number+"nd";
case 3:
... | java | public static String ordinalize(int number){
int modulo = number%100;
if(modulo>=11 && modulo<=13)
return number+"th";
switch(number%10){
case 1:
return number+"st";
case 2:
return number+"nd";
case 3:
... | [
"public",
"static",
"String",
"ordinalize",
"(",
"int",
"number",
")",
"{",
"int",
"modulo",
"=",
"number",
"%",
"100",
";",
"if",
"(",
"modulo",
">=",
"11",
"&&",
"modulo",
"<=",
"13",
")",
"return",
"number",
"+",
"\"th\"",
";",
"switch",
"(",
"num... | Turns a non-negative number into an ordinal string used to
denote the position in an ordered sequence, such as 1st, 2nd,
3rd, 4th
@param number the non-negative number
@return the string with the number and ordinal suffix | [
"Turns",
"a",
"non",
"-",
"negative",
"number",
"into",
"an",
"ordinal",
"string",
"used",
"to",
"denote",
"the",
"position",
"in",
"an",
"ordered",
"sequence",
"such",
"as",
"1st",
"2nd",
"3rd",
"4th"
] | 59c28719f054123cf778278154e1b92e943ad232 | https://github.com/santhosh-tekuri/jlibs/blob/59c28719f054123cf778278154e1b92e943ad232/core/src/main/java/jlibs/core/lang/StringUtil.java#L178-L192 | train |
santhosh-tekuri/jlibs | swing/src/main/java/jlibs/swing/datatransfer/ClipboardUtil.java | ClipboardUtil.getText | public static String getText(){
Transferable contents = clipboard().getContents(null);
try{
if(contents!=null && contents.isDataFlavorSupported(DataFlavor.stringFlavor))
return (String)contents.getTransferData(DataFlavor.stringFlavor);
else
return ... | java | public static String getText(){
Transferable contents = clipboard().getContents(null);
try{
if(contents!=null && contents.isDataFlavorSupported(DataFlavor.stringFlavor))
return (String)contents.getTransferData(DataFlavor.stringFlavor);
else
return ... | [
"public",
"static",
"String",
"getText",
"(",
")",
"{",
"Transferable",
"contents",
"=",
"clipboard",
"(",
")",
".",
"getContents",
"(",
"null",
")",
";",
"try",
"{",
"if",
"(",
"contents",
"!=",
"null",
"&&",
"contents",
".",
"isDataFlavorSupported",
"(",... | returns the current text contents of clipboard. If clipboard
has no text contents or has no content, it returns null | [
"returns",
"the",
"current",
"text",
"contents",
"of",
"clipboard",
".",
"If",
"clipboard",
"has",
"no",
"text",
"contents",
"or",
"has",
"no",
"content",
"it",
"returns",
"null"
] | 59c28719f054123cf778278154e1b92e943ad232 | https://github.com/santhosh-tekuri/jlibs/blob/59c28719f054123cf778278154e1b92e943ad232/swing/src/main/java/jlibs/swing/datatransfer/ClipboardUtil.java#L54-L66 | train |
santhosh-tekuri/jlibs | swing/src/main/java/jlibs/swing/datatransfer/ClipboardUtil.java | ClipboardUtil.clear | public static void clear(){
clipboard().setContents(new Transferable(){
public DataFlavor[] getTransferDataFlavors(){
return new DataFlavor[0];
}
public boolean isDataFlavorSupported(DataFlavor flavor){
return false;
}
... | java | public static void clear(){
clipboard().setContents(new Transferable(){
public DataFlavor[] getTransferDataFlavors(){
return new DataFlavor[0];
}
public boolean isDataFlavorSupported(DataFlavor flavor){
return false;
}
... | [
"public",
"static",
"void",
"clear",
"(",
")",
"{",
"clipboard",
"(",
")",
".",
"setContents",
"(",
"new",
"Transferable",
"(",
")",
"{",
"public",
"DataFlavor",
"[",
"]",
"getTransferDataFlavors",
"(",
")",
"{",
"return",
"new",
"DataFlavor",
"[",
"0",
... | clears contents of clipboard | [
"clears",
"contents",
"of",
"clipboard"
] | 59c28719f054123cf778278154e1b92e943ad232 | https://github.com/santhosh-tekuri/jlibs/blob/59c28719f054123cf778278154e1b92e943ad232/swing/src/main/java/jlibs/swing/datatransfer/ClipboardUtil.java#L69-L83 | train |
santhosh-tekuri/jlibs | core/src/main/java/jlibs/core/lang/ByteSequence.java | ByteSequence.set | public void set(byte[] buff, int offset, int length){
if(offset<0)
throw new IndexOutOfBoundsException("ByteSequence index out of range: "+offset);
if(length<0)
throw new IndexOutOfBoundsException("ByteSequence index out of range: "+length);
if(offset>buff.length-length)
... | java | public void set(byte[] buff, int offset, int length){
if(offset<0)
throw new IndexOutOfBoundsException("ByteSequence index out of range: "+offset);
if(length<0)
throw new IndexOutOfBoundsException("ByteSequence index out of range: "+length);
if(offset>buff.length-length)
... | [
"public",
"void",
"set",
"(",
"byte",
"[",
"]",
"buff",
",",
"int",
"offset",
",",
"int",
"length",
")",
"{",
"if",
"(",
"offset",
"<",
"0",
")",
"throw",
"new",
"IndexOutOfBoundsException",
"(",
"\"ByteSequence index out of range: \"",
"+",
"offset",
")",
... | replaces the internal byte buffer with the given byte array.
@param buff Array that is the source of bytes
@param offset The initial offset
@param length The length | [
"replaces",
"the",
"internal",
"byte",
"buffer",
"with",
"the",
"given",
"byte",
"array",
"."
] | 59c28719f054123cf778278154e1b92e943ad232 | https://github.com/santhosh-tekuri/jlibs/blob/59c28719f054123cf778278154e1b92e943ad232/core/src/main/java/jlibs/core/lang/ByteSequence.java#L72-L83 | train |
santhosh-tekuri/jlibs | core/src/main/java/jlibs/core/lang/ClassUtil.java | ClassUtil.getClassingClass | public static Class getClassingClass(int offset){
Class[] context = ClassContext.INSTANCE.getClassContext();
offset += 2;
return context.length>offset ? context[offset] : null;
} | java | public static Class getClassingClass(int offset){
Class[] context = ClassContext.INSTANCE.getClassContext();
offset += 2;
return context.length>offset ? context[offset] : null;
} | [
"public",
"static",
"Class",
"getClassingClass",
"(",
"int",
"offset",
")",
"{",
"Class",
"[",
"]",
"context",
"=",
"ClassContext",
".",
"INSTANCE",
".",
"getClassContext",
"(",
")",
";",
"offset",
"+=",
"2",
";",
"return",
"context",
".",
"length",
">",
... | returns the calling class.
offset 0 returns class who is calling this method
offset 1 returns class who called your method
and so on | [
"returns",
"the",
"calling",
"class",
"."
] | 59c28719f054123cf778278154e1b92e943ad232 | https://github.com/santhosh-tekuri/jlibs/blob/59c28719f054123cf778278154e1b92e943ad232/core/src/main/java/jlibs/core/lang/ClassUtil.java#L153-L157 | train |
santhosh-tekuri/jlibs | core/src/main/java/jlibs/core/io/FileUtil.java | FileUtil.split | public static String[] split(String fileName){
int dot = fileName.lastIndexOf('.');
if(dot==-1)
return new String[]{ fileName, null };
else
return new String[] { fileName.substring(0, dot), fileName.substring(dot+1)};
} | java | public static String[] split(String fileName){
int dot = fileName.lastIndexOf('.');
if(dot==-1)
return new String[]{ fileName, null };
else
return new String[] { fileName.substring(0, dot), fileName.substring(dot+1)};
} | [
"public",
"static",
"String",
"[",
"]",
"split",
"(",
"String",
"fileName",
")",
"{",
"int",
"dot",
"=",
"fileName",
".",
"lastIndexOf",
"(",
"'",
"'",
")",
";",
"if",
"(",
"dot",
"==",
"-",
"1",
")",
"return",
"new",
"String",
"[",
"]",
"{",
"fi... | splits given fileName into name and extension.
@param fileName fileName
@return string array is of length 2, where 1st item is name and 2nd item is extension(null if no extension) | [
"splits",
"given",
"fileName",
"into",
"name",
"and",
"extension",
"."
] | 59c28719f054123cf778278154e1b92e943ad232 | https://github.com/santhosh-tekuri/jlibs/blob/59c28719f054123cf778278154e1b92e943ad232/core/src/main/java/jlibs/core/io/FileUtil.java#L58-L64 | train |
santhosh-tekuri/jlibs | core/src/main/java/jlibs/core/io/FileUtil.java | FileUtil.getName | public static String getName(String fileName){
int dot = fileName.lastIndexOf('.');
return dot==-1 ? fileName : fileName.substring(0, dot);
} | java | public static String getName(String fileName){
int dot = fileName.lastIndexOf('.');
return dot==-1 ? fileName : fileName.substring(0, dot);
} | [
"public",
"static",
"String",
"getName",
"(",
"String",
"fileName",
")",
"{",
"int",
"dot",
"=",
"fileName",
".",
"lastIndexOf",
"(",
"'",
"'",
")",
";",
"return",
"dot",
"==",
"-",
"1",
"?",
"fileName",
":",
"fileName",
".",
"substring",
"(",
"0",
"... | Returns name of the file without extension | [
"Returns",
"name",
"of",
"the",
"file",
"without",
"extension"
] | 59c28719f054123cf778278154e1b92e943ad232 | https://github.com/santhosh-tekuri/jlibs/blob/59c28719f054123cf778278154e1b92e943ad232/core/src/main/java/jlibs/core/io/FileUtil.java#L67-L70 | train |
santhosh-tekuri/jlibs | core/src/main/java/jlibs/core/io/FileUtil.java | FileUtil.getExtension | public static String getExtension(String fileName){
int dot = fileName.lastIndexOf('.');
return dot==-1 ? null : fileName.substring(dot+1);
} | java | public static String getExtension(String fileName){
int dot = fileName.lastIndexOf('.');
return dot==-1 ? null : fileName.substring(dot+1);
} | [
"public",
"static",
"String",
"getExtension",
"(",
"String",
"fileName",
")",
"{",
"int",
"dot",
"=",
"fileName",
".",
"lastIndexOf",
"(",
"'",
"'",
")",
";",
"return",
"dot",
"==",
"-",
"1",
"?",
"null",
":",
"fileName",
".",
"substring",
"(",
"dot",
... | Returns extension of the file. Returns null if there is no extension | [
"Returns",
"extension",
"of",
"the",
"file",
".",
"Returns",
"null",
"if",
"there",
"is",
"no",
"extension"
] | 59c28719f054123cf778278154e1b92e943ad232 | https://github.com/santhosh-tekuri/jlibs/blob/59c28719f054123cf778278154e1b92e943ad232/core/src/main/java/jlibs/core/io/FileUtil.java#L73-L76 | train |
santhosh-tekuri/jlibs | core/src/main/java/jlibs/core/io/FileUtil.java | FileUtil.mkdir | public static void mkdir(File dir) throws IOException{
if(!dir.exists() && !dir.mkdir())
throw new IOException("couldn't create directory: "+dir);
} | java | public static void mkdir(File dir) throws IOException{
if(!dir.exists() && !dir.mkdir())
throw new IOException("couldn't create directory: "+dir);
} | [
"public",
"static",
"void",
"mkdir",
"(",
"File",
"dir",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"dir",
".",
"exists",
"(",
")",
"&&",
"!",
"dir",
".",
"mkdir",
"(",
")",
")",
"throw",
"new",
"IOException",
"(",
"\"couldn't create directory: \... | create specified directory if doesn't exist. | [
"create",
"specified",
"directory",
"if",
"doesn",
"t",
"exist",
"."
] | 59c28719f054123cf778278154e1b92e943ad232 | https://github.com/santhosh-tekuri/jlibs/blob/59c28719f054123cf778278154e1b92e943ad232/core/src/main/java/jlibs/core/io/FileUtil.java#L202-L205 | train |
santhosh-tekuri/jlibs | xsd/src/main/java/jlibs/xml/xsd/XSParser.java | XSParser.parseString | public XSModel parseString(String schema, String baseURI){
return xsLoader.load(new DOMInputImpl(null, null, baseURI, schema, null));
} | java | public XSModel parseString(String schema, String baseURI){
return xsLoader.load(new DOMInputImpl(null, null, baseURI, schema, null));
} | [
"public",
"XSModel",
"parseString",
"(",
"String",
"schema",
",",
"String",
"baseURI",
")",
"{",
"return",
"xsLoader",
".",
"load",
"(",
"new",
"DOMInputImpl",
"(",
"null",
",",
"null",
",",
"baseURI",
",",
"schema",
",",
"null",
")",
")",
";",
"}"
] | Parse an XML Schema document from String specified
@param schema String data to parse. If provided, this will always be treated as a
sequence of 16-bit units (UTF-16 encoded characters). If an XML
declaration is present, the value of the encoding attribute
will be ignored.
@param baseURI The base URI to be used f... | [
"Parse",
"an",
"XML",
"Schema",
"document",
"from",
"String",
"specified"
] | 59c28719f054123cf778278154e1b92e943ad232 | https://github.com/santhosh-tekuri/jlibs/blob/59c28719f054123cf778278154e1b92e943ad232/xsd/src/main/java/jlibs/xml/xsd/XSParser.java#L121-L123 | train |
santhosh-tekuri/jlibs | xml/src/main/java/jlibs/xml/sax/helpers/MyNamespaceSupport.java | MyNamespaceSupport.findPrefix | public String findPrefix(String uri){
if(uri==null)
uri = "";
String prefix = getPrefix(uri);
if(prefix==null){
String defaultURI = getURI("");
if(defaultURI==null)
defaultURI = "";
if(Util.equals(uri, defaultURI))
p... | java | public String findPrefix(String uri){
if(uri==null)
uri = "";
String prefix = getPrefix(uri);
if(prefix==null){
String defaultURI = getURI("");
if(defaultURI==null)
defaultURI = "";
if(Util.equals(uri, defaultURI))
p... | [
"public",
"String",
"findPrefix",
"(",
"String",
"uri",
")",
"{",
"if",
"(",
"uri",
"==",
"null",
")",
"uri",
"=",
"\"\"",
";",
"String",
"prefix",
"=",
"getPrefix",
"(",
"uri",
")",
";",
"if",
"(",
"prefix",
"==",
"null",
")",
"{",
"String",
"defa... | Return one of the prefixes mapped to a Namespace URI.
<p>If more than one prefix is currently mapped to the same
URI, this method will make an arbitrary selection;
<p>Unlike {@link #getPrefix(String)} this method, this returns empty
prefix if the given uri is bound to default prefix. | [
"Return",
"one",
"of",
"the",
"prefixes",
"mapped",
"to",
"a",
"Namespace",
"URI",
"."
] | 59c28719f054123cf778278154e1b92e943ad232 | https://github.com/santhosh-tekuri/jlibs/blob/59c28719f054123cf778278154e1b92e943ad232/xml/src/main/java/jlibs/xml/sax/helpers/MyNamespaceSupport.java#L62-L74 | train |
santhosh-tekuri/jlibs | xml/src/main/java/jlibs/xml/sax/helpers/MyNamespaceSupport.java | MyNamespaceSupport.declarePrefix | public String declarePrefix(String uri){
String prefix = findPrefix(uri);
if(prefix==null){
if(uri.isEmpty())
prefix = ""; // non-empty prefix cannot be used for empty namespace
else{
prefix = suggested.getProperty(uri, suggestPrefix);
... | java | public String declarePrefix(String uri){
String prefix = findPrefix(uri);
if(prefix==null){
if(uri.isEmpty())
prefix = ""; // non-empty prefix cannot be used for empty namespace
else{
prefix = suggested.getProperty(uri, suggestPrefix);
... | [
"public",
"String",
"declarePrefix",
"(",
"String",
"uri",
")",
"{",
"String",
"prefix",
"=",
"findPrefix",
"(",
"uri",
")",
";",
"if",
"(",
"prefix",
"==",
"null",
")",
"{",
"if",
"(",
"uri",
".",
"isEmpty",
"(",
")",
")",
"prefix",
"=",
"\"\"",
"... | generated a new prefix and binds it to given uri.
<p>you can customize the generated prefix using {@link #suggestPrefix(String, String)} | [
"generated",
"a",
"new",
"prefix",
"and",
"binds",
"it",
"to",
"given",
"uri",
"."
] | 59c28719f054123cf778278154e1b92e943ad232 | https://github.com/santhosh-tekuri/jlibs/blob/59c28719f054123cf778278154e1b92e943ad232/xml/src/main/java/jlibs/xml/sax/helpers/MyNamespaceSupport.java#L102-L127 | train |
santhosh-tekuri/jlibs | core/src/main/java/jlibs/core/util/CollectionUtil.java | CollectionUtil.addAll | @SuppressWarnings({"unchecked", "ManualArrayToCollectionCopy"})
public static <E, T extends E> Collection<E> addAll(Collection<E> c, T... array){
for(T obj: array)
c.add(obj);
return c;
} | java | @SuppressWarnings({"unchecked", "ManualArrayToCollectionCopy"})
public static <E, T extends E> Collection<E> addAll(Collection<E> c, T... array){
for(T obj: array)
c.add(obj);
return c;
} | [
"@",
"SuppressWarnings",
"(",
"{",
"\"unchecked\"",
",",
"\"ManualArrayToCollectionCopy\"",
"}",
")",
"public",
"static",
"<",
"E",
",",
"T",
"extends",
"E",
">",
"Collection",
"<",
"E",
">",
"addAll",
"(",
"Collection",
"<",
"E",
">",
"c",
",",
"T",
"..... | Adds objects in array to the given collection
@return the same collection which is passed as argument | [
"Adds",
"objects",
"in",
"array",
"to",
"the",
"given",
"collection"
] | 59c28719f054123cf778278154e1b92e943ad232 | https://github.com/santhosh-tekuri/jlibs/blob/59c28719f054123cf778278154e1b92e943ad232/core/src/main/java/jlibs/core/util/CollectionUtil.java#L50-L55 | train |
santhosh-tekuri/jlibs | core/src/main/java/jlibs/core/util/CollectionUtil.java | CollectionUtil.removeAll | @SuppressWarnings("unchecked")
public static <E, T extends E> Collection<E> removeAll(Collection<E> c, T... array){
for(T obj: array)
c.remove(obj);
return c;
} | java | @SuppressWarnings("unchecked")
public static <E, T extends E> Collection<E> removeAll(Collection<E> c, T... array){
for(T obj: array)
c.remove(obj);
return c;
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"E",
",",
"T",
"extends",
"E",
">",
"Collection",
"<",
"E",
">",
"removeAll",
"(",
"Collection",
"<",
"E",
">",
"c",
",",
"T",
"...",
"array",
")",
"{",
"for",
"(",
"T",
"... | Removes objects in array to the given collection
@return the same collection which is passed as argument | [
"Removes",
"objects",
"in",
"array",
"to",
"the",
"given",
"collection"
] | 59c28719f054123cf778278154e1b92e943ad232 | https://github.com/santhosh-tekuri/jlibs/blob/59c28719f054123cf778278154e1b92e943ad232/core/src/main/java/jlibs/core/util/CollectionUtil.java#L62-L67 | train |
santhosh-tekuri/jlibs | core/src/main/java/jlibs/core/util/CollectionUtil.java | CollectionUtil.filter | public static <T> List<T> filter(Collection<T> c, Filter<T> filter){
if(c.size()==0)
return Collections.emptyList();
List<T> filteredList = new ArrayList<T>(c.size());
for(T element: c){
if(filter.select(element))
filteredList.add(element);
}
... | java | public static <T> List<T> filter(Collection<T> c, Filter<T> filter){
if(c.size()==0)
return Collections.emptyList();
List<T> filteredList = new ArrayList<T>(c.size());
for(T element: c){
if(filter.select(element))
filteredList.add(element);
}
... | [
"public",
"static",
"<",
"T",
">",
"List",
"<",
"T",
">",
"filter",
"(",
"Collection",
"<",
"T",
">",
"c",
",",
"Filter",
"<",
"T",
">",
"filter",
")",
"{",
"if",
"(",
"c",
".",
"size",
"(",
")",
"==",
"0",
")",
"return",
"Collections",
".",
... | Returns List with elements from given collections which are selected
by specified filter | [
"Returns",
"List",
"with",
"elements",
"from",
"given",
"collections",
"which",
"are",
"selected",
"by",
"specified",
"filter"
] | 59c28719f054123cf778278154e1b92e943ad232 | https://github.com/santhosh-tekuri/jlibs/blob/59c28719f054123cf778278154e1b92e943ad232/core/src/main/java/jlibs/core/util/CollectionUtil.java#L85-L95 | train |
santhosh-tekuri/jlibs | core/src/main/java/jlibs/core/lang/JavaProcessBuilder.java | JavaProcessBuilder.command | public String[] command() throws IOException{
List<String> cmd = new ArrayList<String>();
String executable = javaHome.getCanonicalPath()+FileUtil.SEPARATOR+"bin"+FileUtil.SEPARATOR+"java";
if(OS.get().isWindows())
executable += ".exe";
cmd.add(executable);
String p... | java | public String[] command() throws IOException{
List<String> cmd = new ArrayList<String>();
String executable = javaHome.getCanonicalPath()+FileUtil.SEPARATOR+"bin"+FileUtil.SEPARATOR+"java";
if(OS.get().isWindows())
executable += ".exe";
cmd.add(executable);
String p... | [
"public",
"String",
"[",
"]",
"command",
"(",
")",
"throws",
"IOException",
"{",
"List",
"<",
"String",
">",
"cmd",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
";",
"String",
"executable",
"=",
"javaHome",
".",
"getCanonicalPath",
"(",
")",
... | Returns command with all its arguments | [
"Returns",
"command",
"with",
"all",
"its",
"arguments"
] | 59c28719f054123cf778278154e1b92e943ad232 | https://github.com/santhosh-tekuri/jlibs/blob/59c28719f054123cf778278154e1b92e943ad232/core/src/main/java/jlibs/core/lang/JavaProcessBuilder.java#L395-L458 | train |
santhosh-tekuri/jlibs | core/src/main/java/jlibs/core/lang/JavaProcessBuilder.java | JavaProcessBuilder.launch | public Process launch(OutputStream output, OutputStream error) throws IOException{
Process process = Runtime.getRuntime().exec(command(), null, workingDir);
RuntimeUtil.redirectStreams(process, output, error);
return process;
} | java | public Process launch(OutputStream output, OutputStream error) throws IOException{
Process process = Runtime.getRuntime().exec(command(), null, workingDir);
RuntimeUtil.redirectStreams(process, output, error);
return process;
} | [
"public",
"Process",
"launch",
"(",
"OutputStream",
"output",
",",
"OutputStream",
"error",
")",
"throws",
"IOException",
"{",
"Process",
"process",
"=",
"Runtime",
".",
"getRuntime",
"(",
")",
".",
"exec",
"(",
"command",
"(",
")",
",",
"null",
",",
"work... | launches jvm with current configuration.
note that, the streams passed are not closed automatically.
@param output outputstream to which process's input stream to be redirected.
if null, it is not redirected
@param error outputstream to which process's error stream to be redirected.
if null, it is not redirect... | [
"launches",
"jvm",
"with",
"current",
"configuration",
"."
] | 59c28719f054123cf778278154e1b92e943ad232 | https://github.com/santhosh-tekuri/jlibs/blob/59c28719f054123cf778278154e1b92e943ad232/core/src/main/java/jlibs/core/lang/JavaProcessBuilder.java#L475-L479 | train |
santhosh-tekuri/jlibs | swing/src/main/java/jlibs/swing/SwingUtil.java | SwingUtil.setInitialFocus | public static void setInitialFocus(Window window, final Component comp){
window.addWindowFocusListener(new WindowAdapter(){
@Override
public void windowGainedFocus(WindowEvent we){
comp.requestFocusInWindow();
we.getWindow().removeWindowFocusListener(this)... | java | public static void setInitialFocus(Window window, final Component comp){
window.addWindowFocusListener(new WindowAdapter(){
@Override
public void windowGainedFocus(WindowEvent we){
comp.requestFocusInWindow();
we.getWindow().removeWindowFocusListener(this)... | [
"public",
"static",
"void",
"setInitialFocus",
"(",
"Window",
"window",
",",
"final",
"Component",
"comp",
")",
"{",
"window",
".",
"addWindowFocusListener",
"(",
"new",
"WindowAdapter",
"(",
")",
"{",
"@",
"Override",
"public",
"void",
"windowGainedFocus",
"(",... | sets intial focus in window to the specified component
@param window window on which focus has to be set
@param comp component which need to have initial focus | [
"sets",
"intial",
"focus",
"in",
"window",
"to",
"the",
"specified",
"component"
] | 59c28719f054123cf778278154e1b92e943ad232 | https://github.com/santhosh-tekuri/jlibs/blob/59c28719f054123cf778278154e1b92e943ad232/swing/src/main/java/jlibs/swing/SwingUtil.java#L40-L48 | train |
santhosh-tekuri/jlibs | swing/src/main/java/jlibs/swing/SwingUtil.java | SwingUtil.doAction | public static void doAction(JTextField textField){
String command = null;
if(textField.getAction()!=null)
command = (String)textField.getAction().getValue(Action.ACTION_COMMAND_KEY);
ActionEvent event = null;
for(ActionListener listener: textField.getActionListeners(... | java | public static void doAction(JTextField textField){
String command = null;
if(textField.getAction()!=null)
command = (String)textField.getAction().getValue(Action.ACTION_COMMAND_KEY);
ActionEvent event = null;
for(ActionListener listener: textField.getActionListeners(... | [
"public",
"static",
"void",
"doAction",
"(",
"JTextField",
"textField",
")",
"{",
"String",
"command",
"=",
"null",
";",
"if",
"(",
"textField",
".",
"getAction",
"(",
")",
"!=",
"null",
")",
"command",
"=",
"(",
"String",
")",
"textField",
".",
"getActi... | Programmatically perform action on textfield.This does the same
thing as if the user had pressed enter key in textfield.
@param textField textField on which action to be preformed | [
"Programmatically",
"perform",
"action",
"on",
"textfield",
".",
"This",
"does",
"the",
"same",
"thing",
"as",
"if",
"the",
"user",
"had",
"pressed",
"enter",
"key",
"in",
"textfield",
"."
] | 59c28719f054123cf778278154e1b92e943ad232 | https://github.com/santhosh-tekuri/jlibs/blob/59c28719f054123cf778278154e1b92e943ad232/swing/src/main/java/jlibs/swing/SwingUtil.java#L56-L67 | train |
santhosh-tekuri/jlibs | swing/src/main/java/jlibs/swing/SwingUtil.java | SwingUtil.setText | public static void setText(JTextComponent textComp, String text){
if(text==null)
text = "";
if(textComp.getCaret() instanceof DefaultCaret){
DefaultCaret caret = (DefaultCaret)textComp.getCaret();
int updatePolicy = caret.getUpdatePolicy();
caret.... | java | public static void setText(JTextComponent textComp, String text){
if(text==null)
text = "";
if(textComp.getCaret() instanceof DefaultCaret){
DefaultCaret caret = (DefaultCaret)textComp.getCaret();
int updatePolicy = caret.getUpdatePolicy();
caret.... | [
"public",
"static",
"void",
"setText",
"(",
"JTextComponent",
"textComp",
",",
"String",
"text",
")",
"{",
"if",
"(",
"text",
"==",
"null",
")",
"text",
"=",
"\"\"",
";",
"if",
"(",
"textComp",
".",
"getCaret",
"(",
")",
"instanceof",
"DefaultCaret",
")"... | sets text of textComp without moving its caret.
@param textComp text component whose text needs to be set
@param text text to be set. null will be treated as empty string | [
"sets",
"text",
"of",
"textComp",
"without",
"moving",
"its",
"caret",
"."
] | 59c28719f054123cf778278154e1b92e943ad232 | https://github.com/santhosh-tekuri/jlibs/blob/59c28719f054123cf778278154e1b92e943ad232/swing/src/main/java/jlibs/swing/SwingUtil.java#L75-L104 | train |
OpenNMS/newts | cassandra/search/src/main/java/org/opennms/newts/cassandra/search/ResourceMetadata.java | ResourceMetadata.merge | public boolean merge(ResourceMetadata other) {
boolean modified = m_metrics.addAll(other.m_metrics);
if (!modified) {
modified = !m_attributes.equals(other.m_attributes);
}
m_attributes.putAll(other.m_attributes);
return modified;
} | java | public boolean merge(ResourceMetadata other) {
boolean modified = m_metrics.addAll(other.m_metrics);
if (!modified) {
modified = !m_attributes.equals(other.m_attributes);
}
m_attributes.putAll(other.m_attributes);
return modified;
} | [
"public",
"boolean",
"merge",
"(",
"ResourceMetadata",
"other",
")",
"{",
"boolean",
"modified",
"=",
"m_metrics",
".",
"addAll",
"(",
"other",
".",
"m_metrics",
")",
";",
"if",
"(",
"!",
"modified",
")",
"{",
"modified",
"=",
"!",
"m_attributes",
".",
"... | Merges the metrics and attributes from the given instance, to the current instance.
@param other a {@link ResourceMetadata} object
@return true if the meta-data was modified as a result of the merge, false otherwise | [
"Merges",
"the",
"metrics",
"and",
"attributes",
"from",
"the",
"given",
"instance",
"to",
"the",
"current",
"instance",
"."
] | e1b53169d8a7fbc5e9fb826da08d602f628063ea | https://github.com/OpenNMS/newts/blob/e1b53169d8a7fbc5e9fb826da08d602f628063ea/cassandra/search/src/main/java/org/opennms/newts/cassandra/search/ResourceMetadata.java#L82-L89 | train |
OpenNMS/newts | rest/src/main/java/org/opennms/newts/rest/RepositoryHealthCheck.java | RepositoryHealthCheck.check | @Override
protected Result check() throws Exception {
m_repository.select(Context.DEFAULT_CONTEXT, new Resource("notreal"), Optional.of(Timestamp.fromEpochMillis(0)), Optional.of(Timestamp.fromEpochMillis(0)));
return Result.healthy();
} | java | @Override
protected Result check() throws Exception {
m_repository.select(Context.DEFAULT_CONTEXT, new Resource("notreal"), Optional.of(Timestamp.fromEpochMillis(0)), Optional.of(Timestamp.fromEpochMillis(0)));
return Result.healthy();
} | [
"@",
"Override",
"protected",
"Result",
"check",
"(",
")",
"throws",
"Exception",
"{",
"m_repository",
".",
"select",
"(",
"Context",
".",
"DEFAULT_CONTEXT",
",",
"new",
"Resource",
"(",
"\"notreal\"",
")",
",",
"Optional",
".",
"of",
"(",
"Timestamp",
".",
... | Perform simple query; Establishes only that we can go to the database without excepting. | [
"Perform",
"simple",
"query",
";",
"Establishes",
"only",
"that",
"we",
"can",
"go",
"to",
"the",
"database",
"without",
"excepting",
"."
] | e1b53169d8a7fbc5e9fb826da08d602f628063ea | https://github.com/OpenNMS/newts/blob/e1b53169d8a7fbc5e9fb826da08d602f628063ea/rest/src/main/java/org/opennms/newts/rest/RepositoryHealthCheck.java#L39-L45 | train |
OpenNMS/newts | api/src/main/java/org/opennms/newts/api/query/ResultDescriptor.java | ResultDescriptor.getSourceNames | public Set<String> getSourceNames() {
return Sets.newHashSet(Iterables.transform(getDatasources().values(), new Function<Datasource, String>() {
@Override
public String apply(Datasource input) {
return input.getSource();
}
}));
} | java | public Set<String> getSourceNames() {
return Sets.newHashSet(Iterables.transform(getDatasources().values(), new Function<Datasource, String>() {
@Override
public String apply(Datasource input) {
return input.getSource();
}
}));
} | [
"public",
"Set",
"<",
"String",
">",
"getSourceNames",
"(",
")",
"{",
"return",
"Sets",
".",
"newHashSet",
"(",
"Iterables",
".",
"transform",
"(",
"getDatasources",
"(",
")",
".",
"values",
"(",
")",
",",
"new",
"Function",
"<",
"Datasource",
",",
"Stri... | Returns the set of unique source names; The names of the underlying samples used as the
source of aggregations.
@return source names | [
"Returns",
"the",
"set",
"of",
"unique",
"source",
"names",
";",
"The",
"names",
"of",
"the",
"underlying",
"samples",
"used",
"as",
"the",
"source",
"of",
"aggregations",
"."
] | e1b53169d8a7fbc5e9fb826da08d602f628063ea | https://github.com/OpenNMS/newts/blob/e1b53169d8a7fbc5e9fb826da08d602f628063ea/api/src/main/java/org/opennms/newts/api/query/ResultDescriptor.java#L117-L125 | train |
OpenNMS/newts | cassandra/search/src/main/java/org/opennms/newts/cassandra/search/CassandraResourceTreeWalker.java | CassandraResourceTreeWalker.breadthFirstSearch | public void breadthFirstSearch(Context context, SearchResultVisitor visitor, Resource root) {
Queue<Resource> queue = Lists.newLinkedList();
queue.add(root);
while (!queue.isEmpty()) {
Resource r = queue.remove();
for (SearchResults.Result result : m_searcher
... | java | public void breadthFirstSearch(Context context, SearchResultVisitor visitor, Resource root) {
Queue<Resource> queue = Lists.newLinkedList();
queue.add(root);
while (!queue.isEmpty()) {
Resource r = queue.remove();
for (SearchResults.Result result : m_searcher
... | [
"public",
"void",
"breadthFirstSearch",
"(",
"Context",
"context",
",",
"SearchResultVisitor",
"visitor",
",",
"Resource",
"root",
")",
"{",
"Queue",
"<",
"Resource",
">",
"queue",
"=",
"Lists",
".",
"newLinkedList",
"(",
")",
";",
"queue",
".",
"add",
"(",
... | Visits all nodes in the resource tree bellow the given resource using
breadth-first search. | [
"Visits",
"all",
"nodes",
"in",
"the",
"resource",
"tree",
"bellow",
"the",
"given",
"resource",
"using",
"breadth",
"-",
"first",
"search",
"."
] | e1b53169d8a7fbc5e9fb826da08d602f628063ea | https://github.com/OpenNMS/newts/blob/e1b53169d8a7fbc5e9fb826da08d602f628063ea/cassandra/search/src/main/java/org/opennms/newts/cassandra/search/CassandraResourceTreeWalker.java#L74-L87 | train |
OpenNMS/newts | cassandra/search/src/main/java/org/opennms/newts/cassandra/search/CassandraResourceTreeWalker.java | CassandraResourceTreeWalker.depthFirstSearch | public void depthFirstSearch(Context context, SearchResultVisitor visitor, Resource root) {
ArrayDeque<SearchResults.Result> stack = Queues.newArrayDeque();
// Build an instance of a SearchResult for the root resource
// but don't invoke the visitor with it
boolean skipFirstVisit = true... | java | public void depthFirstSearch(Context context, SearchResultVisitor visitor, Resource root) {
ArrayDeque<SearchResults.Result> stack = Queues.newArrayDeque();
// Build an instance of a SearchResult for the root resource
// but don't invoke the visitor with it
boolean skipFirstVisit = true... | [
"public",
"void",
"depthFirstSearch",
"(",
"Context",
"context",
",",
"SearchResultVisitor",
"visitor",
",",
"Resource",
"root",
")",
"{",
"ArrayDeque",
"<",
"SearchResults",
".",
"Result",
">",
"stack",
"=",
"Queues",
".",
"newArrayDeque",
"(",
")",
";",
"// ... | Visits all nodes in the resource tree bellow the given resource using
depth-first search. | [
"Visits",
"all",
"nodes",
"in",
"the",
"resource",
"tree",
"bellow",
"the",
"given",
"resource",
"using",
"depth",
"-",
"first",
"search",
"."
] | e1b53169d8a7fbc5e9fb826da08d602f628063ea | https://github.com/OpenNMS/newts/blob/e1b53169d8a7fbc5e9fb826da08d602f628063ea/cassandra/search/src/main/java/org/opennms/newts/cassandra/search/CassandraResourceTreeWalker.java#L100-L128 | train |
OpenNMS/newts | cassandra/search/src/main/java/org/opennms/newts/cassandra/search/CassandraSearcher.java | CassandraSearcher.searchForIds | private Set<String> searchForIds(Context context, TermQuery query, ConsistencyLevel readConsistency) {
Set<String> ids = Sets.newTreeSet();
BoundStatement bindStatement = m_searchStatement.bind();
bindStatement.setString(Schema.C_TERMS_CONTEXT, context.getId());
bindStatement.setString(... | java | private Set<String> searchForIds(Context context, TermQuery query, ConsistencyLevel readConsistency) {
Set<String> ids = Sets.newTreeSet();
BoundStatement bindStatement = m_searchStatement.bind();
bindStatement.setString(Schema.C_TERMS_CONTEXT, context.getId());
bindStatement.setString(... | [
"private",
"Set",
"<",
"String",
">",
"searchForIds",
"(",
"Context",
"context",
",",
"TermQuery",
"query",
",",
"ConsistencyLevel",
"readConsistency",
")",
"{",
"Set",
"<",
"String",
">",
"ids",
"=",
"Sets",
".",
"newTreeSet",
"(",
")",
";",
"BoundStatement... | Returns the set of resource ids that match the given
term query. | [
"Returns",
"the",
"set",
"of",
"resource",
"ids",
"that",
"match",
"the",
"given",
"term",
"query",
"."
] | e1b53169d8a7fbc5e9fb826da08d602f628063ea | https://github.com/OpenNMS/newts/blob/e1b53169d8a7fbc5e9fb826da08d602f628063ea/cassandra/search/src/main/java/org/opennms/newts/cassandra/search/CassandraSearcher.java#L169-L183 | train |
OpenNMS/newts | cassandra/search/src/main/java/org/opennms/newts/cassandra/search/CassandraSearcher.java | CassandraSearcher.searchForIds | private Set<String> searchForIds(Context context, BooleanQuery query, ConsistencyLevel readConsistency) {
Set<String> ids = Sets.newTreeSet();
for (BooleanClause clause : query.getClauses()) {
Set<String> subQueryIds;
Query subQuery = clause.getQuery();
if (subQuery... | java | private Set<String> searchForIds(Context context, BooleanQuery query, ConsistencyLevel readConsistency) {
Set<String> ids = Sets.newTreeSet();
for (BooleanClause clause : query.getClauses()) {
Set<String> subQueryIds;
Query subQuery = clause.getQuery();
if (subQuery... | [
"private",
"Set",
"<",
"String",
">",
"searchForIds",
"(",
"Context",
"context",
",",
"BooleanQuery",
"query",
",",
"ConsistencyLevel",
"readConsistency",
")",
"{",
"Set",
"<",
"String",
">",
"ids",
"=",
"Sets",
".",
"newTreeSet",
"(",
")",
";",
"for",
"("... | Returns the set of resource ids that match the given
boolean query.
Separate clauses are performed with separate database queries and their
results are joined in memory. | [
"Returns",
"the",
"set",
"of",
"resource",
"ids",
"that",
"match",
"the",
"given",
"boolean",
"query",
"."
] | e1b53169d8a7fbc5e9fb826da08d602f628063ea | https://github.com/OpenNMS/newts/blob/e1b53169d8a7fbc5e9fb826da08d602f628063ea/cassandra/search/src/main/java/org/opennms/newts/cassandra/search/CassandraSearcher.java#L192-L220 | train |
OpenNMS/newts | cassandra/search/src/main/java/org/opennms/newts/cassandra/search/EscapableResourceIdSplitter.java | EscapableResourceIdSplitter.splitIdIntoElements | @Override
public List<String> splitIdIntoElements(String id) {
Preconditions.checkNotNull(id, "id argument");
List<String> elements = Lists.newArrayList();
int startOfNextElement = 0;
int numConsecutiveEscapeCharacters = 0;
char[] idChars = id.toCharArray();
for (int... | java | @Override
public List<String> splitIdIntoElements(String id) {
Preconditions.checkNotNull(id, "id argument");
List<String> elements = Lists.newArrayList();
int startOfNextElement = 0;
int numConsecutiveEscapeCharacters = 0;
char[] idChars = id.toCharArray();
for (int... | [
"@",
"Override",
"public",
"List",
"<",
"String",
">",
"splitIdIntoElements",
"(",
"String",
"id",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"id",
",",
"\"id argument\"",
")",
";",
"List",
"<",
"String",
">",
"elements",
"=",
"Lists",
".",
"newA... | Splits a resource id into a list of elements.
Elements in the resource id are delimited by colons (:).
Colons can be escaped by a backslash (\:).
Backslashes are escaped when paired (\\).
For example, the following resources id:
a:b\::c\\:d
will result in the following elements:
a, b:, c\, d
@param id the resource i... | [
"Splits",
"a",
"resource",
"id",
"into",
"a",
"list",
"of",
"elements",
"."
] | e1b53169d8a7fbc5e9fb826da08d602f628063ea | https://github.com/OpenNMS/newts/blob/e1b53169d8a7fbc5e9fb826da08d602f628063ea/cassandra/search/src/main/java/org/opennms/newts/cassandra/search/EscapableResourceIdSplitter.java#L50-L74 | train |
OpenNMS/newts | cassandra/search/src/main/java/org/opennms/newts/cassandra/search/EscapableResourceIdSplitter.java | EscapableResourceIdSplitter.maybeAddSanitizedElement | private static void maybeAddSanitizedElement(final String element, final List<String> elements) {
// Trim the element and skip it when empty
String sanitizedElement = element.trim();
if (sanitizedElement.length() == 0) {
return;
}
// \: -> :
sanitizedElement =... | java | private static void maybeAddSanitizedElement(final String element, final List<String> elements) {
// Trim the element and skip it when empty
String sanitizedElement = element.trim();
if (sanitizedElement.length() == 0) {
return;
}
// \: -> :
sanitizedElement =... | [
"private",
"static",
"void",
"maybeAddSanitizedElement",
"(",
"final",
"String",
"element",
",",
"final",
"List",
"<",
"String",
">",
"elements",
")",
"{",
"// Trim the element and skip it when empty",
"String",
"sanitizedElement",
"=",
"element",
".",
"trim",
"(",
... | Maybe adds to element to the list after being sanitized. | [
"Maybe",
"adds",
"to",
"element",
"to",
"the",
"list",
"after",
"being",
"sanitized",
"."
] | e1b53169d8a7fbc5e9fb826da08d602f628063ea | https://github.com/OpenNMS/newts/blob/e1b53169d8a7fbc5e9fb826da08d602f628063ea/cassandra/search/src/main/java/org/opennms/newts/cassandra/search/EscapableResourceIdSplitter.java#L79-L90 | train |
OpenNMS/newts | cassandra/search/src/main/java/org/opennms/newts/cassandra/search/EscapableResourceIdSplitter.java | EscapableResourceIdSplitter.joinElementsToId | @Override
public String joinElementsToId(List<String> elements) {
Preconditions.checkNotNull(elements, "elements argument");
StringBuilder sb = new StringBuilder();
for (String el : elements) {
// Skip null elements
if (el == null) {
continue;
... | java | @Override
public String joinElementsToId(List<String> elements) {
Preconditions.checkNotNull(elements, "elements argument");
StringBuilder sb = new StringBuilder();
for (String el : elements) {
// Skip null elements
if (el == null) {
continue;
... | [
"@",
"Override",
"public",
"String",
"joinElementsToId",
"(",
"List",
"<",
"String",
">",
"elements",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"elements",
",",
"\"elements argument\"",
")",
";",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"("... | Joins a list of elements into a resource id, escaping
special characters if required.
See {@link #splitIdIntoElements(String)} for details.
@param elements a list of elements
@return the resource id | [
"Joins",
"a",
"list",
"of",
"elements",
"into",
"a",
"resource",
"id",
"escaping",
"special",
"characters",
"if",
"required",
"."
] | e1b53169d8a7fbc5e9fb826da08d602f628063ea | https://github.com/OpenNMS/newts/blob/e1b53169d8a7fbc5e9fb826da08d602f628063ea/cassandra/search/src/main/java/org/opennms/newts/cassandra/search/EscapableResourceIdSplitter.java#L101-L128 | train |
OpenNMS/newts | aggregate/src/main/java/org/opennms/newts/aggregate/Aggregation.java | Aggregation.aggregate | private Double aggregate(Datasource ds, Collection<Double> values) {
return ((values.size() / m_intervalsPer) > ds.getXff()) ? ds.getAggregationFuction().apply(values) : Double.NaN;
} | java | private Double aggregate(Datasource ds, Collection<Double> values) {
return ((values.size() / m_intervalsPer) > ds.getXff()) ? ds.getAggregationFuction().apply(values) : Double.NaN;
} | [
"private",
"Double",
"aggregate",
"(",
"Datasource",
"ds",
",",
"Collection",
"<",
"Double",
">",
"values",
")",
"{",
"return",
"(",
"(",
"values",
".",
"size",
"(",
")",
"/",
"m_intervalsPer",
")",
">",
"ds",
".",
"getXff",
"(",
")",
")",
"?",
"ds",... | is within XFF, otherwise return NaN. | [
"is",
"within",
"XFF",
"otherwise",
"return",
"NaN",
"."
] | e1b53169d8a7fbc5e9fb826da08d602f628063ea | https://github.com/OpenNMS/newts/blob/e1b53169d8a7fbc5e9fb826da08d602f628063ea/aggregate/src/main/java/org/opennms/newts/aggregate/Aggregation.java#L133-L135 | train |
OpenNMS/newts | aggregate/src/main/java/org/opennms/newts/aggregate/Aggregation.java | Aggregation.inRange | private boolean inRange() {
if (m_working == null || m_nextOut == null) {
return false;
}
Timestamp rangeUpper = m_nextOut.getTimestamp();
Timestamp rangeLower = m_nextOut.getTimestamp().minus(m_resolution);
return m_working.getTimestamp().lte(rangeUpper) && m_worki... | java | private boolean inRange() {
if (m_working == null || m_nextOut == null) {
return false;
}
Timestamp rangeUpper = m_nextOut.getTimestamp();
Timestamp rangeLower = m_nextOut.getTimestamp().minus(m_resolution);
return m_working.getTimestamp().lte(rangeUpper) && m_worki... | [
"private",
"boolean",
"inRange",
"(",
")",
"{",
"if",
"(",
"m_working",
"==",
"null",
"||",
"m_nextOut",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"Timestamp",
"rangeUpper",
"=",
"m_nextOut",
".",
"getTimestamp",
"(",
")",
";",
"Timestamp",
"r... | true if the working input Row is within the Range of the next output Row; false otherwise | [
"true",
"if",
"the",
"working",
"input",
"Row",
"is",
"within",
"the",
"Range",
"of",
"the",
"next",
"output",
"Row",
";",
"false",
"otherwise"
] | e1b53169d8a7fbc5e9fb826da08d602f628063ea | https://github.com/OpenNMS/newts/blob/e1b53169d8a7fbc5e9fb826da08d602f628063ea/aggregate/src/main/java/org/opennms/newts/aggregate/Aggregation.java#L138-L147 | train |
ffpojo/ffpojo | ffpojo/src/main/java/com/github/ffpojo/file/reader/FlatFileReaderDefinition.java | FlatFileReaderDefinition.getBody | public Class<?> getBody(String message) {
final Set<IdentifierLine> identifierLines = this.definitions.keySet();
final IdentifierLine messageId = new IdentifierLine();
for(IdentifierLine id : identifierLines){
final Map<Integer, String> mapIds = id.getMapIds();
final Set<Integer> keys = mapIds.keySet();
... | java | public Class<?> getBody(String message) {
final Set<IdentifierLine> identifierLines = this.definitions.keySet();
final IdentifierLine messageId = new IdentifierLine();
for(IdentifierLine id : identifierLines){
final Map<Integer, String> mapIds = id.getMapIds();
final Set<Integer> keys = mapIds.keySet();
... | [
"public",
"Class",
"<",
"?",
">",
"getBody",
"(",
"String",
"message",
")",
"{",
"final",
"Set",
"<",
"IdentifierLine",
">",
"identifierLines",
"=",
"this",
".",
"definitions",
".",
"keySet",
"(",
")",
";",
"final",
"IdentifierLine",
"messageId",
"=",
"new... | GETTERS AND SETTERS | [
"GETTERS",
"AND",
"SETTERS"
] | af86a8bc1fa716f23d1f7cd7f9c7c65e63b1681a | https://github.com/ffpojo/ffpojo/blob/af86a8bc1fa716f23d1f7cd7f9c7c65e63b1681a/ffpojo/src/main/java/com/github/ffpojo/file/reader/FlatFileReaderDefinition.java#L79-L106 | train |
NoraUi/NoraUi | src/main/java/com/github/noraui/application/steps/ExpectSteps.java | ExpectSteps.presenceOfNbElementsLocatedBy | public static ExpectedCondition<List<WebElement>> presenceOfNbElementsLocatedBy(final By locator, final int nb) {
return new ExpectedCondition<List<WebElement>>() {
@Override
public List<WebElement> apply(WebDriver driver) {
final List<WebElement> elements = driver.findEl... | java | public static ExpectedCondition<List<WebElement>> presenceOfNbElementsLocatedBy(final By locator, final int nb) {
return new ExpectedCondition<List<WebElement>>() {
@Override
public List<WebElement> apply(WebDriver driver) {
final List<WebElement> elements = driver.findEl... | [
"public",
"static",
"ExpectedCondition",
"<",
"List",
"<",
"WebElement",
">",
">",
"presenceOfNbElementsLocatedBy",
"(",
"final",
"By",
"locator",
",",
"final",
"int",
"nb",
")",
"{",
"return",
"new",
"ExpectedCondition",
"<",
"List",
"<",
"WebElement",
">",
"... | An expectation for checking that nb elements that match the locator are present on the web page.
@param locator
Locator of element
@param nb
Expected number of elements
@return the list of WebElements once they are located | [
"An",
"expectation",
"for",
"checking",
"that",
"nb",
"elements",
"that",
"match",
"the",
"locator",
"are",
"present",
"on",
"the",
"web",
"page",
"."
] | 5f491a3339c7d3c20d7207760bdaf2acdb8f260c | https://github.com/NoraUi/NoraUi/blob/5f491a3339c7d3c20d7207760bdaf2acdb8f260c/src/main/java/com/github/noraui/application/steps/ExpectSteps.java#L122-L130 | train |
NoraUi/NoraUi | src/main/java/com/github/noraui/application/steps/ExpectSteps.java | ExpectSteps.visibilityOfNbElementsLocatedBy | public static ExpectedCondition<List<WebElement>> visibilityOfNbElementsLocatedBy(final By locator, final int nb) {
return new ExpectedCondition<List<WebElement>>() {
@Override
public List<WebElement> apply(WebDriver driver) {
int nbElementIsDisplayed = 0;
... | java | public static ExpectedCondition<List<WebElement>> visibilityOfNbElementsLocatedBy(final By locator, final int nb) {
return new ExpectedCondition<List<WebElement>>() {
@Override
public List<WebElement> apply(WebDriver driver) {
int nbElementIsDisplayed = 0;
... | [
"public",
"static",
"ExpectedCondition",
"<",
"List",
"<",
"WebElement",
">",
">",
"visibilityOfNbElementsLocatedBy",
"(",
"final",
"By",
"locator",
",",
"final",
"int",
"nb",
")",
"{",
"return",
"new",
"ExpectedCondition",
"<",
"List",
"<",
"WebElement",
">",
... | An expectation for checking that nb elements present on the web page that match the locator
are visible. Visibility means that the elements are not only displayed but also have a height
and width that is greater than 0.
@param locator
Locator of element
@param nb
Expected number of elements
@return the list of WebElem... | [
"An",
"expectation",
"for",
"checking",
"that",
"nb",
"elements",
"present",
"on",
"the",
"web",
"page",
"that",
"match",
"the",
"locator",
"are",
"visible",
".",
"Visibility",
"means",
"that",
"the",
"elements",
"are",
"not",
"only",
"displayed",
"but",
"al... | 5f491a3339c7d3c20d7207760bdaf2acdb8f260c | https://github.com/NoraUi/NoraUi/blob/5f491a3339c7d3c20d7207760bdaf2acdb8f260c/src/main/java/com/github/noraui/application/steps/ExpectSteps.java#L143-L157 | train |
NoraUi/NoraUi | src/main/java/com/github/noraui/application/steps/ExpectSteps.java | ExpectSteps.waitForLoad | public static ExpectedCondition<Boolean> waitForLoad() {
return new ExpectedCondition<Boolean>() {
@Override
public Boolean apply(WebDriver driver) {
return ((JavascriptExecutor) driver).executeScript("return document.readyState").equals("complete");
}
... | java | public static ExpectedCondition<Boolean> waitForLoad() {
return new ExpectedCondition<Boolean>() {
@Override
public Boolean apply(WebDriver driver) {
return ((JavascriptExecutor) driver).executeScript("return document.readyState").equals("complete");
}
... | [
"public",
"static",
"ExpectedCondition",
"<",
"Boolean",
">",
"waitForLoad",
"(",
")",
"{",
"return",
"new",
"ExpectedCondition",
"<",
"Boolean",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"Boolean",
"apply",
"(",
"WebDriver",
"driver",
")",
"{",
"return... | Expects that the target page is completely loaded.
@return true or false | [
"Expects",
"that",
"the",
"target",
"page",
"is",
"completely",
"loaded",
"."
] | 5f491a3339c7d3c20d7207760bdaf2acdb8f260c | https://github.com/NoraUi/NoraUi/blob/5f491a3339c7d3c20d7207760bdaf2acdb8f260c/src/main/java/com/github/noraui/application/steps/ExpectSteps.java#L164-L171 | train |
NoraUi/NoraUi | src/main/java/com/github/noraui/utils/Messages.java | Messages.format | public static String format(String templateMessage, Object... args) throws TechnicalException {
if (null != templateMessage && countWildcardsOccurrences(templateMessage, "%s") == args.length) {
try {
return String.format(templateMessage, args);
} catch (final Exceptio... | java | public static String format(String templateMessage, Object... args) throws TechnicalException {
if (null != templateMessage && countWildcardsOccurrences(templateMessage, "%s") == args.length) {
try {
return String.format(templateMessage, args);
} catch (final Exceptio... | [
"public",
"static",
"String",
"format",
"(",
"String",
"templateMessage",
",",
"Object",
"...",
"args",
")",
"throws",
"TechnicalException",
"{",
"if",
"(",
"null",
"!=",
"templateMessage",
"&&",
"countWildcardsOccurrences",
"(",
"templateMessage",
",",
"\"%s\"",
... | Format given message with provided arguments
@param templateMessage
Message to display before formatting
@param args
Arguments
@return a String containing the message well formatted.
@throws TechnicalException
if data input is wrong. | [
"Format",
"given",
"message",
"with",
"provided",
"arguments"
] | 5f491a3339c7d3c20d7207760bdaf2acdb8f260c | https://github.com/NoraUi/NoraUi/blob/5f491a3339c7d3c20d7207760bdaf2acdb8f260c/src/main/java/com/github/noraui/utils/Messages.java#L111-L121 | train |
NoraUi/NoraUi | src/main/java/com/github/noraui/utils/Messages.java | Messages.getMessage | public static String getMessage(String key, String bundle) {
if (!messagesBundles.containsKey(bundle)) {
if (Context.getLocale() == null) {
messagesBundles.put(bundle, ResourceBundle.getBundle("i18n/" + bundle, Locale.getDefault()));
} else {
messages... | java | public static String getMessage(String key, String bundle) {
if (!messagesBundles.containsKey(bundle)) {
if (Context.getLocale() == null) {
messagesBundles.put(bundle, ResourceBundle.getBundle("i18n/" + bundle, Locale.getDefault()));
} else {
messages... | [
"public",
"static",
"String",
"getMessage",
"(",
"String",
"key",
",",
"String",
"bundle",
")",
"{",
"if",
"(",
"!",
"messagesBundles",
".",
"containsKey",
"(",
"bundle",
")",
")",
"{",
"if",
"(",
"Context",
".",
"getLocale",
"(",
")",
"==",
"null",
")... | Gets a message by key using the resources bundle given in parameters.
@param key
The key of the message to retrieve.
@param bundle
The resource bundle to use.
@return
The String content of the message. | [
"Gets",
"a",
"message",
"by",
"key",
"using",
"the",
"resources",
"bundle",
"given",
"in",
"parameters",
"."
] | 5f491a3339c7d3c20d7207760bdaf2acdb8f260c | https://github.com/NoraUi/NoraUi/blob/5f491a3339c7d3c20d7207760bdaf2acdb8f260c/src/main/java/com/github/noraui/utils/Messages.java#L145-L155 | train |
NoraUi/NoraUi | src/main/java/com/github/noraui/utils/Messages.java | Messages.countWildcardsOccurrences | private static int countWildcardsOccurrences(String templateMessage, String occurrence) {
if (templateMessage != null && occurrence != null) {
final Pattern pattern = Pattern.compile(occurrence);
final Matcher matcher = pattern.matcher(templateMessage);
int count = 0;
... | java | private static int countWildcardsOccurrences(String templateMessage, String occurrence) {
if (templateMessage != null && occurrence != null) {
final Pattern pattern = Pattern.compile(occurrence);
final Matcher matcher = pattern.matcher(templateMessage);
int count = 0;
... | [
"private",
"static",
"int",
"countWildcardsOccurrences",
"(",
"String",
"templateMessage",
",",
"String",
"occurrence",
")",
"{",
"if",
"(",
"templateMessage",
"!=",
"null",
"&&",
"occurrence",
"!=",
"null",
")",
"{",
"final",
"Pattern",
"pattern",
"=",
"Pattern... | Count the number of occurrences of a given wildcard.
@param templateMessage
Input string
@param occurrence
String searched.
@return The number of occurrences. | [
"Count",
"the",
"number",
"of",
"occurrences",
"of",
"a",
"given",
"wildcard",
"."
] | 5f491a3339c7d3c20d7207760bdaf2acdb8f260c | https://github.com/NoraUi/NoraUi/blob/5f491a3339c7d3c20d7207760bdaf2acdb8f260c/src/main/java/com/github/noraui/utils/Messages.java#L166-L178 | train |
NoraUi/NoraUi | src/main/java/com/github/noraui/data/CommonDataProvider.java | CommonDataProvider.writeFailedResult | public void writeFailedResult(int line, String value) {
logger.debug("Write Failed result => line:{} value:{}", line, value);
writeValue(resultColumnName, line, value);
} | java | public void writeFailedResult(int line, String value) {
logger.debug("Write Failed result => line:{} value:{}", line, value);
writeValue(resultColumnName, line, value);
} | [
"public",
"void",
"writeFailedResult",
"(",
"int",
"line",
",",
"String",
"value",
")",
"{",
"logger",
".",
"debug",
"(",
"\"Write Failed result => line:{} value:{}\"",
",",
"line",
",",
"value",
")",
";",
"writeValue",
"(",
"resultColumnName",
",",
"line",
",",... | Writes a fail result
@param line
The line number
@param value
The value | [
"Writes",
"a",
"fail",
"result"
] | 5f491a3339c7d3c20d7207760bdaf2acdb8f260c | https://github.com/NoraUi/NoraUi/blob/5f491a3339c7d3c20d7207760bdaf2acdb8f260c/src/main/java/com/github/noraui/data/CommonDataProvider.java#L143-L146 | train |
NoraUi/NoraUi | src/main/java/com/github/noraui/data/CommonDataProvider.java | CommonDataProvider.writeSuccessResult | public void writeSuccessResult(int line) {
logger.debug("Write Success result => line:{}", line);
writeValue(resultColumnName, line, Messages.getMessage(Messages.SUCCESS_MESSAGE));
} | java | public void writeSuccessResult(int line) {
logger.debug("Write Success result => line:{}", line);
writeValue(resultColumnName, line, Messages.getMessage(Messages.SUCCESS_MESSAGE));
} | [
"public",
"void",
"writeSuccessResult",
"(",
"int",
"line",
")",
"{",
"logger",
".",
"debug",
"(",
"\"Write Success result => line:{}\"",
",",
"line",
")",
";",
"writeValue",
"(",
"resultColumnName",
",",
"line",
",",
"Messages",
".",
"getMessage",
"(",
"Message... | Writes a success result
@param line
The line number | [
"Writes",
"a",
"success",
"result"
] | 5f491a3339c7d3c20d7207760bdaf2acdb8f260c | https://github.com/NoraUi/NoraUi/blob/5f491a3339c7d3c20d7207760bdaf2acdb8f260c/src/main/java/com/github/noraui/data/CommonDataProvider.java#L154-L157 | train |
NoraUi/NoraUi | src/main/java/com/github/noraui/data/CommonDataProvider.java | CommonDataProvider.writeWarningResult | public void writeWarningResult(int line, String value) {
logger.debug("Write Warning result => line:{} value:{}", line, value);
writeValue(resultColumnName, line, value);
} | java | public void writeWarningResult(int line, String value) {
logger.debug("Write Warning result => line:{} value:{}", line, value);
writeValue(resultColumnName, line, value);
} | [
"public",
"void",
"writeWarningResult",
"(",
"int",
"line",
",",
"String",
"value",
")",
"{",
"logger",
".",
"debug",
"(",
"\"Write Warning result => line:{} value:{}\"",
",",
"line",
",",
"value",
")",
";",
"writeValue",
"(",
"resultColumnName",
",",
"line",
",... | Writes a warning result
@param line
The line number
@param value
The value | [
"Writes",
"a",
"warning",
"result"
] | 5f491a3339c7d3c20d7207760bdaf2acdb8f260c | https://github.com/NoraUi/NoraUi/blob/5f491a3339c7d3c20d7207760bdaf2acdb8f260c/src/main/java/com/github/noraui/data/CommonDataProvider.java#L167-L170 | train |
NoraUi/NoraUi | src/main/java/com/github/noraui/data/CommonDataProvider.java | CommonDataProvider.writeDataResult | public void writeDataResult(String column, int line, String value) {
logger.debug("Write Data result => column:{} line:{} value:{}", column, line, value);
writeValue(column, line, value);
} | java | public void writeDataResult(String column, int line, String value) {
logger.debug("Write Data result => column:{} line:{} value:{}", column, line, value);
writeValue(column, line, value);
} | [
"public",
"void",
"writeDataResult",
"(",
"String",
"column",
",",
"int",
"line",
",",
"String",
"value",
")",
"{",
"logger",
".",
"debug",
"(",
"\"Write Data result => column:{} line:{} value:{}\"",
",",
"column",
",",
"line",
",",
"value",
")",
";",
"writeValu... | Writes some data as result.
@param column
The column name
@param line
The line number
@param value
The data value | [
"Writes",
"some",
"data",
"as",
"result",
"."
] | 5f491a3339c7d3c20d7207760bdaf2acdb8f260c | https://github.com/NoraUi/NoraUi/blob/5f491a3339c7d3c20d7207760bdaf2acdb8f260c/src/main/java/com/github/noraui/data/CommonDataProvider.java#L182-L185 | train |
NoraUi/NoraUi | src/main/java/com/github/noraui/cucumber/interceptor/ConditionedInterceptor.java | ConditionedInterceptor.displayMessageAtTheBeginningOfMethod | private void displayMessageAtTheBeginningOfMethod(String methodName, List<GherkinStepCondition> conditions) {
logger.debug("{} with {} contition(s)", methodName, conditions.size());
displayConditionsAtTheBeginningOfMethod(conditions);
} | java | private void displayMessageAtTheBeginningOfMethod(String methodName, List<GherkinStepCondition> conditions) {
logger.debug("{} with {} contition(s)", methodName, conditions.size());
displayConditionsAtTheBeginningOfMethod(conditions);
} | [
"private",
"void",
"displayMessageAtTheBeginningOfMethod",
"(",
"String",
"methodName",
",",
"List",
"<",
"GherkinStepCondition",
">",
"conditions",
")",
"{",
"logger",
".",
"debug",
"(",
"\"{} with {} contition(s)\"",
",",
"methodName",
",",
"conditions",
".",
"size"... | Display a message at the beginning of method.
@param methodName
is the name of method for logs
@param conditions
list of 'expected' values condition and 'actual' values ({@link com.github.noraui.gherkin.GherkinStepCondition}). | [
"Display",
"a",
"message",
"at",
"the",
"beginning",
"of",
"method",
"."
] | 5f491a3339c7d3c20d7207760bdaf2acdb8f260c | https://github.com/NoraUi/NoraUi/blob/5f491a3339c7d3c20d7207760bdaf2acdb8f260c/src/main/java/com/github/noraui/cucumber/interceptor/ConditionedInterceptor.java#L63-L66 | train |
NoraUi/NoraUi | src/main/java/com/github/noraui/cucumber/interceptor/ConditionedInterceptor.java | ConditionedInterceptor.checkConditions | public boolean checkConditions(List<GherkinStepCondition> conditions) {
for (GherkinStepCondition gherkinCondition : conditions) {
logger.debug("checkConditions {} in context is ", gherkinCondition.getActual(), Context.getValue(gherkinCondition.getActual()));
if (!gherkinCondition.checkC... | java | public boolean checkConditions(List<GherkinStepCondition> conditions) {
for (GherkinStepCondition gherkinCondition : conditions) {
logger.debug("checkConditions {} in context is ", gherkinCondition.getActual(), Context.getValue(gherkinCondition.getActual()));
if (!gherkinCondition.checkC... | [
"public",
"boolean",
"checkConditions",
"(",
"List",
"<",
"GherkinStepCondition",
">",
"conditions",
")",
"{",
"for",
"(",
"GherkinStepCondition",
"gherkinCondition",
":",
"conditions",
")",
"{",
"logger",
".",
"debug",
"(",
"\"checkConditions {} in context is \"",
",... | Check all conditions.
@param conditions
list of 'expected' values condition and 'actual' values ({@link com.github.noraui.gherkin.GherkinStepCondition}).
@return a boolean | [
"Check",
"all",
"conditions",
"."
] | 5f491a3339c7d3c20d7207760bdaf2acdb8f260c | https://github.com/NoraUi/NoraUi/blob/5f491a3339c7d3c20d7207760bdaf2acdb8f260c/src/main/java/com/github/noraui/cucumber/interceptor/ConditionedInterceptor.java#L105-L113 | train |
NoraUi/NoraUi | src/main/java/com/github/noraui/application/steps/RESTSteps.java | RESTSteps.saveValue | @Conditioned
@Et("Je sauvegarde la valeur de cette API REST '(.*)' '(.*)' '(.*)' dans '(.*)' du contexte[\\.|\\?]")
@And("I save the value of REST API '(.*)' '(.*)' '(.*)' in '(.*)' context key[\\.|\\?]")
public void saveValue(String method, String pageKey, String uri, String targetKey, List<GherkinStepCond... | java | @Conditioned
@Et("Je sauvegarde la valeur de cette API REST '(.*)' '(.*)' '(.*)' dans '(.*)' du contexte[\\.|\\?]")
@And("I save the value of REST API '(.*)' '(.*)' '(.*)' in '(.*)' context key[\\.|\\?]")
public void saveValue(String method, String pageKey, String uri, String targetKey, List<GherkinStepCond... | [
"@",
"Conditioned",
"@",
"Et",
"(",
"\"Je sauvegarde la valeur de cette API REST '(.*)' '(.*)' '(.*)' dans '(.*)' du contexte[\\\\.|\\\\?]\"",
")",
"@",
"And",
"(",
"\"I save the value of REST API '(.*)' '(.*)' '(.*)' in '(.*)' context key[\\\\.|\\\\?]\"",
")",
"public",
"void",
"saveVal... | Save result of REST API in memory if all 'expected' parameters equals 'actual' parameters in conditions.
@param method
GET or POST
@param pageKey
is the key of page (example: GOOGLE_HOME)
@param uri
end of the url
@param targetKey
Target key to save retrieved value.
@param conditions
List of 'expected' values conditio... | [
"Save",
"result",
"of",
"REST",
"API",
"in",
"memory",
"if",
"all",
"expected",
"parameters",
"equals",
"actual",
"parameters",
"in",
"conditions",
"."
] | 5f491a3339c7d3c20d7207760bdaf2acdb8f260c | https://github.com/NoraUi/NoraUi/blob/5f491a3339c7d3c20d7207760bdaf2acdb8f260c/src/main/java/com/github/noraui/application/steps/RESTSteps.java#L61-L77 | train |
NoraUi/NoraUi | src/main/java/com/github/noraui/application/steps/MailSteps.java | MailSteps.validActivationEmail | @Experimental(name = "validActivationEmail")
@RetryOnFailure(attempts = 3, delay = 60)
@Conditioned
@Et("Je valide le mail d'activation '(.*)'[\\.|\\?]")
@And("I valid activation email '(.*)'[\\.|\\?]")
public void validActivationEmail(String mailHost, String mailUser, String mailPassword, String se... | java | @Experimental(name = "validActivationEmail")
@RetryOnFailure(attempts = 3, delay = 60)
@Conditioned
@Et("Je valide le mail d'activation '(.*)'[\\.|\\?]")
@And("I valid activation email '(.*)'[\\.|\\?]")
public void validActivationEmail(String mailHost, String mailUser, String mailPassword, String se... | [
"@",
"Experimental",
"(",
"name",
"=",
"\"validActivationEmail\"",
")",
"@",
"RetryOnFailure",
"(",
"attempts",
"=",
"3",
",",
"delay",
"=",
"60",
")",
"@",
"Conditioned",
"@",
"Et",
"(",
"\"Je valide le mail d'activation '(.*)'[\\\\.|\\\\?]\"",
")",
"@",
"And",
... | Valid activation email.
@param mailHost
example: imap.gmail.com
@param mailUser
login of mail box
@param mailPassword
password of mail box
@param firstCssQuery
the first matching element
@param conditions
list of 'expected' values condition and 'actual' values ({@link com.github.noraui.gherkin.GherkinStepCondition}).
... | [
"Valid",
"activation",
"email",
"."
] | 5f491a3339c7d3c20d7207760bdaf2acdb8f260c | https://github.com/NoraUi/NoraUi/blob/5f491a3339c7d3c20d7207760bdaf2acdb8f260c/src/main/java/com/github/noraui/application/steps/MailSteps.java#L83-L110 | train |
NoraUi/NoraUi | src/main/java/com/github/noraui/browser/steps/BrowserSteps.java | BrowserSteps.openUrlIfDifferent | @Times({ @Time(name = "AM"), @Time(name = "{pageKey}") })
@Conditioned
@Lorsque("'(.*)' est ouvert[\\.|\\?]")
@Given("'(.*)' is opened[\\.|\\?]")
public void openUrlIfDifferent(@TimeName("pageKey") String pageKey, List<GherkinStepCondition> conditions) throws TechnicalException, FailureException {
... | java | @Times({ @Time(name = "AM"), @Time(name = "{pageKey}") })
@Conditioned
@Lorsque("'(.*)' est ouvert[\\.|\\?]")
@Given("'(.*)' is opened[\\.|\\?]")
public void openUrlIfDifferent(@TimeName("pageKey") String pageKey, List<GherkinStepCondition> conditions) throws TechnicalException, FailureException {
... | [
"@",
"Times",
"(",
"{",
"@",
"Time",
"(",
"name",
"=",
"\"AM\"",
")",
",",
"@",
"Time",
"(",
"name",
"=",
"\"{pageKey}\"",
")",
"}",
")",
"@",
"Conditioned",
"@",
"Lorsque",
"(",
"\"'(.*)' est ouvert[\\\\.|\\\\?]\"",
")",
"@",
"Given",
"(",
"\"'(.*)' is ... | Open Url if different with conditions.
@param pageKey
is the key of page (example: GOOGLE_HOME)
@param conditions
list of 'expected' values condition and 'actual' values ({@link com.github.noraui.gherkin.GherkinStepCondition}).
@throws TechnicalException
is thrown if you have a technical error (format, configuration, ... | [
"Open",
"Url",
"if",
"different",
"with",
"conditions",
"."
] | 5f491a3339c7d3c20d7207760bdaf2acdb8f260c | https://github.com/NoraUi/NoraUi/blob/5f491a3339c7d3c20d7207760bdaf2acdb8f260c/src/main/java/com/github/noraui/browser/steps/BrowserSteps.java#L78-L84 | train |
NoraUi/NoraUi | src/main/java/com/github/noraui/browser/steps/BrowserSteps.java | BrowserSteps.goToUrl | @Et("Je retourne vers '(.*)'")
@And("I go back to '(.*)'")
public void goToUrl(String pageKey) throws TechnicalException, FailureException {
goToUrl(pageKey, true);
} | java | @Et("Je retourne vers '(.*)'")
@And("I go back to '(.*)'")
public void goToUrl(String pageKey) throws TechnicalException, FailureException {
goToUrl(pageKey, true);
} | [
"@",
"Et",
"(",
"\"Je retourne vers '(.*)'\"",
")",
"@",
"And",
"(",
"\"I go back to '(.*)'\"",
")",
"public",
"void",
"goToUrl",
"(",
"String",
"pageKey",
")",
"throws",
"TechnicalException",
",",
"FailureException",
"{",
"goToUrl",
"(",
"pageKey",
",",
"true",
... | Go to Url.
@param pageKey
is key corresponding to url of target.
@throws TechnicalException
is thrown if you have a technical error (format, configuration, datas, ...) in NoraUi.
Exception with {@value com.github.noraui.utils.Messages#FAIL_MESSAGE_UNABLE_TO_OPEN_A_NEW_WINDOW} message (with screenshot, with exception)
... | [
"Go",
"to",
"Url",
"."
] | 5f491a3339c7d3c20d7207760bdaf2acdb8f260c | https://github.com/NoraUi/NoraUi/blob/5f491a3339c7d3c20d7207760bdaf2acdb8f260c/src/main/java/com/github/noraui/browser/steps/BrowserSteps.java#L97-L101 | train |
NoraUi/NoraUi | src/main/java/com/github/noraui/browser/steps/BrowserSteps.java | BrowserSteps.navigateTo | private void navigateTo(String pageKey, String urlToOpen, String windowHandle) {
Context.addWindow(pageKey, windowHandle);
Context.setMainWindow(pageKey);
Context.getDriver().navigate().to(urlToOpen);
} | java | private void navigateTo(String pageKey, String urlToOpen, String windowHandle) {
Context.addWindow(pageKey, windowHandle);
Context.setMainWindow(pageKey);
Context.getDriver().navigate().to(urlToOpen);
} | [
"private",
"void",
"navigateTo",
"(",
"String",
"pageKey",
",",
"String",
"urlToOpen",
",",
"String",
"windowHandle",
")",
"{",
"Context",
".",
"addWindow",
"(",
"pageKey",
",",
"windowHandle",
")",
";",
"Context",
".",
"setMainWindow",
"(",
"pageKey",
")",
... | navigateTo change url on the same window. | [
"navigateTo",
"change",
"url",
"on",
"the",
"same",
"window",
"."
] | 5f491a3339c7d3c20d7207760bdaf2acdb8f260c | https://github.com/NoraUi/NoraUi/blob/5f491a3339c7d3c20d7207760bdaf2acdb8f260c/src/main/java/com/github/noraui/browser/steps/BrowserSteps.java#L267-L271 | train |
NoraUi/NoraUi | src/main/java/com/github/noraui/browser/steps/BrowserSteps.java | BrowserSteps.switchToWindow | private void switchToWindow(String key, String handleToKeep) {
Context.addWindow(key, handleToKeep);
Context.setMainWindow(key);
Context.getDriver().switchTo().window(handleToKeep);
} | java | private void switchToWindow(String key, String handleToKeep) {
Context.addWindow(key, handleToKeep);
Context.setMainWindow(key);
Context.getDriver().switchTo().window(handleToKeep);
} | [
"private",
"void",
"switchToWindow",
"(",
"String",
"key",
",",
"String",
"handleToKeep",
")",
"{",
"Context",
".",
"addWindow",
"(",
"key",
",",
"handleToKeep",
")",
";",
"Context",
".",
"setMainWindow",
"(",
"key",
")",
";",
"Context",
".",
"getDriver",
... | switchToWindow switch to an other Window. | [
"switchToWindow",
"switch",
"to",
"an",
"other",
"Window",
"."
] | 5f491a3339c7d3c20d7207760bdaf2acdb8f260c | https://github.com/NoraUi/NoraUi/blob/5f491a3339c7d3c20d7207760bdaf2acdb8f260c/src/main/java/com/github/noraui/browser/steps/BrowserSteps.java#L276-L280 | train |
NoraUi/NoraUi | src/main/java/com/github/noraui/application/steps/Step.java | Step.clickOn | protected void clickOn(PageElement toClick, Object... args) throws TechnicalException, FailureException {
displayMessageAtTheBeginningOfMethod("clickOn: %s in %s", toClick.toString(), toClick.getPage().getApplication());
try {
Context.waitUntil(ExpectedConditions.elementToBeClickable(Util... | java | protected void clickOn(PageElement toClick, Object... args) throws TechnicalException, FailureException {
displayMessageAtTheBeginningOfMethod("clickOn: %s in %s", toClick.toString(), toClick.getPage().getApplication());
try {
Context.waitUntil(ExpectedConditions.elementToBeClickable(Util... | [
"protected",
"void",
"clickOn",
"(",
"PageElement",
"toClick",
",",
"Object",
"...",
"args",
")",
"throws",
"TechnicalException",
",",
"FailureException",
"{",
"displayMessageAtTheBeginningOfMethod",
"(",
"\"clickOn: %s in %s\"",
",",
"toClick",
".",
"toString",
"(",
... | Click on html element.
@param toClick
html element
@param args
list of arguments to format the found selector with
@throws TechnicalException
is thrown if you have a technical error (format, configuration, datas, ...) in NoraUi.
Exception with {@value com.github.noraui.utils.Messages#FAIL_MESSAGE_UNABLE_TO_OPEN_ON_CLI... | [
"Click",
"on",
"html",
"element",
"."
] | 5f491a3339c7d3c20d7207760bdaf2acdb8f260c | https://github.com/NoraUi/NoraUi/blob/5f491a3339c7d3c20d7207760bdaf2acdb8f260c/src/main/java/com/github/noraui/application/steps/Step.java#L113-L121 | train |
NoraUi/NoraUi | src/main/java/com/github/noraui/application/steps/Step.java | Step.checkInputText | protected boolean checkInputText(PageElement pageElement, String textOrKey) throws FailureException, TechnicalException {
WebElement inputText = null;
String value = getTextOrKey(textOrKey);
try {
inputText = Context.waitUntil(ExpectedConditions.presenceOfElementLocated(Utilities... | java | protected boolean checkInputText(PageElement pageElement, String textOrKey) throws FailureException, TechnicalException {
WebElement inputText = null;
String value = getTextOrKey(textOrKey);
try {
inputText = Context.waitUntil(ExpectedConditions.presenceOfElementLocated(Utilities... | [
"protected",
"boolean",
"checkInputText",
"(",
"PageElement",
"pageElement",
",",
"String",
"textOrKey",
")",
"throws",
"FailureException",
",",
"TechnicalException",
"{",
"WebElement",
"inputText",
"=",
"null",
";",
"String",
"value",
"=",
"getTextOrKey",
"(",
"tex... | Checks if input text contains expected value.
@param pageElement
Is target element
@param textOrKey
Is the data to check (text or text in context (after a save))
@return true or false
@throws FailureException
if the scenario encounters a functional error
@throws TechnicalException | [
"Checks",
"if",
"input",
"text",
"contains",
"expected",
"value",
"."
] | 5f491a3339c7d3c20d7207760bdaf2acdb8f260c | https://github.com/NoraUi/NoraUi/blob/5f491a3339c7d3c20d7207760bdaf2acdb8f260c/src/main/java/com/github/noraui/application/steps/Step.java#L288-L297 | train |
NoraUi/NoraUi | src/main/java/com/github/noraui/application/steps/Step.java | Step.expectText | protected void expectText(PageElement pageElement, String textOrKey) throws FailureException, TechnicalException {
WebElement element = null;
String value = getTextOrKey(textOrKey);
try {
element = Context.waitUntil(ExpectedConditions.presenceOfElementLocated(Utilities.getLocator... | java | protected void expectText(PageElement pageElement, String textOrKey) throws FailureException, TechnicalException {
WebElement element = null;
String value = getTextOrKey(textOrKey);
try {
element = Context.waitUntil(ExpectedConditions.presenceOfElementLocated(Utilities.getLocator... | [
"protected",
"void",
"expectText",
"(",
"PageElement",
"pageElement",
",",
"String",
"textOrKey",
")",
"throws",
"FailureException",
",",
"TechnicalException",
"{",
"WebElement",
"element",
"=",
"null",
";",
"String",
"value",
"=",
"getTextOrKey",
"(",
"textOrKey",
... | Expects that an element contains expected value.
@param pageElement
Is target element
@param textOrKey
Is the expected data (text or text in context (after a save))
@throws FailureException
if the scenario encounters a functional error
@throws TechnicalException | [
"Expects",
"that",
"an",
"element",
"contains",
"expected",
"value",
"."
] | 5f491a3339c7d3c20d7207760bdaf2acdb8f260c | https://github.com/NoraUi/NoraUi/blob/5f491a3339c7d3c20d7207760bdaf2acdb8f260c/src/main/java/com/github/noraui/application/steps/Step.java#L310-L326 | train |
NoraUi/NoraUi | src/main/java/com/github/noraui/application/steps/Step.java | Step.checkMandatoryTextField | protected boolean checkMandatoryTextField(PageElement pageElement) throws FailureException {
WebElement inputText = null;
try {
inputText = Context.waitUntil(ExpectedConditions.presenceOfElementLocated(Utilities.getLocator(pageElement)));
} catch (final Exception e) {
... | java | protected boolean checkMandatoryTextField(PageElement pageElement) throws FailureException {
WebElement inputText = null;
try {
inputText = Context.waitUntil(ExpectedConditions.presenceOfElementLocated(Utilities.getLocator(pageElement)));
} catch (final Exception e) {
... | [
"protected",
"boolean",
"checkMandatoryTextField",
"(",
"PageElement",
"pageElement",
")",
"throws",
"FailureException",
"{",
"WebElement",
"inputText",
"=",
"null",
";",
"try",
"{",
"inputText",
"=",
"Context",
".",
"waitUntil",
"(",
"ExpectedConditions",
".",
"pre... | Checks mandatory text field.
@param pageElement
Is concerned element
@return true or false
@throws FailureException
if the scenario encounters a functional error | [
"Checks",
"mandatory",
"text",
"field",
"."
] | 5f491a3339c7d3c20d7207760bdaf2acdb8f260c | https://github.com/NoraUi/NoraUi/blob/5f491a3339c7d3c20d7207760bdaf2acdb8f260c/src/main/java/com/github/noraui/application/steps/Step.java#L337-L345 | train |
NoraUi/NoraUi | src/main/java/com/github/noraui/application/steps/Step.java | Step.checkText | protected void checkText(PageElement pageElement, String textOrKey) throws TechnicalException, FailureException {
WebElement webElement = null;
String value = getTextOrKey(textOrKey);
try {
webElement = Context.waitUntil(ExpectedConditions.presenceOfElementLocated(Utilities.getLo... | java | protected void checkText(PageElement pageElement, String textOrKey) throws TechnicalException, FailureException {
WebElement webElement = null;
String value = getTextOrKey(textOrKey);
try {
webElement = Context.waitUntil(ExpectedConditions.presenceOfElementLocated(Utilities.getLo... | [
"protected",
"void",
"checkText",
"(",
"PageElement",
"pageElement",
",",
"String",
"textOrKey",
")",
"throws",
"TechnicalException",
",",
"FailureException",
"{",
"WebElement",
"webElement",
"=",
"null",
";",
"String",
"value",
"=",
"getTextOrKey",
"(",
"textOrKey"... | Checks if HTML text contains expected value.
@param pageElement
Is target element
@param textOrKey
Is the new data (text or text in context (after a save))
@throws TechnicalException
is thrown if you have a technical error (format, configuration, datas, ...) in NoraUi.
Exception with {@value com.github.noraui.utils.Me... | [
"Checks",
"if",
"HTML",
"text",
"contains",
"expected",
"value",
"."
] | 5f491a3339c7d3c20d7207760bdaf2acdb8f260c | https://github.com/NoraUi/NoraUi/blob/5f491a3339c7d3c20d7207760bdaf2acdb8f260c/src/main/java/com/github/noraui/application/steps/Step.java#L371-L386 | train |
NoraUi/NoraUi | src/main/java/com/github/noraui/application/steps/Step.java | Step.updateList | protected void updateList(PageElement pageElement, String textOrKey) throws TechnicalException, FailureException {
String value = getTextOrKey(textOrKey);
try {
setDropDownValue(pageElement, value);
} catch (final Exception e) {
new Result.Failure<>(e.getMessage(), M... | java | protected void updateList(PageElement pageElement, String textOrKey) throws TechnicalException, FailureException {
String value = getTextOrKey(textOrKey);
try {
setDropDownValue(pageElement, value);
} catch (final Exception e) {
new Result.Failure<>(e.getMessage(), M... | [
"protected",
"void",
"updateList",
"(",
"PageElement",
"pageElement",
",",
"String",
"textOrKey",
")",
"throws",
"TechnicalException",
",",
"FailureException",
"{",
"String",
"value",
"=",
"getTextOrKey",
"(",
"textOrKey",
")",
";",
"try",
"{",
"setDropDownValue",
... | Update a html select with a text value.
@param pageElement
Is target element
@param textOrKey
Is the new data (text or text in context (after a save))
@throws TechnicalException
is thrown if you have a technical error (format, configuration, datas, ...) in NoraUi.
Exception with {@value com.github.noraui.utils.Message... | [
"Update",
"a",
"html",
"select",
"with",
"a",
"text",
"value",
"."
] | 5f491a3339c7d3c20d7207760bdaf2acdb8f260c | https://github.com/NoraUi/NoraUi/blob/5f491a3339c7d3c20d7207760bdaf2acdb8f260c/src/main/java/com/github/noraui/application/steps/Step.java#L457-L465 | train |
NoraUi/NoraUi | src/main/java/com/github/noraui/application/steps/Step.java | Step.updateDateValidated | protected void updateDateValidated(PageElement pageElement, String dateType, String date) throws TechnicalException, FailureException {
logger.debug("updateDateValidated with elementName={}, dateType={} and date={}", pageElement, dateType, date);
final DateFormat formatter = new SimpleDateFormat(Const... | java | protected void updateDateValidated(PageElement pageElement, String dateType, String date) throws TechnicalException, FailureException {
logger.debug("updateDateValidated with elementName={}, dateType={} and date={}", pageElement, dateType, date);
final DateFormat formatter = new SimpleDateFormat(Const... | [
"protected",
"void",
"updateDateValidated",
"(",
"PageElement",
"pageElement",
",",
"String",
"dateType",
",",
"String",
"date",
")",
"throws",
"TechnicalException",
",",
"FailureException",
"{",
"logger",
".",
"debug",
"(",
"\"updateDateValidated with elementName={}, dat... | Update a html input text value with a date.
@param pageElement
Is target element
@param dateType
"any", "future", "today", "future_strict"
@param date
Is the new data (date)
@throws TechnicalException
is thrown if you have a technical error (format, configuration, datas, ...) in NoraUi.
Exception with {@value com.gith... | [
"Update",
"a",
"html",
"input",
"text",
"value",
"with",
"a",
"date",
"."
] | 5f491a3339c7d3c20d7207760bdaf2acdb8f260c | https://github.com/NoraUi/NoraUi/blob/5f491a3339c7d3c20d7207760bdaf2acdb8f260c/src/main/java/com/github/noraui/application/steps/Step.java#L506-L529 | train |
NoraUi/NoraUi | src/main/java/com/github/noraui/application/steps/Step.java | Step.saveElementValue | protected void saveElementValue(String field, String targetKey, Page page) throws TechnicalException, FailureException {
logger.debug("saveValueInStep: {} to {} in {}.", field, targetKey, page.getApplication());
String txt = "";
try {
final WebElement elem = Utilities.findElement... | java | protected void saveElementValue(String field, String targetKey, Page page) throws TechnicalException, FailureException {
logger.debug("saveValueInStep: {} to {} in {}.", field, targetKey, page.getApplication());
String txt = "";
try {
final WebElement elem = Utilities.findElement... | [
"protected",
"void",
"saveElementValue",
"(",
"String",
"field",
",",
"String",
"targetKey",
",",
"Page",
"page",
")",
"throws",
"TechnicalException",
",",
"FailureException",
"{",
"logger",
".",
"debug",
"(",
"\"saveValueInStep: {} to {} in {}.\"",
",",
"field",
",... | Save value in memory.
@param field
is name of the field to retrieve.
@param targetKey
is the key to save value to
@param page
is target page.
@throws TechnicalException
is thrown if you have a technical error (format, configuration, datas, ...) in NoraUi.
Exception with {@value com.github.noraui.utils.Messages#FAIL_ME... | [
"Save",
"value",
"in",
"memory",
"."
] | 5f491a3339c7d3c20d7207760bdaf2acdb8f260c | https://github.com/NoraUi/NoraUi/blob/5f491a3339c7d3c20d7207760bdaf2acdb8f260c/src/main/java/com/github/noraui/application/steps/Step.java#L568-L584 | train |
NoraUi/NoraUi | src/main/java/com/github/noraui/application/steps/Step.java | Step.checkRadioList | protected boolean checkRadioList(PageElement pageElement, String value) throws FailureException {
try {
final List<WebElement> radioButtons = Context.waitUntil(ExpectedConditions.presenceOfAllElementsLocatedBy(Utilities.getLocator(pageElement)));
for (final WebElement button : radioBu... | java | protected boolean checkRadioList(PageElement pageElement, String value) throws FailureException {
try {
final List<WebElement> radioButtons = Context.waitUntil(ExpectedConditions.presenceOfAllElementsLocatedBy(Utilities.getLocator(pageElement)));
for (final WebElement button : radioBu... | [
"protected",
"boolean",
"checkRadioList",
"(",
"PageElement",
"pageElement",
",",
"String",
"value",
")",
"throws",
"FailureException",
"{",
"try",
"{",
"final",
"List",
"<",
"WebElement",
">",
"radioButtons",
"=",
"Context",
".",
"waitUntil",
"(",
"ExpectedCondit... | Checks that given value is matching the selected radio list button.
@param pageElement
The page element
@param value
The value to check the selection from
@return true if the given value is selected, false otherwise.
@throws FailureException
if the scenario encounters a functional error | [
"Checks",
"that",
"given",
"value",
"is",
"matching",
"the",
"selected",
"radio",
"list",
"button",
"."
] | 5f491a3339c7d3c20d7207760bdaf2acdb8f260c | https://github.com/NoraUi/NoraUi/blob/5f491a3339c7d3c20d7207760bdaf2acdb8f260c/src/main/java/com/github/noraui/application/steps/Step.java#L631-L643 | train |
NoraUi/NoraUi | src/main/java/com/github/noraui/application/steps/Step.java | Step.updateRadioList | protected void updateRadioList(PageElement pageElement, String valueOrKey) throws TechnicalException, FailureException {
final String value = Context.getValue(valueOrKey) != null ? Context.getValue(valueOrKey) : valueOrKey;
try {
final List<WebElement> radioButtons = Context.waitUntil(Exp... | java | protected void updateRadioList(PageElement pageElement, String valueOrKey) throws TechnicalException, FailureException {
final String value = Context.getValue(valueOrKey) != null ? Context.getValue(valueOrKey) : valueOrKey;
try {
final List<WebElement> radioButtons = Context.waitUntil(Exp... | [
"protected",
"void",
"updateRadioList",
"(",
"PageElement",
"pageElement",
",",
"String",
"valueOrKey",
")",
"throws",
"TechnicalException",
",",
"FailureException",
"{",
"final",
"String",
"value",
"=",
"Context",
".",
"getValue",
"(",
"valueOrKey",
")",
"!=",
"n... | Update html radio button by text "input".
@param pageElement
Is concerned element
@param valueOrKey
Is the value (value or value in context (after a save)) use for selection
@throws TechnicalException
is thrown if you have a technical error (format, configuration, datas, ...) in NoraUi.
Failure with {@value com.github... | [
"Update",
"html",
"radio",
"button",
"by",
"text",
"input",
"."
] | 5f491a3339c7d3c20d7207760bdaf2acdb8f260c | https://github.com/NoraUi/NoraUi/blob/5f491a3339c7d3c20d7207760bdaf2acdb8f260c/src/main/java/com/github/noraui/application/steps/Step.java#L658-L671 | train |
NoraUi/NoraUi | src/main/java/com/github/noraui/application/steps/Step.java | Step.passOver | protected void passOver(PageElement element) throws TechnicalException, FailureException {
try {
final String javascript = "var evObj = document.createEvent('MouseEvents');"
+ "evObj.initMouseEvent(\"mouseover\",true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0... | java | protected void passOver(PageElement element) throws TechnicalException, FailureException {
try {
final String javascript = "var evObj = document.createEvent('MouseEvents');"
+ "evObj.initMouseEvent(\"mouseover\",true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0... | [
"protected",
"void",
"passOver",
"(",
"PageElement",
"element",
")",
"throws",
"TechnicalException",
",",
"FailureException",
"{",
"try",
"{",
"final",
"String",
"javascript",
"=",
"\"var evObj = document.createEvent('MouseEvents');\"",
"+",
"\"evObj.initMouseEvent(\\\"mouseo... | Passes over a specific page element triggering 'mouseover' js event.
@param element
Target page element
@throws TechnicalException
is thrown if you have a technical error (format, configuration, datas, ...) in NoraUi.
Failure with {@value com.github.noraui.utils.Messages#FAIL_MESSAGE_UNABLE_TO_PASS_OVER_ELEMENT} messa... | [
"Passes",
"over",
"a",
"specific",
"page",
"element",
"triggering",
"mouseover",
"js",
"event",
"."
] | 5f491a3339c7d3c20d7207760bdaf2acdb8f260c | https://github.com/NoraUi/NoraUi/blob/5f491a3339c7d3c20d7207760bdaf2acdb8f260c/src/main/java/com/github/noraui/application/steps/Step.java#L684-L695 | train |
NoraUi/NoraUi | src/main/java/com/github/noraui/application/steps/Step.java | Step.selectCheckbox | protected void selectCheckbox(PageElement element, boolean checked, Object... args) throws TechnicalException, FailureException {
try {
final WebElement webElement = Context.waitUntil(ExpectedConditions.elementToBeClickable(Utilities.getLocator(element, args)));
if (webElement.isSelec... | java | protected void selectCheckbox(PageElement element, boolean checked, Object... args) throws TechnicalException, FailureException {
try {
final WebElement webElement = Context.waitUntil(ExpectedConditions.elementToBeClickable(Utilities.getLocator(element, args)));
if (webElement.isSelec... | [
"protected",
"void",
"selectCheckbox",
"(",
"PageElement",
"element",
",",
"boolean",
"checked",
",",
"Object",
"...",
"args",
")",
"throws",
"TechnicalException",
",",
"FailureException",
"{",
"try",
"{",
"final",
"WebElement",
"webElement",
"=",
"Context",
".",
... | Checks a checkbox type element.
@param element
Target page element
@param checked
Final checkbox value
@param args
list of arguments to format the found selector with
@throws TechnicalException
is thrown if you have a technical error (format, configuration, datas, ...) in NoraUi.
Failure with {@value com.github.noraui... | [
"Checks",
"a",
"checkbox",
"type",
"element",
"."
] | 5f491a3339c7d3c20d7207760bdaf2acdb8f260c | https://github.com/NoraUi/NoraUi/blob/5f491a3339c7d3c20d7207760bdaf2acdb8f260c/src/main/java/com/github/noraui/application/steps/Step.java#L712-L722 | train |
NoraUi/NoraUi | src/main/java/com/github/noraui/application/steps/Step.java | Step.switchFrame | protected void switchFrame(PageElement element, Object... args) throws FailureException, TechnicalException {
try {
Context.waitUntil(ExpectedConditions.frameToBeAvailableAndSwitchToIt(Utilities.getLocator(element, args)));
} catch (final Exception e) {
new Result.Failure<>(e... | java | protected void switchFrame(PageElement element, Object... args) throws FailureException, TechnicalException {
try {
Context.waitUntil(ExpectedConditions.frameToBeAvailableAndSwitchToIt(Utilities.getLocator(element, args)));
} catch (final Exception e) {
new Result.Failure<>(e... | [
"protected",
"void",
"switchFrame",
"(",
"PageElement",
"element",
",",
"Object",
"...",
"args",
")",
"throws",
"FailureException",
",",
"TechnicalException",
"{",
"try",
"{",
"Context",
".",
"waitUntil",
"(",
"ExpectedConditions",
".",
"frameToBeAvailableAndSwitchToI... | Switches to the given frame.
@param element
The PageElement representing a frame.
@param args
list of arguments to format the found selector with
@throws TechnicalException
is thrown if you have a technical error (format, configuration, datas, ...) in NoraUi.
Exception with {@value com.github.noraui.utils.Messages#FAI... | [
"Switches",
"to",
"the",
"given",
"frame",
"."
] | 5f491a3339c7d3c20d7207760bdaf2acdb8f260c | https://github.com/NoraUi/NoraUi/blob/5f491a3339c7d3c20d7207760bdaf2acdb8f260c/src/main/java/com/github/noraui/application/steps/Step.java#L769-L776 | train |
NoraUi/NoraUi | src/main/java/com/github/noraui/application/steps/Step.java | Step.uploadFile | protected void uploadFile(PageElement pageElement, String fileOrKey, Object... args) throws TechnicalException, FailureException {
final String path = Context.getValue(fileOrKey) != null ? Context.getValue(fileOrKey) : System.getProperty(USER_DIR) + File.separator + DOWNLOADED_FILES_FOLDER + File.separator + f... | java | protected void uploadFile(PageElement pageElement, String fileOrKey, Object... args) throws TechnicalException, FailureException {
final String path = Context.getValue(fileOrKey) != null ? Context.getValue(fileOrKey) : System.getProperty(USER_DIR) + File.separator + DOWNLOADED_FILES_FOLDER + File.separator + f... | [
"protected",
"void",
"uploadFile",
"(",
"PageElement",
"pageElement",
",",
"String",
"fileOrKey",
",",
"Object",
"...",
"args",
")",
"throws",
"TechnicalException",
",",
"FailureException",
"{",
"final",
"String",
"path",
"=",
"Context",
".",
"getValue",
"(",
"f... | Updates a html file input with the path of the file to upload.
@param pageElement
Is target element
@param fileOrKey
Is the file path (text or text in context (after a save))
@param args
list of arguments to format the found selector with
@throws TechnicalException
is thrown if you have a technical error (format, conf... | [
"Updates",
"a",
"html",
"file",
"input",
"with",
"the",
"path",
"of",
"the",
"file",
"to",
"upload",
"."
] | 5f491a3339c7d3c20d7207760bdaf2acdb8f260c | https://github.com/NoraUi/NoraUi/blob/5f491a3339c7d3c20d7207760bdaf2acdb8f260c/src/main/java/com/github/noraui/application/steps/Step.java#L793-L811 | train |
NoraUi/NoraUi | src/main/java/com/github/noraui/application/steps/Step.java | Step.getAllCucumberMethods | public static Map<String, Method> getAllCucumberMethods(Class<?> clazz) {
final Map<String, Method> result = new HashMap<>();
final CucumberOptions co = clazz.getAnnotation(CucumberOptions.class);
final Set<Class<?>> classes = getClasses(co.glue());
classes.add(BrowserSteps.class);
... | java | public static Map<String, Method> getAllCucumberMethods(Class<?> clazz) {
final Map<String, Method> result = new HashMap<>();
final CucumberOptions co = clazz.getAnnotation(CucumberOptions.class);
final Set<Class<?>> classes = getClasses(co.glue());
classes.add(BrowserSteps.class);
... | [
"public",
"static",
"Map",
"<",
"String",
",",
"Method",
">",
"getAllCucumberMethods",
"(",
"Class",
"<",
"?",
">",
"clazz",
")",
"{",
"final",
"Map",
"<",
"String",
",",
"Method",
">",
"result",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
"final",
"... | Gets all Cucumber methods.
@param clazz
Class which is the main point of the application (Decorated with the annotation {@link cucumber.api.CucumberOptions})
@return a Map of all Cucumber glue code methods of the application. First part of the entry is the Gherkin matching regular expression.
Second part is the corres... | [
"Gets",
"all",
"Cucumber",
"methods",
"."
] | 5f491a3339c7d3c20d7207760bdaf2acdb8f260c | https://github.com/NoraUi/NoraUi/blob/5f491a3339c7d3c20d7207760bdaf2acdb8f260c/src/main/java/com/github/noraui/application/steps/Step.java#L992-L1009 | train |
NoraUi/NoraUi | src/main/java/com/github/noraui/browser/Auth.java | Auth.getAuthenticationCookie | public static Cookie getAuthenticationCookie(String domainUrl) throws TechnicalException {
if (getInstance().authCookie == null) {
final String cookieStr = System.getProperty(SESSION_COOKIE);
try {
if (cookieStr != null && !"".equals(cookieStr)) {
fina... | java | public static Cookie getAuthenticationCookie(String domainUrl) throws TechnicalException {
if (getInstance().authCookie == null) {
final String cookieStr = System.getProperty(SESSION_COOKIE);
try {
if (cookieStr != null && !"".equals(cookieStr)) {
fina... | [
"public",
"static",
"Cookie",
"getAuthenticationCookie",
"(",
"String",
"domainUrl",
")",
"throws",
"TechnicalException",
"{",
"if",
"(",
"getInstance",
"(",
")",
".",
"authCookie",
"==",
"null",
")",
"{",
"final",
"String",
"cookieStr",
"=",
"System",
".",
"g... | Returns a Cookie object by retrieving data from -Dcookie maven parameter.
@param domainUrl
the domain on which the cookie is applied
@return a Cookie with a name, value, domain and path.
@throws TechnicalException
with a message (no screenshot, no exception) | [
"Returns",
"a",
"Cookie",
"object",
"by",
"retrieving",
"data",
"from",
"-",
"Dcookie",
"maven",
"parameter",
"."
] | 5f491a3339c7d3c20d7207760bdaf2acdb8f260c | https://github.com/NoraUi/NoraUi/blob/5f491a3339c7d3c20d7207760bdaf2acdb8f260c/src/main/java/com/github/noraui/browser/Auth.java#L139-L158 | train |
NoraUi/NoraUi | src/main/java/com/github/noraui/browser/Auth.java | Auth.usingAuthentication | public static String usingAuthentication(String url) {
if (authenticationTypes.BASIC.toString().equals(getInstance().authenticationType)) {
return url.replace("://", "://" + getLogin() + ":" + getPassword() + "@");
}
return url;
} | java | public static String usingAuthentication(String url) {
if (authenticationTypes.BASIC.toString().equals(getInstance().authenticationType)) {
return url.replace("://", "://" + getLogin() + ":" + getPassword() + "@");
}
return url;
} | [
"public",
"static",
"String",
"usingAuthentication",
"(",
"String",
"url",
")",
"{",
"if",
"(",
"authenticationTypes",
".",
"BASIC",
".",
"toString",
"(",
")",
".",
"equals",
"(",
"getInstance",
"(",
")",
".",
"authenticationType",
")",
")",
"{",
"return",
... | Process a given url using the current authentication mode.
@param url
url to access behind authentication
@return
the given url processed using the right authentication mode | [
"Process",
"a",
"given",
"url",
"using",
"the",
"current",
"authentication",
"mode",
"."
] | 5f491a3339c7d3c20d7207760bdaf2acdb8f260c | https://github.com/NoraUi/NoraUi/blob/5f491a3339c7d3c20d7207760bdaf2acdb8f260c/src/main/java/com/github/noraui/browser/Auth.java#L178-L184 | train |
NoraUi/NoraUi | src/main/java/com/github/noraui/utils/Utilities.java | Utilities.isElementPresentAndGetFirstOne | public static WebElement isElementPresentAndGetFirstOne(By element) {
final WebDriver webDriver = Context.getDriver();
webDriver.manage().timeouts().implicitlyWait(DriverFactory.IMPLICIT_WAIT * 2, TimeUnit.MICROSECONDS);
final List<WebElement> foundElements = webDriver.findElements(elem... | java | public static WebElement isElementPresentAndGetFirstOne(By element) {
final WebDriver webDriver = Context.getDriver();
webDriver.manage().timeouts().implicitlyWait(DriverFactory.IMPLICIT_WAIT * 2, TimeUnit.MICROSECONDS);
final List<WebElement> foundElements = webDriver.findElements(elem... | [
"public",
"static",
"WebElement",
"isElementPresentAndGetFirstOne",
"(",
"By",
"element",
")",
"{",
"final",
"WebDriver",
"webDriver",
"=",
"Context",
".",
"getDriver",
"(",
")",
";",
"webDriver",
".",
"manage",
"(",
")",
".",
"timeouts",
"(",
")",
".",
"imp... | Check if element present and get first one.
@param element
is {link org.openqa.selenium.By} find in page.
@return first {link org.openqa.selenium.WebElement} finded present element. | [
"Check",
"if",
"element",
"present",
"and",
"get",
"first",
"one",
"."
] | 5f491a3339c7d3c20d7207760bdaf2acdb8f260c | https://github.com/NoraUi/NoraUi/blob/5f491a3339c7d3c20d7207760bdaf2acdb8f260c/src/main/java/com/github/noraui/utils/Utilities.java#L220-L237 | train |
NoraUi/NoraUi | src/main/java/com/github/noraui/application/steps/CommonSteps.java | CommonSteps.wait | @Conditioned
@Lorsque("Je patiente '(.*)' secondes[\\.|\\?]")
@Then("I wait '(.*)' seconds[\\.|\\?]")
public void wait(int time, List<GherkinStepCondition> conditions) throws InterruptedException {
Thread.sleep((long) time * 1000);
} | java | @Conditioned
@Lorsque("Je patiente '(.*)' secondes[\\.|\\?]")
@Then("I wait '(.*)' seconds[\\.|\\?]")
public void wait(int time, List<GherkinStepCondition> conditions) throws InterruptedException {
Thread.sleep((long) time * 1000);
} | [
"@",
"Conditioned",
"@",
"Lorsque",
"(",
"\"Je patiente '(.*)' secondes[\\\\.|\\\\?]\"",
")",
"@",
"Then",
"(",
"\"I wait '(.*)' seconds[\\\\.|\\\\?]\"",
")",
"public",
"void",
"wait",
"(",
"int",
"time",
",",
"List",
"<",
"GherkinStepCondition",
">",
"conditions",
")... | Waits a time in second.
@param time
is time to wait
@param conditions
list of 'expected' values condition and 'actual' values ({@link com.github.noraui.gherkin.GherkinStepCondition}).
@throws InterruptedException
Exception for the sleep | [
"Waits",
"a",
"time",
"in",
"second",
"."
] | 5f491a3339c7d3c20d7207760bdaf2acdb8f260c | https://github.com/NoraUi/NoraUi/blob/5f491a3339c7d3c20d7207760bdaf2acdb8f260c/src/main/java/com/github/noraui/application/steps/CommonSteps.java#L67-L72 | train |
NoraUi/NoraUi | src/main/java/com/github/noraui/application/steps/CommonSteps.java | CommonSteps.waitStalenessOf | @Conditioned
@Lorsque("Je patiente la disparition de '(.*)-(.*)' avec un timeout de '(.*)' secondes[\\.|\\?]")
@Then("I wait staleness of '(.*)-(.*)' with timeout of '(.*)' seconds[\\.|\\?]")
public void waitStalenessOf(String page, String element, int time, List<GherkinStepCondition> conditions) throws ... | java | @Conditioned
@Lorsque("Je patiente la disparition de '(.*)-(.*)' avec un timeout de '(.*)' secondes[\\.|\\?]")
@Then("I wait staleness of '(.*)-(.*)' with timeout of '(.*)' seconds[\\.|\\?]")
public void waitStalenessOf(String page, String element, int time, List<GherkinStepCondition> conditions) throws ... | [
"@",
"Conditioned",
"@",
"Lorsque",
"(",
"\"Je patiente la disparition de '(.*)-(.*)' avec un timeout de '(.*)' secondes[\\\\.|\\\\?]\"",
")",
"@",
"Then",
"(",
"\"I wait staleness of '(.*)-(.*)' with timeout of '(.*)' seconds[\\\\.|\\\\?]\"",
")",
"public",
"void",
"waitStalenessOf",
... | Waits staleness of element with timeout of x seconds.
@param page
The concerned page of field
@param element
is key of PageElement concerned
@param time
is custom timeout
@param conditions
list of 'expected' values condition and 'actual' values ({@link com.github.noraui.gherkin.GherkinStepCondition}).
@throws Technica... | [
"Waits",
"staleness",
"of",
"element",
"with",
"timeout",
"of",
"x",
"seconds",
"."
] | 5f491a3339c7d3c20d7207760bdaf2acdb8f260c | https://github.com/NoraUi/NoraUi/blob/5f491a3339c7d3c20d7207760bdaf2acdb8f260c/src/main/java/com/github/noraui/application/steps/CommonSteps.java#L110-L116 | train |
NoraUi/NoraUi | src/main/java/com/github/noraui/application/steps/CommonSteps.java | CommonSteps.loop | @Lorsque("Si '(.*)' vérifie '(.*)', je fais '(.*)' fois:")
@Then("If '(.*)' matches '(.*)', I do '(.*)' times:")
public void loop(String actual, String expected, int times, List<GherkinConditionedLoopedStep> steps) {
try {
if (new GherkinStepCondition("loopKey", expected, actual).checkCo... | java | @Lorsque("Si '(.*)' vérifie '(.*)', je fais '(.*)' fois:")
@Then("If '(.*)' matches '(.*)', I do '(.*)' times:")
public void loop(String actual, String expected, int times, List<GherkinConditionedLoopedStep> steps) {
try {
if (new GherkinStepCondition("loopKey", expected, actual).checkCo... | [
"@",
"Lorsque",
"(",
"\"Si '(.*)' vérifie '(.*)', je fais '(.*)' fois:\")",
"\r",
"@",
"Then",
"(",
"\"If '(.*)' matches '(.*)', I do '(.*)' times:\"",
")",
"public",
"void",
"loop",
"(",
"String",
"actual",
",",
"String",
"expected",
",",
"int",
"times",
",",
"List",
... | Loops on steps execution for a specific number of times.
@param actual
actual value for global condition.
@param expected
expected value for global condition.
@param times
Number of loops.
@param steps
List of steps run in a loop. | [
"Loops",
"on",
"steps",
"execution",
"for",
"a",
"specific",
"number",
"of",
"times",
"."
] | 5f491a3339c7d3c20d7207760bdaf2acdb8f260c | https://github.com/NoraUi/NoraUi/blob/5f491a3339c7d3c20d7207760bdaf2acdb8f260c/src/main/java/com/github/noraui/application/steps/CommonSteps.java#L130-L142 | train |
NoraUi/NoraUi | src/main/java/com/github/noraui/application/steps/CommonSteps.java | CommonSteps.checkMandatoryFields | @Lorsque("Je vérifie les champs obligatoires:")
@Given("I check mandatory fields:")
public void checkMandatoryFields(Map<String, String> mandatoryFields) throws TechnicalException, FailureException {
final List<String> errors = new ArrayList<>();
for (final Entry<String, String> element : ma... | java | @Lorsque("Je vérifie les champs obligatoires:")
@Given("I check mandatory fields:")
public void checkMandatoryFields(Map<String, String> mandatoryFields) throws TechnicalException, FailureException {
final List<String> errors = new ArrayList<>();
for (final Entry<String, String> element : ma... | [
"@",
"Lorsque",
"(",
"\"Je vérifie les champs obligatoires:\")",
"\r",
"@",
"Given",
"(",
"\"I check mandatory fields:\"",
")",
"public",
"void",
"checkMandatoryFields",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"mandatoryFields",
")",
"throws",
"TechnicalException... | Check all mandatory fields.
@param mandatoryFields
is a Map of mandatory fields
@throws TechnicalException
is thrown if you have a technical error (format, configuration, datas, ...) in NoraUi.
Exception with {@value com.github.noraui.utils.Messages#FAIL_MESSAGE_EMPTY_DATA} message (no screenshot)
@throws FailureExcep... | [
"Check",
"all",
"mandatory",
"fields",
"."
] | 5f491a3339c7d3c20d7207760bdaf2acdb8f260c | https://github.com/NoraUi/NoraUi/blob/5f491a3339c7d3c20d7207760bdaf2acdb8f260c/src/main/java/com/github/noraui/application/steps/CommonSteps.java#L248-L277 | train |
NoraUi/NoraUi | src/main/java/com/github/noraui/application/steps/CommonSteps.java | CommonSteps.saveValue | @Conditioned
@Et("Je sauvegarde la valeur de '(.*)-(.*)' dans la clé '(.*)' du contexte[\\.|\\?]")
@And("I save the value of '(.*)-(.*)' in '(.*)' context key[\\.|\\?]")
public void saveValue(String page, String field, String targetKey, List<GherkinStepCondition> conditions) throws TechnicalException, Fa... | java | @Conditioned
@Et("Je sauvegarde la valeur de '(.*)-(.*)' dans la clé '(.*)' du contexte[\\.|\\?]")
@And("I save the value of '(.*)-(.*)' in '(.*)' context key[\\.|\\?]")
public void saveValue(String page, String field, String targetKey, List<GherkinStepCondition> conditions) throws TechnicalException, Fa... | [
"@",
"Conditioned",
"@",
"Et",
"(",
"\"Je sauvegarde la valeur de '(.*)-(.*)' dans la clé '(.*)' du contexte[\\\\.|\\\\?]\")",
"\r",
"@",
"And",
"(",
"\"I save the value of '(.*)-(.*)' in '(.*)' context key[\\\\.|\\\\?]\"",
")",
"public",
"void",
"saveValue",
"(",
"String",
"page",... | Save field in memory if all 'expected' parameters equals 'actual' parameters in conditions.
The value is saved directly into the Context targetKey.
@param page
The concerned page of field
@param field
Name of the field to save in memory.
@param targetKey
Target key to save retrieved value.
@param conditions
list of 'e... | [
"Save",
"field",
"in",
"memory",
"if",
"all",
"expected",
"parameters",
"equals",
"actual",
"parameters",
"in",
"conditions",
".",
"The",
"value",
"is",
"saved",
"directly",
"into",
"the",
"Context",
"targetKey",
"."
] | 5f491a3339c7d3c20d7207760bdaf2acdb8f260c | https://github.com/NoraUi/NoraUi/blob/5f491a3339c7d3c20d7207760bdaf2acdb8f260c/src/main/java/com/github/noraui/application/steps/CommonSteps.java#L362-L367 | train |
NoraUi/NoraUi | src/main/java/com/github/noraui/application/steps/CommonSteps.java | CommonSteps.clickOn | @Conditioned
@Quand("Je clique sur '(.*)-(.*)'[\\.|\\?]")
@When("I click on '(.*)-(.*)'[\\.|\\?]")
public void clickOn(String page, String toClick, List<GherkinStepCondition> conditions) throws TechnicalException, FailureException {
logger.debug("{} clickOn: {}", page, toClick);
clickOn... | java | @Conditioned
@Quand("Je clique sur '(.*)-(.*)'[\\.|\\?]")
@When("I click on '(.*)-(.*)'[\\.|\\?]")
public void clickOn(String page, String toClick, List<GherkinStepCondition> conditions) throws TechnicalException, FailureException {
logger.debug("{} clickOn: {}", page, toClick);
clickOn... | [
"@",
"Conditioned",
"@",
"Quand",
"(",
"\"Je clique sur '(.*)-(.*)'[\\\\.|\\\\?]\"",
")",
"@",
"When",
"(",
"\"I click on '(.*)-(.*)'[\\\\.|\\\\?]\"",
")",
"public",
"void",
"clickOn",
"(",
"String",
"page",
",",
"String",
"toClick",
",",
"List",
"<",
"GherkinStepCond... | Click on html element if all 'expected' parameters equals 'actual' parameters in conditions.
@param page
The concerned page of toClick
@param toClick
html element.
@param conditions
list of 'expected' values condition and 'actual' values ({@link com.github.noraui.gherkin.GherkinStepCondition}).
@throws TechnicalExcept... | [
"Click",
"on",
"html",
"element",
"if",
"all",
"expected",
"parameters",
"equals",
"actual",
"parameters",
"in",
"conditions",
"."
] | 5f491a3339c7d3c20d7207760bdaf2acdb8f260c | https://github.com/NoraUi/NoraUi/blob/5f491a3339c7d3c20d7207760bdaf2acdb8f260c/src/main/java/com/github/noraui/application/steps/CommonSteps.java#L384-L390 | train |
NoraUi/NoraUi | src/main/java/com/github/noraui/application/steps/CommonSteps.java | CommonSteps.clickOnXpathByJs | @Conditioned
@Quand("Je clique via js sur xpath '(.*)' de '(.*)' page[\\.|\\?]")
@When("I click by js on xpath '(.*)' from '(.*)' page[\\.|\\?]")
public void clickOnXpathByJs(String xpath, String page, List<GherkinStepCondition> conditions) throws TechnicalException, FailureException {
logger.de... | java | @Conditioned
@Quand("Je clique via js sur xpath '(.*)' de '(.*)' page[\\.|\\?]")
@When("I click by js on xpath '(.*)' from '(.*)' page[\\.|\\?]")
public void clickOnXpathByJs(String xpath, String page, List<GherkinStepCondition> conditions) throws TechnicalException, FailureException {
logger.de... | [
"@",
"Conditioned",
"@",
"Quand",
"(",
"\"Je clique via js sur xpath '(.*)' de '(.*)' page[\\\\.|\\\\?]\"",
")",
"@",
"When",
"(",
"\"I click by js on xpath '(.*)' from '(.*)' page[\\\\.|\\\\?]\"",
")",
"public",
"void",
"clickOnXpathByJs",
"(",
"String",
"xpath",
",",
"String"... | Click on html element using Javascript if all 'expected' parameters equals 'actual' parameters in conditions.
@param xpath
xpath of html element
@param page
The concerned page of toClick
@param conditions
list of 'expected' values condition and 'actual' values ({@link com.github.noraui.gherkin.GherkinStepCondition}).
... | [
"Click",
"on",
"html",
"element",
"using",
"Javascript",
"if",
"all",
"expected",
"parameters",
"equals",
"actual",
"parameters",
"in",
"conditions",
"."
] | 5f491a3339c7d3c20d7207760bdaf2acdb8f260c | https://github.com/NoraUi/NoraUi/blob/5f491a3339c7d3c20d7207760bdaf2acdb8f260c/src/main/java/com/github/noraui/application/steps/CommonSteps.java#L430-L436 | train |
NoraUi/NoraUi | src/main/java/com/github/noraui/application/steps/CommonSteps.java | CommonSteps.passOver | @Conditioned
@Quand("Je passe au dessus de '(.*)-(.*)'[\\.|\\?]")
@When("I pass over '(.*)-(.*)'[\\.|\\?]")
public void passOver(String page, String elementName, List<GherkinStepCondition> conditions) throws TechnicalException, FailureException {
passOver(Page.getInstance(page).getPageElementByK... | java | @Conditioned
@Quand("Je passe au dessus de '(.*)-(.*)'[\\.|\\?]")
@When("I pass over '(.*)-(.*)'[\\.|\\?]")
public void passOver(String page, String elementName, List<GherkinStepCondition> conditions) throws TechnicalException, FailureException {
passOver(Page.getInstance(page).getPageElementByK... | [
"@",
"Conditioned",
"@",
"Quand",
"(",
"\"Je passe au dessus de '(.*)-(.*)'[\\\\.|\\\\?]\"",
")",
"@",
"When",
"(",
"\"I pass over '(.*)-(.*)'[\\\\.|\\\\?]\"",
")",
"public",
"void",
"passOver",
"(",
"String",
"page",
",",
"String",
"elementName",
",",
"List",
"<",
"G... | Simulates the mouse over a html element
@param page
The concerned page of elementName
@param elementName
Is target element
@param conditions
list of 'expected' values condition and 'actual' values ({@link com.github.noraui.gherkin.GherkinStepCondition}).
@throws TechnicalException
is throws if you have a technical err... | [
"Simulates",
"the",
"mouse",
"over",
"a",
"html",
"element"
] | 5f491a3339c7d3c20d7207760bdaf2acdb8f260c | https://github.com/NoraUi/NoraUi/blob/5f491a3339c7d3c20d7207760bdaf2acdb8f260c/src/main/java/com/github/noraui/application/steps/CommonSteps.java#L500-L505 | train |
NoraUi/NoraUi | src/main/java/com/github/noraui/application/steps/CommonSteps.java | CommonSteps.updateDate | @Conditioned
@Quand("Je mets à jour la date '(.*)-(.*)' avec une '(.*)' date '(.*)'[\\.|\\?]")
@When("I update date '(.*)-(.*)' with a '(.*)' date '(.*)'[\\.|\\?]")
public void updateDate(String page, String elementName, String dateType, String dateOrKey, List<GherkinStepCondition> conditions) throws Tec... | java | @Conditioned
@Quand("Je mets à jour la date '(.*)-(.*)' avec une '(.*)' date '(.*)'[\\.|\\?]")
@When("I update date '(.*)-(.*)' with a '(.*)' date '(.*)'[\\.|\\?]")
public void updateDate(String page, String elementName, String dateType, String dateOrKey, List<GherkinStepCondition> conditions) throws Tec... | [
"@",
"Conditioned",
"@",
"Quand",
"(",
"\"Je mets à jour la date '(.*)-(.*)' avec une '(.*)' date '(.*)'[\\\\.|\\\\?]\")",
"\r",
"@",
"When",
"(",
"\"I update date '(.*)-(.*)' with a '(.*)' date '(.*)'[\\\\.|\\\\?]\"",
")",
"public",
"void",
"updateDate",
"(",
"String",
"page",
"... | Update a html input text with a date.
@param page
The concerned page of elementName
@param elementName
is target element
@param dateOrKey
Is the new date (date or date in context (after a save))
@param dateType
'future', 'future_strict', 'today' or 'any'
@param conditions
list of 'expected' values condition and 'actua... | [
"Update",
"a",
"html",
"input",
"text",
"with",
"a",
"date",
"."
] | 5f491a3339c7d3c20d7207760bdaf2acdb8f260c | https://github.com/NoraUi/NoraUi/blob/5f491a3339c7d3c20d7207760bdaf2acdb8f260c/src/main/java/com/github/noraui/application/steps/CommonSteps.java#L526-L539 | train |
NoraUi/NoraUi | src/main/java/com/github/noraui/application/steps/CommonSteps.java | CommonSteps.checkMandatoryField | @Conditioned
@Lorsque("Je vérifie le champ obligatoire '(.*)-(.*)' de type '(.*)'[\\.|\\?]")
@Then("I check mandatory field '(.*)-(.*)' of type '(.*)'[\\.|\\?]")
public void checkMandatoryField(String page, String fieldName, String type, List<GherkinStepCondition> conditions) throws TechnicalException, F... | java | @Conditioned
@Lorsque("Je vérifie le champ obligatoire '(.*)-(.*)' de type '(.*)'[\\.|\\?]")
@Then("I check mandatory field '(.*)-(.*)' of type '(.*)'[\\.|\\?]")
public void checkMandatoryField(String page, String fieldName, String type, List<GherkinStepCondition> conditions) throws TechnicalException, F... | [
"@",
"Conditioned",
"@",
"Lorsque",
"(",
"\"Je vérifie le champ obligatoire '(.*)-(.*)' de type '(.*)'[\\\\.|\\\\?]\")",
"\r",
"@",
"Then",
"(",
"\"I check mandatory field '(.*)-(.*)' of type '(.*)'[\\\\.|\\\\?]\"",
")",
"public",
"void",
"checkMandatoryField",
"(",
"String",
"page... | Checks that mandatory field is no empty with conditions.
@param page
The concerned page of fieldName
@param fieldName
Name of the field to check (see .ini file)
@param type
Type of the field ('text', 'select'...). Only 'text' is implemented for the moment!
@param conditions
list of 'expected' values condition and 'act... | [
"Checks",
"that",
"mandatory",
"field",
"is",
"no",
"empty",
"with",
"conditions",
"."
] | 5f491a3339c7d3c20d7207760bdaf2acdb8f260c | https://github.com/NoraUi/NoraUi/blob/5f491a3339c7d3c20d7207760bdaf2acdb8f260c/src/main/java/com/github/noraui/application/steps/CommonSteps.java#L653-L668 | train |
NoraUi/NoraUi | src/main/java/com/github/noraui/application/steps/CommonSteps.java | CommonSteps.checkInputText | @Conditioned
@Et("Je vérifie le texte '(.*)-(.*)' avec '(.*)'[\\.|\\?]")
@And("I check text '(.*)-(.*)' with '(.*)'[\\.|\\?]")
public void checkInputText(String page, String elementName, String textOrKey, List<GherkinStepCondition> conditions) throws FailureException, TechnicalException {
if (!c... | java | @Conditioned
@Et("Je vérifie le texte '(.*)-(.*)' avec '(.*)'[\\.|\\?]")
@And("I check text '(.*)-(.*)' with '(.*)'[\\.|\\?]")
public void checkInputText(String page, String elementName, String textOrKey, List<GherkinStepCondition> conditions) throws FailureException, TechnicalException {
if (!c... | [
"@",
"Conditioned",
"@",
"Et",
"(",
"\"Je vérifie le texte '(.*)-(.*)' avec '(.*)'[\\\\.|\\\\?]\")",
"\r",
"@",
"And",
"(",
"\"I check text '(.*)-(.*)' with '(.*)'[\\\\.|\\\\?]\"",
")",
"public",
"void",
"checkInputText",
"(",
"String",
"page",
",",
"String",
"elementName",
... | Checks if html input text contains expected value.
@param page
The concerned page of elementName
@param elementName
The key of the PageElement to check
@param textOrKey
Is the new data (text or text in context (after a save))
@param conditions
list of 'expected' values condition and 'actual' values ({@link com.github.... | [
"Checks",
"if",
"html",
"input",
"text",
"contains",
"expected",
"value",
"."
] | 5f491a3339c7d3c20d7207760bdaf2acdb8f260c | https://github.com/NoraUi/NoraUi/blob/5f491a3339c7d3c20d7207760bdaf2acdb8f260c/src/main/java/com/github/noraui/application/steps/CommonSteps.java#L687-L694 | train |
NoraUi/NoraUi | src/main/java/com/github/noraui/application/steps/CommonSteps.java | CommonSteps.checkElementVisible | @Conditioned
@Et("Je vérifie que '(.*)-(.*)' est visible[\\.|\\?]")
@And("I check that '(.*)-(.*)' is visible[\\.|\\?]")
public void checkElementVisible(String page, String elementName, List<GherkinStepCondition> conditions) throws FailureException, TechnicalException {
checkElementVisible(Page.... | java | @Conditioned
@Et("Je vérifie que '(.*)-(.*)' est visible[\\.|\\?]")
@And("I check that '(.*)-(.*)' is visible[\\.|\\?]")
public void checkElementVisible(String page, String elementName, List<GherkinStepCondition> conditions) throws FailureException, TechnicalException {
checkElementVisible(Page.... | [
"@",
"Conditioned",
"@",
"Et",
"(",
"\"Je vérifie que '(.*)-(.*)' est visible[\\\\.|\\\\?]\")",
"\r",
"@",
"And",
"(",
"\"I check that '(.*)-(.*)' is visible[\\\\.|\\\\?]\"",
")",
"public",
"void",
"checkElementVisible",
"(",
"String",
"page",
",",
"String",
"elementName",
... | Checks if an html element is visible.
@param page
The concerned page of elementName
@param elementName
The key of the PageElement to check
@param conditions
list of 'expected' values condition and 'actual' values ({@link com.github.noraui.gherkin.GherkinStepCondition}).
@throws TechnicalException
is throws if you have... | [
"Checks",
"if",
"an",
"html",
"element",
"is",
"visible",
"."
] | 5f491a3339c7d3c20d7207760bdaf2acdb8f260c | https://github.com/NoraUi/NoraUi/blob/5f491a3339c7d3c20d7207760bdaf2acdb8f260c/src/main/java/com/github/noraui/application/steps/CommonSteps.java#L711-L716 | train |
NoraUi/NoraUi | src/main/java/com/github/noraui/application/steps/CommonSteps.java | CommonSteps.checkAlert | @Et("Je vérifie le message '(.*)' sur l'alerte")
@And("I check message '(.*)' on alert")
public void checkAlert(String messageOrKey) throws TechnicalException, FailureException {
final String message = Context.getValue(messageOrKey) != null ? Context.getValue(messageOrKey) : messageOrKey;
fi... | java | @Et("Je vérifie le message '(.*)' sur l'alerte")
@And("I check message '(.*)' on alert")
public void checkAlert(String messageOrKey) throws TechnicalException, FailureException {
final String message = Context.getValue(messageOrKey) != null ? Context.getValue(messageOrKey) : messageOrKey;
fi... | [
"@",
"Et",
"(",
"\"Je vérifie le message '(.*)' sur l'alerte\")",
"\r",
"@",
"And",
"(",
"\"I check message '(.*)' on alert\"",
")",
"public",
"void",
"checkAlert",
"(",
"String",
"messageOrKey",
")",
"throws",
"TechnicalException",
",",
"FailureException",
"{",
"final",
... | Checks that a given page displays a html alert with a message.
@param messageOrKey
Is message (message or message in context (after a save)) displayed on html alert
@throws FailureException
if the scenario encounters a functional error
@throws TechnicalException
is throws if you have a technical error (format, configu... | [
"Checks",
"that",
"a",
"given",
"page",
"displays",
"a",
"html",
"alert",
"with",
"a",
"message",
"."
] | 5f491a3339c7d3c20d7207760bdaf2acdb8f260c | https://github.com/NoraUi/NoraUi/blob/5f491a3339c7d3c20d7207760bdaf2acdb8f260c/src/main/java/com/github/noraui/application/steps/CommonSteps.java#L816-L824 | train |
NoraUi/NoraUi | src/main/java/com/github/noraui/application/steps/CommonSteps.java | CommonSteps.updateRadioList | @Conditioned
@Et("Je mets à jour la liste radio '(.*)-(.*)' avec '(.*)'[\\.|\\?]")
@And("I update radio list '(.*)-(.*)' with '(.*)'[\\.|\\?]")
public void updateRadioList(String page, String elementName, String valueOrKey, List<GherkinStepCondition> conditions) throws TechnicalException, FailureExceptio... | java | @Conditioned
@Et("Je mets à jour la liste radio '(.*)-(.*)' avec '(.*)'[\\.|\\?]")
@And("I update radio list '(.*)-(.*)' with '(.*)'[\\.|\\?]")
public void updateRadioList(String page, String elementName, String valueOrKey, List<GherkinStepCondition> conditions) throws TechnicalException, FailureExceptio... | [
"@",
"Conditioned",
"@",
"Et",
"(",
"\"Je mets à jour la liste radio '(.*)-(.*)' avec '(.*)'[\\\\.|\\\\?]\")",
"\r",
"@",
"And",
"(",
"\"I update radio list '(.*)-(.*)' with '(.*)'[\\\\.|\\\\?]\"",
")",
"public",
"void",
"updateRadioList",
"(",
"String",
"page",
",",
"String",
... | Updates the value of a html radio element with conditions.
@param page
The concerned page of elementName
@param elementName
is target element
@param valueOrKey
Is the value (value or value in context (after a save)) use for selection
@param conditions
list of 'expected' values condition and 'actual' values ({@link com... | [
"Updates",
"the",
"value",
"of",
"a",
"html",
"radio",
"element",
"with",
"conditions",
"."
] | 5f491a3339c7d3c20d7207760bdaf2acdb8f260c | https://github.com/NoraUi/NoraUi/blob/5f491a3339c7d3c20d7207760bdaf2acdb8f260c/src/main/java/com/github/noraui/application/steps/CommonSteps.java#L843-L848 | train |
NoraUi/NoraUi | src/main/java/com/github/noraui/browser/DriverFactory.java | DriverFactory.getDriver | public WebDriver getDriver() {
// Driver's name is retrieved by system properties
String driverName = Context.getBrowser();
driverName = driverName != null ? driverName : DEFAULT_DRIVER;
WebDriver driver = null;
if (!drivers.containsKey(driverName)) {
try {
... | java | public WebDriver getDriver() {
// Driver's name is retrieved by system properties
String driverName = Context.getBrowser();
driverName = driverName != null ? driverName : DEFAULT_DRIVER;
WebDriver driver = null;
if (!drivers.containsKey(driverName)) {
try {
... | [
"public",
"WebDriver",
"getDriver",
"(",
")",
"{",
"// Driver's name is retrieved by system properties\r",
"String",
"driverName",
"=",
"Context",
".",
"getBrowser",
"(",
")",
";",
"driverName",
"=",
"driverName",
"!=",
"null",
"?",
"driverName",
":",
"DEFAULT_DRIVER"... | Get selenium driver. Drivers are lazy loaded.
@return selenium driver | [
"Get",
"selenium",
"driver",
".",
"Drivers",
"are",
"lazy",
"loaded",
"."
] | 5f491a3339c7d3c20d7207760bdaf2acdb8f260c | https://github.com/NoraUi/NoraUi/blob/5f491a3339c7d3c20d7207760bdaf2acdb8f260c/src/main/java/com/github/noraui/browser/DriverFactory.java#L70-L85 | train |
NoraUi/NoraUi | src/main/java/com/github/noraui/browser/DriverFactory.java | DriverFactory.generateIEDriver | private WebDriver generateIEDriver() throws TechnicalException {
final String pathWebdriver = DriverFactory.getPath(Driver.IE);
if (!new File(pathWebdriver).setExecutable(true)) {
throw new TechnicalException(Messages.getMessage(TechnicalException.TECHNICAL_ERROR_MESSAGE_WEBDRIVER_SET_EXE... | java | private WebDriver generateIEDriver() throws TechnicalException {
final String pathWebdriver = DriverFactory.getPath(Driver.IE);
if (!new File(pathWebdriver).setExecutable(true)) {
throw new TechnicalException(Messages.getMessage(TechnicalException.TECHNICAL_ERROR_MESSAGE_WEBDRIVER_SET_EXE... | [
"private",
"WebDriver",
"generateIEDriver",
"(",
")",
"throws",
"TechnicalException",
"{",
"final",
"String",
"pathWebdriver",
"=",
"DriverFactory",
".",
"getPath",
"(",
"Driver",
".",
"IE",
")",
";",
"if",
"(",
"!",
"new",
"File",
"(",
"pathWebdriver",
")",
... | Generates an ie webdriver. Unable to use it with a proxy. Causes a crash.
@return
An ie webdriver
@throws TechnicalException
if an error occured when Webdriver setExecutable to true. | [
"Generates",
"an",
"ie",
"webdriver",
".",
"Unable",
"to",
"use",
"it",
"with",
"a",
"proxy",
".",
"Causes",
"a",
"crash",
"."
] | 5f491a3339c7d3c20d7207760bdaf2acdb8f260c | https://github.com/NoraUi/NoraUi/blob/5f491a3339c7d3c20d7207760bdaf2acdb8f260c/src/main/java/com/github/noraui/browser/DriverFactory.java#L105-L132 | train |
NoraUi/NoraUi | src/main/java/com/github/noraui/browser/DriverFactory.java | DriverFactory.generateGoogleChromeDriver | private WebDriver generateGoogleChromeDriver() throws TechnicalException {
final String pathWebdriver = DriverFactory.getPath(Driver.CHROME);
if (!new File(pathWebdriver).setExecutable(true)) {
throw new TechnicalException(Messages.getMessage(TechnicalException.TECHNICAL_ERROR_MESSAGE_WEB... | java | private WebDriver generateGoogleChromeDriver() throws TechnicalException {
final String pathWebdriver = DriverFactory.getPath(Driver.CHROME);
if (!new File(pathWebdriver).setExecutable(true)) {
throw new TechnicalException(Messages.getMessage(TechnicalException.TECHNICAL_ERROR_MESSAGE_WEB... | [
"private",
"WebDriver",
"generateGoogleChromeDriver",
"(",
")",
"throws",
"TechnicalException",
"{",
"final",
"String",
"pathWebdriver",
"=",
"DriverFactory",
".",
"getPath",
"(",
"Driver",
".",
"CHROME",
")",
";",
"if",
"(",
"!",
"new",
"File",
"(",
"pathWebdri... | Generates a chrome webdriver.
@return
A chrome webdriver
@throws TechnicalException
if an error occured when Webdriver setExecutable to true. | [
"Generates",
"a",
"chrome",
"webdriver",
"."
] | 5f491a3339c7d3c20d7207760bdaf2acdb8f260c | https://github.com/NoraUi/NoraUi/blob/5f491a3339c7d3c20d7207760bdaf2acdb8f260c/src/main/java/com/github/noraui/browser/DriverFactory.java#L142-L176 | train |
NoraUi/NoraUi | src/main/java/com/github/noraui/browser/DriverFactory.java | DriverFactory.setChromeOptions | private void setChromeOptions(final DesiredCapabilities capabilities, ChromeOptions chromeOptions) {
// Set custom downloaded file path. When you check content of downloaded file by robot.
final HashMap<String, Object> chromePrefs = new HashMap<>();
chromePrefs.put("download.default_directo... | java | private void setChromeOptions(final DesiredCapabilities capabilities, ChromeOptions chromeOptions) {
// Set custom downloaded file path. When you check content of downloaded file by robot.
final HashMap<String, Object> chromePrefs = new HashMap<>();
chromePrefs.put("download.default_directo... | [
"private",
"void",
"setChromeOptions",
"(",
"final",
"DesiredCapabilities",
"capabilities",
",",
"ChromeOptions",
"chromeOptions",
")",
"{",
"// Set custom downloaded file path. When you check content of downloaded file by robot.\r",
"final",
"HashMap",
"<",
"String",
",",
"Objec... | Sets the target browser binary path in chromeOptions if it exists in configuration.
@param capabilities
The global DesiredCapabilities | [
"Sets",
"the",
"target",
"browser",
"binary",
"path",
"in",
"chromeOptions",
"if",
"it",
"exists",
"in",
"configuration",
"."
] | 5f491a3339c7d3c20d7207760bdaf2acdb8f260c | https://github.com/NoraUi/NoraUi/blob/5f491a3339c7d3c20d7207760bdaf2acdb8f260c/src/main/java/com/github/noraui/browser/DriverFactory.java#L184-L198 | train |
NoraUi/NoraUi | src/main/java/com/github/noraui/browser/DriverFactory.java | DriverFactory.generateFirefoxDriver | private WebDriver generateFirefoxDriver() throws TechnicalException {
final String pathWebdriver = DriverFactory.getPath(Driver.FIREFOX);
if (!new File(pathWebdriver).setExecutable(true)) {
throw new TechnicalException(Messages.getMessage(TechnicalException.TECHNICAL_ERROR_MESSAGE_WEBDRIV... | java | private WebDriver generateFirefoxDriver() throws TechnicalException {
final String pathWebdriver = DriverFactory.getPath(Driver.FIREFOX);
if (!new File(pathWebdriver).setExecutable(true)) {
throw new TechnicalException(Messages.getMessage(TechnicalException.TECHNICAL_ERROR_MESSAGE_WEBDRIV... | [
"private",
"WebDriver",
"generateFirefoxDriver",
"(",
")",
"throws",
"TechnicalException",
"{",
"final",
"String",
"pathWebdriver",
"=",
"DriverFactory",
".",
"getPath",
"(",
"Driver",
".",
"FIREFOX",
")",
";",
"if",
"(",
"!",
"new",
"File",
"(",
"pathWebdriver"... | Generates a firefox webdriver.
@return
A firefox webdriver
@throws TechnicalException
if an error occured when Webdriver setExecutable to true. | [
"Generates",
"a",
"firefox",
"webdriver",
"."
] | 5f491a3339c7d3c20d7207760bdaf2acdb8f260c | https://github.com/NoraUi/NoraUi/blob/5f491a3339c7d3c20d7207760bdaf2acdb8f260c/src/main/java/com/github/noraui/browser/DriverFactory.java#L208-L240 | train |
NoraUi/NoraUi | src/main/java/com/github/noraui/browser/DriverFactory.java | DriverFactory.generateWebDriver | private WebDriver generateWebDriver(String driverName) throws TechnicalException {
WebDriver driver;
if (IE.equals(driverName)) {
driver = generateIEDriver();
} else if (CHROME.equals(driverName)) {
driver = generateGoogleChromeDriver();
} else if (FIREFOX.e... | java | private WebDriver generateWebDriver(String driverName) throws TechnicalException {
WebDriver driver;
if (IE.equals(driverName)) {
driver = generateIEDriver();
} else if (CHROME.equals(driverName)) {
driver = generateGoogleChromeDriver();
} else if (FIREFOX.e... | [
"private",
"WebDriver",
"generateWebDriver",
"(",
"String",
"driverName",
")",
"throws",
"TechnicalException",
"{",
"WebDriver",
"driver",
";",
"if",
"(",
"IE",
".",
"equals",
"(",
"driverName",
")",
")",
"{",
"driver",
"=",
"generateIEDriver",
"(",
")",
";",
... | Generates a selenium webdriver following a name given in parameter.
By default a chrome driver is generated.
@param driverName
The name of the web driver to generate
@return
An instance a web driver whose type is provided by driver name given in parameter
@throws TechnicalException
if an error occured when Webdriver s... | [
"Generates",
"a",
"selenium",
"webdriver",
"following",
"a",
"name",
"given",
"in",
"parameter",
".",
"By",
"default",
"a",
"chrome",
"driver",
"is",
"generated",
"."
] | 5f491a3339c7d3c20d7207760bdaf2acdb8f260c | https://github.com/NoraUi/NoraUi/blob/5f491a3339c7d3c20d7207760bdaf2acdb8f260c/src/main/java/com/github/noraui/browser/DriverFactory.java#L253-L270 | train |
NoraUi/NoraUi | src/main/java/com/github/noraui/browser/DriverFactory.java | DriverFactory.setLoggingLevel | private void setLoggingLevel(DesiredCapabilities caps) {
final LoggingPreferences logPrefs = new LoggingPreferences();
logPrefs.enable(LogType.BROWSER, Level.ALL);
logPrefs.enable(LogType.CLIENT, Level.OFF);
logPrefs.enable(LogType.DRIVER, Level.OFF);
logPrefs.enable(LogType... | java | private void setLoggingLevel(DesiredCapabilities caps) {
final LoggingPreferences logPrefs = new LoggingPreferences();
logPrefs.enable(LogType.BROWSER, Level.ALL);
logPrefs.enable(LogType.CLIENT, Level.OFF);
logPrefs.enable(LogType.DRIVER, Level.OFF);
logPrefs.enable(LogType... | [
"private",
"void",
"setLoggingLevel",
"(",
"DesiredCapabilities",
"caps",
")",
"{",
"final",
"LoggingPreferences",
"logPrefs",
"=",
"new",
"LoggingPreferences",
"(",
")",
";",
"logPrefs",
".",
"enable",
"(",
"LogType",
".",
"BROWSER",
",",
"Level",
".",
"ALL",
... | Sets the logging level of the generated web driver.
@param caps
The web driver's capabilities
@param level
The logging level | [
"Sets",
"the",
"logging",
"level",
"of",
"the",
"generated",
"web",
"driver",
"."
] | 5f491a3339c7d3c20d7207760bdaf2acdb8f260c | https://github.com/NoraUi/NoraUi/blob/5f491a3339c7d3c20d7207760bdaf2acdb8f260c/src/main/java/com/github/noraui/browser/DriverFactory.java#L280-L289 | train |
NoraUi/NoraUi | src/main/java/com/github/noraui/browser/DriverFactory.java | DriverFactory.getPath | public static String getPath(Driver currentDriver) {
final OperatingSystem currentOperatingSystem = OperatingSystem.getCurrentOperatingSystem();
String format = "";
if ("webdriver.ie.driver".equals(currentDriver.driverName)) {
format = Utilities.setProperty(Context.getWebdriversP... | java | public static String getPath(Driver currentDriver) {
final OperatingSystem currentOperatingSystem = OperatingSystem.getCurrentOperatingSystem();
String format = "";
if ("webdriver.ie.driver".equals(currentDriver.driverName)) {
format = Utilities.setProperty(Context.getWebdriversP... | [
"public",
"static",
"String",
"getPath",
"(",
"Driver",
"currentDriver",
")",
"{",
"final",
"OperatingSystem",
"currentOperatingSystem",
"=",
"OperatingSystem",
".",
"getCurrentOperatingSystem",
"(",
")",
";",
"String",
"format",
"=",
"\"\"",
";",
"if",
"(",
"\"we... | Get the path of the driver given in parameters.
@param currentDriver
The driver to get the path of
@return
A String representation of the path | [
"Get",
"the",
"path",
"of",
"the",
"driver",
"given",
"in",
"parameters",
"."
] | 5f491a3339c7d3c20d7207760bdaf2acdb8f260c | https://github.com/NoraUi/NoraUi/blob/5f491a3339c7d3c20d7207760bdaf2acdb8f260c/src/main/java/com/github/noraui/browser/DriverFactory.java#L299-L311 | train |
NoraUi/NoraUi | src/main/java/com/github/noraui/utils/Context.java | Context.getUrlByPagekey | public static String getUrlByPagekey(String pageKey) {
if (pageKey != null) {
for (final Map.Entry<String, Application> application : getInstance().applications.entrySet()) {
for (final Map.Entry<String, String> urlPage : application.getValue().getUrlPages().entrySet()) {
... | java | public static String getUrlByPagekey(String pageKey) {
if (pageKey != null) {
for (final Map.Entry<String, Application> application : getInstance().applications.entrySet()) {
for (final Map.Entry<String, String> urlPage : application.getValue().getUrlPages().entrySet()) {
... | [
"public",
"static",
"String",
"getUrlByPagekey",
"(",
"String",
"pageKey",
")",
"{",
"if",
"(",
"pageKey",
"!=",
"null",
")",
"{",
"for",
"(",
"final",
"Map",
".",
"Entry",
"<",
"String",
",",
"Application",
">",
"application",
":",
"getInstance",
"(",
"... | Get url name in a string by page key.
@param pageKey
is key of page
@return url in a string | [
"Get",
"url",
"name",
"in",
"a",
"string",
"by",
"page",
"key",
"."
] | 5f491a3339c7d3c20d7207760bdaf2acdb8f260c | https://github.com/NoraUi/NoraUi/blob/5f491a3339c7d3c20d7207760bdaf2acdb8f260c/src/main/java/com/github/noraui/utils/Context.java#L745-L758 | train |
NoraUi/NoraUi | src/main/java/com/github/noraui/utils/Context.java | Context.getApplicationByPagekey | public static String getApplicationByPagekey(String pageKey) {
if (pageKey != null) {
for (final Map.Entry<String, Application> application : getInstance().applications.entrySet()) {
for (final Map.Entry<String, String> urlPage : application.getValue().getUrlPages().entrySet()) {
... | java | public static String getApplicationByPagekey(String pageKey) {
if (pageKey != null) {
for (final Map.Entry<String, Application> application : getInstance().applications.entrySet()) {
for (final Map.Entry<String, String> urlPage : application.getValue().getUrlPages().entrySet()) {
... | [
"public",
"static",
"String",
"getApplicationByPagekey",
"(",
"String",
"pageKey",
")",
"{",
"if",
"(",
"pageKey",
"!=",
"null",
")",
"{",
"for",
"(",
"final",
"Map",
".",
"Entry",
"<",
"String",
",",
"Application",
">",
"application",
":",
"getInstance",
... | Get application name in a string by page key.
@param pageKey
is key of page
@return application name in a string | [
"Get",
"application",
"name",
"in",
"a",
"string",
"by",
"page",
"key",
"."
] | 5f491a3339c7d3c20d7207760bdaf2acdb8f260c | https://github.com/NoraUi/NoraUi/blob/5f491a3339c7d3c20d7207760bdaf2acdb8f260c/src/main/java/com/github/noraui/utils/Context.java#L767-L780 | train |
NoraUi/NoraUi | src/main/java/com/github/noraui/cli/NoraUiCommandLineInterface.java | NoraUiCommandLineInterface.isApplicationFound | private boolean isApplicationFound(String applicationName) {
boolean applicationFinded = false;
List<String> appList = application.get();
if (!appList.isEmpty()) {
if (appList.contains(applicationName)) {
applicationFinded = true;
} else {
... | java | private boolean isApplicationFound(String applicationName) {
boolean applicationFinded = false;
List<String> appList = application.get();
if (!appList.isEmpty()) {
if (appList.contains(applicationName)) {
applicationFinded = true;
} else {
... | [
"private",
"boolean",
"isApplicationFound",
"(",
"String",
"applicationName",
")",
"{",
"boolean",
"applicationFinded",
"=",
"false",
";",
"List",
"<",
"String",
">",
"appList",
"=",
"application",
".",
"get",
"(",
")",
";",
"if",
"(",
"!",
"appList",
".",
... | Is application found looking for if applicationName match with an existing application.
@param applicationName
is the name of the application you are looking for.
@return true if applicationName match with an existing application. | [
"Is",
"application",
"found",
"looking",
"for",
"if",
"applicationName",
"match",
"with",
"an",
"existing",
"application",
"."
] | 5f491a3339c7d3c20d7207760bdaf2acdb8f260c | https://github.com/NoraUi/NoraUi/blob/5f491a3339c7d3c20d7207760bdaf2acdb8f260c/src/main/java/com/github/noraui/cli/NoraUiCommandLineInterface.java#L870-L883 | train |
NoraUi/NoraUi | src/main/java/com/github/noraui/cli/Application.java | Application.remove | public void remove(String applicationName, Class<?> robotContext, boolean verbose) {
logger.info("Remove application named [{}].", applicationName);
removeApplicationPages(applicationName, robotContext, verbose);
removeApplicationSteps(applicationName, robotContext, verbose);
removeAppli... | java | public void remove(String applicationName, Class<?> robotContext, boolean verbose) {
logger.info("Remove application named [{}].", applicationName);
removeApplicationPages(applicationName, robotContext, verbose);
removeApplicationSteps(applicationName, robotContext, verbose);
removeAppli... | [
"public",
"void",
"remove",
"(",
"String",
"applicationName",
",",
"Class",
"<",
"?",
">",
"robotContext",
",",
"boolean",
"verbose",
")",
"{",
"logger",
".",
"info",
"(",
"\"Remove application named [{}].\"",
",",
"applicationName",
")",
";",
"removeApplicationPa... | Remove target application to your robot.
@param applicationName
name of application removed.
@param robotContext
Context class from robot.
@param verbose
boolean to activate verbose mode (show more traces). | [
"Remove",
"target",
"application",
"to",
"your",
"robot",
"."
] | 5f491a3339c7d3c20d7207760bdaf2acdb8f260c | https://github.com/NoraUi/NoraUi/blob/5f491a3339c7d3c20d7207760bdaf2acdb8f260c/src/main/java/com/github/noraui/cli/Application.java#L104-L115 | train |
FXMisc/UndoFX | undofx/src/main/java/org/fxmisc/undo/impl/UndoManagerImpl.java | UndoManagerImpl.applyChange | private boolean applyChange(boolean isChangeAvailable, Supplier<C> changeToApply) {
if (isChangeAvailable) {
canMerge = false;
// perform change
C change = changeToApply.get();
this.expectedChange = change;
performingAction.suspendWhile(() -> apply.ac... | java | private boolean applyChange(boolean isChangeAvailable, Supplier<C> changeToApply) {
if (isChangeAvailable) {
canMerge = false;
// perform change
C change = changeToApply.get();
this.expectedChange = change;
performingAction.suspendWhile(() -> apply.ac... | [
"private",
"boolean",
"applyChange",
"(",
"boolean",
"isChangeAvailable",
",",
"Supplier",
"<",
"C",
">",
"changeToApply",
")",
"{",
"if",
"(",
"isChangeAvailable",
")",
"{",
"canMerge",
"=",
"false",
";",
"// perform change",
"C",
"change",
"=",
"changeToApply"... | Helper method for reducing code duplication
@param isChangeAvailable same as `isUndoAvailable()` [Undo] or `isRedoAvailable()` [Redo]
@param changeToApply same as `invert.apply(queue.prev())` [Undo] or `queue.next()` [Redo] | [
"Helper",
"method",
"for",
"reducing",
"code",
"duplication"
] | 5f9404a657e1dcfcd60bebee0aadef2f072dc2ab | https://github.com/FXMisc/UndoFX/blob/5f9404a657e1dcfcd60bebee0aadef2f072dc2ab/undofx/src/main/java/org/fxmisc/undo/impl/UndoManagerImpl.java#L206-L224 | train |
aws/aws-cloudtrail-processing-library | src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/manager/SqsManager.java | SqsManager.pollQueue | public List<Message> pollQueue() {
boolean success = false;
ProgressStatus pollQueueStatus = new ProgressStatus(ProgressState.pollQueue, new BasicPollQueueInfo(0, success));
final Object reportObject = progressReporter.reportStart(pollQueueStatus);
ReceiveMessageRequest request = new Re... | java | public List<Message> pollQueue() {
boolean success = false;
ProgressStatus pollQueueStatus = new ProgressStatus(ProgressState.pollQueue, new BasicPollQueueInfo(0, success));
final Object reportObject = progressReporter.reportStart(pollQueueStatus);
ReceiveMessageRequest request = new Re... | [
"public",
"List",
"<",
"Message",
">",
"pollQueue",
"(",
")",
"{",
"boolean",
"success",
"=",
"false",
";",
"ProgressStatus",
"pollQueueStatus",
"=",
"new",
"ProgressStatus",
"(",
"ProgressState",
".",
"pollQueue",
",",
"new",
"BasicPollQueueInfo",
"(",
"0",
"... | Poll SQS queue for incoming messages, filter them, and return a list of SQS Messages.
@return a list of SQS messages. | [
"Poll",
"SQS",
"queue",
"for",
"incoming",
"messages",
"filter",
"them",
"and",
"return",
"a",
"list",
"of",
"SQS",
"Messages",
"."
] | 411315808d8d3dc6b45e4182212e3e04d82e3782 | https://github.com/aws/aws-cloudtrail-processing-library/blob/411315808d8d3dc6b45e4182212e3e04d82e3782/src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/manager/SqsManager.java#L113-L140 | train |
aws/aws-cloudtrail-processing-library | src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/manager/SqsManager.java | SqsManager.parseMessage | public List<CloudTrailSource> parseMessage(List<Message> sqsMessages) {
List<CloudTrailSource> sources = new ArrayList<>();
for (Message sqsMessage : sqsMessages) {
boolean parseMessageSuccess = false;
ProgressStatus parseMessageStatus = new ProgressStatus(ProgressState.parseMe... | java | public List<CloudTrailSource> parseMessage(List<Message> sqsMessages) {
List<CloudTrailSource> sources = new ArrayList<>();
for (Message sqsMessage : sqsMessages) {
boolean parseMessageSuccess = false;
ProgressStatus parseMessageStatus = new ProgressStatus(ProgressState.parseMe... | [
"public",
"List",
"<",
"CloudTrailSource",
">",
"parseMessage",
"(",
"List",
"<",
"Message",
">",
"sqsMessages",
")",
"{",
"List",
"<",
"CloudTrailSource",
">",
"sources",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"for",
"(",
"Message",
"sqsMessage",
"... | Given a list of raw SQS message parse each of them, and return a list of CloudTrailSource.
@param sqsMessages list of SQS messages.
@return list of CloudTrailSource. | [
"Given",
"a",
"list",
"of",
"raw",
"SQS",
"message",
"parse",
"each",
"of",
"them",
"and",
"return",
"a",
"list",
"of",
"CloudTrailSource",
"."
] | 411315808d8d3dc6b45e4182212e3e04d82e3782 | https://github.com/aws/aws-cloudtrail-processing-library/blob/411315808d8d3dc6b45e4182212e3e04d82e3782/src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/manager/SqsManager.java#L148-L176 | train |
aws/aws-cloudtrail-processing-library | src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/manager/SqsManager.java | SqsManager.deleteMessageFromQueue | public void deleteMessageFromQueue(Message sqsMessage, ProgressStatus progressStatus) {
final Object reportObject = progressReporter.reportStart(progressStatus);
boolean deleteMessageSuccess = false;
try {
sqsClient.deleteMessage(new DeleteMessageRequest(config.getSqsUrl(), sqsMessag... | java | public void deleteMessageFromQueue(Message sqsMessage, ProgressStatus progressStatus) {
final Object reportObject = progressReporter.reportStart(progressStatus);
boolean deleteMessageSuccess = false;
try {
sqsClient.deleteMessage(new DeleteMessageRequest(config.getSqsUrl(), sqsMessag... | [
"public",
"void",
"deleteMessageFromQueue",
"(",
"Message",
"sqsMessage",
",",
"ProgressStatus",
"progressStatus",
")",
"{",
"final",
"Object",
"reportObject",
"=",
"progressReporter",
".",
"reportStart",
"(",
"progressStatus",
")",
";",
"boolean",
"deleteMessageSuccess... | Delete a message from the SQS queue that you specified in the configuration file.
@param sqsMessage the {@link Message} that you want to delete.
@param progressStatus {@link ProgressStatus} tracks the start and end status. | [
"Delete",
"a",
"message",
"from",
"the",
"SQS",
"queue",
"that",
"you",
"specified",
"in",
"the",
"configuration",
"file",
"."
] | 411315808d8d3dc6b45e4182212e3e04d82e3782 | https://github.com/aws/aws-cloudtrail-processing-library/blob/411315808d8d3dc6b45e4182212e3e04d82e3782/src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/manager/SqsManager.java#L185-L195 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.