@BeforeClass
  public static void setUpClass() throws Exception {
    MockServices.setServices();
    DalvikPlatformManager.getDefault().setSdkLocation(SDK_DIR);
    tempFolder = File.createTempFile("junit", "");
    tempFolder.delete();
    tempFolder.mkdir();

    FileObject scratch = FileUtil.toFileObject(tempFolder);
    FileObject cacheDir = scratch.createFolder("cache");
    CacheFolder.setCacheFolder(cacheDir);
    FileObject sdkDirFo = FileUtil.toFileObject(new File(SDK_DIR));

    projdir = scratch.createFolder("Snake");
    FileUtilities.recursiveCopy(sdkDirFo.getFileObject("samples/android-8/Snake"), projdir);

    FileObject dir = projdir;
    for (String dirName : Splitter.on('/').split("gen/com/example/android/snake")) {
      dir = dir.createFolder(dirName);
    }
    OutputStream os = dir.createData("R.java").getOutputStream();
    FileUtil.copy(ProjectRefResolverTest.class.getResourceAsStream("Snake_R_java.txt"), os);
    os.close();

    pp = ProjectManager.getDefault().findProject(projdir);
  }
 @AfterClass
 public static void delete() {
   FileUtilities.recursiveDelete(tempFolder);
 }