MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
testsuite.clusterj.AbstractClusterJModelTest Class Reference
Inheritance diagram for testsuite.clusterj.AbstractClusterJModelTest:
Collaboration diagram for testsuite.clusterj.AbstractClusterJModelTest:

Classes

class  ColumnDescriptor
interface  InstanceHandler

Public Member Functions

void localSetUp ()
- Public Member Functions inherited from testsuite.clusterj.AbstractClusterJTest
void createSession ()

Protected Member Functions

boolean getCleanupAfterTest ()
void setAutoCommit (Connection connection, boolean b)
void createEmployeeInstances (int count)
void consistencyCheck (Employee emp)
void createDn2idInstances (int number)
void consistencyCheck (Dn2id dn2id)
List< Object[]> getExpected ()
String getTableName ()
int getNumberOfInstances ()
ColumnDescriptor[] getColumnDescriptors ()
Object getColumnValue (int i, int j)
void writeJDBCreadNDB ()
void writeJDBCreadJDBC ()
void writeNDBreadNDB ()
void writeNDBreadJDBC ()
void queryAndVerifyResults (String where, ColumnDescriptor[] columnDescriptors, String conditions, Object[] parameters, int...objectIds)
List< Object[]> queryJDBC (ColumnDescriptor[] columnDescriptors, String conditions, Object[] parameters)
void verifyQueryResults (String where, List< Object[]> results, int...objectIds)
void verify (String where, List< Object[]> expecteds, List< Object[]> actuals)
void generateInstances (ColumnDescriptor[] columnDescriptors)
IdBase getNewInstance (Class<?extends IdBase > modelClass)
void writeToJDBC (ColumnDescriptor[] columnDescriptors, List< IdBase > instances)
void writeToNDB (ColumnDescriptor[] columnDescriptors, List< IdBase > instances)
List< Object[]> readFromNDB (ColumnDescriptor[] columnDescriptors)
List< Object[]> readFromJDBC (ColumnDescriptor[] columnDescriptors)
String getA1for (int number, int index)
String getA3for (long i)
void createAllPrimitivesInstances (int number)
void createAllPrimitivesInstances (Session session, int number)
AllPrimitives createAllPrimitiveInstance (Session session, int i)
void initialize (AllPrimitives instance, int i)
- Protected Member Functions inherited from testsuite.clusterj.AbstractClusterJTest
boolean getDebug ()
void addTearDownClasses (Class<?>...classes)
void createSessionFactory ()
Properties modifyProperties ()
void dumpSystemProperties ()
void error (String message)
void error (String context, Exception ex)
void errorIfNotEqual (String message, Object expected, Object actual)
void errorIfNotEqual (String message, int[] expected, int[] actual)
void errorIfEqual (String message, Object expected, Object actual)
void failOnError ()
void closeConnection ()
void getConnection (Properties extraProperties)
Connection getConnection ()
void getConnection (String propertiesFileName)
void loadDriver ()
void initializeErrorMessages ()
void initializeJDBC ()
void initializeSchema ()
void loadProperties ()
void loadProperties (String propsFileName)
void loadSchema ()
void loadSchemaDefinition ()
void localTearDown ()
final void setUp () throws Exception
final void tearDown () throws Exception
void removeAll (Class<?> cls)
boolean testSchema ()
boolean resetSchema ()
String dump (List< String > list)

Static Protected Member Functions

static long getMillisFor (int year, int month, int day, int hour, int minute, int second)
static long getMillisFor (int year, int month, int day)
static long getMillisFor (int days, int hour, int minute, int second)
static void resetLocalSystemDefaultTimeZone (Connection connection)
static Object[] setupDn2idPK ()
- Static Protected Member Functions inherited from testsuite.clusterj.AbstractClusterJTest
static String dump (String string)

Protected Attributes

List< Employeeemployees
List< Dn2iddn2ids
List< IdBaseinstances = new ArrayList<IdBase>()
ClassLoader loader
- Protected Attributes inherited from testsuite.clusterj.AbstractClusterJTest
Session session
SessionFactory sessionFactory
Transaction tx
boolean debug

Static Protected Attributes

static TimeZone localSystemTimeZone = TimeZone.getDefault()
static final long ONE_SECOND = 1000L
static final long ONE_MINUTE = 1000L * 60L
static final long ONE_HOUR = 1000L * 60L * 60L
static final long TEN_HOURS = 1000L * 60L * 60L * 10L
static final long ONE_DAY = 1000L * 60L * 60L * 24L
static Object[] dn2idPK = setupDn2idPK()
- Static Protected Attributes inherited from testsuite.clusterj.AbstractClusterJTest
static final String JDBC_DRIVER_NAME = "jdbc.driverName"
static final String JDBC_URL = "jdbc.url"
static Connection connection
static String jdbcDriverName
static String jdbcPassword
static String jdbcURL
static String jdbcUsername
static Properties props
static List< StringschemaDefinition = new ArrayList<String>()
static boolean schemaInitialized = false

Detailed Description

Definition at line 45 of file AbstractClusterJModelTest.java.

Member Function Documentation

void testsuite.clusterj.AbstractClusterJModelTest.generateInstances ( ColumnDescriptor[]  columnDescriptors)
inlineprotected

Generated instances to persist. When using JDBC, the data is obtained from the instance via the column descriptors. As a side effect (!) create the list of expected results from read.

Parameters
columnDescriptorsthe column descriptors
Returns
the generated instances

Definition at line 483 of file AbstractClusterJModelTest.java.

Here is the call graph for this function:

Here is the caller graph for this function:

List<Object[]> testsuite.clusterj.AbstractClusterJModelTest.getExpected ( )
inlineprotected

Subclasses usually should not override this method to provide the list of expected results

Definition at line 298 of file AbstractClusterJModelTest.java.

Here is the caller graph for this function:

static long testsuite.clusterj.AbstractClusterJModelTest.getMillisFor ( int  year,
int  month,
int  day,
int  hour,
int  minute,
int  second 
)
inlinestaticprotected

Convert year, month, day, hour, minute, second into milliseconds after the Epoch, UCT.

Parameters
yearthe year
monththe month (0 for January)
daythe day of the month
hourthe hour of the day
minutethe minute
secondthe second
Returns

Definition at line 74 of file AbstractClusterJModelTest.java.

Here is the caller graph for this function:

static long testsuite.clusterj.AbstractClusterJModelTest.getMillisFor ( int  year,
int  month,
int  day 
)
inlinestaticprotected

Convert year, month, day into milliseconds after the Epoch, UCT. Set hours, minutes, seconds, and milliseconds to zero.

Parameters
yearthe year
monththe month (0 for January)
daythe day of the month
Returns

Definition at line 95 of file AbstractClusterJModelTest.java.

static long testsuite.clusterj.AbstractClusterJModelTest.getMillisFor ( int  days,
int  hour,
int  minute,
int  second 
)
inlinestaticprotected

Convert days, hours, minutes, and seconds into milliseconds after the Epoch, UCT. Date is index origin 1 so add one to the number of days. Default year and month, as these are assumed by Calendar to be the Epoch.

Parameters
daythe number of days
hourthe hour (or number of hours)
minutethe minute (or number of minutes)
secondthe second (or number of seconds)
Returns
millis past the Epoch UCT

Definition at line 118 of file AbstractClusterJModelTest.java.

IdBase testsuite.clusterj.AbstractClusterJModelTest.getNewInstance ( Class<?extends IdBase modelClass)
inlineprotected

Create a new instance of the parameter interface

Parameters
modelClassthe interface to instantiate
Returns
an instance of the class

Definition at line 514 of file AbstractClusterJModelTest.java.

Here is the call graph for this function:

Here is the caller graph for this function:

void testsuite.clusterj.AbstractClusterJModelTest.localSetUp ( )
inline
List<Object[]> testsuite.clusterj.AbstractClusterJModelTest.queryJDBC ( ColumnDescriptor[]  columnDescriptors,
String  conditions,
Object[]  parameters 
)
inlineprotected

Read data via JDBC

Definition at line 388 of file AbstractClusterJModelTest.java.

Here is the call graph for this function:

List<Object[]> testsuite.clusterj.AbstractClusterJModelTest.readFromJDBC ( ColumnDescriptor[]  columnDescriptors)
inlineprotected

Read data via JDBC ordered by id

Definition at line 601 of file AbstractClusterJModelTest.java.

Here is the call graph for this function:

Here is the caller graph for this function:

List<Object[]> testsuite.clusterj.AbstractClusterJModelTest.readFromNDB ( ColumnDescriptor[]  columnDescriptors)
inlineprotected

Read data via NDB

Definition at line 568 of file AbstractClusterJModelTest.java.

Here is the call graph for this function:

Here is the caller graph for this function:

static void testsuite.clusterj.AbstractClusterJModelTest.resetLocalSystemDefaultTimeZone ( Connection  connection)
inlinestaticprotected

Reset the local system default time zone to the time zone used by the MySQL server. This guarantees that there is no time zone offset between the time zone in the client and the time zone in the server.

Parameters
connection

Definition at line 175 of file AbstractClusterJModelTest.java.

Here is the caller graph for this function:

void testsuite.clusterj.AbstractClusterJModelTest.verify ( String  where,
List< Object[]>  expecteds,
List< Object[]>  actuals 
)
inlineprotected

Verify that the actual results match the expected results. If not, use the multiple error reporting method errorIfNotEqual defined in the superclass.

Parameters
wherethe location of the verification of results, normally the name of the test method
expectedsthe expected results
actualsthe actual results

Reimplemented in testsuite.clusterj.BitTypesTest, testsuite.clusterj.VarbinaryTypesTest, and testsuite.clusterj.BinaryTypesTest.

Definition at line 461 of file AbstractClusterJModelTest.java.

Here is the caller graph for this function:

void testsuite.clusterj.AbstractClusterJModelTest.writeJDBCreadJDBC ( )
inlineprotected

Write data via JDBC and read back the data via JDBC

Definition at line 338 of file AbstractClusterJModelTest.java.

Here is the call graph for this function:

Here is the caller graph for this function:

void testsuite.clusterj.AbstractClusterJModelTest.writeJDBCreadNDB ( )
inlineprotected

Write data via JDBC and read back the data via NDB

Definition at line 328 of file AbstractClusterJModelTest.java.

Here is the call graph for this function:

Here is the caller graph for this function:

void testsuite.clusterj.AbstractClusterJModelTest.writeNDBreadJDBC ( )
inlineprotected

Write data via NDB and read back the data via JDBC

Definition at line 358 of file AbstractClusterJModelTest.java.

Here is the call graph for this function:

Here is the caller graph for this function:

void testsuite.clusterj.AbstractClusterJModelTest.writeNDBreadNDB ( )
inlineprotected

Write data via NDB and read back the data via NDB

Definition at line 348 of file AbstractClusterJModelTest.java.

Here is the call graph for this function:

void testsuite.clusterj.AbstractClusterJModelTest.writeToJDBC ( ColumnDescriptor[]  columnDescriptors,
List< IdBase instances 
)
inlineprotected

Write data to JDBC.

Definition at line 521 of file AbstractClusterJModelTest.java.

Here is the call graph for this function:

Here is the caller graph for this function:

void testsuite.clusterj.AbstractClusterJModelTest.writeToNDB ( ColumnDescriptor[]  columnDescriptors,
List< IdBase instances 
)
inlineprotected

Write data via NDB

Definition at line 561 of file AbstractClusterJModelTest.java.

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

List<IdBase> testsuite.clusterj.AbstractClusterJModelTest.instances = new ArrayList<IdBase>()
protected

The instances used in the tests, generated by generateInstances

Definition at line 140 of file AbstractClusterJModelTest.java.

ClassLoader testsuite.clusterj.AbstractClusterJModelTest.loader
protected

The class loader for the domain object type

Definition at line 149 of file AbstractClusterJModelTest.java.

TimeZone testsuite.clusterj.AbstractClusterJModelTest.localSystemTimeZone = TimeZone.getDefault()
staticprotected

The local system default time zone, which is reset by resetLocalSystemDefaultTimeZone

Definition at line 48 of file AbstractClusterJModelTest.java.

final long testsuite.clusterj.AbstractClusterJModelTest.ONE_DAY = 1000L * 60L * 60L * 24L
staticprotected

ONE_DAY is the number of milliseconds in one day.

Definition at line 63 of file AbstractClusterJModelTest.java.

final long testsuite.clusterj.AbstractClusterJModelTest.ONE_HOUR = 1000L * 60L * 60L
staticprotected

ONE_HOUR is the number of milliseconds in one hour.

Definition at line 57 of file AbstractClusterJModelTest.java.

final long testsuite.clusterj.AbstractClusterJModelTest.ONE_MINUTE = 1000L * 60L
staticprotected

ONE_MINUTE is the number of milliseconds in one minute.

Definition at line 54 of file AbstractClusterJModelTest.java.

final long testsuite.clusterj.AbstractClusterJModelTest.ONE_SECOND = 1000L
staticprotected

ONE_SECOND is the number of milliseconds in one second.

Definition at line 51 of file AbstractClusterJModelTest.java.

final long testsuite.clusterj.AbstractClusterJModelTest.TEN_HOURS = 1000L * 60L * 60L * 10L
staticprotected

TEN_HOURS is the number of milliseconds in ten hours.

Definition at line 60 of file AbstractClusterJModelTest.java.


The documentation for this class was generated from the following file: