Remove unused ServerConfig debugSql options, Update Tests to use agentloader

This commit is contained in:
Robin Bygrave
2013-04-29 22:42:27 +12:00
parent bb2479c9e7
commit 2f97c5c36e
217 changed files with 6351 additions and 6740 deletions
@@ -1,49 +1,51 @@
package com.avaje.tests.basic;
import junit.framework.TestCase;
import org.junit.Assert;
import org.junit.Test;
import com.avaje.ebean.BaseTestCase;
import com.avaje.ebean.Ebean;
import com.avaje.tests.model.basic.PersistentFile;
import com.avaje.tests.model.basic.PersistentFileContent;
public class TestDeleteOneToOne extends TestCase {
public void testCreateDeletePersistentFile() {
public class TestDeleteOneToOne extends BaseTestCase {
PersistentFile persistentFile = new PersistentFile("test.txt", new PersistentFileContent("test".getBytes()));
@Test
public void testCreateDeletePersistentFile() {
Ebean.save(persistentFile);
Integer id = persistentFile.getId();
Integer contentId = persistentFile.getPersistentFileContent().getId();
PersistentFile persistentFile = new PersistentFile("test.txt", new PersistentFileContent(
"test".getBytes()));
// should delete file and fileContent
Ebean.delete(PersistentFile.class, id);
Ebean.save(persistentFile);
Integer id = persistentFile.getId();
Integer contentId = persistentFile.getPersistentFileContent().getId();
PersistentFile file1 = Ebean.find(PersistentFile.class, id);
PersistentFileContent content1 = Ebean.find(PersistentFileContent.class, contentId);
// should delete file and fileContent
Ebean.delete(PersistentFile.class, id);
Assert.assertNull(file1);
Assert.assertNull(content1);
PersistentFile file1 = Ebean.find(PersistentFile.class, id);
PersistentFileContent content1 = Ebean.find(PersistentFileContent.class, contentId);
}
Assert.assertNull(file1);
Assert.assertNull(content1);
// public void testDeleteMany() {
//
// Customer c = new Customer();
// c.setName("Fiona");
// c.setStatus(Customer.Status.ACTIVE);
// c.addContact(new Contact("Fiona", "Black"));
// c.addContact(new Contact("Tracy", "Red"));
//
// Ebean.save(c);
//
// Ebean.delete(Customer.class, c.getId());
//
// Customer deletedCustomer = Ebean.find(Customer.class, c.getId());
//
// Assert.assertNull(deletedCustomer);
//
// }
}
// public void testDeleteMany() {
//
// Customer c = new Customer();
// c.setName("Fiona");
// c.setStatus(Customer.Status.ACTIVE);
// c.addContact(new Contact("Fiona", "Black"));
// c.addContact(new Contact("Tracy", "Red"));
//
// Ebean.save(c);
//
// Ebean.delete(Customer.class, c.getId());
//
// Customer deletedCustomer = Ebean.find(Customer.class, c.getId());
//
// Assert.assertNull(deletedCustomer);
//
// }
}