Package com.avaje.tests.model.basic

Examples of com.avaje.tests.model.basic.PFile


public class TestConstructorPutfieldReplacement extends BaseTestCase {

  @Test
  public void test() {
   
    PFile persistentFile = new PFile("test.txt", new PFileContent("test".getBytes()));

    EntityBean eb = (EntityBean)persistentFile;
    EntityBeanIntercept ebi = eb._ebean_getIntercept();
   
    int namePos = ebi.findProperty("name");
View Full Code Here


//    Ebean.delete(persistentFile);
//  }

  @Test
  public void testCreateLoadDeletePFile() {
    PFile persistentFile = new PFile("test.txt",
        new PFileContent("test".getBytes()));

    Ebean.save(persistentFile);

    persistentFile = Ebean.find(PFile.class, persistentFile.getId());
   
    PFileContent persistentFileContent = persistentFile.getFileContent();
   
    Assert.assertNotNull(persistentFileContent);
   
    Assert.assertNotNull("load byte content", persistentFileContent.getContent());
   
View Full Code Here

public class TestDeleteOneToOneMultiple extends BaseTestCase {

  @Test
  public void testCreateDeletePersistentFile() {

    PFile persistentFile = new PFile("test.txt", new PFileContent("test".getBytes()));
//    PFile persistentFile = new PFile();
//    persistentFile.setName("test.txt");
//    PFileContent content = new PFileContent();
//    content.setContent("test".getBytes());
//    persistentFile.setFileContent(content);

    Ebean.save(persistentFile);
    Integer id = persistentFile.getId();
    Integer contentId = persistentFile.getFileContent().getId();

    // should delete file and fileContent
    Ebean.delete(PFile.class, id);
    System.out.println("finished delete");

    PFile file1 = Ebean.find(PFile.class, id);
    PFileContent content1 = Ebean.find(PFileContent.class, contentId);

    Assert.assertNull(file1);
    Assert.assertNull(content1);
View Full Code Here

public class TestDeleteImportedPartial extends BaseTestCase {

  @Test
  public void test() {

    PFile persistentFile = new PFile("test.txt", new PFileContent("test".getBytes()));

    Ebean.save(persistentFile);
    Integer id = persistentFile.getId();
    Integer contentId = persistentFile.getFileContent().getId();

    PFile partialPfile = Ebean.find(PFile.class).select("id").where().idEq(persistentFile.getId())
        .findUnique();

    // should delete file and fileContent
    Ebean.delete(partialPfile);
    System.out.println("finished delete");

    PFile file1 = Ebean.find(PFile.class, id);
    PFileContent content1 = Ebean.find(PFileContent.class, contentId);

    Assert.assertNull(file1);
    Assert.assertNull(content1);
View Full Code Here

TOP

Related Classes of com.avaje.tests.model.basic.PFile

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.