mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
no effective change - format test code
This commit is contained in:
+12
-13
@@ -1,10 +1,5 @@
|
||||
package com.avaje.ebeaninternal.server.deploy;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
import com.avaje.ebean.BaseTestCase;
|
||||
import com.avaje.ebean.Ebean;
|
||||
import com.avaje.ebean.bean.BeanCollection;
|
||||
@@ -13,30 +8,34 @@ import com.avaje.ebean.bean.EntityBeanIntercept;
|
||||
import com.avaje.ebeaninternal.api.SpiEbeanServer;
|
||||
import com.avaje.tests.model.basic.Contact;
|
||||
import com.avaje.tests.model.basic.Customer;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class TestCollectionLoadedStatus extends BaseTestCase {
|
||||
|
||||
@Test
|
||||
public void test() {
|
||||
|
||||
SpiEbeanServer server = (SpiEbeanServer)Ebean.getServer(null);
|
||||
|
||||
SpiEbeanServer server = (SpiEbeanServer) Ebean.getServer(null);
|
||||
BeanDescriptor<Customer> custDesc = server.getBeanDescriptor(Customer.class);
|
||||
|
||||
|
||||
Customer customer = new Customer();
|
||||
EntityBean eb = (EntityBean)customer;
|
||||
EntityBean eb = (EntityBean) customer;
|
||||
EntityBeanIntercept ebi = eb._ebean_getIntercept();
|
||||
|
||||
|
||||
BeanProperty contactsProperty = custDesc.getBeanProperty("contacts");
|
||||
Assert.assertFalse(ebi.isLoadedProperty(contactsProperty.getPropertyIndex()));
|
||||
|
||||
|
||||
Object contactsViaInternal = contactsProperty.getValue(eb);
|
||||
Assert.assertNull(contactsViaInternal);
|
||||
Assert.assertFalse(ebi.isLoadedProperty(contactsProperty.getPropertyIndex()));
|
||||
|
||||
|
||||
List<Contact> contacts = customer.getContacts();
|
||||
Assert.assertNotNull(contacts);
|
||||
Assert.assertTrue(contacts instanceof BeanCollection);
|
||||
Assert.assertTrue(ebi.isLoadedProperty(contactsProperty.getPropertyIndex()));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user