use of org.datanucleus.PersistenceNucleusContextImpl in project tests by datanucleus.
the class BasicTest method testLoadingMetaDataForPackage.
/**
* Tests the loading of XML metadata specified in package,jdo.
*/
public void testLoadingMetaDataForPackage() {
MetaDataManager mmgr = new PersistenceNucleusContextImpl("JDO", null).getMetaDataManager();
ClassLoaderResolver clr = new ClassLoaderResolverImpl();
// Validate metadata for DateWidget
AbstractClassMetaData cmd = mmgr.getMetaDataForClass(DateWidget.class, clr);
assertNotNull("ClassMetaData is null!", cmd);
assertEquals("Class name", DateWidget.class.getName(), cmd.getFullClassName());
assertEquals("Package name", "org.datanucleus.samples.widget", cmd.getPackageName());
assertEquals("Superclass", Widget.class.getName(), cmd.getPersistableSuperclass());
assertEquals("Identity type", IdentityType.DATASTORE, cmd.getIdentityType());
assertNull("Identity class", cmd.getObjectidClass());
assertNotNull("Inheritance", cmd.getInheritanceMetaData());
assertEquals("Inheritance strategy", cmd.getInheritanceMetaData().getStrategy().toString(), "new-table");
String[] sortedFieldNames = new String[] { "dateField", "dateJdbcTimestampField", "sqlDateField", "sqlTimestampField" };
Assert.assertEquals("Field count", sortedFieldNames.length, cmd.getNoOfManagedMembers());
for (int i = 0; i < sortedFieldNames.length; ++i) {
AbstractMemberMetaData fmd = cmd.getMetaDataForManagedMemberAtRelativePosition(i);
String s = sortedFieldNames[i];
assertEquals(s, fmd.getName());
assertEquals(s + " persistence modifier", FieldPersistenceModifier.PERSISTENT, fmd.getPersistenceModifier());
assertEquals(s + " primary key", false, fmd.isPrimaryKey());
assertEquals(s + " null value handling", NullValue.NONE, fmd.getNullValue());
assertEquals(s + " default fetch group", true, fmd.isDefaultFetchGroup());
assertNull(s + " collection metadata", fmd.getContainer());
assertNull(s + " map metadata", fmd.getContainer());
}
// Validate metadata for FloatWidget
cmd = mmgr.getMetaDataForClass(FloatWidget.class, clr);
assertNotNull("Metadata", cmd);
assertEquals("Class name", FloatWidget.class.getName(), cmd.getFullClassName());
assertEquals("Package name", "org.datanucleus.samples.widget", cmd.getPackageName());
assertEquals("Superclass", Widget.class.getName(), cmd.getPersistableSuperclass());
assertEquals("Identity type", IdentityType.DATASTORE, cmd.getIdentityType());
assertNull("Identity class", cmd.getObjectidClass());
sortedFieldNames = new String[] { "doubleField", "doubleObjField", "floatField", "floatObjField" };
NullValue[] nullValueHandlings = new NullValue[] { NullValue.EXCEPTION, NullValue.NONE, NullValue.EXCEPTION, NullValue.NONE };
assertEquals("Field count", sortedFieldNames.length, cmd.getNoOfManagedMembers());
for (int i = 0; i < sortedFieldNames.length; ++i) {
AbstractMemberMetaData fmd = cmd.getMetaDataForManagedMemberAtRelativePosition(i);
String s = sortedFieldNames[i];
Assert.assertEquals(s, fmd.getName());
Assert.assertEquals(s + " persistence modifier", FieldPersistenceModifier.PERSISTENT, fmd.getPersistenceModifier());
Assert.assertEquals(s + " primary key", false, fmd.isPrimaryKey());
Assert.assertEquals(s + " null value handling", nullValueHandlings[i], fmd.getNullValue());
Assert.assertEquals(s + " default fetch group", true, fmd.isDefaultFetchGroup());
Assert.assertNull(s + " collection metadata", fmd.getContainer());
Assert.assertNull(s + " map metadata", fmd.getContainer());
}
}
use of org.datanucleus.PersistenceNucleusContextImpl in project tests by datanucleus.
the class FetchPlanTest method testNestedFetchGroupsAgain.
/**
* Test nested fetch groups.
* TODO Merge this with the test above
*/
public void testNestedFetchGroupsAgain() {
FetchPlan fp = getFetchPlan();
PersistenceNucleusContextImpl nucleusCtx = new PersistenceNucleusContextImpl("JDO", null);
MetaDataManager metaMgr = new JDOMetaDataManager(nucleusCtx);
// test parent with fetch-group = group1
AbstractClassMetaData cmd = metaMgr.getMetaDataForClass(FP1Sub.class, new ClassLoaderResolverImpl());
fp.addGroup("1");
fp.removeGroup(FetchPlan.DEFAULT);
FetchPlanForClass fpc = fp.getFetchPlanForClass(cmd);
int[] fieldsInFP = fpc.getMemberNumbers();
assertEquals("should have 2 fields in fetchplan", 2, fieldsInFP.length);
// check if fields are in the FP
BitSet fieldsInFPBitSet = fpc.getMemberNumbersByBitSet();
assertTrue("name should be in the fetchplan", fieldsInFPBitSet.get(cmd.getAbsolutePositionOfMember("name")));
assertTrue("room should be in the fetchplan", fieldsInFPBitSet.get(cmd.getAbsolutePositionOfMember("room")));
}
use of org.datanucleus.PersistenceNucleusContextImpl in project tests by datanucleus.
the class FetchPlanTest method testPostLoad.
/**
* Test the use of "postload"
*/
public void testPostLoad() throws Exception {
FetchPlan fp = getFetchPlan();
PersistenceNucleusContextImpl nucleusCtx = new PersistenceNucleusContextImpl("JDO", null);
MetaDataManager metaMgr = new JDOMetaDataManager(nucleusCtx);
AbstractClassMetaData cmd = metaMgr.getMetaDataForClass(FP2Base.class, new ClassLoaderResolverImpl());
// --------------------------------------
// all fields in DFG
// --------------------------------------
FetchPlanForClass fpc = fp.getFetchPlanForClass(cmd);
boolean[] loadedFields = new boolean[14];
loadedFields[cmd.getAbsolutePositionOfMember("piece1")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece2")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece3")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece4")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece5")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece6")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece7")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece8")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece9")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece10")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece11")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece12")] = true;
assertFalse("Should not call postLoad callback", fpc.isToCallPostLoadFetchPlan(loadedFields));
loadedFields[cmd.getAbsolutePositionOfMember("piece1")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece2")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece3")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece4")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece5")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece6")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece7")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece8")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece9")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece10")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece11")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece12")] = false;
assertFalse("Should not call postLoad callback", fpc.isToCallPostLoadFetchPlan(loadedFields));
loadedFields[cmd.getAbsolutePositionOfMember("piece1")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece2")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece3")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece4")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece5")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece6")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece7")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece8")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece9")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece10")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece11")] = false;
loadedFields[cmd.getAbsolutePositionOfMember("piece12")] = false;
assertTrue("Should call postLoad callback", fpc.isToCallPostLoadFetchPlan(loadedFields));
// --------------------------------------
// fetch group width postLoad + DFG
// --------------------------------------
fp.addGroup("groupD");
fpc = fp.getFetchPlanForClass(cmd);
loadedFields[cmd.getAbsolutePositionOfMember("piece1")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece2")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece3")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece4")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece5")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece6")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece7")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece8")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece9")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece10")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece11")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece12")] = true;
assertFalse("Should not call postLoad callback", fpc.isToCallPostLoadFetchPlan(loadedFields));
loadedFields[cmd.getAbsolutePositionOfMember("piece1")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece2")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece3")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece4")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece5")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece6")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece7")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece8")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece9")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece10")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece11")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece12")] = false;
assertTrue("Should call postLoad callback", fpc.isToCallPostLoadFetchPlan(loadedFields));
loadedFields[cmd.getAbsolutePositionOfMember("piece1")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece2")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece3")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece4")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece5")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece6")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece7")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece8")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece9")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece10")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece11")] = false;
loadedFields[cmd.getAbsolutePositionOfMember("piece12")] = false;
assertTrue("Should call postLoad callback", fpc.isToCallPostLoadFetchPlan(loadedFields));
// --------------------------------------
// fetch group width postLoad
// --------------------------------------
fp.addGroup("groupD");
fp.removeGroup(FetchPlan.DEFAULT);
fpc = fp.getFetchPlanForClass(cmd);
loadedFields[cmd.getAbsolutePositionOfMember("piece1")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece2")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece3")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece4")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece5")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece6")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece7")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece8")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece9")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece10")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece11")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece12")] = true;
assertFalse("Should not call postLoad callback", fpc.isToCallPostLoadFetchPlan(loadedFields));
loadedFields[cmd.getAbsolutePositionOfMember("piece1")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece2")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece3")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece4")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece5")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece6")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece7")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece8")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece9")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece10")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece11")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece12")] = false;
assertTrue("Should call postLoad callback", fpc.isToCallPostLoadFetchPlan(loadedFields));
loadedFields[cmd.getAbsolutePositionOfMember("piece1")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece2")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece3")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece4")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece5")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece6")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece7")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece8")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece9")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece10")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece11")] = false;
loadedFields[cmd.getAbsolutePositionOfMember("piece12")] = false;
assertTrue("Should call postLoad callback", fpc.isToCallPostLoadFetchPlan(loadedFields));
loadedFields[cmd.getAbsolutePositionOfMember("piece1")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece2")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece3")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece4")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece5")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece6")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece7")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece8")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece9")] = false;
loadedFields[cmd.getAbsolutePositionOfMember("piece10")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece11")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece12")] = true;
assertFalse("Should not call postLoad callback", fpc.isToCallPostLoadFetchPlan(loadedFields));
// --------------------------------------
// fetch group without postLoad
// --------------------------------------
fp.addGroup("groupC");
fp.removeGroup("groupD");
fp.removeGroup(FetchPlan.DEFAULT);
fpc = fp.getFetchPlanForClass(cmd);
loadedFields[cmd.getAbsolutePositionOfMember("piece1")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece2")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece3")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece4")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece5")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece6")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece7")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece8")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece9")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece10")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece11")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece12")] = true;
assertFalse("Should not call postLoad callback", fpc.isToCallPostLoadFetchPlan(loadedFields));
loadedFields[cmd.getAbsolutePositionOfMember("piece1")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece2")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece3")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece4")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece5")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece6")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece7")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece8")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece9")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece10")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece11")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece12")] = false;
assertFalse("Should call postLoad callback", fpc.isToCallPostLoadFetchPlan(loadedFields));
loadedFields[cmd.getAbsolutePositionOfMember("piece1")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece2")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece3")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece4")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece5")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece6")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece7")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece8")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece9")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece10")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece11")] = false;
loadedFields[cmd.getAbsolutePositionOfMember("piece12")] = false;
assertFalse("Should not call postLoad callback", fpc.isToCallPostLoadFetchPlan(loadedFields));
loadedFields[cmd.getAbsolutePositionOfMember("piece1")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece2")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece3")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece4")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece5")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece6")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece7")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece8")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece9")] = false;
loadedFields[cmd.getAbsolutePositionOfMember("piece10")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece11")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece12")] = true;
assertFalse("Should not call postLoad callback", fpc.isToCallPostLoadFetchPlan(loadedFields));
// --------------------------------------
// fetch group width postLoad
// --------------------------------------
fp.addGroup("groupAll");
fp.removeGroup("groupC");
fp.removeGroup(FetchPlan.DEFAULT);
fpc = fp.getFetchPlanForClass(cmd);
loadedFields[cmd.getAbsolutePositionOfMember("piece1")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece2")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece3")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece4")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece5")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece6")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece7")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece8")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece9")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece10")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece11")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece12")] = true;
assertFalse("Should not call postLoad callback", fpc.isToCallPostLoadFetchPlan(loadedFields));
loadedFields[cmd.getAbsolutePositionOfMember("piece1")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece2")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece3")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece4")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece5")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece6")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece7")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece8")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece9")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece10")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece11")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece12")] = false;
assertTrue("Should call postLoad callback", fpc.isToCallPostLoadFetchPlan(loadedFields));
loadedFields[cmd.getAbsolutePositionOfMember("piece1")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece2")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece3")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece4")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece5")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece6")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece7")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece8")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece9")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece10")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece11")] = false;
loadedFields[cmd.getAbsolutePositionOfMember("piece12")] = false;
assertTrue("Should call postLoad callback", fpc.isToCallPostLoadFetchPlan(loadedFields));
loadedFields[cmd.getAbsolutePositionOfMember("piece1")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece2")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece3")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece4")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece5")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece6")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece7")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece8")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece9")] = false;
loadedFields[cmd.getAbsolutePositionOfMember("piece10")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece11")] = true;
loadedFields[cmd.getAbsolutePositionOfMember("piece12")] = true;
assertFalse("Should not call postLoad callback", fpc.isToCallPostLoadFetchPlan(loadedFields));
}
use of org.datanucleus.PersistenceNucleusContextImpl in project tests by datanucleus.
the class AnnotationPlusXMLTest method setUp.
@Override
protected void setUp() throws Exception {
super.setUp();
// Don't initialise this since the store manager will be undefined due to no URL
nucleusCtx = new PersistenceNucleusContextImpl("JDO", null);
metaDataMgr = nucleusCtx.getMetaDataManager();
clr = new ClassLoaderResolverImpl();
}
use of org.datanucleus.PersistenceNucleusContextImpl in project tests by datanucleus.
the class AnnotationTest method setUp.
@Override
protected void setUp() throws Exception {
super.setUp();
nucleusCtx = new PersistenceNucleusContextImpl("JDO", null);
metaDataMgr = new JDOMetaDataManager(nucleusCtx);
clr = new ClassLoaderResolverImpl();
}
Aggregations