diff --git a/docs/docs/manual/grelfunctions.md b/docs/docs/manual/grelfunctions.md index fe5d7d76a..f441986e3 100644 --- a/docs/docs/manual/grelfunctions.md +++ b/docs/docs/manual/grelfunctions.md @@ -1,4 +1,4 @@ ---- +--- id: grelfunctions title: GREL functions sidebar_label: GREL functions @@ -6,9 +6,9 @@ sidebar_label: GREL functions ## Reading this reference -For the reference below, the function is given in full-length notation and the in-text examples are written in dot notation. Shorthands are used to indicate the kind of [data type](exploring#data-types) used in each function: s for string, b for boolean, n for number, d for date, a for array, p for a regex pattern, and o for any data type, as well as “null” and “error” data types. +For the reference below, the function is given in full-length notation and the in-text examples are written in dot notation. Shorthands are used to indicate the kind of [data type](exploring#data-types) used in each function: s for string, b for boolean, n for number, d for date, a for array, p for a regex pattern, and o for object (meaning any data type), as well as “null” and “error” data types. -If a function can take more than one kind of data as input or can output more than one kind of data, that is indicated with more than one letter (as with “s or a”) or with o for object. +If a function can take more than one kind of data as input or can output more than one kind of data, that is indicated with more than one letter (as with “s or a”) or with o for object, meaning it can take any type of data (string, boolean, date, number, etc.). We also use shorthands for substring (“sub”) and separator string (“sep”). Optional arguments will say “(optional)”. @@ -170,9 +170,9 @@ For example, if `value` is “hello 123456 goodbye”, the following would occur Returns a string converted to a number. Will attempt to convert other formats into a string, then into a number. If the value is already a number, it will return the number. -###### split(s, s or p sep) +###### split(s, s or p sep, b preserveTokens (optional)) -Returns the array of strings obtained by splitting s by sep. The separator can be either a string or a regex pattern. For example, `"fire, water, earth, air".split(",")` returns an array of 4 strings: [ "fire", " water", " earth", " air" ]. Note that the space characters are retained but the separator is removed. +Returns the array of strings obtained by splitting s by sep. The separator can be either a string or a regex pattern. For example, `"fire, water, earth, air".split(",")` returns an array of 4 strings: [ "fire", " water", " earth", " air" ]. Note that the space characters are retained but the separator is removed. If you include “true” for the preserveTokens boolean, empty segments are preserved. ###### splitByLengths(s, n1, n2, ...) @@ -226,9 +226,9 @@ Returns the [SHA-1 hash](https://en.wikipedia.org/wiki/SHA-1) of an object. If f Returns a phonetic encoding of a string, based on an available phonetic algorithm. See the [section on phonetic clustering](cellediting#clustering-methods) for more information. Can be one of the following supported phonetic methods: [metaphone, doublemetaphone, metaphone3](https://www.wikipedia.org/wiki/Metaphone), [soundex](https://en.wikipedia.org/wiki/Soundex), [cologne](https://en.wikipedia.org/wiki/Cologne_phonetics). Quotes are required around your encoding method. For example, `"Ruth Prawer Jhabvala".phonetic("metaphone")` outputs the string “R0PRWRJHBFL”. -###### reinterpret(s, s encoder) +###### reinterpret(s, s encoderTarget, s encoderSource) -Returns s reinterpreted through the given character encoder. You must supply one of the [supported encodings](http://java.sun.com/j2se/1.5.0/docs/guide/intl/encoding.doc.html). Note that quotes are required around your character encoder. +Returns s reinterpreted through the given character encoders. You must supply one of the [supported encodings](http://java.sun.com/j2se/1.5.0/docs/guide/intl/encoding.doc.html) for each of the original source and the target output. Note that quotes are required around your character encoder. When an OpenRefine project is started, data is imported and interpreted. A specific character encoding is identified or manually selected at that time (such as UTF-8). You can reinterpret a column into another specificed encoding using this function. This function may not fix your data; it may be better to use this in conjunction with new projects to test the interpretation, and pre-format your data as needed. @@ -333,9 +333,6 @@ Returns the [inner HTML](https://developer.mozilla.org/en-US/docs/Web/API/Elemen ###### innerXml(element) Returns the inner XML elements of an XML element. Does not return the text directly inside your chosen XML element - only the contents of its children. To select the direct text, use ownText(). To select both, use xmlText(). Use it in conjunction with parseXml() and select() to provide an element. -###### outerHtml(element) -Returns the [outer HTML](https://developer.mozilla.org/en-US/docs/Web/API/Element/outerHTML) of an HTML element. outerHtml includes the start and end tags of the current element. Use it in conjunction with parseHtml() and select() to provide an element. - ###### ownText(element) Returns the text directly inside the selected XML or HTML element only, ignoring text inside children elements (for this, use innerXml()). Use it in conjunction with a parser and select() to provide an element. @@ -468,13 +465,13 @@ Some of these math functions don't recognize integers when supplied as the first |Function|Use|Example| |-|-|-| |`abs(n)`|Returns the absolute value of a number.|`abs(-6)` returns 6.| -|`acos(n)`|Returns the arc cosine of an angle, in the range 0 through PI.|`acos(0.345)` returns 1.218557541697832.| -|`asin(n)`|Returns the arc sine of an angle in the range of -PI/2 through [PI](https://docs.oracle.com/javase/8/docs/api/java/lang/Math.html#PI)/2.|`asin(0.345)` returns 0.35223878509706474.| +|`acos(n)`|Returns the arc cosine of an angle, in the range 0 through [PI](https://docs.oracle.com/javase/8/docs/api/java/lang/Math.html#PI).|`acos(0.345)` returns 1.218557541697832.| +|`asin(n)`|Returns the arc sine of an angle in the range of -PI/2 through PI/2.|`asin(0.345)` returns 0.35223878509706474.| |`atan(n)`|Returns the arc tangent of an angle in the range of -PI/2 through PI/2.|`atan(0.345)` returns 0.3322135507465967.| -|`atan2(n1, n2)`|Converts rectangular coordinates (n1, n2) to polar (r, theta). Returns number theta.|`atan2(0.345,0.6)` returns 0.5218342798144103.| +|`atan2(n1, n2)`|Converts rectangular coordinates (n1, n2) to polar (r, theta). Returns number theta.|`atan2(0.345,0.6)` returns 0.5218342798144103.| |`ceil(n)`|Returns the ceiling of a number.|`3.7.ceil()` returns 4 and `-3.7.ceil()` returns -3.| |`combin(n1, n2)`|Returns the number of combinations for n2 elements as divided into n1.|`combin(20,2)` returns 190.| -|`cos(n)`|Returns the trigonometric cosine of an angle.|`cos(5)` returns 0.28366218546322625.| +|`cos(n)`|Returns the trigonometric cosine of a value.|`cos(5)` returns 0.28366218546322625.| |`cosh(n)`|Returns the hyperbolic cosine of a value.|`cosh(5)` returns 74.20994852478785.| |`degrees(n)`|Converts an angle from radians to degrees.|`degrees(5)` returns 286.4788975654116.| |`even(n)`|Rounds the number up to the nearest even integer.|`even(5)` returns 6.| @@ -482,7 +479,7 @@ Some of these math functions don't recognize integers when supplied as the first |`fact(n)`|Returns the factorial of a number, starting from 1.|`fact(5)` returns 120.| |`factn(n1, n2)`|Returns the factorial of n1, starting from n2.|`factn(10,3)` returns 280.| |`floor(n)`|Returns the floor of a number.|`3.7.floor()` returns 3 and `-3.7.floor()` returns -4.| -|`gcd(n1, n2)`|Returns the greatest common denominator of the two numbers.|`gcd(95,135)` returns 5.| +|`gcd(n1, n2)`|Returns the greatest common denominator of two numbers.|`gcd(95,135)` returns 5.| |`lcm(n1, n2)`|Returns the least common multiple of two numbers.|`lcm(95,135)` returns 2565.| |`ln(n)`|Returns the natural logarithm of n.|`ln(5)` returns 1.6094379124341003.| |`log(n)`|Returns the base 10 logarithm of n.|`log(5)` returns 0.6989700043360189.| @@ -494,7 +491,7 @@ Some of these math functions don't recognize integers when supplied as the first |`pow(n1, n2)`|Returns n1 raised to the power of n2. Note: value.pow(3)` will work, whereas `2.pow(3)` will not work.|`pow(2, 3)` returns 8 (2 cubed) and `pow(3, 2)` returns 9 (3 squared). The square root of any numeric value can be called with `value.pow(0.5)`.| |`quotient(n1, n2)`|Returns the integer portion of a division (truncated, not rounded), when supplied with a numerator and denominator.|`quotient(9,2)` returns 4.| |`radians(n)`|Converts an angle in degrees to radians.|`radians(10)` returns 0.17453292519943295.| -|`randomNumber(n lower_bound, n upper_bound)`|Returns a random integer in the interval between the lower and upper bounds (inclusively). Will output a different random number in each cell in a column.| +|`randomNumber(n lowerBound, n upperBound)`|Returns a random integer in the interval between the lower and upper bounds (inclusively). Will output a different random number in each cell in a column.| |`round(n)`|Rounds a number to the nearest integer.|`3.7.round()` returns 4 and `-3.7.round()` returns -4.| |`sin(n)`|Returns the trigonometric sine of an angle.|`sin(10)` returns -0.5440211108893698.| |`sinh(n)`|Returns the hyperbolic sine of an angle.|`sinh(10)` returns 11013.232874703393.| @@ -525,7 +522,7 @@ Returns a boolean indicating whether o has a member field called [name](expressi ###### coalesce(o1, o2, o3, ...) Returns the first non-null from a series of objects. For example, `coalesce(value, "")` would return an empty string “” if `value` was null, but otherwise return `value`. -###### cross(cell, s projectName, s columnName) +###### cross(cell, s projectName (optional), s columnName (optional)) Returns an array of zero or more rows in the project projectName for which the cells in their column columnName have the same content as the cell in your chosen column. For example, if two projects contained matching names, and you wanted to pull addresses for people by their names from a project called “People” you would apply the following expression to your column of names: ``` cell.cross("People","Name").cells["Address"].value[0] @@ -535,4 +532,6 @@ This would match your current column to the “Name” column in “People” an You may need to do some data preparation with cross(), such as using trim() on your key columns or deduplicating values. +The first argument will be interpreted as `cell.value` if set to `cell`. If you omit projectName and columnName, they will default to the current project and index column (number 0). + Recipes and more examples for using cross() can be found [on our wiki](https://github.com/OpenRefine/OpenRefine/wiki/Recipes#combining-datasets). diff --git a/main/src/com/google/refine/expr/functions/Coalesce.java b/main/src/com/google/refine/expr/functions/Coalesce.java index e3b384a46..408b2859a 100644 --- a/main/src/com/google/refine/expr/functions/Coalesce.java +++ b/main/src/com/google/refine/expr/functions/Coalesce.java @@ -58,12 +58,12 @@ public class Coalesce implements Function { @Override public String getDescription() { - return "Returns the first non-null from a series of values"; + return "Returns the first non-null from a series of objects (meaning any data type - string, date, number, boolean, etc.)."; } @Override public String getParams() { - return "two or more objects"; + return "o1, o2, ..."; } @Override diff --git a/main/src/com/google/refine/expr/functions/Cross.java b/main/src/com/google/refine/expr/functions/Cross.java index dc06371ed..c9ba8a4d7 100644 --- a/main/src/com/google/refine/expr/functions/Cross.java +++ b/main/src/com/google/refine/expr/functions/Cross.java @@ -98,7 +98,7 @@ public class Cross implements Function { return "Looks up the given value in the target column of the target project, returns an array of matched rows. Two values match if and only if they have the same string representation. " + "The first argument will be interpreted as cell.value if set to cell. " + "The second argument will be interpreted as the current project name if omitted or set to \"\". " + - "The third argument will be interpreted as the index (starts from 0) column if omitted or set to \"\""; + "The third argument will be interpreted as the index (starts from 0) column if omitted or set to \"\"."; } @Override diff --git a/main/src/com/google/refine/expr/functions/FacetCount.java b/main/src/com/google/refine/expr/functions/FacetCount.java index 7c4c689b0..3f87119e8 100644 --- a/main/src/com/google/refine/expr/functions/FacetCount.java +++ b/main/src/com/google/refine/expr/functions/FacetCount.java @@ -85,7 +85,7 @@ public class FacetCount implements Function { @Override public String getDescription() { - return "Returns the facet count corresponding to the given choice value"; + return "Returns the facet count corresponding to the given choice value, by looking for the facetExpression in the choiceValue in columnName."; } @Override diff --git a/main/src/com/google/refine/expr/functions/Get.java b/main/src/com/google/refine/expr/functions/Get.java index 4ee7866f9..545c89c14 100644 --- a/main/src/com/google/refine/expr/functions/Get.java +++ b/main/src/com/google/refine/expr/functions/Get.java @@ -153,9 +153,9 @@ public class Get implements Function { @Override public String getDescription() { return - "If o has fields, returns the field named 'from' of o. " + - "If o is an array, returns o[from, to]. " + - "if o is a string, returns o.substring(from, to)" + "If o has named fields, returns the field named 'from' of o. " + + "If o is an array, returns a sub-array o[from, to]. " + + "if o is a string, returns o.substring(from, to)." ; } diff --git a/main/src/com/google/refine/expr/functions/HasField.java b/main/src/com/google/refine/expr/functions/HasField.java index 3e466ca2f..f6e159423 100644 --- a/main/src/com/google/refine/expr/functions/HasField.java +++ b/main/src/com/google/refine/expr/functions/HasField.java @@ -61,7 +61,7 @@ public class HasField implements Function { @Override public String getDescription() { - return "Returns whether o has field name"; + return "Returns a boolean indicating whether o has a member field called name."; } @Override diff --git a/main/src/com/google/refine/expr/functions/Jsonize.java b/main/src/com/google/refine/expr/functions/Jsonize.java index f9081fe12..10ea0c3ad 100644 --- a/main/src/com/google/refine/expr/functions/Jsonize.java +++ b/main/src/com/google/refine/expr/functions/Jsonize.java @@ -61,7 +61,7 @@ public class Jsonize implements Function { @Override public String getParams() { - return "value"; + return "o"; } @Override diff --git a/main/src/com/google/refine/expr/functions/Length.java b/main/src/com/google/refine/expr/functions/Length.java index ddf58f38b..17a2635d0 100644 --- a/main/src/com/google/refine/expr/functions/Length.java +++ b/main/src/com/google/refine/expr/functions/Length.java @@ -70,12 +70,12 @@ public class Length implements Function { @Override public String getDescription() { - return "Returns the length of o"; + return "Returns the length of string s as a number, or the size of array a, meaning the number of objects inside it. Arrays can be empty, in which case length() will return 0."; } @Override public String getParams() { - return "array or string o"; + return "array a or string s"; } @Override diff --git a/main/src/com/google/refine/expr/functions/Slice.java b/main/src/com/google/refine/expr/functions/Slice.java index cb689203e..c651d3ed0 100644 --- a/main/src/com/google/refine/expr/functions/Slice.java +++ b/main/src/com/google/refine/expr/functions/Slice.java @@ -124,19 +124,17 @@ public class Slice implements Function { @Override public String getDescription() { - return - "If o is an array, returns o[from, to]. " + - "if o is a string, returns o.substring(from, to)" - ; + return "Given a string, returns the substring starting from character index from, and up to character index to. If the to argument is omitted, will output to the end of s. Remember character indices start from zero. Given an array, returns a sub-array from the first index provided up to and including the last index provided. If the to value is omitted, it is understood to be the end of the array. Slice only."; + } @Override public String getParams() { - return "o, number from, optional number to"; + return "string s or array a, number from, number to (optional)"; } @Override public String getReturns() { - return "Depends on actual arguments"; + return "string, array, or array item (number, string, etc.)"; } } diff --git a/main/src/com/google/refine/expr/functions/ToDate.java b/main/src/com/google/refine/expr/functions/ToDate.java index edc857868..ca225b981 100644 --- a/main/src/com/google/refine/expr/functions/ToDate.java +++ b/main/src/com/google/refine/expr/functions/ToDate.java @@ -196,12 +196,12 @@ public class ToDate implements Function { @Override public String getDescription() { - return "Returns o converted to a date object, you can hint if the day or the month is listed first, or give an ordered list of possible formats using this syntax: http://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html"; + return "Returns the inputted object converted to a date object. Without arguments, it returns the ISO 8601 extended format. With arguments, you can control the output format. With monthFirst: set false if the date is formatted with the day before the month. With formatN: attempt to parse the date using an ordered list of possible formats. Supply formats based on the SimpleDateFormat syntax: http://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html."; } @Override public String getParams() { - return "o, boolean month_first / format1, format2, ... (all optional)"; + return "o, boolean monthFirst, string format1, string format2, ...)"; } @Override diff --git a/main/src/com/google/refine/expr/functions/ToNumber.java b/main/src/com/google/refine/expr/functions/ToNumber.java index fb0121387..82178afe3 100644 --- a/main/src/com/google/refine/expr/functions/ToNumber.java +++ b/main/src/com/google/refine/expr/functions/ToNumber.java @@ -74,7 +74,7 @@ public class ToNumber implements Function { @Override public String getDescription() { - return "Returns o converted to a number"; + return "Returns a string converted to a number. Will attempt to convert other formats into a string, then into a number. If the value is already a number, it will return the number."; } @Override diff --git a/main/src/com/google/refine/expr/functions/ToString.java b/main/src/com/google/refine/expr/functions/ToString.java index 6e90b684f..8f9113d5f 100644 --- a/main/src/com/google/refine/expr/functions/ToString.java +++ b/main/src/com/google/refine/expr/functions/ToString.java @@ -70,12 +70,12 @@ public class ToString implements Function { @Override public String getDescription() { - return "Returns o converted to a string"; + return "Takes any value type (string, number, date, boolean, error, null) and gives a string version of that value. You can convert numbers to strings with rounding, using an optional string format. See https://docs.oracle.com/javase/8/docs/api/java/util/Formatter.html. You can also convert dates to strings using date parsing syntax. See https://docs.openrefine.org/manual/grelfunctions/#date-functions."; } @Override public String getParams() { - return "o, string format (optional)"; + return "object o, string format (optional)"; } @Override diff --git a/main/src/com/google/refine/expr/functions/Type.java b/main/src/com/google/refine/expr/functions/Type.java index d8abc465c..9f581a570 100644 --- a/main/src/com/google/refine/expr/functions/Type.java +++ b/main/src/com/google/refine/expr/functions/Type.java @@ -72,7 +72,7 @@ public class Type implements Function { @Override public String getDescription() { - return "Returns the type of o as a string ('string', 'date', 'number', 'array', 'boolean' or a class name)"; + return "Returns a string with the data type of o, such as undefined, string, number, boolean, etc."; } @Override diff --git a/main/src/com/google/refine/expr/functions/arrays/InArray.java b/main/src/com/google/refine/expr/functions/arrays/InArray.java index 1fd47ceea..b0cc80e7e 100644 --- a/main/src/com/google/refine/expr/functions/arrays/InArray.java +++ b/main/src/com/google/refine/expr/functions/arrays/InArray.java @@ -74,7 +74,7 @@ public class InArray implements Function { @Override public String getDescription() { - return "Checks if array a contains string s"; + return "Returns true if the array contains the desired string, and false otherwise. Will not convert data types."; } @Override diff --git a/main/src/com/google/refine/expr/functions/arrays/Join.java b/main/src/com/google/refine/expr/functions/arrays/Join.java index c59522231..d1ddcc5f8 100644 --- a/main/src/com/google/refine/expr/functions/arrays/Join.java +++ b/main/src/com/google/refine/expr/functions/arrays/Join.java @@ -95,7 +95,7 @@ public class Join implements Function { @Override public String getDescription() { - return "Returns the string obtained by joining the array a with the separator sep"; + return "Joins the items in the array with sep, and returns it all as a string."; } @Override diff --git a/main/src/com/google/refine/expr/functions/arrays/Reverse.java b/main/src/com/google/refine/expr/functions/arrays/Reverse.java index 383e7763c..869749142 100644 --- a/main/src/com/google/refine/expr/functions/arrays/Reverse.java +++ b/main/src/com/google/refine/expr/functions/arrays/Reverse.java @@ -81,7 +81,7 @@ public class Reverse implements Function { @Override public String getDescription() { - return "Reverses array a"; + return "Reverses array a."; } @Override diff --git a/main/src/com/google/refine/expr/functions/arrays/Sort.java b/main/src/com/google/refine/expr/functions/arrays/Sort.java index 2476d5dc1..01a138ea3 100644 --- a/main/src/com/google/refine/expr/functions/arrays/Sort.java +++ b/main/src/com/google/refine/expr/functions/arrays/Sort.java @@ -85,7 +85,7 @@ public class Sort implements Function { @Override public String getDescription() { - return "Sorts array a"; + return "Sorts the array in ascending order. Sorting is case-sensitive, uppercase first and lowercase second."; } @Override diff --git a/main/src/com/google/refine/expr/functions/arrays/Uniques.java b/main/src/com/google/refine/expr/functions/arrays/Uniques.java index f5414c485..7c85da191 100644 --- a/main/src/com/google/refine/expr/functions/arrays/Uniques.java +++ b/main/src/com/google/refine/expr/functions/arrays/Uniques.java @@ -73,7 +73,7 @@ public class Uniques implements Function { @Override public String getDescription() { - return "Returns array a with duplicates removed"; + return "Returns the array with duplicates removed. Case-sensitive."; } @Override diff --git a/main/src/com/google/refine/expr/functions/booleans/And.java b/main/src/com/google/refine/expr/functions/booleans/And.java index fea94814a..35babf268 100644 --- a/main/src/com/google/refine/expr/functions/booleans/And.java +++ b/main/src/com/google/refine/expr/functions/booleans/And.java @@ -56,12 +56,12 @@ public class And implements Function { @Override public String getDescription() { - return "AND two or more booleans to yield a boolean"; + return "Uses the logical operator AND on two or more booleans to output a boolean. Evaluates multiple statements into booleans, then returns true if all of the statements are true. For example, (1 < 3).and(1 < 0) returns false because one condition is true and one is false."; } @Override public String getParams() { - return "boolean a, boolean b"; + return "boolean a, boolean b, ..."; } @Override diff --git a/main/src/com/google/refine/expr/functions/booleans/Not.java b/main/src/com/google/refine/expr/functions/booleans/Not.java index 05b2c7968..bd0637c93 100644 --- a/main/src/com/google/refine/expr/functions/booleans/Not.java +++ b/main/src/com/google/refine/expr/functions/booleans/Not.java @@ -56,7 +56,7 @@ public class Not implements Function { @Override public String getDescription() { - return "Returns the opposite of b"; + return "Uses the logical operator NOT on a boolean to output a boolean. For example, not(1 > 7) returns true because 1 > 7 itself is false."; } @Override diff --git a/main/src/com/google/refine/expr/functions/booleans/Or.java b/main/src/com/google/refine/expr/functions/booleans/Or.java index 91b3a2b6c..7a654ea8e 100644 --- a/main/src/com/google/refine/expr/functions/booleans/Or.java +++ b/main/src/com/google/refine/expr/functions/booleans/Or.java @@ -56,12 +56,12 @@ public class Or implements Function { @Override public String getDescription() { - return "OR two or more booleans to yield a boolean"; + return "Uses the logical operator OR on two or more booleans to output a boolean. For example, (1 < 3).or(1 > 7) returns true because at least one of the conditions (the first one) is true."; } @Override public String getParams() { - return "boolean a, boolean b"; + return "boolean a, boolean b, ..."; } @Override diff --git a/main/src/com/google/refine/expr/functions/booleans/Xor.java b/main/src/com/google/refine/expr/functions/booleans/Xor.java index d104772a5..e4118199a 100644 --- a/main/src/com/google/refine/expr/functions/booleans/Xor.java +++ b/main/src/com/google/refine/expr/functions/booleans/Xor.java @@ -43,12 +43,12 @@ public class Xor implements Function { @Override public String getDescription() { - return "XORs two or more boolean values"; + return "Uses the logical operator XOR (exclusive-or) on two or more booleans to output a boolean. Evaluates multiple statements, then returns true if only one of them is true. For example, (1 < 3).xor(1 < 7) returns false because more than one of the conditions is true."; } @Override public String getParams() { - return "boolean a, boolean b"; + return "boolean a, boolean b, ..."; } @Override diff --git a/main/src/com/google/refine/expr/functions/date/DatePart.java b/main/src/com/google/refine/expr/functions/date/DatePart.java index 6f048310a..0443c3e61 100644 --- a/main/src/com/google/refine/expr/functions/date/DatePart.java +++ b/main/src/com/google/refine/expr/functions/date/DatePart.java @@ -139,12 +139,12 @@ public class DatePart implements Function { @Override public String getDescription() { - return "Returns part of a date"; + return "Returns part of a date. The data type returned depends on the unit. See https://docs.openrefine.org/manual/grelfunctions/#datepartd-s-timeunit for a table. "; } @Override public String getParams() { - return "date d, string part"; + return "date d, string timeUnit"; } @Override diff --git a/main/src/com/google/refine/expr/functions/date/Inc.java b/main/src/com/google/refine/expr/functions/date/Inc.java index a5a3c1c2e..3317ea617 100644 --- a/main/src/com/google/refine/expr/functions/date/Inc.java +++ b/main/src/com/google/refine/expr/functions/date/Inc.java @@ -86,12 +86,12 @@ public class Inc implements Function { @Override public String getDescription() { - return "Returns a date changed by the given amount in the given unit of time"; + return "Returns a date changed by the given amount in the given unit of time, in quotes. See https://docs.openrefine.org/manual/grelfunctions/#incd-n-s-timeunit for a table. The default unit is 'hour'. A positive value increases the date, and a negative value moves it back in time."; } @Override public String getParams() { - return "date d, number value, string unit (default to 'hour')"; + return "date d, number n, string unit"; } @Override diff --git a/main/src/com/google/refine/expr/functions/date/Now.java b/main/src/com/google/refine/expr/functions/date/Now.java index b72d18b02..428d3b254 100644 --- a/main/src/com/google/refine/expr/functions/date/Now.java +++ b/main/src/com/google/refine/expr/functions/date/Now.java @@ -51,7 +51,7 @@ public class Now implements Function { @Override public String getDescription() { - return "Returns the current time"; + return "Returns the current time according to your system clock, in the ISO 8601 extended format (converted to UTC). For example, 10:53am (and 00 seconds) on November 26th 2020 in EST returns [date 2020-11-26T15:53:00Z]."; } @Override diff --git a/main/src/com/google/refine/expr/functions/html/InnerHtml.java b/main/src/com/google/refine/expr/functions/html/InnerHtml.java index 5a0b8b4f8..63cd9cc13 100644 --- a/main/src/com/google/refine/expr/functions/html/InnerHtml.java +++ b/main/src/com/google/refine/expr/functions/html/InnerHtml.java @@ -60,17 +60,17 @@ public class InnerHtml implements Function { @Override public String getDescription() { - return "The innerHtml of an HTML element"; + return "Returns the inner HTML of an HTML element. This will include text and children elements within the element selected. Use it in conjunction with parseHtml() and select() to provide an element."; } @Override public String getParams() { - return "Element e"; + return "element e"; } @Override public String getReturns() { - return "String innerHtml"; + return "string innerHtml"; } } diff --git a/main/src/com/google/refine/expr/functions/html/ParseHtml.java b/main/src/com/google/refine/expr/functions/html/ParseHtml.java index d278da6eb..cc6de672a 100644 --- a/main/src/com/google/refine/expr/functions/html/ParseHtml.java +++ b/main/src/com/google/refine/expr/functions/html/ParseHtml.java @@ -56,7 +56,7 @@ public class ParseHtml implements Function { @Override public String getDescription() { - return "Parses a string as HTML"; + return "Given a cell full of HTML-formatted text, parseHtml() simplifies HTML tags (such as by removing ' /' at the end of self-closing tags), closes any unclosed tags, and inserts linebreaks and indents for cleaner code. A cell cannot store the output of parseHtml() unless you convert it with toString(): for example, value.parseHtml().toString()."; } @Override diff --git a/main/src/com/google/refine/expr/functions/math/ACos.java b/main/src/com/google/refine/expr/functions/math/ACos.java index 99a2632fa..cc9315bff 100644 --- a/main/src/com/google/refine/expr/functions/math/ACos.java +++ b/main/src/com/google/refine/expr/functions/math/ACos.java @@ -51,12 +51,12 @@ public class ACos implements Function { @Override public String getDescription() { - return "Returns the arc cosine of an angle, in the range 0 through PI"; + return "Returns the arc cosine of an angle, in the range 0 through PI."; } @Override public String getParams() { - return "number d"; + return "number n"; } @Override diff --git a/main/src/com/google/refine/expr/functions/math/ASin.java b/main/src/com/google/refine/expr/functions/math/ASin.java index c7cbbeb7c..28c54e421 100644 --- a/main/src/com/google/refine/expr/functions/math/ASin.java +++ b/main/src/com/google/refine/expr/functions/math/ASin.java @@ -51,12 +51,12 @@ public class ASin implements Function { @Override public String getDescription() { - return "Returns the arc sine of an angle in the range of -PI/2 through PI/2"; + return "Returns the arc sine of an angle in the range of -PI/2 through PI/2."; } @Override public String getParams() { - return "number d"; + return "number n"; } @Override diff --git a/main/src/com/google/refine/expr/functions/math/ATan.java b/main/src/com/google/refine/expr/functions/math/ATan.java index 226bd18a6..aaa7e2249 100644 --- a/main/src/com/google/refine/expr/functions/math/ATan.java +++ b/main/src/com/google/refine/expr/functions/math/ATan.java @@ -51,12 +51,12 @@ public class ATan implements Function { @Override public String getDescription() { - return "Returns the arc tangent of an angle in the range of -PI/2 through PI/2"; + return "Returns the arc tangent of an angle in the range of -PI/2 through PI/2."; } @Override public String getParams() { - return "number d"; + return "number n"; } @Override diff --git a/main/src/com/google/refine/expr/functions/math/ATan2.java b/main/src/com/google/refine/expr/functions/math/ATan2.java index 6b2019dd2..3a6d38ee6 100644 --- a/main/src/com/google/refine/expr/functions/math/ATan2.java +++ b/main/src/com/google/refine/expr/functions/math/ATan2.java @@ -52,12 +52,12 @@ public class ATan2 implements Function { @Override public String getDescription() { - return "Converts rectangular coordinates (x, y) to polar (r, theta)"; + return "Converts rectangular coordinates (n1, n2) to polar (r, theta). Returns number theta."; } @Override public String getParams() { - return "number x, number y"; + return "number n1, number n2"; } @Override diff --git a/main/src/com/google/refine/expr/functions/math/Abs.java b/main/src/com/google/refine/expr/functions/math/Abs.java index 14a5cc0cb..3478f4e60 100644 --- a/main/src/com/google/refine/expr/functions/math/Abs.java +++ b/main/src/com/google/refine/expr/functions/math/Abs.java @@ -51,12 +51,12 @@ public class Abs implements Function { @Override public String getDescription() { - return "Returns the absolute value of a number"; + return "Returns the absolute value of a number."; } @Override public String getParams() { - return "number d"; + return "number n"; } @Override diff --git a/main/src/com/google/refine/expr/functions/math/Ceil.java b/main/src/com/google/refine/expr/functions/math/Ceil.java index c986a0429..b373b472c 100644 --- a/main/src/com/google/refine/expr/functions/math/Ceil.java +++ b/main/src/com/google/refine/expr/functions/math/Ceil.java @@ -51,12 +51,12 @@ public class Ceil implements Function { @Override public String getDescription() { - return "Returns the ceiling of a number"; + return "Returns the ceiling of a number."; } @Override public String getParams() { - return "number d"; + return "number n"; } @Override diff --git a/main/src/com/google/refine/expr/functions/math/Combin.java b/main/src/com/google/refine/expr/functions/math/Combin.java index 0e9a120c0..2940fbf35 100644 --- a/main/src/com/google/refine/expr/functions/math/Combin.java +++ b/main/src/com/google/refine/expr/functions/math/Combin.java @@ -85,12 +85,12 @@ public class Combin implements Function { @Override public String getDescription() { - return "Returns the number of combinations for n elements as divided into k"; + return "Returns the number of combinations for n2 elements as divided into n1."; } @Override public String getParams() { - return "number d"; + return "number n1, number n2"; } @Override diff --git a/main/src/com/google/refine/expr/functions/math/Cos.java b/main/src/com/google/refine/expr/functions/math/Cos.java index 6d15df4dc..008bede9e 100644 --- a/main/src/com/google/refine/expr/functions/math/Cos.java +++ b/main/src/com/google/refine/expr/functions/math/Cos.java @@ -51,12 +51,12 @@ public class Cos implements Function { @Override public String getDescription() { - return "Returns the trigonometric cosine of an angle"; + return "Returns the trigonometric cosine of an angle."; } @Override public String getParams() { - return "number d"; + return "number n"; } @Override diff --git a/main/src/com/google/refine/expr/functions/math/Cosh.java b/main/src/com/google/refine/expr/functions/math/Cosh.java index 04420734e..ae9d3e9b3 100644 --- a/main/src/com/google/refine/expr/functions/math/Cosh.java +++ b/main/src/com/google/refine/expr/functions/math/Cosh.java @@ -51,12 +51,12 @@ public class Cosh implements Function { @Override public String getDescription() { - return "Returns the hyperbolic cosine of a value"; + return "Returns the hyperbolic cosine of a value."; } @Override public String getParams() { - return "number d"; + return "number n"; } @Override diff --git a/main/src/com/google/refine/expr/functions/math/Degrees.java b/main/src/com/google/refine/expr/functions/math/Degrees.java index 96c3e3b85..0f25899ec 100644 --- a/main/src/com/google/refine/expr/functions/math/Degrees.java +++ b/main/src/com/google/refine/expr/functions/math/Degrees.java @@ -56,7 +56,7 @@ public class Degrees implements Function { @Override public String getParams() { - return "number d"; + return "number n"; } @Override diff --git a/main/src/com/google/refine/expr/functions/math/Even.java b/main/src/com/google/refine/expr/functions/math/Even.java index 22bef743a..70826609d 100644 --- a/main/src/com/google/refine/expr/functions/math/Even.java +++ b/main/src/com/google/refine/expr/functions/math/Even.java @@ -56,12 +56,12 @@ public class Even implements Function { @Override public String getDescription() { - return "Rounds the number up to the nearest even integer"; + return "Rounds the number up to the nearest even integer."; } @Override public String getParams() { - return "number d"; + return "number n"; } @Override diff --git a/main/src/com/google/refine/expr/functions/math/Exp.java b/main/src/com/google/refine/expr/functions/math/Exp.java index 52f01b688..929cccaa9 100644 --- a/main/src/com/google/refine/expr/functions/math/Exp.java +++ b/main/src/com/google/refine/expr/functions/math/Exp.java @@ -49,7 +49,7 @@ public class Exp implements Function { @Override public String getDescription() { - return "Returns e^n"; + return "Returns e to the power of n."; } @Override diff --git a/main/src/com/google/refine/expr/functions/math/Fact.java b/main/src/com/google/refine/expr/functions/math/Fact.java index b9aa916ce..52a0908e8 100644 --- a/main/src/com/google/refine/expr/functions/math/Fact.java +++ b/main/src/com/google/refine/expr/functions/math/Fact.java @@ -51,12 +51,12 @@ public class Fact implements Function { @Override public String getDescription() { - return "Returns the factorial of a number"; + return "Returns the factorial of a number, starting from 1."; } @Override public String getParams() { - return "number i"; + return "number n"; } @Override diff --git a/main/src/com/google/refine/expr/functions/math/FactN.java b/main/src/com/google/refine/expr/functions/math/FactN.java index dfcb73bbc..0162f843c 100644 --- a/main/src/com/google/refine/expr/functions/math/FactN.java +++ b/main/src/com/google/refine/expr/functions/math/FactN.java @@ -78,12 +78,12 @@ public class FactN implements Function { @Override public String getDescription() { - return "Returns the factorial of a number"; + return "Returns the factorial of n1, starting from n2."; } @Override public String getParams() { - return "number i"; + return "number n1, number n2"; } @Override diff --git a/main/src/com/google/refine/expr/functions/math/Floor.java b/main/src/com/google/refine/expr/functions/math/Floor.java index 2d7602b95..c4ecbaa47 100644 --- a/main/src/com/google/refine/expr/functions/math/Floor.java +++ b/main/src/com/google/refine/expr/functions/math/Floor.java @@ -51,12 +51,12 @@ public class Floor implements Function { @Override public String getDescription() { - return "Returns the floor of a number as an integer"; + return "Returns the floor of a number."; } @Override public String getParams() { - return "number d"; + return "number n"; } @Override diff --git a/main/src/com/google/refine/expr/functions/math/GreatestCommonDenominator.java b/main/src/com/google/refine/expr/functions/math/GreatestCommonDenominator.java index c9a115112..fa15cc11d 100644 --- a/main/src/com/google/refine/expr/functions/math/GreatestCommonDenominator.java +++ b/main/src/com/google/refine/expr/functions/math/GreatestCommonDenominator.java @@ -56,12 +56,12 @@ public class GreatestCommonDenominator implements Function { @Override public String getDescription() { - return "Returns the greatest common denominator of the two numbers"; + return "Returns the greatest common denominator of two numbers."; } @Override public String getParams() { - return "number d, number e"; + return "number n1, number n2"; } @Override diff --git a/main/src/com/google/refine/expr/functions/math/LeastCommonMultiple.java b/main/src/com/google/refine/expr/functions/math/LeastCommonMultiple.java index ad6635421..3dbdf1068 100644 --- a/main/src/com/google/refine/expr/functions/math/LeastCommonMultiple.java +++ b/main/src/com/google/refine/expr/functions/math/LeastCommonMultiple.java @@ -68,12 +68,12 @@ public class LeastCommonMultiple implements Function { @Override public String getDescription() { - return "Returns the greatest common denominator of the two numbers"; + return "Returns the greatest common denominator of two numbers."; } @Override public String getParams() { - return "number d, number e"; + return "number n1, number n2"; } @Override diff --git a/main/src/com/google/refine/expr/functions/math/Ln.java b/main/src/com/google/refine/expr/functions/math/Ln.java index 2da1c4249..bf5cb92e8 100644 --- a/main/src/com/google/refine/expr/functions/math/Ln.java +++ b/main/src/com/google/refine/expr/functions/math/Ln.java @@ -51,7 +51,7 @@ public class Ln implements Function { @Override public String getDescription() { - return "Returns the natural log of n"; + return "Returns the natural logarithm of n."; } @Override diff --git a/main/src/com/google/refine/expr/functions/math/Log.java b/main/src/com/google/refine/expr/functions/math/Log.java index efeac212d..010d58387 100644 --- a/main/src/com/google/refine/expr/functions/math/Log.java +++ b/main/src/com/google/refine/expr/functions/math/Log.java @@ -51,7 +51,7 @@ public class Log implements Function { @Override public String getDescription() { - return "Returns the base 10 log of n"; + return "Returns the base 10 logarithm of n."; } @Override diff --git a/main/src/com/google/refine/expr/functions/math/Max.java b/main/src/com/google/refine/expr/functions/math/Max.java index 8fa28325a..4de3a582b 100644 --- a/main/src/com/google/refine/expr/functions/math/Max.java +++ b/main/src/com/google/refine/expr/functions/math/Max.java @@ -55,12 +55,12 @@ public class Max implements Function { @Override public String getDescription() { - return "Returns the greater of two numbers"; + return "Returns the greater of two numbers."; } @Override public String getParams() { - return "number a, number b"; + return "number n1, number n2"; } @Override diff --git a/main/src/com/google/refine/expr/functions/math/Min.java b/main/src/com/google/refine/expr/functions/math/Min.java index fad87784f..b13e05ac2 100644 --- a/main/src/com/google/refine/expr/functions/math/Min.java +++ b/main/src/com/google/refine/expr/functions/math/Min.java @@ -55,12 +55,12 @@ public class Min implements Function { @Override public String getDescription() { - return "Returns the smaller of two numbers"; + return "Returns the smaller of two numbers."; } @Override public String getParams() { - return "number a, number b"; + return "number n1, number n2"; } @Override diff --git a/main/src/com/google/refine/expr/functions/math/Mod.java b/main/src/com/google/refine/expr/functions/math/Mod.java index 2851f0d1d..57f28e715 100644 --- a/main/src/com/google/refine/expr/functions/math/Mod.java +++ b/main/src/com/google/refine/expr/functions/math/Mod.java @@ -56,12 +56,12 @@ public class Mod implements Function { @Override public String getDescription() { - return "Returns a modulus b"; + return "Returns n1 modulus n2."; } @Override public String getParams() { - return "number a, number b"; + return "number n1, number n2"; } @Override diff --git a/main/src/com/google/refine/expr/functions/math/Multinomial.java b/main/src/com/google/refine/expr/functions/math/Multinomial.java index 64fdfe437..e85a78106 100644 --- a/main/src/com/google/refine/expr/functions/math/Multinomial.java +++ b/main/src/com/google/refine/expr/functions/math/Multinomial.java @@ -61,12 +61,12 @@ public class Multinomial implements Function { @Override public String getDescription() { - return "Calculates the multinomial of a series of numbers"; + return "Calculates the multinomial of one number or a series of numbers."; } @Override public String getParams() { - return "one or more numbers"; + return "number n1, number n2, ..."; } @Override diff --git a/main/src/com/google/refine/expr/functions/math/Odd.java b/main/src/com/google/refine/expr/functions/math/Odd.java index 1c5b6198e..216f79015 100644 --- a/main/src/com/google/refine/expr/functions/math/Odd.java +++ b/main/src/com/google/refine/expr/functions/math/Odd.java @@ -56,12 +56,12 @@ public class Odd implements Function { @Override public String getDescription() { - return "Rounds the number up to the nearest even integer"; + return "Rounds the number up to the nearest odd integer."; } @Override public String getParams() { - return "number d"; + return "number n1"; } @Override diff --git a/main/src/com/google/refine/expr/functions/math/Pow.java b/main/src/com/google/refine/expr/functions/math/Pow.java index dcfa71bdf..6dd341836 100644 --- a/main/src/com/google/refine/expr/functions/math/Pow.java +++ b/main/src/com/google/refine/expr/functions/math/Pow.java @@ -52,12 +52,12 @@ public class Pow implements Function { @Override public String getDescription() { - return "Returns a^b"; + return "Returns n1 raised to the power of n2."; } @Override public String getParams() { - return "number a, number b"; + return "number n1, number n2"; } @Override diff --git a/main/src/com/google/refine/expr/functions/math/Quotient.java b/main/src/com/google/refine/expr/functions/math/Quotient.java index 93f6718a4..c8fca3a30 100644 --- a/main/src/com/google/refine/expr/functions/math/Quotient.java +++ b/main/src/com/google/refine/expr/functions/math/Quotient.java @@ -52,7 +52,7 @@ public class Quotient implements Function { @Override public String getDescription() { - return "Returns the integer portion of a division"; + return "Returns the integer portion of a division (truncated, not rounded), when supplied with a numerator and denominator."; } @Override diff --git a/main/src/com/google/refine/expr/functions/math/Radians.java b/main/src/com/google/refine/expr/functions/math/Radians.java index 9f1115a15..10085e5bf 100644 --- a/main/src/com/google/refine/expr/functions/math/Radians.java +++ b/main/src/com/google/refine/expr/functions/math/Radians.java @@ -51,12 +51,12 @@ public class Radians implements Function { @Override public String getDescription() { - return "Converts an angle in degrees to radians"; + return "Converts an angle in degrees to radians."; } @Override public String getParams() { - return "number d"; + return "number n"; } @Override diff --git a/main/src/com/google/refine/expr/functions/math/RandomNumber.java b/main/src/com/google/refine/expr/functions/math/RandomNumber.java index f1f0a70c1..f4be1933f 100644 --- a/main/src/com/google/refine/expr/functions/math/RandomNumber.java +++ b/main/src/com/google/refine/expr/functions/math/RandomNumber.java @@ -55,12 +55,12 @@ public class RandomNumber implements Function { @Override public String getDescription() { - return "Returns a pseudo-random integer between the lower and upper bound (inclusive)"; + return "Returns a random integer in the interval between the lower and upper bounds (inclusively). Will output a different random number in each cell in a column."; } @Override public String getParams() { - return "number lower bound, number upper bound"; + return "number lowerBound, number upperBound"; } @Override diff --git a/main/src/com/google/refine/expr/functions/math/Round.java b/main/src/com/google/refine/expr/functions/math/Round.java index 4537c3067..762f182b9 100644 --- a/main/src/com/google/refine/expr/functions/math/Round.java +++ b/main/src/com/google/refine/expr/functions/math/Round.java @@ -51,7 +51,7 @@ public class Round implements Function { @Override public String getDescription() { - return "Returns n rounded"; + return "Rounds a number to the nearest integer."; } @Override diff --git a/main/src/com/google/refine/expr/functions/math/Sin.java b/main/src/com/google/refine/expr/functions/math/Sin.java index 599eccb65..ebee2e3ce 100644 --- a/main/src/com/google/refine/expr/functions/math/Sin.java +++ b/main/src/com/google/refine/expr/functions/math/Sin.java @@ -51,12 +51,12 @@ public class Sin implements Function { @Override public String getDescription() { - return "Returns the trigonometric sine of an angle"; + return "Returns the trigonometric sine of an angle."; } @Override public String getParams() { - return "number d"; + return "number n"; } @Override diff --git a/main/src/com/google/refine/expr/functions/math/Sinh.java b/main/src/com/google/refine/expr/functions/math/Sinh.java index 94d0e2d5e..e796eeb9f 100644 --- a/main/src/com/google/refine/expr/functions/math/Sinh.java +++ b/main/src/com/google/refine/expr/functions/math/Sinh.java @@ -51,12 +51,12 @@ public class Sinh implements Function { @Override public String getDescription() { - return "Returns the hyperbolic sine of an angle"; + return "Returns the hyperbolic sine of an angle."; } @Override public String getParams() { - return "number d"; + return "number n"; } @Override diff --git a/main/src/com/google/refine/expr/functions/math/Sum.java b/main/src/com/google/refine/expr/functions/math/Sum.java index 03da9acc5..07f9c437a 100644 --- a/main/src/com/google/refine/expr/functions/math/Sum.java +++ b/main/src/com/google/refine/expr/functions/math/Sum.java @@ -80,7 +80,7 @@ public class Sum implements Function { @Override public String getDescription() { - return "Sums numbers in array a"; + return "Return the sum of the numbers in the array. Ignores non-number items. Returns 0 if the array does not contain numbers."; } @Override diff --git a/main/src/com/google/refine/expr/functions/math/Tan.java b/main/src/com/google/refine/expr/functions/math/Tan.java index b510c75bb..5dd52b826 100644 --- a/main/src/com/google/refine/expr/functions/math/Tan.java +++ b/main/src/com/google/refine/expr/functions/math/Tan.java @@ -51,12 +51,12 @@ public class Tan implements Function { @Override public String getDescription() { - return "Returns the trigonometric tangent of an angle"; + return "Returns the trigonometric tangent of an angle."; } @Override public String getParams() { - return "number d"; + return "number n"; } @Override diff --git a/main/src/com/google/refine/expr/functions/math/Tanh.java b/main/src/com/google/refine/expr/functions/math/Tanh.java index 49be8c5ad..d5e61f565 100644 --- a/main/src/com/google/refine/expr/functions/math/Tanh.java +++ b/main/src/com/google/refine/expr/functions/math/Tanh.java @@ -51,12 +51,12 @@ public class Tanh implements Function { @Override public String getDescription() { - return "Returns the hyperbolic tangent of a value"; + return "Returns the hyperbolic tangent of an angle."; } @Override public String getParams() { - return "number d"; + return "number n"; } @Override diff --git a/main/src/com/google/refine/expr/functions/strings/Chomp.java b/main/src/com/google/refine/expr/functions/strings/Chomp.java index cb9858267..f2dd2140a 100644 --- a/main/src/com/google/refine/expr/functions/strings/Chomp.java +++ b/main/src/com/google/refine/expr/functions/strings/Chomp.java @@ -55,12 +55,12 @@ public class Chomp implements Function { @Override public String getDescription() { - return "Removes separator from the end of str if it's there, otherwise leave it alone."; + return "Returns a copy of string s with string sep remoed from the end if s ends with sep; otherwies, returns s."; } @Override public String getParams() { - return "string str, string separator"; + return "string s, string sep"; } @Override diff --git a/main/src/com/google/refine/expr/functions/strings/Contains.java b/main/src/com/google/refine/expr/functions/strings/Contains.java index 2e7eb41bc..2d846f1d6 100644 --- a/main/src/com/google/refine/expr/functions/strings/Contains.java +++ b/main/src/com/google/refine/expr/functions/strings/Contains.java @@ -62,12 +62,12 @@ public class Contains implements Function { } @Override public String getDescription() { - return "Returns whether s contains frag"; + return "Returns a boolean indicating whether s contains sub, which is either a substring or a regex pattern. For example, \"food\".contains(\"oo\") returns true."; } @Override public String getParams() { - return "string s, string frag"; + return "string s, string or pattern sub"; } @Override diff --git a/main/src/com/google/refine/expr/functions/strings/Diff.java b/main/src/com/google/refine/expr/functions/strings/Diff.java index a41dfdbd5..91b1d9001 100644 --- a/main/src/com/google/refine/expr/functions/strings/Diff.java +++ b/main/src/com/google/refine/expr/functions/strings/Diff.java @@ -99,7 +99,7 @@ public class Diff implements Function { @Override public String getDescription() { - return "For strings, returns the portion where they differ. For dates, it returns the difference in given time units"; + return "For strings, takes two strings and compares them, returning a string. Returns the remainder of o2 starting with the first character where they differ. For dates, returns the difference in given time units. See the time unit table at https://docs.openrefine.org/manual/grelfunctions/#datepartd-s-timeunit."; } @Override diff --git a/main/src/com/google/refine/expr/functions/strings/EndsWith.java b/main/src/com/google/refine/expr/functions/strings/EndsWith.java index 91d51ea44..95389b22c 100644 --- a/main/src/com/google/refine/expr/functions/strings/EndsWith.java +++ b/main/src/com/google/refine/expr/functions/strings/EndsWith.java @@ -55,7 +55,7 @@ public class EndsWith implements Function { @Override public String getDescription() { - return "Returns whether s ends with sub"; + return "Returns a boolean indicating whether s ends with sub. For example, \"food\".endsWith(\"ood\") returns true, whereas \"food\".endsWith(\"odd\") returns false."; } @Override diff --git a/main/src/com/google/refine/expr/functions/strings/Escape.java b/main/src/com/google/refine/expr/functions/strings/Escape.java index c36a8c260..4ea01fafa 100644 --- a/main/src/com/google/refine/expr/functions/strings/Escape.java +++ b/main/src/com/google/refine/expr/functions/strings/Escape.java @@ -84,7 +84,7 @@ public class Escape implements Function { @Override public String getDescription() { - return "Escapes a string depending on the given escaping mode."; + return "Escapes s in the given escaping mode. The mode can be one of: 'html', 'xml', csv', 'url', 'javascript'. Note that quotes are required around your mode."; } @Override diff --git a/main/src/com/google/refine/expr/functions/strings/Find.java b/main/src/com/google/refine/expr/functions/strings/Find.java index 9ab126811..30ca532d6 100644 --- a/main/src/com/google/refine/expr/functions/strings/Find.java +++ b/main/src/com/google/refine/expr/functions/strings/Find.java @@ -65,17 +65,17 @@ public class Find implements Function { return allMatches.toArray(new String[0]); } - return new EvalError(ControlFunctionRegistry.getFunctionName(this) + " expects a string or a regexp"); + return new EvalError(ControlFunctionRegistry.getFunctionName(this) + " expects a string or a regex"); } @Override public String getDescription() { - return "Returns all the occurrences of match given regular expression or simple string"; + return "Outputs an array of all consecutive substrings inside string s that match the substring or regex pattern p. You can supply a substring by putting it in quotes."; } @Override public String getParams() { - return "string or regexp"; + return "string s, substring or regex p"; } @Override diff --git a/main/src/com/google/refine/expr/functions/strings/Fingerprint.java b/main/src/com/google/refine/expr/functions/strings/Fingerprint.java index 46cff1b42..54d0e4a75 100644 --- a/main/src/com/google/refine/expr/functions/strings/Fingerprint.java +++ b/main/src/com/google/refine/expr/functions/strings/Fingerprint.java @@ -55,7 +55,7 @@ public class Fingerprint implements Function { @Override public String getDescription() { - return "Returns the fingerprint of s, a derived string that aims to be a more canonical form of it (this is mostly useful for finding clusters of strings related to the same information)."; + return "Returns the fingerprint of s, a string that is the first step in fingerprint clustering methods: it will trim whitespaces, convert all characters to lowercase, remove punctuation, sort words alphabetically, etc."; } @Override diff --git a/main/src/com/google/refine/expr/functions/strings/IndexOf.java b/main/src/com/google/refine/expr/functions/strings/IndexOf.java index 9edf5d8ca..9056a3f8e 100644 --- a/main/src/com/google/refine/expr/functions/strings/IndexOf.java +++ b/main/src/com/google/refine/expr/functions/strings/IndexOf.java @@ -55,7 +55,7 @@ public class IndexOf implements Function { @Override public String getDescription() { - return "Returns the index of sub first ocurring in s"; + return "Returns the first character index of sub as it first occurs in s; or, returns -1 if s does not contain sub. For example, \"internationalization\".indexOf(\"nation\") returns 5."; } @Override diff --git a/main/src/com/google/refine/expr/functions/strings/LastIndexOf.java b/main/src/com/google/refine/expr/functions/strings/LastIndexOf.java index bab4bf68e..56b83d839 100644 --- a/main/src/com/google/refine/expr/functions/strings/LastIndexOf.java +++ b/main/src/com/google/refine/expr/functions/strings/LastIndexOf.java @@ -55,7 +55,7 @@ public class LastIndexOf implements Function { @Override public String getDescription() { - return "Returns the index of sub last ocurring in s"; + return "Returns the first character index of sub as it last occurs in s; or, returns -1 if s does not contain sub. For example, \"parallel\".lastIndexOf(\"a\") returns 3 (pointing at the second 'a')."; } @Override diff --git a/main/src/com/google/refine/expr/functions/strings/MD5.java b/main/src/com/google/refine/expr/functions/strings/MD5.java index ec2d83136..275fab9a8 100644 --- a/main/src/com/google/refine/expr/functions/strings/MD5.java +++ b/main/src/com/google/refine/expr/functions/strings/MD5.java @@ -55,7 +55,7 @@ public class MD5 implements Function { @Override public String getDescription() { - return "Returns the MD5 hash of s"; + return "Returns the MD5 hash of an object. If fed something other than a string (array, number, date, etc.), md5() will convert it to a string and deliver the hash of the string."; } @Override diff --git a/main/src/com/google/refine/expr/functions/strings/Match.java b/main/src/com/google/refine/expr/functions/strings/Match.java index f92225e37..feeb4c3a6 100644 --- a/main/src/com/google/refine/expr/functions/strings/Match.java +++ b/main/src/com/google/refine/expr/functions/strings/Match.java @@ -71,17 +71,17 @@ public class Match implements Function { return null; } - return new EvalError(ControlFunctionRegistry.getFunctionName(this) + " expects a regexp"); + return new EvalError(ControlFunctionRegistry.getFunctionName(this) + " expects regex"); } @Override public String getDescription() { - return "Returns an array of the groups matching the given regular expression"; + return "Attempts to match the string s in its entirety against the regex pattern p and, if the pattern is found, outputs an array of all capturing groups (found in order)."; } @Override public String getParams() { - return "regexp"; + return "string s, regex p"; } @Override diff --git a/main/src/com/google/refine/expr/functions/strings/NGram.java b/main/src/com/google/refine/expr/functions/strings/NGram.java index e27c9f4c5..769aba557 100644 --- a/main/src/com/google/refine/expr/functions/strings/NGram.java +++ b/main/src/com/google/refine/expr/functions/strings/NGram.java @@ -78,7 +78,7 @@ public class NGram implements Function { @Override public String getDescription() { - return "Returns an array of the word ngrams of s"; + return "Returns an array of the word n-grams of s. That is, it lists all the possible consecutive combinations of n words in the string."; } @Override diff --git a/main/src/com/google/refine/expr/functions/strings/NGramFingerprint.java b/main/src/com/google/refine/expr/functions/strings/NGramFingerprint.java index c35c03ce9..6a9aff45f 100644 --- a/main/src/com/google/refine/expr/functions/strings/NGramFingerprint.java +++ b/main/src/com/google/refine/expr/functions/strings/NGramFingerprint.java @@ -74,7 +74,7 @@ public class NGramFingerprint implements Function { @Override public String getDescription() { - return "Returns the n-gram fingerprint of s"; + return "Returns the n-gram fingerprint of s."; } @Override diff --git a/main/src/com/google/refine/expr/functions/strings/ParseJson.java b/main/src/com/google/refine/expr/functions/strings/ParseJson.java index c858ea0bd..39ea8931f 100644 --- a/main/src/com/google/refine/expr/functions/strings/ParseJson.java +++ b/main/src/com/google/refine/expr/functions/strings/ParseJson.java @@ -61,7 +61,7 @@ public class ParseJson implements Function { @Override public String getDescription() { - return "Parses a string as JSON"; + return "Parses a string as JSON."; } @Override diff --git a/main/src/com/google/refine/expr/functions/strings/Partition.java b/main/src/com/google/refine/expr/functions/strings/Partition.java index ee7acabb9..941f0e125 100644 --- a/main/src/com/google/refine/expr/functions/strings/Partition.java +++ b/main/src/com/google/refine/expr/functions/strings/Partition.java @@ -100,12 +100,12 @@ public class Partition implements Function { @Override public String getDescription() { return - "Returns an array of strings [a,frag,b] where a is the string part before the first occurrence of frag in s and b is what's left. If omitFragment is true, frag is not returned."; + "Returns an array of strings [ a, fragment, z ] where a is the substring within s before the first occurrence of fragment, and z is the substring after fragment. Fragment can be a string or a regex. If omitFragment is true, frag is not returned."; } @Override public String getParams() { - return "string s, string or regex frag, optional boolean omitFragment"; + return "string s, string or regex fragment, optional boolean omitFragment"; } @Override diff --git a/main/src/com/google/refine/expr/functions/strings/Phonetic.java b/main/src/com/google/refine/expr/functions/strings/Phonetic.java index 8b1887948..b73c7c15c 100644 --- a/main/src/com/google/refine/expr/functions/strings/Phonetic.java +++ b/main/src/com/google/refine/expr/functions/strings/Phonetic.java @@ -101,7 +101,7 @@ public class Phonetic implements Function { @Override public String getDescription() { - return "Returns the a phonetic encoding of s (optionally indicating which encoding to use')"; + return "Returns a phonetic encoding of a string, based on an available phonetic algorithm. Can be one of the following supported phonetic methods: metaphone, doublemetaphone, metaphone3, soundex, cologne. Defaults to 'metaphone3'."; } @Override diff --git a/main/src/com/google/refine/expr/functions/strings/RPartition.java b/main/src/com/google/refine/expr/functions/strings/RPartition.java index caf155b84..b8a96b585 100644 --- a/main/src/com/google/refine/expr/functions/strings/RPartition.java +++ b/main/src/com/google/refine/expr/functions/strings/RPartition.java @@ -101,12 +101,12 @@ public class RPartition implements Function { @Override public String getDescription() { return - "Returns an array of strings [a,frag,b] where a is the string part before the last occurrence of frag in s and b is what's left. If omitFragment is true, frag is not returned."; + "Returns an array of strings [ a, fragment, z ] where a is the substring within s before the last occurrence of fragment, and z is the substring after the last instance of fragment. If omitFragment is true, frag is not returned."; } @Override public String getParams() { - return "string s, string or regex frag, optional boolean omitFragment"; + return "string s, string or regex fragment, optional boolean omitFragment"; } @Override diff --git a/main/src/com/google/refine/expr/functions/strings/Reinterpret.java b/main/src/com/google/refine/expr/functions/strings/Reinterpret.java index c11cee24a..101243a7b 100644 --- a/main/src/com/google/refine/expr/functions/strings/Reinterpret.java +++ b/main/src/com/google/refine/expr/functions/strings/Reinterpret.java @@ -97,7 +97,7 @@ public class Reinterpret implements Function { @Override public String getDescription() { - return "Returns s reinterpreted using a target encoding and optional source encoding."; + return "Returns s reinterpreted through the given character encoders. You must supply one of the supported encodings for each of the original source and the target output: https://docs.oracle.com/javase/1.5.0/docs/guide/intl/encoding.doc.html. Note that quotes are required around character encoders."; } @Override diff --git a/main/src/com/google/refine/expr/functions/strings/Replace.java b/main/src/com/google/refine/expr/functions/strings/Replace.java index 017dc082e..86b2636dc 100644 --- a/main/src/com/google/refine/expr/functions/strings/Replace.java +++ b/main/src/com/google/refine/expr/functions/strings/Replace.java @@ -65,12 +65,12 @@ public class Replace implements Function { @Override public String getDescription() { - return "Returns the string obtained by replacing f with r in s"; + return "Returns the string obtained by replacing the find string with the replace string in the inputted string. For example, 'The cow jumps over the moon and moos'.replace('oo', 'ee') returns the string 'The cow jumps over the meen and mees'. Find can be a regex pattern."; } @Override public String getParams() { - return "string s, string or regex f, string r"; + return "string s, string or regex find, string replace"; } @Override diff --git a/main/src/com/google/refine/expr/functions/strings/ReplaceChars.java b/main/src/com/google/refine/expr/functions/strings/ReplaceChars.java index 320df6055..b67957b80 100644 --- a/main/src/com/google/refine/expr/functions/strings/ReplaceChars.java +++ b/main/src/com/google/refine/expr/functions/strings/ReplaceChars.java @@ -60,12 +60,12 @@ public class ReplaceChars implements Function { @Override public String getDescription() { - return "Returns the string obtained by replacing all chars in f with the char in s at that same position"; + return "Returns the string obtained by replacing a character in s, identified by find, with the corresponding character identified in replace. You cannot use this to replace a single character with more than one character."; } @Override public String getParams() { - return "string s, string f, string r"; + return "string s, string find, string replace"; } @Override diff --git a/main/src/com/google/refine/expr/functions/strings/SHA1.java b/main/src/com/google/refine/expr/functions/strings/SHA1.java index abb9f00a1..3f9d1f861 100644 --- a/main/src/com/google/refine/expr/functions/strings/SHA1.java +++ b/main/src/com/google/refine/expr/functions/strings/SHA1.java @@ -55,7 +55,7 @@ public class SHA1 implements Function { @Override public String getDescription() { - return "Returns the SHA-1 hash of s"; + return "Returns the SHA-1 hash of an object. If fed something other than a string (array, number, date, etc.), sha1() will convert it to a string and deliver the hash of the string."; } @Override diff --git a/main/src/com/google/refine/expr/functions/strings/SmartSplit.java b/main/src/com/google/refine/expr/functions/strings/SmartSplit.java index 6e01ca95b..5894c0638 100644 --- a/main/src/com/google/refine/expr/functions/strings/SmartSplit.java +++ b/main/src/com/google/refine/expr/functions/strings/SmartSplit.java @@ -102,7 +102,7 @@ public class SmartSplit implements Function { @Override public String getDescription() { - return "Returns the array of strings obtained by splitting s with separator sep. Handles quotes properly. Guesses tab or comma separator if \"sep\" is not given."; + return "Returns the array of strings obtained by splitting s by sep, or by guessing either tab or comma separation if there is no sep given. Handles quotes properly and understands cancelled characters. The separator can be either a string or a regex pattern."; } @Override diff --git a/main/src/com/google/refine/expr/functions/strings/Split.java b/main/src/com/google/refine/expr/functions/strings/Split.java index 3a47fd8d8..c12448fbc 100644 --- a/main/src/com/google/refine/expr/functions/strings/Split.java +++ b/main/src/com/google/refine/expr/functions/strings/Split.java @@ -75,12 +75,12 @@ public class Split implements Function { @Override public String getDescription() { - return "Returns the array of strings obtained by splitting s with separator sep. If preserveAllTokens is true, then empty segments are preserved."; + return "Returns the array of strings obtained by splitting s by sep. The separator can be either a string or a regex pattern. If preserveTokens is true, empty segments are preserved."; } @Override public String getParams() { - return "string s, string or regex sep, optional boolean preserveAllTokens"; + return "string s, string or regex sep, optional boolean preserveTokens"; } @Override diff --git a/main/src/com/google/refine/expr/functions/strings/SplitByCharType.java b/main/src/com/google/refine/expr/functions/strings/SplitByCharType.java index 4f2980cb8..369626b52 100644 --- a/main/src/com/google/refine/expr/functions/strings/SplitByCharType.java +++ b/main/src/com/google/refine/expr/functions/strings/SplitByCharType.java @@ -57,7 +57,7 @@ public class SplitByCharType implements Function { @Override public String getDescription() { - return "Returns an array of strings obtained by splitting s grouping consecutive chars by their unicode type"; + return "Returns an array of strings obtained by splitting s into groups of consecutive characters each time the characters change Unicode categories."; } @Override diff --git a/main/src/com/google/refine/expr/functions/strings/SplitByLengths.java b/main/src/com/google/refine/expr/functions/strings/SplitByLengths.java index 41c88ce62..69b0ea242 100644 --- a/main/src/com/google/refine/expr/functions/strings/SplitByLengths.java +++ b/main/src/com/google/refine/expr/functions/strings/SplitByLengths.java @@ -69,12 +69,12 @@ public class SplitByLengths implements Function { @Override public String getDescription() { - return "Returns the array of strings obtained by splitting s into substrings with the given lengths"; + return "Returns the array of strings obtained by splitting s into substrings with the given lengths. For example, \"internationalization\".splitByLengths(5, 6, 3) returns an array of 3 strings: [ \"inter\", \"nation\", \"ali\" ]. Excess characters are discarded."; } @Override public String getParams() { - return "string s, number n, ..."; + return "string s, number n1, number n2, ..."; } @Override diff --git a/main/src/com/google/refine/expr/functions/strings/StartsWith.java b/main/src/com/google/refine/expr/functions/strings/StartsWith.java index 51a803618..f6d720679 100644 --- a/main/src/com/google/refine/expr/functions/strings/StartsWith.java +++ b/main/src/com/google/refine/expr/functions/strings/StartsWith.java @@ -54,7 +54,7 @@ public class StartsWith implements Function { } @Override public String getDescription() { - return "Returns whether s starts with sub"; + return "Returns a boolean indicating whether s starts with sub. For example, \"food\".startsWith(\"foo\") returns true, whereas \"food\".startsWith(\"bar\") returns false."; } @Override diff --git a/main/src/com/google/refine/expr/functions/strings/ToLowercase.java b/main/src/com/google/refine/expr/functions/strings/ToLowercase.java index 2647b7112..e0c7196fc 100644 --- a/main/src/com/google/refine/expr/functions/strings/ToLowercase.java +++ b/main/src/com/google/refine/expr/functions/strings/ToLowercase.java @@ -52,7 +52,7 @@ public class ToLowercase implements Function { @Override public String getDescription() { - return "Returns s converted to lowercase"; + return "Returns string s converted to all lowercase characters."; } @Override diff --git a/main/src/com/google/refine/expr/functions/strings/ToTitlecase.java b/main/src/com/google/refine/expr/functions/strings/ToTitlecase.java index fe376493b..2b149f29b 100644 --- a/main/src/com/google/refine/expr/functions/strings/ToTitlecase.java +++ b/main/src/com/google/refine/expr/functions/strings/ToTitlecase.java @@ -63,7 +63,7 @@ public class ToTitlecase implements Function { @Override public String getDescription() { - return "Returns s converted to titlecase"; + return "Returns string s converted into titlecase: a capital letter starting each word, and the rest of the letters lowercase. For example, 'Once upon a midnight DREARY'.toTitlecase() returns the string 'Once Upon A Midnight Dreary'."; } @Override diff --git a/main/src/com/google/refine/expr/functions/strings/ToUppercase.java b/main/src/com/google/refine/expr/functions/strings/ToUppercase.java index bfe0e1246..9c0116ba0 100644 --- a/main/src/com/google/refine/expr/functions/strings/ToUppercase.java +++ b/main/src/com/google/refine/expr/functions/strings/ToUppercase.java @@ -52,7 +52,7 @@ public class ToUppercase implements Function { @Override public String getDescription() { - return "Returns s converted to uppercase"; + return "Returns string s converted to all uppercase characters."; } @Override diff --git a/main/src/com/google/refine/expr/functions/strings/Trim.java b/main/src/com/google/refine/expr/functions/strings/Trim.java index 89cf1ac08..cf66cbe84 100644 --- a/main/src/com/google/refine/expr/functions/strings/Trim.java +++ b/main/src/com/google/refine/expr/functions/strings/Trim.java @@ -53,7 +53,7 @@ public class Trim implements Function { } @Override public String getDescription() { - return "Returns copy of the string, with leading and trailing whitespace omitted."; + return "Returns a copy of string s with leading and trailing whitespace removed."; } @Override diff --git a/main/src/com/google/refine/expr/functions/strings/Unescape.java b/main/src/com/google/refine/expr/functions/strings/Unescape.java index 08f9461a0..b1aa09089 100644 --- a/main/src/com/google/refine/expr/functions/strings/Unescape.java +++ b/main/src/com/google/refine/expr/functions/strings/Unescape.java @@ -75,7 +75,7 @@ public class Unescape implements Function { @Override public String getDescription() { - return "Unescapes all escaped parts of the string depending on the given escaping mode."; + return "Unescapes s in the given escaping mode. The mode can be one of: 'html', 'xml', 'csv', 'url', 'javascript'. Note that quotes are required around your mode. "; } @Override diff --git a/main/src/com/google/refine/expr/functions/strings/Unicode.java b/main/src/com/google/refine/expr/functions/strings/Unicode.java index 69e0f8bee..391b7ce30 100644 --- a/main/src/com/google/refine/expr/functions/strings/Unicode.java +++ b/main/src/com/google/refine/expr/functions/strings/Unicode.java @@ -55,7 +55,7 @@ public class Unicode implements Function { @Override public String getDescription() { - return "Returns an array of strings describing each character of s in their full unicode notation"; + return "Returns an array of strings describing each character of s in their full unicode notation."; } @Override diff --git a/main/src/com/google/refine/expr/functions/strings/UnicodeType.java b/main/src/com/google/refine/expr/functions/strings/UnicodeType.java index 7bf2eb0f9..e52b42758 100644 --- a/main/src/com/google/refine/expr/functions/strings/UnicodeType.java +++ b/main/src/com/google/refine/expr/functions/strings/UnicodeType.java @@ -92,7 +92,7 @@ public class UnicodeType implements Function { @Override public String getDescription() { - return "Returns an array of strings describing each character of s in their full unicode notation"; + return "Returns an array of strings describing each character of s by their unicode type."; } @Override diff --git a/main/src/com/google/refine/expr/functions/xml/InnerXml.java b/main/src/com/google/refine/expr/functions/xml/InnerXml.java index 49e59ab83..77dbe969b 100644 --- a/main/src/com/google/refine/expr/functions/xml/InnerXml.java +++ b/main/src/com/google/refine/expr/functions/xml/InnerXml.java @@ -70,17 +70,17 @@ public class InnerXml implements Function { @Override public String getDescription() { - return "The innerXml/innerHtml of an XML/HTML element"; + return "Returns the inner XML elements of an XML element. Does not return the text directly inside your chosen XML element - only the contents of its children. Use it in conjunction with parseXml() and select() to provide an element."; } @Override public String getParams() { - return "Element e"; + return "element e"; } @Override public String getReturns() { - return "String innerXml/innerHtml"; + return "string innerXml"; } } diff --git a/main/src/com/google/refine/expr/functions/xml/OwnText.java b/main/src/com/google/refine/expr/functions/xml/OwnText.java index 0604f8899..1a0cbf79a 100644 --- a/main/src/com/google/refine/expr/functions/xml/OwnText.java +++ b/main/src/com/google/refine/expr/functions/xml/OwnText.java @@ -61,17 +61,17 @@ public class OwnText implements Function { @Override public String getDescription() { - return "Gets the text owned by this XML/HTML element only; does not get the combined text of all children."; + return "Returns the text directly inside the selected XML or HTML element only, ignoring text inside children elements (for this, use innerXml()). Use it in conjunction with a parser and select() to provide an element."; } @Override public String getParams() { - return "Element e"; + return "element e"; } @Override public String getReturns() { - return "String ownText"; + return "string ownText"; } } diff --git a/main/src/com/google/refine/expr/functions/xml/ParseXml.java b/main/src/com/google/refine/expr/functions/xml/ParseXml.java index 047667f1f..8361bba86 100644 --- a/main/src/com/google/refine/expr/functions/xml/ParseXml.java +++ b/main/src/com/google/refine/expr/functions/xml/ParseXml.java @@ -68,7 +68,7 @@ public class ParseXml implements Function { @Override public String getDescription() { - return "Parses a string as XML"; + return "Given a cell full of XML-formatted text, parseXml() returns a full XML document and adds any missing closing tags."; } @Override diff --git a/main/src/com/google/refine/expr/functions/xml/SelectXml.java b/main/src/com/google/refine/expr/functions/xml/SelectXml.java index fff66aac6..695dc1597 100644 --- a/main/src/com/google/refine/expr/functions/xml/SelectXml.java +++ b/main/src/com/google/refine/expr/functions/xml/SelectXml.java @@ -63,12 +63,12 @@ public class SelectXml implements Function { @Override public String getDescription() { - return "Selects an element from an XML or HTML elementn using selector syntax."; + return "Returns an array of all the desired elements from an HTML or XML document, if the element exists. Elements are identified using the Jsoup selector syntax: https://jsoup.org/apidocs/org/jsoup/select/Selector.html."; } @Override public String getParams() { - return "Element e, String s"; + return "string s, element e"; } @Override diff --git a/main/src/com/google/refine/expr/functions/xml/WholeText.java b/main/src/com/google/refine/expr/functions/xml/WholeText.java index 61d667023..8dba04283 100644 --- a/main/src/com/google/refine/expr/functions/xml/WholeText.java +++ b/main/src/com/google/refine/expr/functions/xml/WholeText.java @@ -61,16 +61,16 @@ public class WholeText implements Function { @Override public String getDescription() { - return "Selects the (unencoded) text of an element and its children, including any newlines and spaces, and returns unencoded, un-normalized text"; + return "Selects the (unencoded) text of an element and its children, including any new lines and spaces, and returns a string of unencoded, un-normalized text. Use it in conjunction with parseHtml() and select() to provide an element."; } @Override public String getParams() { - return "Element e"; + return "element e"; } @Override public String getReturns() { - return "String text"; + return "string"; } } diff --git a/main/src/com/google/refine/expr/functions/xml/XmlAttr.java b/main/src/com/google/refine/expr/functions/xml/XmlAttr.java index 626514efa..2148d2a7f 100644 --- a/main/src/com/google/refine/expr/functions/xml/XmlAttr.java +++ b/main/src/com/google/refine/expr/functions/xml/XmlAttr.java @@ -63,17 +63,17 @@ public class XmlAttr implements Function { @Override public String getDescription() { - return "Selects a value from an attribute on an XML or HTML Element"; + return "Returns a string from an attribute on an XML or HTML element. Use it in conjunction with parseHtml() or parseXml() to point to an element first."; } @Override public String getParams() { - return "Element e, String s"; + return "string s, element e"; } @Override public String getReturns() { - return "String attribute Value"; + return "string attribute value"; } } diff --git a/main/src/com/google/refine/expr/functions/xml/XmlText.java b/main/src/com/google/refine/expr/functions/xml/XmlText.java index 8d9167a3b..313491c4e 100644 --- a/main/src/com/google/refine/expr/functions/xml/XmlText.java +++ b/main/src/com/google/refine/expr/functions/xml/XmlText.java @@ -61,7 +61,7 @@ public class XmlText implements Function { @Override public String getDescription() { - return "Selects the text from within an element (including all child elements)"; + return "Returns a string of the text from within an HTML or XML element (including all child elements), removing tags and line breaks inside the string. Use it in conjunction with parseHtml() or parseXml() and select() to provide an element."; } @Override diff --git a/main/tests/server/src/com/google/refine/expr/functions/CoalesceTests.java b/main/tests/server/src/com/google/refine/expr/functions/CoalesceTests.java index f545e3d5d..82d9f4f53 100644 --- a/main/tests/server/src/com/google/refine/expr/functions/CoalesceTests.java +++ b/main/tests/server/src/com/google/refine/expr/functions/CoalesceTests.java @@ -82,10 +82,4 @@ public class CoalesceTests extends RefineTest { Assert.assertEquals(invoke("coalesce", (Object) null, ZERO_TO_TWO),ZERO_TO_TWO); } - @Test - public void serializeCoalesce() { - String json = "{\"description\":\"Returns the first non-null from a series of values\",\"params\":\"two or more objects\",\"returns\":\"object or null\"}"; - TestUtils.isSerializedTo(new Coalesce(), json); - } - } diff --git a/main/tests/server/src/com/google/refine/expr/functions/CrossTests.java b/main/tests/server/src/com/google/refine/expr/functions/CrossTests.java index a8638e36f..3acd34062 100644 --- a/main/tests/server/src/com/google/refine/expr/functions/CrossTests.java +++ b/main/tests/server/src/com/google/refine/expr/functions/CrossTests.java @@ -371,14 +371,5 @@ public class CrossTests extends RefineTest { "cross expects a cell or value, a project name to look up (optional), and a column name in that project (optional)"); } - @Test - public void serializeCross() { - String json = "{\"description\":\"Looks up the given value in the target column of the target project, returns an array of matched rows. Two values match if and only if they have the same string representation. " + - "The first argument will be interpreted as cell.value if set to cell. " + - "The second argument will be interpreted as the current project name if omitted or set to \\\"\\\". " + - "The third argument will be interpreted as the index (starts from 0) column if omitted or set to \\\"\\\"\"," + - "\"params\":\"cell or value, string projectName (optional), string columnName (optional)\",\"returns\":\"array\"}"; - TestUtils.isSerializedTo(new Cross(), json); - } } diff --git a/main/tests/server/src/com/google/refine/expr/functions/FacetCountTests.java b/main/tests/server/src/com/google/refine/expr/functions/FacetCountTests.java index b6c2bc2a6..ec2f612dc 100644 --- a/main/tests/server/src/com/google/refine/expr/functions/FacetCountTests.java +++ b/main/tests/server/src/com/google/refine/expr/functions/FacetCountTests.java @@ -31,10 +31,5 @@ import org.testng.annotations.Test; import com.google.refine.util.TestUtils; public class FacetCountTests { - @Test - public void serializeFacetCount() { - String json = "{\"description\":\"Returns the facet count corresponding to the given choice value\",\"params\":\"choiceValue, string facetExpression, string columnName\",\"returns\":\"number\"}"; - TestUtils.isSerializedTo(new FacetCount(), json); - } } diff --git a/main/tests/server/src/com/google/refine/expr/functions/GetTests.java b/main/tests/server/src/com/google/refine/expr/functions/GetTests.java index b9f515df8..4a1118e0e 100644 --- a/main/tests/server/src/com/google/refine/expr/functions/GetTests.java +++ b/main/tests/server/src/com/google/refine/expr/functions/GetTests.java @@ -66,12 +66,6 @@ public class GetTests extends RefineTest { bindings = null; } - @Test - public void serializeGet() { - String json = "{\"description\":\"If o has fields, returns the field named 'from' of o. If o is an array, returns o[from, to]. if o is a string, returns o.substring(from, to)\",\"params\":\"o, number or string from, optional number to\",\"returns\":\"Depends on actual arguments\"}"; - TestUtils.isSerializedTo(new Get(), json); - } - @Test public void testGetJsonFieldExists() throws ParsingException { String test[] = { "\"[{\\\"one\\\": \\\"1\\\"}]\".parseJson()[0].one", "1" }; diff --git a/main/tests/server/src/com/google/refine/expr/functions/HasFieldTests.java b/main/tests/server/src/com/google/refine/expr/functions/HasFieldTests.java index b1d5af35b..81e68a340 100644 --- a/main/tests/server/src/com/google/refine/expr/functions/HasFieldTests.java +++ b/main/tests/server/src/com/google/refine/expr/functions/HasFieldTests.java @@ -31,10 +31,5 @@ import org.testng.annotations.Test; import com.google.refine.util.TestUtils; public class HasFieldTests { - @Test - public void serializeHasField() { - String json = "{\"description\":\"Returns whether o has field name\",\"params\":\"o, string name\",\"returns\":\"boolean\"}"; - TestUtils.isSerializedTo(new HasField(), json); - } } diff --git a/main/tests/server/src/com/google/refine/expr/functions/JsonizeTests.java b/main/tests/server/src/com/google/refine/expr/functions/JsonizeTests.java index efdbc22c8..aa51f3c78 100644 --- a/main/tests/server/src/com/google/refine/expr/functions/JsonizeTests.java +++ b/main/tests/server/src/com/google/refine/expr/functions/JsonizeTests.java @@ -31,10 +31,5 @@ import org.testng.annotations.Test; import com.google.refine.util.TestUtils; public class JsonizeTests { - @Test - public void serializeJsonize() { - String json = "{\"description\":\"Quotes a value as a JSON literal value\",\"params\":\"value\",\"returns\":\"JSON literal value\"}"; - TestUtils.isSerializedTo(new Jsonize(), json); - } } diff --git a/main/tests/server/src/com/google/refine/expr/functions/LengthTests.java b/main/tests/server/src/com/google/refine/expr/functions/LengthTests.java index 403bb0afd..ad783efe8 100644 --- a/main/tests/server/src/com/google/refine/expr/functions/LengthTests.java +++ b/main/tests/server/src/com/google/refine/expr/functions/LengthTests.java @@ -31,10 +31,5 @@ import org.testng.annotations.Test; import com.google.refine.util.TestUtils; public class LengthTests { - @Test - public void serializeLength() { - String json = "{\"description\":\"Returns the length of o\",\"params\":\"array or string o\",\"returns\":\"number\"}"; - TestUtils.isSerializedTo(new Length(), json); - } } diff --git a/main/tests/server/src/com/google/refine/expr/functions/SliceTests.java b/main/tests/server/src/com/google/refine/expr/functions/SliceTests.java index a40082459..c6b6cad03 100644 --- a/main/tests/server/src/com/google/refine/expr/functions/SliceTests.java +++ b/main/tests/server/src/com/google/refine/expr/functions/SliceTests.java @@ -31,10 +31,5 @@ import org.testng.annotations.Test; import com.google.refine.util.TestUtils; public class SliceTests { - @Test - public void serializeSlice() { - String json = "{\"description\":\"If o is an array, returns o[from, to]. if o is a string, returns o.substring(from, to)\",\"params\":\"o, number from, optional number to\",\"returns\":\"Depends on actual arguments\"}"; - TestUtils.isSerializedTo(new Slice(), json); - } } diff --git a/main/tests/server/src/com/google/refine/expr/functions/ToDateTests.java b/main/tests/server/src/com/google/refine/expr/functions/ToDateTests.java index 49c57c17f..2a2663914 100644 --- a/main/tests/server/src/com/google/refine/expr/functions/ToDateTests.java +++ b/main/tests/server/src/com/google/refine/expr/functions/ToDateTests.java @@ -41,12 +41,6 @@ import com.google.refine.expr.util.CalendarParserException; import com.google.refine.util.TestUtils; public class ToDateTests extends RefineTest { - @Test - public void serializeToDate() { - String json = "{\"description\":\"Returns o converted to a date object, you can hint if the day or the month is listed first, or give an ordered list of possible formats using this syntax: http://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html\",\"params\":\"o, boolean month_first / format1, format2, ... (all optional)\",\"returns\":\"date\"}"; - TestUtils.isSerializedTo(new ToDate(), json); - } - @Test public void testToDate() throws CalendarParserException { TimeZone originalTimeZone = TimeZone.getDefault(); diff --git a/main/tests/server/src/com/google/refine/expr/functions/ToNumberTests.java b/main/tests/server/src/com/google/refine/expr/functions/ToNumberTests.java index 3942a7232..6cf061adb 100644 --- a/main/tests/server/src/com/google/refine/expr/functions/ToNumberTests.java +++ b/main/tests/server/src/com/google/refine/expr/functions/ToNumberTests.java @@ -43,12 +43,6 @@ public class ToNumberTests extends RefineTest { private static final Double EPSILON = 0.000001; static Properties bindings = new Properties(); - @Test - public void serializeToNumber() { - String json = "{\"description\":\"Returns o converted to a number\",\"params\":\"o\",\"returns\":\"number\"}"; - TestUtils.isSerializedTo(new ToNumber(), json); - } - @Test public void testConversions() { Function f = new ToNumber(); diff --git a/main/tests/server/src/com/google/refine/expr/functions/ToStringTests.java b/main/tests/server/src/com/google/refine/expr/functions/ToStringTests.java index 14eef7be0..ad0fe60d6 100644 --- a/main/tests/server/src/com/google/refine/expr/functions/ToStringTests.java +++ b/main/tests/server/src/com/google/refine/expr/functions/ToStringTests.java @@ -38,12 +38,6 @@ import com.google.refine.expr.util.CalendarParserException; import com.google.refine.util.TestUtils; public class ToStringTests extends RefineTest { - @Test - public void serializeToString() { - String json = "{\"description\":\"Returns o converted to a string\",\"params\":\"o, string format (optional)\",\"returns\":\"string\"}"; - TestUtils.isSerializedTo(new ToString(), json); - } - @Test public void testToString() throws CalendarParserException { assertTrue(invoke("toString") instanceof EvalError); diff --git a/main/tests/server/src/com/google/refine/expr/functions/TypeTests.java b/main/tests/server/src/com/google/refine/expr/functions/TypeTests.java index 56b4baab7..05d193d41 100644 --- a/main/tests/server/src/com/google/refine/expr/functions/TypeTests.java +++ b/main/tests/server/src/com/google/refine/expr/functions/TypeTests.java @@ -79,11 +79,5 @@ public class TypeTests extends RefineTest { Assert.assertEquals(invoke("type", dateTimeValue), "date"); Assert.assertEquals(invoke("type", listArray), "array"); } - - @Test - public void serializeType() { - String json = "{\"description\":\"Returns the type of o as a string ('string', 'date', 'number', 'array', 'boolean' or a class name)\",\"params\":\"object o\",\"returns\":\"string\"}"; - TestUtils.isSerializedTo(new Type(), json); - } } diff --git a/main/tests/server/src/com/google/refine/expr/functions/arrays/InArrayTests.java b/main/tests/server/src/com/google/refine/expr/functions/arrays/InArrayTests.java index 09e7549a6..05be42d55 100644 --- a/main/tests/server/src/com/google/refine/expr/functions/arrays/InArrayTests.java +++ b/main/tests/server/src/com/google/refine/expr/functions/arrays/InArrayTests.java @@ -45,13 +45,6 @@ public class InArrayTests extends RefineTest { static final List listArray = Arrays.asList("v1", "v2", "v3"); static final String stringArray[] = {"v1","v2","v3"}; - - @Test - public void serializeInArray() { - String json = "{\"description\":\"Checks if array a contains string s\",\"params\":\"array a, string s\",\"returns\":\"boolean\"}"; - TestUtils.isSerializedTo(new InArray(), json); - } - @Test public void testInArrayParameters() { Assert.assertTrue(invoke("inArray") instanceof EvalError); diff --git a/main/tests/server/src/com/google/refine/expr/functions/arrays/JoinTests.java b/main/tests/server/src/com/google/refine/expr/functions/arrays/JoinTests.java index 47bfdd061..98fd316a6 100644 --- a/main/tests/server/src/com/google/refine/expr/functions/arrays/JoinTests.java +++ b/main/tests/server/src/com/google/refine/expr/functions/arrays/JoinTests.java @@ -33,12 +33,6 @@ import com.google.refine.expr.ParsingException; import com.google.refine.util.TestUtils; public class JoinTests extends RefineTest { - @Test - public void serializeJoin() { - String json = "{\"description\":\"Returns the string obtained by joining the array a with the separator sep\",\"params\":\"array a, string sep\",\"returns\":\"string\"}"; - TestUtils.isSerializedTo(new Join(), json); - } - @Test public void joinArray() throws ParsingException { String[] test = {"[2,1,3].join('|')", "2|1|3"}; diff --git a/main/tests/server/src/com/google/refine/expr/functions/arrays/ReverseTests.java b/main/tests/server/src/com/google/refine/expr/functions/arrays/ReverseTests.java index 81c31e003..ec0f2ffed 100644 --- a/main/tests/server/src/com/google/refine/expr/functions/arrays/ReverseTests.java +++ b/main/tests/server/src/com/google/refine/expr/functions/arrays/ReverseTests.java @@ -33,12 +33,6 @@ import com.google.refine.expr.ParsingException; import com.google.refine.util.TestUtils; public class ReverseTests extends RefineTest { - @Test - public void serializeReverse() { - String json = "{\"description\":\"Reverses array a\",\"params\":\"array a\",\"returns\":\"array\"}"; - TestUtils.isSerializedTo(new Reverse(), json); - } - @Test public void reverseJsonArray() throws ParsingException { String[] test = {"'[2,1,3]'.parseJson().reverse().toString()", "[3, 1, 2]"}; diff --git a/main/tests/server/src/com/google/refine/expr/functions/arrays/SortTests.java b/main/tests/server/src/com/google/refine/expr/functions/arrays/SortTests.java index 4a2879a7d..ebce0574d 100644 --- a/main/tests/server/src/com/google/refine/expr/functions/arrays/SortTests.java +++ b/main/tests/server/src/com/google/refine/expr/functions/arrays/SortTests.java @@ -34,12 +34,6 @@ import com.google.refine.expr.ParsingException; import com.google.refine.util.TestUtils; public class SortTests extends RefineTest { - @Test - public void serializeSort() { - String json = "{\"description\":\"Sorts array a\",\"params\":\"array a of uniform type\",\"returns\":\"array\"}"; - TestUtils.isSerializedTo(new Sort(), json); - } - @Test public void sortJsonArray() throws ParsingException { String[] test = {"'[2,1,3]'.parseJson().sort().toString()", "[1, 2, 3]"}; diff --git a/main/tests/server/src/com/google/refine/expr/functions/arrays/UniquesTests.java b/main/tests/server/src/com/google/refine/expr/functions/arrays/UniquesTests.java index fcb38ce86..1b7b51f22 100644 --- a/main/tests/server/src/com/google/refine/expr/functions/arrays/UniquesTests.java +++ b/main/tests/server/src/com/google/refine/expr/functions/arrays/UniquesTests.java @@ -33,12 +33,6 @@ import com.google.refine.expr.ParsingException; import com.google.refine.util.TestUtils; public class UniquesTests extends RefineTest { - @Test - public void serializeUniques() { - String json = "{\"description\":\"Returns array a with duplicates removed\",\"params\":\"array a\",\"returns\":\"array\"}"; - TestUtils.isSerializedTo(new Uniques(), json); - } - @Test public void uniquesJsonArray() throws ParsingException { String[] test = {"'{a:[2,1,1,3]}'.parseJson().a.uniques().toString()", "[2, 1, 3]"}; diff --git a/main/tests/server/src/com/google/refine/expr/functions/booleans/AndTests.java b/main/tests/server/src/com/google/refine/expr/functions/booleans/AndTests.java index 7f0c6263f..8a27ff3d6 100644 --- a/main/tests/server/src/com/google/refine/expr/functions/booleans/AndTests.java +++ b/main/tests/server/src/com/google/refine/expr/functions/booleans/AndTests.java @@ -31,10 +31,5 @@ import org.testng.annotations.Test; import com.google.refine.util.TestUtils; public class AndTests { - @Test - public void serializeAnd() { - String json = "{\"description\":\"AND two or more booleans to yield a boolean\",\"params\":\"boolean a, boolean b\",\"returns\":\"boolean\"}"; - TestUtils.isSerializedTo(new And(), json); - } } diff --git a/main/tests/server/src/com/google/refine/expr/functions/booleans/NotTests.java b/main/tests/server/src/com/google/refine/expr/functions/booleans/NotTests.java index dbdb7902e..b310a0a75 100644 --- a/main/tests/server/src/com/google/refine/expr/functions/booleans/NotTests.java +++ b/main/tests/server/src/com/google/refine/expr/functions/booleans/NotTests.java @@ -31,10 +31,5 @@ import org.testng.annotations.Test; import com.google.refine.util.TestUtils; public class NotTests { - @Test - public void serializeNot() { - String json = "{\"description\":\"Returns the opposite of b\",\"params\":\"boolean b\",\"returns\":\"boolean\"}"; - TestUtils.isSerializedTo(new Not(), json); - } } diff --git a/main/tests/server/src/com/google/refine/expr/functions/booleans/OrTests.java b/main/tests/server/src/com/google/refine/expr/functions/booleans/OrTests.java index 76889cf6b..14436a5a6 100644 --- a/main/tests/server/src/com/google/refine/expr/functions/booleans/OrTests.java +++ b/main/tests/server/src/com/google/refine/expr/functions/booleans/OrTests.java @@ -31,10 +31,5 @@ import org.testng.annotations.Test; import com.google.refine.util.TestUtils; public class OrTests { - @Test - public void serializeOr() { - String json = "{\"description\":\"OR two or more booleans to yield a boolean\",\"params\":\"boolean a, boolean b\",\"returns\":\"boolean\"}"; - TestUtils.isSerializedTo(new Or(), json); - } } diff --git a/main/tests/server/src/com/google/refine/expr/functions/booleans/XorTests.java b/main/tests/server/src/com/google/refine/expr/functions/booleans/XorTests.java index a4a619b74..b777c2d76 100644 --- a/main/tests/server/src/com/google/refine/expr/functions/booleans/XorTests.java +++ b/main/tests/server/src/com/google/refine/expr/functions/booleans/XorTests.java @@ -31,10 +31,5 @@ import org.testng.annotations.Test; import com.google.refine.util.TestUtils; public class XorTests { - @Test - public void serializeXor() { - String json = "{\"description\":\"XORs two or more boolean values\",\"params\":\"boolean a, boolean b\",\"returns\":\"boolean\"}"; - TestUtils.isSerializedTo(new Xor(), json); - } } diff --git a/main/tests/server/src/com/google/refine/expr/functions/date/DatePartTests.java b/main/tests/server/src/com/google/refine/expr/functions/date/DatePartTests.java index 5fbbd2e97..7eec46e06 100644 --- a/main/tests/server/src/com/google/refine/expr/functions/date/DatePartTests.java +++ b/main/tests/server/src/com/google/refine/expr/functions/date/DatePartTests.java @@ -116,11 +116,5 @@ public class DatePartTests extends RefineTest { calendar.setTime(date); return calendar; } - - @Test - public void serializeDatePart() { - String json = "{\"description\":\"Returns part of a date\",\"params\":\"date d, string part\",\"returns\":\"date\"}"; - TestUtils.isSerializedTo(new DatePart(), json); - } } diff --git a/main/tests/server/src/com/google/refine/expr/functions/date/IncTests.java b/main/tests/server/src/com/google/refine/expr/functions/date/IncTests.java index 81f42e71d..f39bd0c79 100644 --- a/main/tests/server/src/com/google/refine/expr/functions/date/IncTests.java +++ b/main/tests/server/src/com/google/refine/expr/functions/date/IncTests.java @@ -105,10 +105,4 @@ public class IncTests extends RefineTest { Assert.assertTrue(invoke("inc", source.toInstant().toEpochMilli(), 99, "h") instanceof EvalError); } - @Test - public void serializeInc() { - String json = "{\"description\":\"Returns a date changed by the given amount in the given unit of time\",\"params\":\"date d, number value, string unit (default to 'hour')\",\"returns\":\"date\"}"; - TestUtils.isSerializedTo(new Inc(), json); - } - } diff --git a/main/tests/server/src/com/google/refine/expr/functions/date/NowTests.java b/main/tests/server/src/com/google/refine/expr/functions/date/NowTests.java index 22516d123..72df95657 100644 --- a/main/tests/server/src/com/google/refine/expr/functions/date/NowTests.java +++ b/main/tests/server/src/com/google/refine/expr/functions/date/NowTests.java @@ -56,11 +56,5 @@ public class NowTests extends RefineTest { Assert.assertTrue(invoke("now") instanceof OffsetDateTime); Assert.assertTrue(((OffsetDateTime)invoke("now")).isAfter(source)); } - - @Test - public void serializeNow() { - String json = "{\"description\":\"Returns the current time\",\"returns\":\"date\"}"; - TestUtils.isSerializedTo(new Now(), json); - } - + } diff --git a/main/tests/server/src/com/google/refine/expr/functions/html/InnerHtmlTests.java b/main/tests/server/src/com/google/refine/expr/functions/html/InnerHtmlTests.java index 57ae1f3af..9a9926f1d 100644 --- a/main/tests/server/src/com/google/refine/expr/functions/html/InnerHtmlTests.java +++ b/main/tests/server/src/com/google/refine/expr/functions/html/InnerHtmlTests.java @@ -31,10 +31,5 @@ import org.testng.annotations.Test; import com.google.refine.util.TestUtils; public class InnerHtmlTests { - @Test - public void serializeInnerHtml() { - String json = "{\"description\":\"The innerHtml of an HTML element\",\"params\":\"Element e\",\"returns\":\"String innerHtml\"}"; - TestUtils.isSerializedTo(new InnerHtml(), json); - } } diff --git a/main/tests/server/src/com/google/refine/expr/functions/html/ParseHtmlTests.java b/main/tests/server/src/com/google/refine/expr/functions/html/ParseHtmlTests.java index 7b403b08e..984dfc077 100644 --- a/main/tests/server/src/com/google/refine/expr/functions/html/ParseHtmlTests.java +++ b/main/tests/server/src/com/google/refine/expr/functions/html/ParseHtmlTests.java @@ -67,12 +67,6 @@ public class ParseHtmlTests extends RefineTest { logger = LoggerFactory.getLogger(this.getClass()); } - @Test - public void serializeParseHtml() { - String json = "{\"description\":\"Parses a string as HTML\",\"params\":\"string s\",\"returns\":\"HTML object\"}"; - TestUtils.isSerializedTo(new ParseHtml(), json); - } - @Test public void testParseHtml() { Assert.assertTrue(invoke("parseHtml") instanceof EvalError); diff --git a/main/tests/server/src/com/google/refine/expr/functions/math/ACosTests.java b/main/tests/server/src/com/google/refine/expr/functions/math/ACosTests.java deleted file mode 100644 index 1ea601135..000000000 --- a/main/tests/server/src/com/google/refine/expr/functions/math/ACosTests.java +++ /dev/null @@ -1,40 +0,0 @@ -/******************************************************************************* - * Copyright (C) 2018, OpenRefine contributors - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - ******************************************************************************/ -package com.google.refine.expr.functions.math; - -import org.testng.annotations.Test; - -import com.google.refine.util.TestUtils; - -public class ACosTests { - @Test - public void serializeACos() { - String json = "{\"description\":\"Returns the arc cosine of an angle, in the range 0 through PI\",\"params\":\"number d\",\"returns\":\"number\"}"; - TestUtils.isSerializedTo(new ACos(), json); - } -} - diff --git a/main/tests/server/src/com/google/refine/expr/functions/math/ASinTests.java b/main/tests/server/src/com/google/refine/expr/functions/math/ASinTests.java deleted file mode 100644 index 844ba1e74..000000000 --- a/main/tests/server/src/com/google/refine/expr/functions/math/ASinTests.java +++ /dev/null @@ -1,40 +0,0 @@ -/******************************************************************************* - * Copyright (C) 2018, OpenRefine contributors - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - ******************************************************************************/ -package com.google.refine.expr.functions.math; - -import org.testng.annotations.Test; - -import com.google.refine.util.TestUtils; - -public class ASinTests { - @Test - public void serializeASin() { - String json = "{\"description\":\"Returns the arc sine of an angle in the range of -PI/2 through PI/2\",\"params\":\"number d\",\"returns\":\"number\"}"; - TestUtils.isSerializedTo(new ASin(), json); - } -} - diff --git a/main/tests/server/src/com/google/refine/expr/functions/math/ATan2Tests.java b/main/tests/server/src/com/google/refine/expr/functions/math/ATan2Tests.java deleted file mode 100644 index 4e1bcda98..000000000 --- a/main/tests/server/src/com/google/refine/expr/functions/math/ATan2Tests.java +++ /dev/null @@ -1,40 +0,0 @@ -/******************************************************************************* - * Copyright (C) 2018, OpenRefine contributors - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - ******************************************************************************/ -package com.google.refine.expr.functions.math; - -import org.testng.annotations.Test; - -import com.google.refine.util.TestUtils; - -public class ATan2Tests { - @Test - public void serializeATan2() { - String json = "{\"description\":\"Converts rectangular coordinates (x, y) to polar (r, theta)\",\"params\":\"number x, number y\",\"returns\":\"number theta\"}"; - TestUtils.isSerializedTo(new ATan2(), json); - } -} - diff --git a/main/tests/server/src/com/google/refine/expr/functions/math/ATanTests.java b/main/tests/server/src/com/google/refine/expr/functions/math/ATanTests.java deleted file mode 100644 index 805340dbb..000000000 --- a/main/tests/server/src/com/google/refine/expr/functions/math/ATanTests.java +++ /dev/null @@ -1,40 +0,0 @@ -/******************************************************************************* - * Copyright (C) 2018, OpenRefine contributors - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - ******************************************************************************/ -package com.google.refine.expr.functions.math; - -import org.testng.annotations.Test; - -import com.google.refine.util.TestUtils; - -public class ATanTests { - @Test - public void serializeATan() { - String json = "{\"description\":\"Returns the arc tangent of an angle in the range of -PI/2 through PI/2\",\"params\":\"number d\",\"returns\":\"number\"}"; - TestUtils.isSerializedTo(new ATan(), json); - } -} - diff --git a/main/tests/server/src/com/google/refine/expr/functions/math/AbsTests.java b/main/tests/server/src/com/google/refine/expr/functions/math/AbsTests.java deleted file mode 100644 index e84452c04..000000000 --- a/main/tests/server/src/com/google/refine/expr/functions/math/AbsTests.java +++ /dev/null @@ -1,40 +0,0 @@ -/******************************************************************************* - * Copyright (C) 2018, OpenRefine contributors - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - ******************************************************************************/ -package com.google.refine.expr.functions.math; - -import org.testng.annotations.Test; - -import com.google.refine.util.TestUtils; - -public class AbsTests { - @Test - public void serializeAbs() { - String json = "{\"description\":\"Returns the absolute value of a number\",\"params\":\"number d\",\"returns\":\"number\"}"; - TestUtils.isSerializedTo(new Abs(), json); - } -} - diff --git a/main/tests/server/src/com/google/refine/expr/functions/math/CeilTests.java b/main/tests/server/src/com/google/refine/expr/functions/math/CeilTests.java deleted file mode 100644 index 03083533a..000000000 --- a/main/tests/server/src/com/google/refine/expr/functions/math/CeilTests.java +++ /dev/null @@ -1,40 +0,0 @@ -/******************************************************************************* - * Copyright (C) 2018, OpenRefine contributors - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - ******************************************************************************/ -package com.google.refine.expr.functions.math; - -import org.testng.annotations.Test; - -import com.google.refine.util.TestUtils; - -public class CeilTests { - @Test - public void serializeCeil() { - String json = "{\"description\":\"Returns the ceiling of a number\",\"params\":\"number d\",\"returns\":\"number\"}"; - TestUtils.isSerializedTo(new Ceil(), json); - } -} - diff --git a/main/tests/server/src/com/google/refine/expr/functions/math/CombinTests.java b/main/tests/server/src/com/google/refine/expr/functions/math/CombinTests.java deleted file mode 100644 index 3f63d3e91..000000000 --- a/main/tests/server/src/com/google/refine/expr/functions/math/CombinTests.java +++ /dev/null @@ -1,40 +0,0 @@ -/******************************************************************************* - * Copyright (C) 2018, OpenRefine contributors - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - ******************************************************************************/ -package com.google.refine.expr.functions.math; - -import org.testng.annotations.Test; - -import com.google.refine.util.TestUtils; - -public class CombinTests { - @Test - public void serializeCombin() { - String json = "{\"description\":\"Returns the number of combinations for n elements as divided into k\",\"params\":\"number d\",\"returns\":\"number\"}"; - TestUtils.isSerializedTo(new Combin(), json); - } -} - diff --git a/main/tests/server/src/com/google/refine/expr/functions/math/CosTests.java b/main/tests/server/src/com/google/refine/expr/functions/math/CosTests.java deleted file mode 100644 index c1e8702d1..000000000 --- a/main/tests/server/src/com/google/refine/expr/functions/math/CosTests.java +++ /dev/null @@ -1,40 +0,0 @@ -/******************************************************************************* - * Copyright (C) 2018, OpenRefine contributors - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - ******************************************************************************/ -package com.google.refine.expr.functions.math; - -import org.testng.annotations.Test; - -import com.google.refine.util.TestUtils; - -public class CosTests { - @Test - public void serializeCos() { - String json = "{\"description\":\"Returns the trigonometric cosine of an angle\",\"params\":\"number d\",\"returns\":\"number\"}"; - TestUtils.isSerializedTo(new Cos(), json); - } -} - diff --git a/main/tests/server/src/com/google/refine/expr/functions/math/CoshTests.java b/main/tests/server/src/com/google/refine/expr/functions/math/CoshTests.java deleted file mode 100644 index b34541ec4..000000000 --- a/main/tests/server/src/com/google/refine/expr/functions/math/CoshTests.java +++ /dev/null @@ -1,40 +0,0 @@ -/******************************************************************************* - * Copyright (C) 2018, OpenRefine contributors - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - ******************************************************************************/ -package com.google.refine.expr.functions.math; - -import org.testng.annotations.Test; - -import com.google.refine.util.TestUtils; - -public class CoshTests { - @Test - public void serializeCosh() { - String json = "{\"description\":\"Returns the hyperbolic cosine of a value\",\"params\":\"number d\",\"returns\":\"number\"}"; - TestUtils.isSerializedTo(new Cosh(), json); - } -} - diff --git a/main/tests/server/src/com/google/refine/expr/functions/math/DegreesTests.java b/main/tests/server/src/com/google/refine/expr/functions/math/DegreesTests.java deleted file mode 100644 index 0f27c7dc9..000000000 --- a/main/tests/server/src/com/google/refine/expr/functions/math/DegreesTests.java +++ /dev/null @@ -1,40 +0,0 @@ -/******************************************************************************* - * Copyright (C) 2018, OpenRefine contributors - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - ******************************************************************************/ -package com.google.refine.expr.functions.math; - -import org.testng.annotations.Test; - -import com.google.refine.util.TestUtils; - -public class DegreesTests { - @Test - public void serializeDegrees() { - String json = "{\"description\":\"Converts an angle from radians to degrees.\",\"params\":\"number d\",\"returns\":\"number\"}"; - TestUtils.isSerializedTo(new Degrees(), json); - } -} - diff --git a/main/tests/server/src/com/google/refine/expr/functions/math/EvenTests.java b/main/tests/server/src/com/google/refine/expr/functions/math/EvenTests.java deleted file mode 100644 index 7e801e1fc..000000000 --- a/main/tests/server/src/com/google/refine/expr/functions/math/EvenTests.java +++ /dev/null @@ -1,40 +0,0 @@ -/******************************************************************************* - * Copyright (C) 2018, OpenRefine contributors - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - ******************************************************************************/ -package com.google.refine.expr.functions.math; - -import org.testng.annotations.Test; - -import com.google.refine.util.TestUtils; - -public class EvenTests { - @Test - public void serializeEven() { - String json = "{\"description\":\"Rounds the number up to the nearest even integer\",\"params\":\"number d\",\"returns\":\"number\"}"; - TestUtils.isSerializedTo(new Even(), json); - } -} - diff --git a/main/tests/server/src/com/google/refine/expr/functions/math/ExpTests.java b/main/tests/server/src/com/google/refine/expr/functions/math/ExpTests.java deleted file mode 100644 index a570613ef..000000000 --- a/main/tests/server/src/com/google/refine/expr/functions/math/ExpTests.java +++ /dev/null @@ -1,40 +0,0 @@ -/******************************************************************************* - * Copyright (C) 2018, OpenRefine contributors - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - ******************************************************************************/ -package com.google.refine.expr.functions.math; - -import org.testng.annotations.Test; - -import com.google.refine.util.TestUtils; - -public class ExpTests { - @Test - public void serializeExp() { - String json = "{\"description\":\"Returns e^n\",\"params\":\"number n\",\"returns\":\"number\"}"; - TestUtils.isSerializedTo(new Exp(), json); - } -} - diff --git a/main/tests/server/src/com/google/refine/expr/functions/math/FactNTests.java b/main/tests/server/src/com/google/refine/expr/functions/math/FactNTests.java deleted file mode 100644 index 431d2317b..000000000 --- a/main/tests/server/src/com/google/refine/expr/functions/math/FactNTests.java +++ /dev/null @@ -1,40 +0,0 @@ -/******************************************************************************* - * Copyright (C) 2018, OpenRefine contributors - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - ******************************************************************************/ -package com.google.refine.expr.functions.math; - -import org.testng.annotations.Test; - -import com.google.refine.util.TestUtils; - -public class FactNTests { - @Test - public void serializeFactN() { - String json = "{\"description\":\"Returns the factorial of a number\",\"params\":\"number i\",\"returns\":\"number\"}"; - TestUtils.isSerializedTo(new FactN(), json); - } -} - diff --git a/main/tests/server/src/com/google/refine/expr/functions/math/FactTests.java b/main/tests/server/src/com/google/refine/expr/functions/math/FactTests.java deleted file mode 100644 index 5758a071b..000000000 --- a/main/tests/server/src/com/google/refine/expr/functions/math/FactTests.java +++ /dev/null @@ -1,40 +0,0 @@ -/******************************************************************************* - * Copyright (C) 2018, OpenRefine contributors - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - ******************************************************************************/ -package com.google.refine.expr.functions.math; - -import org.testng.annotations.Test; - -import com.google.refine.util.TestUtils; - -public class FactTests { - @Test - public void serializeFact() { - String json = "{\"description\":\"Returns the factorial of a number\",\"params\":\"number i\",\"returns\":\"number\"}"; - TestUtils.isSerializedTo(new Fact(), json); - } -} - diff --git a/main/tests/server/src/com/google/refine/expr/functions/math/FloorTests.java b/main/tests/server/src/com/google/refine/expr/functions/math/FloorTests.java deleted file mode 100644 index b5d813e5b..000000000 --- a/main/tests/server/src/com/google/refine/expr/functions/math/FloorTests.java +++ /dev/null @@ -1,40 +0,0 @@ -/******************************************************************************* - * Copyright (C) 2018, OpenRefine contributors - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - ******************************************************************************/ -package com.google.refine.expr.functions.math; - -import org.testng.annotations.Test; - -import com.google.refine.util.TestUtils; - -public class FloorTests { - @Test - public void serializeFloor() { - String json = "{\"description\":\"Returns the floor of a number as an integer\",\"params\":\"number d\",\"returns\":\"number\"}"; - TestUtils.isSerializedTo(new Floor(), json); - } -} - diff --git a/main/tests/server/src/com/google/refine/expr/functions/math/GreatestCommonDenominatorTests.java b/main/tests/server/src/com/google/refine/expr/functions/math/GreatestCommonDenominatorTests.java deleted file mode 100644 index eb8d4dcc6..000000000 --- a/main/tests/server/src/com/google/refine/expr/functions/math/GreatestCommonDenominatorTests.java +++ /dev/null @@ -1,40 +0,0 @@ -/******************************************************************************* - * Copyright (C) 2018, OpenRefine contributors - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - ******************************************************************************/ -package com.google.refine.expr.functions.math; - -import org.testng.annotations.Test; - -import com.google.refine.util.TestUtils; - -public class GreatestCommonDenominatorTests { - @Test - public void serializeGreatestCommonDenominator() { - String json = "{\"description\":\"Returns the greatest common denominator of the two numbers\",\"params\":\"number d, number e\",\"returns\":\"number\"}"; - TestUtils.isSerializedTo(new GreatestCommonDenominator(), json); - } -} - diff --git a/main/tests/server/src/com/google/refine/expr/functions/math/LeastCommonMultipleTests.java b/main/tests/server/src/com/google/refine/expr/functions/math/LeastCommonMultipleTests.java deleted file mode 100644 index 88b27943d..000000000 --- a/main/tests/server/src/com/google/refine/expr/functions/math/LeastCommonMultipleTests.java +++ /dev/null @@ -1,40 +0,0 @@ -/******************************************************************************* - * Copyright (C) 2018, OpenRefine contributors - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - ******************************************************************************/ -package com.google.refine.expr.functions.math; - -import org.testng.annotations.Test; - -import com.google.refine.util.TestUtils; - -public class LeastCommonMultipleTests { - @Test - public void serializeLeastCommonMultiple() { - String json = "{\"description\":\"Returns the greatest common denominator of the two numbers\",\"params\":\"number d, number e\",\"returns\":\"number\"}"; - TestUtils.isSerializedTo(new LeastCommonMultiple(), json); - } -} - diff --git a/main/tests/server/src/com/google/refine/expr/functions/math/LnTests.java b/main/tests/server/src/com/google/refine/expr/functions/math/LnTests.java deleted file mode 100644 index 2c318a4ab..000000000 --- a/main/tests/server/src/com/google/refine/expr/functions/math/LnTests.java +++ /dev/null @@ -1,40 +0,0 @@ -/******************************************************************************* - * Copyright (C) 2018, OpenRefine contributors - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - ******************************************************************************/ -package com.google.refine.expr.functions.math; - -import org.testng.annotations.Test; - -import com.google.refine.util.TestUtils; - -public class LnTests { - @Test - public void serializeLn() { - String json = "{\"description\":\"Returns the natural log of n\",\"params\":\"number n\",\"returns\":\"number\"}"; - TestUtils.isSerializedTo(new Ln(), json); - } -} - diff --git a/main/tests/server/src/com/google/refine/expr/functions/math/LogTests.java b/main/tests/server/src/com/google/refine/expr/functions/math/LogTests.java deleted file mode 100644 index 6d8da50aa..000000000 --- a/main/tests/server/src/com/google/refine/expr/functions/math/LogTests.java +++ /dev/null @@ -1,40 +0,0 @@ -/******************************************************************************* - * Copyright (C) 2018, OpenRefine contributors - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - ******************************************************************************/ -package com.google.refine.expr.functions.math; - -import org.testng.annotations.Test; - -import com.google.refine.util.TestUtils; - -public class LogTests { - @Test - public void serializeLog() { - String json = "{\"description\":\"Returns the base 10 log of n\",\"params\":\"number n\",\"returns\":\"number\"}"; - TestUtils.isSerializedTo(new Log(), json); - } -} - diff --git a/main/tests/server/src/com/google/refine/expr/functions/math/MaxTests.java b/main/tests/server/src/com/google/refine/expr/functions/math/MaxTests.java deleted file mode 100644 index 591bdc560..000000000 --- a/main/tests/server/src/com/google/refine/expr/functions/math/MaxTests.java +++ /dev/null @@ -1,40 +0,0 @@ -/******************************************************************************* - * Copyright (C) 2018, OpenRefine contributors - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - ******************************************************************************/ -package com.google.refine.expr.functions.math; - -import org.testng.annotations.Test; - -import com.google.refine.util.TestUtils; - -public class MaxTests { - @Test - public void serializeMax() { - String json = "{\"description\":\"Returns the greater of two numbers\",\"params\":\"number a, number b\",\"returns\":\"number\"}"; - TestUtils.isSerializedTo(new Max(), json); - } -} - diff --git a/main/tests/server/src/com/google/refine/expr/functions/math/MinTests.java b/main/tests/server/src/com/google/refine/expr/functions/math/MinTests.java deleted file mode 100644 index d38dc8560..000000000 --- a/main/tests/server/src/com/google/refine/expr/functions/math/MinTests.java +++ /dev/null @@ -1,40 +0,0 @@ -/******************************************************************************* - * Copyright (C) 2018, OpenRefine contributors - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - ******************************************************************************/ -package com.google.refine.expr.functions.math; - -import org.testng.annotations.Test; - -import com.google.refine.util.TestUtils; - -public class MinTests { - @Test - public void serializeMin() { - String json = "{\"description\":\"Returns the smaller of two numbers\",\"params\":\"number a, number b\",\"returns\":\"number\"}"; - TestUtils.isSerializedTo(new Min(), json); - } -} - diff --git a/main/tests/server/src/com/google/refine/expr/functions/math/ModTests.java b/main/tests/server/src/com/google/refine/expr/functions/math/ModTests.java deleted file mode 100644 index 3a3b8b3cd..000000000 --- a/main/tests/server/src/com/google/refine/expr/functions/math/ModTests.java +++ /dev/null @@ -1,40 +0,0 @@ -/******************************************************************************* - * Copyright (C) 2018, OpenRefine contributors - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - ******************************************************************************/ -package com.google.refine.expr.functions.math; - -import org.testng.annotations.Test; - -import com.google.refine.util.TestUtils; - -public class ModTests { - @Test - public void serializeMod() { - String json = "{\"description\":\"Returns a modulus b\",\"params\":\"number a, number b\",\"returns\":\"number\"}"; - TestUtils.isSerializedTo(new Mod(), json); - } -} - diff --git a/main/tests/server/src/com/google/refine/expr/functions/math/MultinomialTests.java b/main/tests/server/src/com/google/refine/expr/functions/math/MultinomialTests.java deleted file mode 100644 index 68ecb8101..000000000 --- a/main/tests/server/src/com/google/refine/expr/functions/math/MultinomialTests.java +++ /dev/null @@ -1,40 +0,0 @@ -/******************************************************************************* - * Copyright (C) 2018, OpenRefine contributors - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - ******************************************************************************/ -package com.google.refine.expr.functions.math; - -import org.testng.annotations.Test; - -import com.google.refine.util.TestUtils; - -public class MultinomialTests { - @Test - public void serializeMultinomial() { - String json = "{\"description\":\"Calculates the multinomial of a series of numbers\",\"params\":\"one or more numbers\",\"returns\":\"number\"}"; - TestUtils.isSerializedTo(new Multinomial(), json); - } -} - diff --git a/main/tests/server/src/com/google/refine/expr/functions/math/OddTests.java b/main/tests/server/src/com/google/refine/expr/functions/math/OddTests.java deleted file mode 100644 index f61d200e1..000000000 --- a/main/tests/server/src/com/google/refine/expr/functions/math/OddTests.java +++ /dev/null @@ -1,40 +0,0 @@ -/******************************************************************************* - * Copyright (C) 2018, OpenRefine contributors - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - ******************************************************************************/ -package com.google.refine.expr.functions.math; - -import org.testng.annotations.Test; - -import com.google.refine.util.TestUtils; - -public class OddTests { - @Test - public void serializeOdd() { - String json = "{\"description\":\"Rounds the number up to the nearest even integer\",\"params\":\"number d\",\"returns\":\"number\"}"; - TestUtils.isSerializedTo(new Odd(), json); - } -} - diff --git a/main/tests/server/src/com/google/refine/expr/functions/math/PowTests.java b/main/tests/server/src/com/google/refine/expr/functions/math/PowTests.java deleted file mode 100644 index 3523fcf94..000000000 --- a/main/tests/server/src/com/google/refine/expr/functions/math/PowTests.java +++ /dev/null @@ -1,40 +0,0 @@ -/******************************************************************************* - * Copyright (C) 2018, OpenRefine contributors - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - ******************************************************************************/ -package com.google.refine.expr.functions.math; - -import org.testng.annotations.Test; - -import com.google.refine.util.TestUtils; - -public class PowTests { - @Test - public void serializePow() { - String json = "{\"description\":\"Returns a^b\",\"params\":\"number a, number b\",\"returns\":\"number\"}"; - TestUtils.isSerializedTo(new Pow(), json); - } -} - diff --git a/main/tests/server/src/com/google/refine/expr/functions/math/QuotientTests.java b/main/tests/server/src/com/google/refine/expr/functions/math/QuotientTests.java deleted file mode 100644 index e3c288d70..000000000 --- a/main/tests/server/src/com/google/refine/expr/functions/math/QuotientTests.java +++ /dev/null @@ -1,40 +0,0 @@ -/******************************************************************************* - * Copyright (C) 2018, OpenRefine contributors - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - ******************************************************************************/ -package com.google.refine.expr.functions.math; - -import org.testng.annotations.Test; - -import com.google.refine.util.TestUtils; - -public class QuotientTests { - @Test - public void serializeQuotient() { - String json = "{\"description\":\"Returns the integer portion of a division\",\"params\":\"number numerator, number denominator\",\"returns\":\"number\"}"; - TestUtils.isSerializedTo(new Quotient(), json); - } -} - diff --git a/main/tests/server/src/com/google/refine/expr/functions/math/RadiansTests.java b/main/tests/server/src/com/google/refine/expr/functions/math/RadiansTests.java deleted file mode 100644 index 2ecc3dec1..000000000 --- a/main/tests/server/src/com/google/refine/expr/functions/math/RadiansTests.java +++ /dev/null @@ -1,40 +0,0 @@ -/******************************************************************************* - * Copyright (C) 2018, OpenRefine contributors - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - ******************************************************************************/ -package com.google.refine.expr.functions.math; - -import org.testng.annotations.Test; - -import com.google.refine.util.TestUtils; - -public class RadiansTests { - @Test - public void serializeRadians() { - String json = "{\"description\":\"Converts an angle in degrees to radians\",\"params\":\"number d\",\"returns\":\"number\"}"; - TestUtils.isSerializedTo(new Radians(), json); - } -} - diff --git a/main/tests/server/src/com/google/refine/expr/functions/math/RandomNumberTests.java b/main/tests/server/src/com/google/refine/expr/functions/math/RandomNumberTests.java deleted file mode 100644 index 3fb5b93b3..000000000 --- a/main/tests/server/src/com/google/refine/expr/functions/math/RandomNumberTests.java +++ /dev/null @@ -1,61 +0,0 @@ -/******************************************************************************* - * Copyright (C) 2018, OpenRefine contributors - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - ******************************************************************************/ -package com.google.refine.expr.functions.math; - -import java.util.Properties; - -import org.testng.Assert; -import org.testng.annotations.Test; - -import com.google.refine.RefineTest; -import com.google.refine.expr.EvalError; -import com.google.refine.util.TestUtils; - -public class RandomNumberTests extends RefineTest { - static Properties bindings; - - @Test - public void serializeRandomNumber() { - String json = "{\"description\":\"Returns a pseudo-random integer between the lower and upper bound (inclusive)\",\"params\":\"number lower bound, number upper bound\",\"returns\":\"number\"}"; - TestUtils.isSerializedTo(new RandomNumber(), json); - } - - @Test - public void testRandomNumberParameters() { - Assert.assertTrue(invoke("randomNumber") instanceof EvalError); - Assert.assertTrue(invoke("randomNumber", "string1") instanceof EvalError); - Assert.assertTrue(invoke("randomNumber", "string1","string2") instanceof EvalError); - Assert.assertTrue(invoke("randomNumber", 3, 2) instanceof EvalError); - } - - @Test - public void testRandomNumber() { - Object a = invoke("randomNumber", 1, 10); - Assert.assertTrue((int) a < 11 && (int) a > 0); - } -} - diff --git a/main/tests/server/src/com/google/refine/expr/functions/math/RoundTests.java b/main/tests/server/src/com/google/refine/expr/functions/math/RoundTests.java deleted file mode 100644 index 330baa93e..000000000 --- a/main/tests/server/src/com/google/refine/expr/functions/math/RoundTests.java +++ /dev/null @@ -1,40 +0,0 @@ -/******************************************************************************* - * Copyright (C) 2018, OpenRefine contributors - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - ******************************************************************************/ -package com.google.refine.expr.functions.math; - -import org.testng.annotations.Test; - -import com.google.refine.util.TestUtils; - -public class RoundTests { - @Test - public void serializeRound() { - String json = "{\"description\":\"Returns n rounded\",\"params\":\"number n\",\"returns\":\"number\"}"; - TestUtils.isSerializedTo(new Round(), json); - } -} - diff --git a/main/tests/server/src/com/google/refine/expr/functions/math/SinTests.java b/main/tests/server/src/com/google/refine/expr/functions/math/SinTests.java deleted file mode 100644 index c3ed18c21..000000000 --- a/main/tests/server/src/com/google/refine/expr/functions/math/SinTests.java +++ /dev/null @@ -1,40 +0,0 @@ -/******************************************************************************* - * Copyright (C) 2018, OpenRefine contributors - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - ******************************************************************************/ -package com.google.refine.expr.functions.math; - -import org.testng.annotations.Test; - -import com.google.refine.util.TestUtils; - -public class SinTests { - @Test - public void serializeSin() { - String json = "{\"description\":\"Returns the trigonometric sine of an angle\",\"params\":\"number d\",\"returns\":\"number\"}"; - TestUtils.isSerializedTo(new Sin(), json); - } -} - diff --git a/main/tests/server/src/com/google/refine/expr/functions/math/SinhTests.java b/main/tests/server/src/com/google/refine/expr/functions/math/SinhTests.java deleted file mode 100644 index bb9c09d4d..000000000 --- a/main/tests/server/src/com/google/refine/expr/functions/math/SinhTests.java +++ /dev/null @@ -1,40 +0,0 @@ -/******************************************************************************* - * Copyright (C) 2018, OpenRefine contributors - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - ******************************************************************************/ -package com.google.refine.expr.functions.math; - -import org.testng.annotations.Test; - -import com.google.refine.util.TestUtils; - -public class SinhTests { - @Test - public void serializeSinh() { - String json = "{\"description\":\"Returns the hyperbolic sine of an angle\",\"params\":\"number d\",\"returns\":\"number\"}"; - TestUtils.isSerializedTo(new Sinh(), json); - } -} - diff --git a/main/tests/server/src/com/google/refine/expr/functions/math/SumTests.java b/main/tests/server/src/com/google/refine/expr/functions/math/SumTests.java deleted file mode 100644 index 1003bb313..000000000 --- a/main/tests/server/src/com/google/refine/expr/functions/math/SumTests.java +++ /dev/null @@ -1,40 +0,0 @@ -/******************************************************************************* - * Copyright (C) 2018, OpenRefine contributors - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - ******************************************************************************/ -package com.google.refine.expr.functions.math; - -import org.testng.annotations.Test; - -import com.google.refine.util.TestUtils; - -public class SumTests { - @Test - public void serializeSum() { - String json = "{\"description\":\"Sums numbers in array a\",\"params\":\"array a\",\"returns\":\"number\"}"; - TestUtils.isSerializedTo(new Sum(), json); - } -} - diff --git a/main/tests/server/src/com/google/refine/expr/functions/math/TanTests.java b/main/tests/server/src/com/google/refine/expr/functions/math/TanTests.java deleted file mode 100644 index 99f1b8c15..000000000 --- a/main/tests/server/src/com/google/refine/expr/functions/math/TanTests.java +++ /dev/null @@ -1,40 +0,0 @@ -/******************************************************************************* - * Copyright (C) 2018, OpenRefine contributors - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - ******************************************************************************/ -package com.google.refine.expr.functions.math; - -import org.testng.annotations.Test; - -import com.google.refine.util.TestUtils; - -public class TanTests { - @Test - public void serializeTan() { - String json = "{\"description\":\"Returns the trigonometric tangent of an angle\",\"params\":\"number d\",\"returns\":\"number\"}"; - TestUtils.isSerializedTo(new Tan(), json); - } -} - diff --git a/main/tests/server/src/com/google/refine/expr/functions/math/TanhTests.java b/main/tests/server/src/com/google/refine/expr/functions/math/TanhTests.java deleted file mode 100644 index a2d175398..000000000 --- a/main/tests/server/src/com/google/refine/expr/functions/math/TanhTests.java +++ /dev/null @@ -1,40 +0,0 @@ -/******************************************************************************* - * Copyright (C) 2018, OpenRefine contributors - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - ******************************************************************************/ -package com.google.refine.expr.functions.math; - -import org.testng.annotations.Test; - -import com.google.refine.util.TestUtils; - -public class TanhTests { - @Test - public void serializeTanh() { - String json = "{\"description\":\"Returns the hyperbolic tangent of a value\",\"params\":\"number d\",\"returns\":\"number\"}"; - TestUtils.isSerializedTo(new Tanh(), json); - } -} - diff --git a/main/tests/server/src/com/google/refine/expr/functions/strings/ChompTests.java b/main/tests/server/src/com/google/refine/expr/functions/strings/ChompTests.java index 0ea758b0c..ac2524a08 100644 --- a/main/tests/server/src/com/google/refine/expr/functions/strings/ChompTests.java +++ b/main/tests/server/src/com/google/refine/expr/functions/strings/ChompTests.java @@ -34,12 +34,6 @@ import com.google.refine.RefineTest; import com.google.refine.util.TestUtils; public class ChompTests extends RefineTest { - @Test - public void serializeChomp() { - String json = "{\"description\":\"Removes separator from the end of str if it's there, otherwise leave it alone.\",\"params\":\"string str, string separator\",\"returns\":\"string\"}"; - TestUtils.isSerializedTo(new Chomp(), json); - } - @Test public void testChomp() { // FIXME: These return null instead of an EvalError diff --git a/main/tests/server/src/com/google/refine/expr/functions/strings/ContainsTests.java b/main/tests/server/src/com/google/refine/expr/functions/strings/ContainsTests.java index 76f288eca..04a930160 100644 --- a/main/tests/server/src/com/google/refine/expr/functions/strings/ContainsTests.java +++ b/main/tests/server/src/com/google/refine/expr/functions/strings/ContainsTests.java @@ -61,10 +61,5 @@ public class ContainsTests extends RefineTest { Assert.assertEquals(invoke("contains", value, Pattern.compile("\\s+")),true); } - @Test - public void serializeContains() { - String json = "{\"description\":\"Returns whether s contains frag\",\"params\":\"string s, string frag\",\"returns\":\"boolean\"}"; - TestUtils.isSerializedTo(new Contains(), json); - } } diff --git a/main/tests/server/src/com/google/refine/expr/functions/strings/DiffTests.java b/main/tests/server/src/com/google/refine/expr/functions/strings/DiffTests.java index 7e60d1034..cca154d33 100644 --- a/main/tests/server/src/com/google/refine/expr/functions/strings/DiffTests.java +++ b/main/tests/server/src/com/google/refine/expr/functions/strings/DiffTests.java @@ -119,10 +119,4 @@ public class DiffTests extends RefineTest { Assert.assertTrue(invoke("diff", odt4, odt5, "yars") instanceof EvalError); } - @Test - public void serializeDiff() { - String json = "{\"description\":\"For strings, returns the portion where they differ. For dates, it returns the difference in given time units\",\"params\":\"o1, o2, time unit (optional)\",\"returns\":\"string for strings, number for dates\"}"; - TestUtils.isSerializedTo(new Diff(), json); - } - } diff --git a/main/tests/server/src/com/google/refine/expr/functions/strings/EndsWithTests.java b/main/tests/server/src/com/google/refine/expr/functions/strings/EndsWithTests.java index 9b462e9c9..4c4be283e 100644 --- a/main/tests/server/src/com/google/refine/expr/functions/strings/EndsWithTests.java +++ b/main/tests/server/src/com/google/refine/expr/functions/strings/EndsWithTests.java @@ -35,12 +35,6 @@ import com.google.refine.RefineTest; import com.google.refine.util.TestUtils; public class EndsWithTests extends RefineTest { - @Test - public void serializeEndsWith() { - String json = "{\"description\":\"Returns whether s ends with sub\",\"params\":\"string s, string sub\",\"returns\":\"boolean\"}"; - TestUtils.isSerializedTo(new EndsWith(), json); - } - @Test public void testStartsWith() { assertTrue((Boolean) invoke("endsWith", "testString", "ing")); diff --git a/main/tests/server/src/com/google/refine/expr/functions/strings/EscapeTests.java b/main/tests/server/src/com/google/refine/expr/functions/strings/EscapeTests.java index fb329715d..218149833 100644 --- a/main/tests/server/src/com/google/refine/expr/functions/strings/EscapeTests.java +++ b/main/tests/server/src/com/google/refine/expr/functions/strings/EscapeTests.java @@ -35,12 +35,6 @@ import com.google.refine.RefineTest; import com.google.refine.util.TestUtils; public class EscapeTests extends RefineTest { - @Test - public void serializeEscape() { - String json = "{\"description\":\"Escapes a string depending on the given escaping mode.\",\"params\":\"string s, string mode ['html','xml','csv','url','javascript']\",\"returns\":\"string\"}"; - TestUtils.isSerializedTo(new Escape(), json); - } - @Test public void testEscape() { assertNull(invoke("escape")); diff --git a/main/tests/server/src/com/google/refine/expr/functions/strings/FindTests.java b/main/tests/server/src/com/google/refine/expr/functions/strings/FindTests.java index 76536714a..828b8c515 100644 --- a/main/tests/server/src/com/google/refine/expr/functions/strings/FindTests.java +++ b/main/tests/server/src/com/google/refine/expr/functions/strings/FindTests.java @@ -73,9 +73,4 @@ public class FindTests extends RefineTest { Assert.assertEquals(matches[1], "123456"); } - @Test - public void serializeFind() { - String json = "{\"description\":\"Returns all the occurrences of match given regular expression or simple string\",\"params\":\"string or regexp\",\"returns\":\"array of strings\"}"; - TestUtils.isSerializedTo(new Find(), json); - } } diff --git a/main/tests/server/src/com/google/refine/expr/functions/strings/FingerprintTests.java b/main/tests/server/src/com/google/refine/expr/functions/strings/FingerprintTests.java index 66138c9a8..8aa191414 100644 --- a/main/tests/server/src/com/google/refine/expr/functions/strings/FingerprintTests.java +++ b/main/tests/server/src/com/google/refine/expr/functions/strings/FingerprintTests.java @@ -82,11 +82,4 @@ public class FingerprintTests extends RefineTest { } } - @Test - public void serializeFingerprint() { - String json = "{\"description\":\"Returns the fingerprint of s, a derived string that aims to be a more canonical form of it (this is mostly useful for finding clusters of strings related to the same information).\",\"params\":\"string s\",\"returns\":\"string\"}"; - TestUtils.isSerializedTo(new Fingerprint(), json); - } - - } diff --git a/main/tests/server/src/com/google/refine/expr/functions/strings/IndexOfTests.java b/main/tests/server/src/com/google/refine/expr/functions/strings/IndexOfTests.java index 63bbaf332..e7c25b662 100644 --- a/main/tests/server/src/com/google/refine/expr/functions/strings/IndexOfTests.java +++ b/main/tests/server/src/com/google/refine/expr/functions/strings/IndexOfTests.java @@ -31,10 +31,5 @@ import org.testng.annotations.Test; import com.google.refine.util.TestUtils; public class IndexOfTests { - @Test - public void serializeIndexOf() { - String json = "{\"description\":\"Returns the index of sub first ocurring in s\",\"params\":\"string s, string sub\",\"returns\":\"number\"}"; - TestUtils.isSerializedTo(new IndexOf(), json); - } } diff --git a/main/tests/server/src/com/google/refine/expr/functions/strings/LastIndexOfTests.java b/main/tests/server/src/com/google/refine/expr/functions/strings/LastIndexOfTests.java index 81bbf308b..fa1357593 100644 --- a/main/tests/server/src/com/google/refine/expr/functions/strings/LastIndexOfTests.java +++ b/main/tests/server/src/com/google/refine/expr/functions/strings/LastIndexOfTests.java @@ -31,10 +31,5 @@ import org.testng.annotations.Test; import com.google.refine.util.TestUtils; public class LastIndexOfTests { - @Test - public void serializeLastIndexOf() { - String json = "{\"description\":\"Returns the index of sub last ocurring in s\",\"params\":\"string s, string sub\",\"returns\":\"number\"}"; - TestUtils.isSerializedTo(new LastIndexOf(), json); - } } diff --git a/main/tests/server/src/com/google/refine/expr/functions/strings/MD5Tests.java b/main/tests/server/src/com/google/refine/expr/functions/strings/MD5Tests.java index 73ce3bb7e..ce7f02c7a 100644 --- a/main/tests/server/src/com/google/refine/expr/functions/strings/MD5Tests.java +++ b/main/tests/server/src/com/google/refine/expr/functions/strings/MD5Tests.java @@ -31,10 +31,5 @@ import org.testng.annotations.Test; import com.google.refine.util.TestUtils; public class MD5Tests { - @Test - public void serializeMD5() { - String json = "{\"description\":\"Returns the MD5 hash of s\",\"params\":\"string s\",\"returns\":\"string\"}"; - TestUtils.isSerializedTo(new MD5(), json); - } } diff --git a/main/tests/server/src/com/google/refine/expr/functions/strings/MatchTests.java b/main/tests/server/src/com/google/refine/expr/functions/strings/MatchTests.java index 660a0515f..409b2e669 100644 --- a/main/tests/server/src/com/google/refine/expr/functions/strings/MatchTests.java +++ b/main/tests/server/src/com/google/refine/expr/functions/strings/MatchTests.java @@ -31,10 +31,5 @@ import org.testng.annotations.Test; import com.google.refine.util.TestUtils; public class MatchTests { - @Test - public void serializeMatch() { - String json = "{\"description\":\"Returns an array of the groups matching the given regular expression\",\"params\":\"regexp\",\"returns\":\"array of strings\"}"; - TestUtils.isSerializedTo(new Match(), json); - } } diff --git a/main/tests/server/src/com/google/refine/expr/functions/strings/NGramFingerprintTests.java b/main/tests/server/src/com/google/refine/expr/functions/strings/NGramFingerprintTests.java index 1703aae88..31658ecce 100644 --- a/main/tests/server/src/com/google/refine/expr/functions/strings/NGramFingerprintTests.java +++ b/main/tests/server/src/com/google/refine/expr/functions/strings/NGramFingerprintTests.java @@ -31,10 +31,5 @@ import org.testng.annotations.Test; import com.google.refine.util.TestUtils; public class NGramFingerprintTests { - @Test - public void serializeNGramFingerprint() { - String json = "{\"description\":\"Returns the n-gram fingerprint of s\",\"params\":\"string s, number n\",\"returns\":\"string\"}"; - TestUtils.isSerializedTo(new NGramFingerprint(), json); - } } diff --git a/main/tests/server/src/com/google/refine/expr/functions/strings/NGramTests.java b/main/tests/server/src/com/google/refine/expr/functions/strings/NGramTests.java index bc1190749..5c15d8552 100644 --- a/main/tests/server/src/com/google/refine/expr/functions/strings/NGramTests.java +++ b/main/tests/server/src/com/google/refine/expr/functions/strings/NGramTests.java @@ -31,10 +31,5 @@ import org.testng.annotations.Test; import com.google.refine.util.TestUtils; public class NGramTests { - @Test - public void serializeNGram() { - String json = "{\"description\":\"Returns an array of the word ngrams of s\",\"params\":\"string s, number n\",\"returns\":\"array of strings\"}"; - TestUtils.isSerializedTo(new NGram(), json); - } } diff --git a/main/tests/server/src/com/google/refine/expr/functions/strings/ParseJsonTests.java b/main/tests/server/src/com/google/refine/expr/functions/strings/ParseJsonTests.java index 16a6a7ae2..a876da631 100644 --- a/main/tests/server/src/com/google/refine/expr/functions/strings/ParseJsonTests.java +++ b/main/tests/server/src/com/google/refine/expr/functions/strings/ParseJsonTests.java @@ -31,10 +31,5 @@ import org.testng.annotations.Test; import com.google.refine.util.TestUtils; public class ParseJsonTests { - @Test - public void serializeParseJson() { - String json = "{\"description\":\"Parses a string as JSON\",\"params\":\"string s\",\"returns\":\"JSON object\"}"; - TestUtils.isSerializedTo(new ParseJson(), json); - } } diff --git a/main/tests/server/src/com/google/refine/expr/functions/strings/PartitionTests.java b/main/tests/server/src/com/google/refine/expr/functions/strings/PartitionTests.java index 005f0d408..180c6b1bf 100644 --- a/main/tests/server/src/com/google/refine/expr/functions/strings/PartitionTests.java +++ b/main/tests/server/src/com/google/refine/expr/functions/strings/PartitionTests.java @@ -31,10 +31,5 @@ import org.testng.annotations.Test; import com.google.refine.util.TestUtils; public class PartitionTests { - @Test - public void serializePartition() { - String json = "{\"description\":\"Returns an array of strings [a,frag,b] where a is the string part before the first occurrence of frag in s and b is what's left. If omitFragment is true, frag is not returned.\",\"params\":\"string s, string or regex frag, optional boolean omitFragment\",\"returns\":\"array\"}"; - TestUtils.isSerializedTo(new Partition(), json); - } } diff --git a/main/tests/server/src/com/google/refine/expr/functions/strings/PhoneticTests.java b/main/tests/server/src/com/google/refine/expr/functions/strings/PhoneticTests.java index 1281c868c..418fbacc5 100644 --- a/main/tests/server/src/com/google/refine/expr/functions/strings/PhoneticTests.java +++ b/main/tests/server/src/com/google/refine/expr/functions/strings/PhoneticTests.java @@ -32,12 +32,7 @@ import com.google.refine.util.TestUtils; import com.google.refine.expr.EvalError; public class PhoneticTests extends RefineTest { - @Test - public void serializePhonetic() { - String json = "{\"description\":\"Returns the a phonetic encoding of s (optionally indicating which encoding to use')\",\"params\":\"string s, string encoding (optional, defaults to 'metaphone3')\",\"returns\":\"string\"}"; - TestUtils.isSerializedTo(new Phonetic(), json); - } - + @Test public void testtoPhoneticInvalidParams() { Assert.assertTrue(invoke("phonetic") instanceof EvalError); //if no arguments are provided diff --git a/main/tests/server/src/com/google/refine/expr/functions/strings/RPartitionTests.java b/main/tests/server/src/com/google/refine/expr/functions/strings/RPartitionTests.java index 4baba0428..41663301e 100644 --- a/main/tests/server/src/com/google/refine/expr/functions/strings/RPartitionTests.java +++ b/main/tests/server/src/com/google/refine/expr/functions/strings/RPartitionTests.java @@ -31,10 +31,5 @@ import org.testng.annotations.Test; import com.google.refine.util.TestUtils; public class RPartitionTests { - @Test - public void serializeRPartition() { - String json = "{\"description\":\"Returns an array of strings [a,frag,b] where a is the string part before the last occurrence of frag in s and b is what's left. If omitFragment is true, frag is not returned.\",\"params\":\"string s, string or regex frag, optional boolean omitFragment\",\"returns\":\"array\"}"; - TestUtils.isSerializedTo(new RPartition(), json); - } } diff --git a/main/tests/server/src/com/google/refine/expr/functions/strings/RangeTests.java b/main/tests/server/src/com/google/refine/expr/functions/strings/RangeTests.java index 71ead4605..adf47b59b 100644 --- a/main/tests/server/src/com/google/refine/expr/functions/strings/RangeTests.java +++ b/main/tests/server/src/com/google/refine/expr/functions/strings/RangeTests.java @@ -313,10 +313,4 @@ public class RangeTests extends RefineTest { Assert.assertEquals(((Integer[]) (invoke("range", 5, "1", "-2"))), FIVE_AND_THREE); } - @Test - public void serializeRange() { - String json = "{\"description\":\"Returns an array where a and b are the start and the end of the range respectively and c is the step (increment).\",\"params\":\"A single string 'a', 'a, b' or 'a, b, c' or one, two or three integers a or a, b or a, b, c\",\"returns\":\"array\"}"; - TestUtils.isSerializedTo(new Range(), json); - } - } diff --git a/main/tests/server/src/com/google/refine/expr/functions/strings/ReinterpretTests.java b/main/tests/server/src/com/google/refine/expr/functions/strings/ReinterpretTests.java index 66ab267fe..0259761a8 100644 --- a/main/tests/server/src/com/google/refine/expr/functions/strings/ReinterpretTests.java +++ b/main/tests/server/src/com/google/refine/expr/functions/strings/ReinterpretTests.java @@ -31,10 +31,5 @@ import org.testng.annotations.Test; import com.google.refine.util.TestUtils; public class ReinterpretTests { - @Test - public void serializeReinterpret() { - String json = "{\"description\":\"Returns s reinterpreted using a target encoding and optional source encoding.\",\"params\":\"string s, string target encoding, string source encoding\",\"returns\":\"string\"}"; - TestUtils.isSerializedTo(new Reinterpret(), json); - } } diff --git a/main/tests/server/src/com/google/refine/expr/functions/strings/ReplaceCharsTests.java b/main/tests/server/src/com/google/refine/expr/functions/strings/ReplaceCharsTests.java index b43f883ad..e95d9aafa 100644 --- a/main/tests/server/src/com/google/refine/expr/functions/strings/ReplaceCharsTests.java +++ b/main/tests/server/src/com/google/refine/expr/functions/strings/ReplaceCharsTests.java @@ -31,10 +31,5 @@ import org.testng.annotations.Test; import com.google.refine.util.TestUtils; public class ReplaceCharsTests { - @Test - public void serializeReplaceChars() { - String json = "{\"description\":\"Returns the string obtained by replacing all chars in f with the char in s at that same position\",\"params\":\"string s, string f, string r\",\"returns\":\"string\"}"; - TestUtils.isSerializedTo(new ReplaceChars(), json); - } } diff --git a/main/tests/server/src/com/google/refine/expr/functions/strings/ReplaceTests.java b/main/tests/server/src/com/google/refine/expr/functions/strings/ReplaceTests.java index a834abe44..106ba83b9 100644 --- a/main/tests/server/src/com/google/refine/expr/functions/strings/ReplaceTests.java +++ b/main/tests/server/src/com/google/refine/expr/functions/strings/ReplaceTests.java @@ -36,12 +36,6 @@ import com.google.refine.expr.EvalError; import com.google.refine.util.TestUtils; public class ReplaceTests extends RefineTest { - @Test - public void serializeReplace() { - String json = "{\"description\":\"Returns the string obtained by replacing f with r in s\",\"params\":\"string s, string or regex f, string r\",\"returns\":\"string\"}"; - TestUtils.isSerializedTo(new Replace(), json); - } - @Test public void testReplace() { assertTrue(invoke("replace") instanceof EvalError); diff --git a/main/tests/server/src/com/google/refine/expr/functions/strings/SHA1Tests.java b/main/tests/server/src/com/google/refine/expr/functions/strings/SHA1Tests.java index 98c5cb478..3faab68cf 100644 --- a/main/tests/server/src/com/google/refine/expr/functions/strings/SHA1Tests.java +++ b/main/tests/server/src/com/google/refine/expr/functions/strings/SHA1Tests.java @@ -31,10 +31,5 @@ import org.testng.annotations.Test; import com.google.refine.util.TestUtils; public class SHA1Tests { - @Test - public void serializeSHA1() { - String json = "{\"description\":\"Returns the SHA-1 hash of s\",\"params\":\"string s\",\"returns\":\"string\"}"; - TestUtils.isSerializedTo(new SHA1(), json); - } } diff --git a/main/tests/server/src/com/google/refine/expr/functions/strings/SmartSplitTests.java b/main/tests/server/src/com/google/refine/expr/functions/strings/SmartSplitTests.java index 077b7955d..722b5c635 100644 --- a/main/tests/server/src/com/google/refine/expr/functions/strings/SmartSplitTests.java +++ b/main/tests/server/src/com/google/refine/expr/functions/strings/SmartSplitTests.java @@ -117,10 +117,4 @@ public class SmartSplitTests { } } - @Test - public void serializeSmartSplit() { - String json = "{\"description\":\"Returns the array of strings obtained by splitting s with separator sep. Handles quotes properly. Guesses tab or comma separator if \\\"sep\\\" is not given.\",\"params\":\"string s, optional string sep\",\"returns\":\"array\"}"; - TestUtils.isSerializedTo(new SmartSplit(), json); - } - } diff --git a/main/tests/server/src/com/google/refine/expr/functions/strings/SplitByCharTypeTests.java b/main/tests/server/src/com/google/refine/expr/functions/strings/SplitByCharTypeTests.java index 0037c1bed..949a04d4f 100644 --- a/main/tests/server/src/com/google/refine/expr/functions/strings/SplitByCharTypeTests.java +++ b/main/tests/server/src/com/google/refine/expr/functions/strings/SplitByCharTypeTests.java @@ -31,10 +31,5 @@ import org.testng.annotations.Test; import com.google.refine.util.TestUtils; public class SplitByCharTypeTests { - @Test - public void serializeSplitByCharType() { - String json = "{\"description\":\"Returns an array of strings obtained by splitting s grouping consecutive chars by their unicode type\",\"params\":\"string s\",\"returns\":\"array\"}"; - TestUtils.isSerializedTo(new SplitByCharType(), json); - } } diff --git a/main/tests/server/src/com/google/refine/expr/functions/strings/SplitByLengthsTests.java b/main/tests/server/src/com/google/refine/expr/functions/strings/SplitByLengthsTests.java index 026ef05a8..84fab937f 100644 --- a/main/tests/server/src/com/google/refine/expr/functions/strings/SplitByLengthsTests.java +++ b/main/tests/server/src/com/google/refine/expr/functions/strings/SplitByLengthsTests.java @@ -31,10 +31,5 @@ import org.testng.annotations.Test; import com.google.refine.util.TestUtils; public class SplitByLengthsTests { - @Test - public void serializeSplitByLengths() { - String json = "{\"description\":\"Returns the array of strings obtained by splitting s into substrings with the given lengths\",\"params\":\"string s, number n, ...\",\"returns\":\"array\"}"; - TestUtils.isSerializedTo(new SplitByLengths(), json); - } } diff --git a/main/tests/server/src/com/google/refine/expr/functions/strings/SplitTests.java b/main/tests/server/src/com/google/refine/expr/functions/strings/SplitTests.java index 1a6f76ddf..f1ca594d4 100644 --- a/main/tests/server/src/com/google/refine/expr/functions/strings/SplitTests.java +++ b/main/tests/server/src/com/google/refine/expr/functions/strings/SplitTests.java @@ -34,12 +34,6 @@ import com.google.refine.RefineTest; import com.google.refine.util.TestUtils; public class SplitTests extends RefineTest { - @Test - public void serializeSplit() { - String json = "{\"description\":\"Returns the array of strings obtained by splitting s with separator sep. If preserveAllTokens is true, then empty segments are preserved.\",\"params\":\"string s, string or regex sep, optional boolean preserveAllTokens\",\"returns\":\"array\"}"; - TestUtils.isSerializedTo(new Split(), json); - } - @Test public void testSplit() { assertEquals(invoke("split", "a,,b,c,d", ","), new String[] {"a", "b", "c", "d"}); diff --git a/main/tests/server/src/com/google/refine/expr/functions/strings/StartsWithTests.java b/main/tests/server/src/com/google/refine/expr/functions/strings/StartsWithTests.java index 1910e7560..a35b742fa 100644 --- a/main/tests/server/src/com/google/refine/expr/functions/strings/StartsWithTests.java +++ b/main/tests/server/src/com/google/refine/expr/functions/strings/StartsWithTests.java @@ -35,12 +35,6 @@ import com.google.refine.RefineTest; import com.google.refine.util.TestUtils; public class StartsWithTests extends RefineTest { - @Test - public void serializeStartsWith() { - String json = "{\"description\":\"Returns whether s starts with sub\",\"params\":\"string s, string sub\",\"returns\":\"boolean\"}"; - TestUtils.isSerializedTo(new StartsWith(), json); - } - @Test public void testStartsWith() { assertTrue((Boolean) invoke("startsWith", "testString", "test")); diff --git a/main/tests/server/src/com/google/refine/expr/functions/strings/ToLowercaseTests.java b/main/tests/server/src/com/google/refine/expr/functions/strings/ToLowercaseTests.java index 4f28306fe..3f48f67a4 100644 --- a/main/tests/server/src/com/google/refine/expr/functions/strings/ToLowercaseTests.java +++ b/main/tests/server/src/com/google/refine/expr/functions/strings/ToLowercaseTests.java @@ -34,12 +34,6 @@ import com.google.refine.expr.EvalError; import com.google.refine.util.TestUtils; public class ToLowercaseTests extends RefineTest { - @Test - public void serializeToLowercase() { - String json = "{\"description\":\"Returns s converted to lowercase\",\"params\":\"string s\",\"returns\":\"string\"}"; - TestUtils.isSerializedTo(new ToLowercase(), json); - } - @Test public void testtoLowercaseInvalidParams() { Assert.assertTrue(invoke("toLowercase") instanceof EvalError); diff --git a/main/tests/server/src/com/google/refine/expr/functions/strings/ToTitlecaseTests.java b/main/tests/server/src/com/google/refine/expr/functions/strings/ToTitlecaseTests.java index e7316c287..e2fdfc873 100644 --- a/main/tests/server/src/com/google/refine/expr/functions/strings/ToTitlecaseTests.java +++ b/main/tests/server/src/com/google/refine/expr/functions/strings/ToTitlecaseTests.java @@ -34,12 +34,6 @@ import com.google.refine.expr.EvalError; import com.google.refine.util.TestUtils; public class ToTitlecaseTests extends RefineTest { - @Test - public void serializeToTitlecase() { - String json = "{\"description\":\"Returns s converted to titlecase\",\"params\":\"string s\",\"returns\":\"string\"}"; - TestUtils.isSerializedTo(new ToTitlecase(), json); - } - @Test public void testToTitlecaseInvalidParams() { Assert.assertTrue(invoke("toTitlecase") instanceof EvalError); diff --git a/main/tests/server/src/com/google/refine/expr/functions/strings/ToUppercaseTests.java b/main/tests/server/src/com/google/refine/expr/functions/strings/ToUppercaseTests.java index fadac139d..6f6c4970a 100644 --- a/main/tests/server/src/com/google/refine/expr/functions/strings/ToUppercaseTests.java +++ b/main/tests/server/src/com/google/refine/expr/functions/strings/ToUppercaseTests.java @@ -31,10 +31,5 @@ import org.testng.annotations.Test; import com.google.refine.util.TestUtils; public class ToUppercaseTests { - @Test - public void serializeToUppercase() { - String json = "{\"description\":\"Returns s converted to uppercase\",\"params\":\"string s\",\"returns\":\"string\"}"; - TestUtils.isSerializedTo(new ToUppercase(), json); - } } diff --git a/main/tests/server/src/com/google/refine/expr/functions/strings/TrimTests.java b/main/tests/server/src/com/google/refine/expr/functions/strings/TrimTests.java index 0dd929ced..169a77e6d 100644 --- a/main/tests/server/src/com/google/refine/expr/functions/strings/TrimTests.java +++ b/main/tests/server/src/com/google/refine/expr/functions/strings/TrimTests.java @@ -97,10 +97,4 @@ public class TrimTests extends RefineTest { } } - - @Test - public void serializeTrim() { - String json = "{\"description\":\"Returns copy of the string, with leading and trailing whitespace omitted.\",\"params\":\"string s\",\"returns\":\"string\"}"; - TestUtils.isSerializedTo(new Trim(), json); - } } diff --git a/main/tests/server/src/com/google/refine/expr/functions/strings/UnescapeTests.java b/main/tests/server/src/com/google/refine/expr/functions/strings/UnescapeTests.java index 93e22cacc..d010f3040 100644 --- a/main/tests/server/src/com/google/refine/expr/functions/strings/UnescapeTests.java +++ b/main/tests/server/src/com/google/refine/expr/functions/strings/UnescapeTests.java @@ -34,12 +34,6 @@ import com.google.refine.RefineTest; import com.google.refine.util.TestUtils; public class UnescapeTests extends RefineTest { - @Test - public void serializeUnescape() { - String json = "{\"description\":\"Unescapes all escaped parts of the string depending on the given escaping mode.\",\"params\":\"string s, string mode ['html','xml','csv','url','javascript']\",\"returns\":\"string\"}"; - TestUtils.isSerializedTo(new Unescape(), json); - } - @Test public void testUnescape() { assertEquals(invoke("unescape", "Ä", "html"), "Ä"); diff --git a/main/tests/server/src/com/google/refine/expr/functions/strings/UnicodeTests.java b/main/tests/server/src/com/google/refine/expr/functions/strings/UnicodeTests.java index c01ca25df..419d175c0 100644 --- a/main/tests/server/src/com/google/refine/expr/functions/strings/UnicodeTests.java +++ b/main/tests/server/src/com/google/refine/expr/functions/strings/UnicodeTests.java @@ -31,10 +31,5 @@ import org.testng.annotations.Test; import com.google.refine.util.TestUtils; public class UnicodeTests { - @Test - public void serializeUnicode() { - String json = "{\"description\":\"Returns an array of strings describing each character of s in their full unicode notation\",\"params\":\"string s\",\"returns\":\"string\"}"; - TestUtils.isSerializedTo(new Unicode(), json); - } } diff --git a/main/tests/server/src/com/google/refine/expr/functions/strings/UnicodeTypeTests.java b/main/tests/server/src/com/google/refine/expr/functions/strings/UnicodeTypeTests.java index dd6a6c4c2..d2a1fd977 100644 --- a/main/tests/server/src/com/google/refine/expr/functions/strings/UnicodeTypeTests.java +++ b/main/tests/server/src/com/google/refine/expr/functions/strings/UnicodeTypeTests.java @@ -31,10 +31,5 @@ import org.testng.annotations.Test; import com.google.refine.util.TestUtils; public class UnicodeTypeTests { - @Test - public void serializeUnicodeType() { - String json = "{\"description\":\"Returns an array of strings describing each character of s in their full unicode notation\",\"params\":\"string s\",\"returns\":\"string\"}"; - TestUtils.isSerializedTo(new UnicodeType(), json); - } } diff --git a/main/tests/server/src/com/google/refine/expr/functions/xml/InnerXmlTests.java b/main/tests/server/src/com/google/refine/expr/functions/xml/InnerXmlTests.java index 5f14b967e..c19f49cea 100644 --- a/main/tests/server/src/com/google/refine/expr/functions/xml/InnerXmlTests.java +++ b/main/tests/server/src/com/google/refine/expr/functions/xml/InnerXmlTests.java @@ -31,10 +31,5 @@ import org.testng.annotations.Test; import com.google.refine.util.TestUtils; public class InnerXmlTests { - @Test - public void serializeInnerXml() { - String json = "{\"description\":\"The innerXml/innerHtml of an XML/HTML element\",\"params\":\"Element e\",\"returns\":\"String innerXml/innerHtml\"}"; - TestUtils.isSerializedTo(new InnerXml(), json); - } } diff --git a/main/tests/server/src/com/google/refine/expr/functions/xml/OwnTextTests.java b/main/tests/server/src/com/google/refine/expr/functions/xml/OwnTextTests.java index 64e0f6b4a..770eac7ba 100644 --- a/main/tests/server/src/com/google/refine/expr/functions/xml/OwnTextTests.java +++ b/main/tests/server/src/com/google/refine/expr/functions/xml/OwnTextTests.java @@ -31,10 +31,5 @@ import org.testng.annotations.Test; import com.google.refine.util.TestUtils; public class OwnTextTests { - @Test - public void serializeOwnText() { - String json = "{\"description\":\"Gets the text owned by this XML/HTML element only; does not get the combined text of all children.\",\"params\":\"Element e\",\"returns\":\"String ownText\"}"; - TestUtils.isSerializedTo(new OwnText(), json); - } } diff --git a/main/tests/server/src/com/google/refine/expr/functions/xml/ParseXmlTests.java b/main/tests/server/src/com/google/refine/expr/functions/xml/ParseXmlTests.java index 213da6dae..36d0d4833 100644 --- a/main/tests/server/src/com/google/refine/expr/functions/xml/ParseXmlTests.java +++ b/main/tests/server/src/com/google/refine/expr/functions/xml/ParseXmlTests.java @@ -67,12 +67,6 @@ public class ParseXmlTests extends RefineTest { logger = LoggerFactory.getLogger(this.getClass()); } - @Test - public void serializeParseXml() { - String json = "{\"description\":\"Parses a string as XML\",\"params\":\"string s\",\"returns\":\"XML object\"}"; - TestUtils.isSerializedTo(new ParseXml(), json); - } - @Test public void testParseXml() { Assert.assertTrue(invoke("parseXml") instanceof EvalError); diff --git a/main/tests/server/src/com/google/refine/expr/functions/xml/SelectXmlTests.java b/main/tests/server/src/com/google/refine/expr/functions/xml/SelectXmlTests.java index a68e92d77..9f4e2a8e5 100644 --- a/main/tests/server/src/com/google/refine/expr/functions/xml/SelectXmlTests.java +++ b/main/tests/server/src/com/google/refine/expr/functions/xml/SelectXmlTests.java @@ -31,10 +31,5 @@ import org.testng.annotations.Test; import com.google.refine.util.TestUtils; public class SelectXmlTests { - @Test - public void serializeSelectXml() { - String json = "{\"description\":\"Selects an element from an XML or HTML elementn using selector syntax.\",\"returns\":\"HTML Elements\",\"params\":\"Element e, String s\"}"; - TestUtils.isSerializedTo(new SelectXml(), json); - } } diff --git a/main/tests/server/src/com/google/refine/expr/functions/xml/xmlAttrTests.java b/main/tests/server/src/com/google/refine/expr/functions/xml/xmlAttrTests.java deleted file mode 100644 index 5a38d18c3..000000000 --- a/main/tests/server/src/com/google/refine/expr/functions/xml/xmlAttrTests.java +++ /dev/null @@ -1,40 +0,0 @@ -/******************************************************************************* - * Copyright (C) 2018, OpenRefine contributors - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - ******************************************************************************/ -package com.google.refine.expr.functions.xml; - -import org.testng.annotations.Test; - -import com.google.refine.util.TestUtils; - -public class xmlAttrTests { - @Test - public void serializeXmlAttr() { - String json = "{\"description\":\"Selects a value from an attribute on an XML or HTML Element\",\"returns\":\"String attribute Value\",\"params\":\"Element e, String s\"}"; - TestUtils.isSerializedTo(new XmlAttr(), json); - } -} - diff --git a/main/tests/server/src/com/google/refine/expr/functions/xml/xmlTextTests.java b/main/tests/server/src/com/google/refine/expr/functions/xml/xmlTextTests.java deleted file mode 100644 index 41bef9444..000000000 --- a/main/tests/server/src/com/google/refine/expr/functions/xml/xmlTextTests.java +++ /dev/null @@ -1,40 +0,0 @@ -/******************************************************************************* - * Copyright (C) 2018, OpenRefine contributors - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - ******************************************************************************/ -package com.google.refine.expr.functions.xml; - -import org.testng.annotations.Test; - -import com.google.refine.util.TestUtils; - -public class xmlTextTests { - @Test - public void serializeXmlText() { - String json = "{\"description\":\"Selects the text from within an element (including all child elements)\",\"params\":\"Element e\",\"returns\":\"String text\"}"; - TestUtils.isSerializedTo(new XmlText(), json); - } -} -