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

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


   *
   */
  @Test
  public void testFiles(){
//    testing file layout/generic/nsViewportFrame.cpp
    File f = fSession.uniqueResult("from VersionedFile as file where file.path = '/cvsroot/mozilla/layout/generic/nsViewportFrame.cpp'", File.class);
    assertEquals("nsViewportFrame.cpp",f.getName());
    assertEquals("/cvsroot/mozilla/layout/generic",f.getParentDirectory().getPath());
    //testing file layout/generic/nsViewportFrame.h
    File f2 = fSession.uniqueResult("from VersionedFile as file where file.path = '/cvsroot/mozilla/layout/generic/nsViewportFrame.h'", File.class);
    assertEquals("nsViewportFrame.h",f2.getName());
    assertEquals("/cvsroot/mozilla/layout/generic",f2.getParentDirectory().getPath());
    //testinig file layout/generic/punct_marks.ccmap

    File f3 = fSession.uniqueResult("from VersionedFile as file where file.path = '/cvsroot/mozilla/layout/generic/punct_marks.ccmap'", File.class);
    assertEquals("punct_marks.ccmap",f3.getName());
    assertEquals("/cvsroot/mozilla/layout/generic",f3.getParentDirectory().getPath());
  }
View Full Code Here


    assertTrue(roles.contains(secondRole));
  }
 
  @Test
  public void testFilesAndDirectories() {
    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);
View Full Code Here

TOP

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

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.