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

Public Member Functions

void localSetUp ()
void testThrowNullPointerException ()
void testCrazyDelegate ()

Additional Inherited Members

- Protected Member Functions inherited from testsuite.clusterj.AbstractClusterJModelTest
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)
- Static Protected Member Functions inherited from testsuite.clusterj.AbstractClusterJModelTest
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 ()
- Protected Attributes inherited from testsuite.clusterj.AbstractClusterJModelTest
List< Employeeemployees
List< Dn2iddn2ids
List< IdBaseinstances = new ArrayList<IdBase>()
ClassLoader loader
- Static Protected Attributes inherited from testsuite.clusterj.AbstractClusterJModelTest
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()

Detailed Description

This test verifies the behavior of the core implementation to provide for loadable DomainTypeHandlerFactory implementations. This is the way to support abstract classes or concrete classes as domain types.

If a file META-INF/services/com.mysql.clusterj.spi.DomainTypeHandlerFactory exists that names a loadable class, the core implementation should use it preferentially to load a DomainTypeHandler for an unregistered domain type.

This test includes an implementation of DomainTypeHandlerFactory, called CrazyDomainTypeHandlerFactoryImpl, that has three modes of operation:

  1. if the simple domain class name begins with "Throw", then an exception is thrown immediately. This should cause clusterj to save the exception information and proceed to the next factory. The test will succeed when the standard implementation does not accept the domain class as a valid domain class.
  2. if the simple domain class name is "CrazyDelegate", then an implementation of DomainTypeHandlerFactory is returned. The returned implementation doesn't immediately throw an exception but throws an exception when the method getProxyClass is called. This exception will be reported to clusterj and the test succeeds.
  3. in all other cases, null is returned. This should cause clusterj to go to the next prospective factory. This case is exercised by every test case that includes the CrazyDomainTypeHandlerFactoryImpl in the services file (i.e. all other test cases).

Definition at line 51 of file DomainTypeHandlerFactoryTest.java.

Member Function Documentation

void testsuite.clusterj.DomainTypeHandlerFactoryTest.localSetUp ( )
inline

Subclasses may override this method to allocate any data and resources that they need in order to successfully execute this testcase. Adding teardown classes and instances is done in the overridden method.

Reimplemented from testsuite.clusterj.AbstractClusterJModelTest.

Definition at line 54 of file DomainTypeHandlerFactoryTest.java.

Here is the call graph for this function:


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