/** * Instantiates a new kundera persistence. */ public KunderaPersistence() { this.providerUtil = new KunderaPersistenceProviderUtil(this); this.cache = new PersistenceUtilHelper.MetadataCache(); }
@Test public void testIsLoaded() { KunderaPersistenceProviderUtil providerUtil = new KunderaPersistenceProviderUtil(persistence); LoadState state = providerUtil.isLoaded(null); Assert.assertNotNull(state); Assert.assertEquals(LoadState.NOT_LOADED, state); }
@Test public void testIsLoadedWithOutReference() { KunderaPersistenceProviderUtil providerUtil = new KunderaPersistenceProviderUtil(persistence); Person p = new Person(); p.setAge(32); LoadState state = providerUtil.isLoadedWithoutReference(p,"age"); Assert.assertNotNull(state); Assert.assertEquals(LoadState.LOADED, state); }
@Test public void testIsLoadedWithReference() { KunderaPersistenceProviderUtil providerUtil = new KunderaPersistenceProviderUtil(persistence); Person p = new Person(); p.setAge(32); LoadState state = providerUtil.isLoadedWithReference(p,"age"); Assert.assertNotNull(state); Assert.assertEquals(LoadState.UNKNOWN, state); }