use of org.datanucleus.store.rdbms.adapter.DatastoreAdapter in project tests by datanucleus.
the class IdentifierFactoryTest method testJPOXTruncate.
/**
* Verify that JPOXIdentifierFactory does truncation with a 2-character hashcode, as was done in JPOX
* 1.2.0 (this had been changed to 4-character hashcode in datanucleus)
*/
public void testJPOXTruncate() {
class SubclassForTesting extends JPOXIdentifierFactory {
private SubclassForTesting(DatastoreAdapter dba, ClassLoaderResolver clr, Map props) {
super(dba, clr, props);
}
public String publicTestTruncate(String string, int length) {
return truncate(string, length);
}
}
RDBMSStoreManager srm = (RDBMSStoreManager) storeMgr;
SubclassForTesting jpoxCompatibilityIdentifierFactory = new SubclassForTesting(srm.getDatastoreAdapter(), new ClassLoaderResolverImpl(), new Properties());
assertEquals("BIDIR_CONTAINED_LEVEL2_I2S", jpoxCompatibilityIdentifierFactory.publicTestTruncate("BIDIR_CONTAINED_LEVEL2_INTEGER", 26).toUpperCase());
}
Aggregations