|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.h2.test.TestBase
org.h2.test.db.TestFunctions
public class TestFunctions
Tests for user defined functions and aggregates.
Nested Class Summary | |
---|---|
static class |
TestFunctions.MedianString
This median implementation keeps all objects in memory. |
Field Summary |
---|
Fields inherited from class org.h2.test.TestBase |
---|
BASE_TEST_DIR, config, start, TEMP_DIR, uniqueId |
Constructor Summary | |
---|---|
TestFunctions()
|
Method Summary | |
---|---|
void |
add(java.lang.Object value)
This method is called once for each row. |
static int |
addRow(java.sql.Connection conn,
int id,
java.lang.String name)
This method is called via reflection from the database. |
static java.sql.Blob |
blob(java.sql.Blob value)
This method is called via reflection from the database. |
static java.io.BufferedInputStream |
blob2stream(java.sql.Blob value)
This method is called via reflection from the database. |
static java.sql.Clob |
clob(java.sql.Clob value)
This method is called via reflection from the database. |
static java.lang.Object[] |
dynamic(java.lang.Object[] args)
This method is called via reflection from the database. |
static java.lang.Object[] |
getArray()
This method is called via reflection from the database. |
static int |
getCount()
This method is called via reflection from the database. |
java.lang.Object |
getResult()
This method returns the computed aggregate value. |
int |
getType(int[] inputTypes)
This method must return the SQL type of the method, given the SQL type of the input data. |
void |
init(java.sql.Connection conn)
This method is called when the aggregate function is used. |
static void |
main(java.lang.String... a)
Run just this test. |
static double |
mean()
This method is called via reflection from the database. |
static double |
mean(double... values)
This method is called via reflection from the database. |
static double |
mean2(java.sql.Connection conn,
double... values)
This method is called via reflection from the database. |
static java.math.BigDecimal |
noOp(java.math.BigDecimal dec)
This method is called via reflection from the database. |
static java.sql.ResultSet |
nullResultSet(java.sql.Connection conn)
This method is called via reflection from the database. |
static java.lang.String |
printMean(java.lang.String prefix,
double... values)
This method is called via reflection from the database. |
static java.sql.ResultSet |
resultSetWithNull(java.sql.Connection conn)
This method is called via reflection from the database. |
static java.lang.String |
reverse(java.lang.String s)
This method is called via reflection from the database. |
static int |
root(int value)
This method is called via reflection from the database. |
static java.sql.ResultSet |
select(java.sql.Connection conn,
java.lang.String sql)
This method is called via reflection from the database. |
static java.sql.ResultSet |
selectMaxId(java.sql.Connection conn)
This method is called via reflection from the database. |
static java.sql.ResultSet |
simpleFunctionTable(java.sql.Connection conn)
This method is called via reflection from the database. |
static java.sql.ResultSet |
simpleResultSet(java.lang.Integer rowCount,
int ip,
boolean bp,
float fp,
double dp,
long lp,
byte byParam,
short sp)
Test method to create a simple result set. |
static java.io.BufferedInputStream |
stream2stream(java.io.InputStream value)
This method is called via reflection from the database. |
void |
test()
This method will be called by the test framework. |
static void |
testDefaultConn()
This method is called via reflection from the database. |
static Value |
toChar(Value... args)
This method is called via reflection from the database. |
static java.util.UUID |
xorUUID(java.util.UUID a,
java.util.UUID b)
This method is called via reflection from the database. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TestFunctions()
Method Detail |
---|
public static void main(java.lang.String... a) throws java.lang.Exception
a
- ignored
java.lang.Exception
public void test() throws java.lang.Exception
TestBase
test
in class TestBase
java.lang.Exception
- if an exception in the test occurspublic static java.sql.ResultSet simpleFunctionTable(java.sql.Connection conn)
conn
- the connection
public static Value toChar(Value... args)
args
- the argument list
public static void testDefaultConn() throws java.sql.SQLException
java.sql.SQLException
public static java.io.BufferedInputStream blob2stream(java.sql.Blob value) throws java.sql.SQLException
value
- the blob
java.sql.SQLException
public static java.sql.Blob blob(java.sql.Blob value)
value
- the blob
public static java.sql.Clob clob(java.sql.Clob value)
value
- the blob
public static java.io.BufferedInputStream stream2stream(java.io.InputStream value)
value
- the input stream
public static int addRow(java.sql.Connection conn, int id, java.lang.String name) throws java.sql.SQLException
conn
- the connectionid
- the test idname
- the text
java.sql.SQLException
public static java.sql.ResultSet select(java.sql.Connection conn, java.lang.String sql) throws java.sql.SQLException
conn
- the connectionsql
- the SQL statement
java.sql.SQLException
public static java.sql.ResultSet selectMaxId(java.sql.Connection conn) throws java.sql.SQLException
conn
- the connection
java.sql.SQLException
public static java.lang.Object[] getArray()
public static java.sql.ResultSet resultSetWithNull(java.sql.Connection conn) throws java.sql.SQLException
conn
- the connection
java.sql.SQLException
public static java.sql.ResultSet nullResultSet(java.sql.Connection conn)
conn
- the connection
public static java.sql.ResultSet simpleResultSet(java.lang.Integer rowCount, int ip, boolean bp, float fp, double dp, long lp, byte byParam, short sp)
rowCount
- the number of rowsip
- an intbp
- a booleanfp
- a floatdp
- a doublelp
- a longbyParam
- a bytesp
- a short
public static int root(int value)
value
- the value
public static double mean()
public static java.math.BigDecimal noOp(java.math.BigDecimal dec)
dec
- the value
public static int getCount()
public static java.lang.String reverse(java.lang.String s)
s
- the string
public static double mean(double... values)
values
- the values
public static double mean2(java.sql.Connection conn, double... values)
conn
- the connectionvalues
- the values
public static java.lang.String printMean(java.lang.String prefix, double... values)
prefix
- the print prefixvalues
- the values
public static java.util.UUID xorUUID(java.util.UUID a, java.util.UUID b)
a
- the first UUIDb
- the second UUID
public static java.lang.Object[] dynamic(java.lang.Object[] args)
args
- the argument list
public void add(java.lang.Object value)
AggregateFunction
add
in interface AggregateFunction
value
- the value(s) for this rowpublic java.lang.Object getResult()
AggregateFunction
getResult
in interface AggregateFunction
public int getType(int[] inputTypes)
AggregateFunction
getType
in interface AggregateFunction
inputTypes
- the SQL type of the parameters
public void init(java.sql.Connection conn)
AggregateFunction
init
in interface AggregateFunction
conn
- a connection to the database
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |