private boolean installVmPrereqs(ITestDevice device,CtsBuildHelper ctsBuild) throws DeviceNotAvailableException {
  cleanupDeviceFiles(device);
  CLog.d("Creating device temp directory, including dalvik-cache.");
  createRemoteDir(device,VM_TEST_TEMP_DIR + "/dalvik-cache");
  try {
    File localTmpDir=FileUtil.createTempDir("cts-vm",new File("/tmp/"));
    CLog.d("Creating host temp dir %s",localTmpDir.getPath());
    File jarFile=new File(ctsBuild.getTestCasesDir(),getJarFileName());
    if (!jarFile.exists()) {
      CLog.e("Missing jar file %s",jarFile.getPath());
      return false;
    }
    CLog.d("Extracting jar file %s to host temp directory %s.",jarFile.getPath(),localTmpDir.getPath());
    ZipFile zipFile=new ZipFile(jarFile);
    FileUtil.extractZip(zipFile,localTmpDir);
    File localTestTmpDir=new File(localTmpDir,"tests");
    CLog.d("Syncing host dir %s to device dir %s",localTestTmpDir.getPath(),VM_TEST_TEMP_DIR);
    if (!device.pushDir(localTestTmpDir,VM_TEST_TEMP_DIR)) {
      CLog.e("Failed to push vm test files");
      return false;
    }
    CLog.d("Cleaning up host temp dir %s",localTmpDir.getPath());
    FileUtil.recursiveDelete(localTmpDir);
  }
 catch (  IOException e) {
    CLog.e("Failed to extract jar file %s and sync it to device %s.",getJarFileName(),device.getSerialNumber());
    return false;
  }
  return true;
}

private boolean installVmPrereqs ( ITestDevice device , CtsBuildHelper ctsBuild ) throws DeviceNotAvailableException { cleanupDeviceFiles ( device ) ; CLog . d ( "Creating device temp directory, including dalvik-cache." ) ; createRemoteDir ( device , VM_TEST_TEMP_DIR + "/dalvik-cache" ) ; try { File localTmpDir = FileUtil . createTempDir ( "cts-vm" , new File ( "/tmp/" ) ) ; CLog . d ( "Creating host temp dir %s" , localTmpDir . getPath ( ) ) ; File jarFile = new File ( ctsBuild . getTestCasesDir ( ) , getJarFileName ( ) ) ; if ( ! jarFile . exists ( ) ) { CLog . e ( "Missing jar file %s" , jarFile . getPath ( ) ) ; return false ; } CLog . d ( "Extracting jar file %s to host temp directory %s." , jarFile . getPath ( ) , localTmpDir . getPath ( ) ) ; ZipFile zipFile = new ZipFile ( jarFile ) ; FileUtil . extractZip ( zipFile , localTmpDir ) ; File localTestTmpDir = new File ( localTmpDir , "tests" ) ; CLog . d ( "Syncing host dir %s to device dir %s" , localTestTmpDir . getPath ( ) , VM_TEST_TEMP_DIR ) ; if ( ! device . pushDir ( localTestTmpDir , VM_TEST_TEMP_DIR ) ) { CLog . e ( "Failed to push vm test files" ) ; return false ; } CLog . d ( "Cleaning up host temp dir %s" , localTmpDir . getPath ( ) ) ; FileUtil . recursiveDelete ( localTmpDir ) ; } catch ( IOException e ) { CLog . e ( "Failed to extract jar file %s and sync it to device %s." , getJarFileName ( ) , device . getSerialNumber ( ) ) ; return false ; } return true ; }
install pre - requisite jars for running vm - tests , creates temp directories for test .
