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

Classes

class  ColumnDescriptor
interface  InstanceHandler

Public Member Functions

void deleteAll ()
void verifyDeleteAll ()
void createAll ()
void findAll ()
void updateThenVerifyAll ()
void deleteThenVerifyAll ()
- Public Member Functions inherited from com.mysql.clusterj.jpatest.SingleEMTestCase
void setUp ()
void setUp (Object...props)
void tearDown () throws Exception

Protected Member Functions

void getConnection ()
void setAutoCommit (Connection connection, boolean b)
void verifyEmployee (Employee e, int updateOffset)
int getNumberOfEmployees ()
boolean getDebug ()
List< Object[]> getExpected ()
String getTableName ()
int getNumberOfInstances ()
ColumnDescriptor[] getColumnDescriptors ()
IdBase getNewInstance (Class<?extends IdBase > modelClass)
Class<?extends IdBasegetModelClass ()
Object getColumnValue (int i, int j)
void generateInstances (ColumnDescriptor[] columnDescriptors)
void verify (String where, List< Object[]> expecteds, List< Object[]> actuals)
void removeAll (Class<?extends IdBase > modelClass)
void writeJDBCreadJPA ()
void writeJDBCreadJDBC ()
void writeJPAreadJPA ()
void writeJPAreadJDBC ()
void writeToJPA (ColumnDescriptor[] columnDescriptors, List< IdBase > instances)
void writeToJDBC (ColumnDescriptor[] columnDescriptors, List< IdBase > instances)
List< Object[]> readFromJPA (ColumnDescriptor[] columnDescriptors)
List< Object[]> readFromJDBC (ColumnDescriptor[] columnDescriptors)
- Protected Member Functions inherited from com.mysql.clusterj.jpatest.SingleEMTestCase
boolean begin ()
boolean commit ()
boolean rollback ()
boolean close ()

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)

Protected Attributes

Connection connection
- Protected Attributes inherited from com.mysql.clusterj.jpatest.SingleEMTestCase
EntityManager em
EntityTransaction tx
- Protected Attributes inherited from com.mysql.clusterj.jpatest.SingleEMFTestCase
EntityManagerFactory emf
- Protected Attributes inherited from com.mysql.clusterj.jpatest.PersistenceTestCase
TestResult testResult
Map map

Static Protected Attributes

static TimeZone localSystemTimeZone = TimeZone.getDefault()
static boolean debug

Detailed Description

Definition at line 39 of file AbstractJPABaseTest.java.

Member Function Documentation

void com.mysql.clusterj.jpatest.AbstractJPABaseTest.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 366 of file AbstractJPABaseTest.java.

Here is the call graph for this function:

Here is the caller graph for this function:

List<Object[]> com.mysql.clusterj.jpatest.AbstractJPABaseTest.getExpected ( )
inlineprotected

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

Definition at line 327 of file AbstractJPABaseTest.java.

Here is the caller graph for this function:

static long com.mysql.clusterj.jpatest.AbstractJPABaseTest.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 185 of file AbstractJPABaseTest.java.

Here is the caller graph for this function:

static long com.mysql.clusterj.jpatest.AbstractJPABaseTest.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 206 of file AbstractJPABaseTest.java.

static long com.mysql.clusterj.jpatest.AbstractJPABaseTest.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 229 of file AbstractJPABaseTest.java.

List<Object[]> com.mysql.clusterj.jpatest.AbstractJPABaseTest.readFromJDBC ( ColumnDescriptor[]  columnDescriptors)
inlineprotected

Read data via JDBC

Definition at line 538 of file AbstractJPABaseTest.java.

Here is the call graph for this function:

Here is the caller graph for this function:

List<Object[]> com.mysql.clusterj.jpatest.AbstractJPABaseTest.readFromJPA ( ColumnDescriptor[]  columnDescriptors)
inlineprotected

Read data via JPA

Definition at line 521 of file AbstractJPABaseTest.java.

Here is the call graph for this function:

Here is the caller graph for this function:

static void com.mysql.clusterj.jpatest.AbstractJPABaseTest.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
connection2

Definition at line 247 of file AbstractJPABaseTest.java.

Here is the caller graph for this function:

void com.mysql.clusterj.jpatest.AbstractJPABaseTest.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

Definition at line 399 of file AbstractJPABaseTest.java.

Here is the caller graph for this function:

void com.mysql.clusterj.jpatest.AbstractJPABaseTest.writeJDBCreadJDBC ( )
inlineprotected

Write data via JDBC and read back the data via JDBC

Definition at line 442 of file AbstractJPABaseTest.java.

Here is the call graph for this function:

void com.mysql.clusterj.jpatest.AbstractJPABaseTest.writeJDBCreadJPA ( )
inlineprotected

Write data via JDBC and read back the data via JPA

Definition at line 432 of file AbstractJPABaseTest.java.

Here is the call graph for this function:

Here is the caller graph for this function:

void com.mysql.clusterj.jpatest.AbstractJPABaseTest.writeJPAreadJDBC ( )
inlineprotected

Write data via JPA and read back the data via JDBC

Definition at line 462 of file AbstractJPABaseTest.java.

Here is the call graph for this function:

void com.mysql.clusterj.jpatest.AbstractJPABaseTest.writeJPAreadJPA ( )
inlineprotected

Write data via JPA and read back the data via JPA

Definition at line 452 of file AbstractJPABaseTest.java.

Here is the call graph for this function:

void com.mysql.clusterj.jpatest.AbstractJPABaseTest.writeToJDBC ( ColumnDescriptor[]  columnDescriptors,
List< IdBase instances 
)
inlineprotected

Write data to JDBC.

Definition at line 481 of file AbstractJPABaseTest.java.

Here is the call graph for this function:

Here is the caller graph for this function:

void com.mysql.clusterj.jpatest.AbstractJPABaseTest.writeToJPA ( ColumnDescriptor[]  columnDescriptors,
List< IdBase instances 
)
inlineprotected

Write data via JPA

Definition at line 472 of file AbstractJPABaseTest.java.

Here is the caller graph for this function:

Member Data Documentation

Connection com.mysql.clusterj.jpatest.AbstractJPABaseTest.connection
protected

The connection to the database

Definition at line 45 of file AbstractJPABaseTest.java.

boolean com.mysql.clusterj.jpatest.AbstractJPABaseTest.debug
staticprotected

Debug flag

Definition at line 57 of file AbstractJPABaseTest.java.

TimeZone com.mysql.clusterj.jpatest.AbstractJPABaseTest.localSystemTimeZone = TimeZone.getDefault()
staticprotected

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

Definition at line 42 of file AbstractJPABaseTest.java.


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