public class TestFunctions extends TestBase implements AggregateFunction
| Modifier and Type | Class and Description |
|---|---|
static class |
TestFunctions.MedianString
This median implementation keeps all objects in memory.
|
static class |
TestFunctions.MedianStringType
This median implementation keeps all objects in memory.
|
TestBase.ChildBASE_TEST_DIR, config, start, uniqueId| Constructor and Description |
|---|
TestFunctions() |
| Modifier and Type | Method and Description |
|---|---|
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 long |
currentTimestampOverride()
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.sql.ResultSet |
varArgsFunctionTable(int... values)
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.
|
assertContains, assertEqualDatabases, assertEqualReaders, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEqualStreams, assertFalse, assertFalse, assertKnownException, assertKnownException, assertNull, assertResult, assertResultRowCount, assertResultSetMeta, assertResultSetOrdered, assertSingleValue, assertSmaller, assertStartsWith, assertThrows, assertThrows, assertThrows, assertThrows, assertTrue, assertTrue, buildChild, crash, createCaller, createClassProxy, createFailingStream, deleteDb, deleteDb, eatMemory, execute, execute, fail, fail, freeMemory, getBaseDir, getClassPath, getConnection, getConnection, getFilePassword, getMemoryUsed, getMemoryUsedBytes, getPassword, getPassword, getSize, getTestDir, getTestName, getURL, getUser, init, init, logError, logErrorMessage, println, printTime, printTimeMemory, readString, runTest, startServerIfRequired, throwException, trace, trace, traceMemorypublic static void main(java.lang.String... a)
throws java.lang.Exception
a - ignoredjava.lang.Exceptionpublic void test()
throws java.lang.Exception
TestBasepublic static java.sql.ResultSet simpleFunctionTable(java.sql.Connection conn)
conn - the connectionpublic static java.sql.ResultSet varArgsFunctionTable(int... values)
throws java.sql.SQLException
values - the value arrayjava.sql.SQLExceptionpublic static Value toChar(Value... args)
args - the argument listpublic static void testDefaultConn()
throws java.sql.SQLException
java.sql.SQLExceptionpublic static java.io.BufferedInputStream blob2stream(java.sql.Blob value)
throws java.sql.SQLException
value - the blobjava.sql.SQLExceptionpublic static java.sql.Blob blob(java.sql.Blob value)
value - the blobpublic static java.sql.Clob clob(java.sql.Clob value)
value - the blobpublic static java.io.BufferedInputStream stream2stream(java.io.InputStream value)
value - the input streampublic static int addRow(java.sql.Connection conn,
int id,
java.lang.String name)
throws java.sql.SQLException
conn - the connectionid - the test idname - the textjava.sql.SQLExceptionpublic static java.sql.ResultSet select(java.sql.Connection conn,
java.lang.String sql)
throws java.sql.SQLException
conn - the connectionsql - the SQL statementjava.sql.SQLExceptionpublic static java.sql.ResultSet selectMaxId(java.sql.Connection conn)
throws java.sql.SQLException
conn - the connectionjava.sql.SQLExceptionpublic static java.lang.Object[] getArray()
public static java.sql.ResultSet resultSetWithNull(java.sql.Connection conn)
throws java.sql.SQLException
conn - the connectionjava.sql.SQLExceptionpublic static java.sql.ResultSet nullResultSet(java.sql.Connection conn)
conn - the connectionpublic 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 shortpublic static int root(int value)
value - the valuepublic static double mean()
public static java.math.BigDecimal noOp(java.math.BigDecimal dec)
dec - the valuepublic static int getCount()
public static java.lang.String reverse(java.lang.String s)
s - the stringpublic static double mean(double... values)
values - the valuespublic static double mean2(java.sql.Connection conn,
double... values)
conn - the connectionvalues - the valuespublic static java.lang.String printMean(java.lang.String prefix,
double... values)
prefix - the print prefixvalues - the valuespublic static java.util.UUID xorUUID(java.util.UUID a,
java.util.UUID b)
a - the first UUIDb - the second UUIDpublic static java.lang.Object[] dynamic(java.lang.Object[] args)
args - the argument listpublic static long currentTimestampOverride()
public void add(java.lang.Object value)
AggregateFunctionadd in interface AggregateFunctionvalue - the value(s) for this rowpublic java.lang.Object getResult()
AggregateFunctiongetResult in interface AggregateFunctionpublic int getType(int[] inputTypes)
AggregateFunctiongetType in interface AggregateFunctioninputTypes - the SQL type of the parameters, Typespublic void init(java.sql.Connection conn)
AggregateFunctioninit in interface AggregateFunctionconn - a connection to the database