Package org.evolizer.model.resources.entities.fs

Examples of org.evolizer.model.resources.entities.fs.Directory


    File f = new File("/rootFile.txt", Directory.ROOT);
    assertEquals("/rootFile.txt", f.getPath());
    assertEquals("rootFile.txt", f.getName());
    assertEquals(Directory.ROOT, f.getParentDirectory());
   
    Directory d = new Directory("/home", Directory.ROOT);
    assertEquals("/home", d.getPath());
    assertEquals("home", d.getName());
    assertEquals(Directory.ROOT, d.getParentDirectory());
   
    save(f, Directory.ROOT, d);
    File fLoaded = loadUnique("from File as f where f.path like '%txt'", File.class);
   
    assertEquals(f, fLoaded);
    assertEquals(f.getParentDirectory(), Directory.ROOT);
   
    File dLoaded = loadUnique("from Directory as f where f.path like '/home'", File.class);
    assertEquals(d, dLoaded);
    assertEquals(Directory.ROOT, d.getParentDirectory());
   
    Directory rLoaded = loadUnique("from Directory as f where f.path like '/'", Directory.class);
    assertEquals(Directory.ROOT, rLoaded);
    assertEquals(2, rLoaded.getContent().size());
    assertTrue(rLoaded.getContent().contains(f));
    assertTrue(rLoaded.getContent().contains(d));
  }
View Full Code Here

TOP

Related Classes of org.evolizer.model.resources.entities.fs.Directory

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.