Home
last modified time | relevance | path

Searched refs:tmpDir (Results 1 – 17 of 17) sorted by relevance

/tools/tradefederation/core/tests/src/com/android/tradefed/util/
DFileUtilTest.java344 File tmpDir = FileUtil.createTempDir("find_files_test"); in testFindFilesSuccess() local
346 File matchFile1 = FileUtil.createTempFile("test", ".config", tmpDir); in testFindFilesSuccess()
347 File subDir = new File(tmpDir, "subfolder"); in testFindFilesSuccess()
351 Set<String> matchFiles = FileUtil.findFiles(tmpDir, ".*.config"); in testFindFilesSuccess()
356 FileUtil.recursiveDelete(tmpDir); in testFindFilesSuccess()
366 File tmpDir = FileUtil.createTempDir("find_files_test"); in testFindFilesSuccess_symlink() local
369 File matchFile1 = FileUtil.createTempFile("test", ".config", tmpDir); in testFindFilesSuccess_symlink()
371 File destLink = new File(tmpDir, "subFolder"); in testFindFilesSuccess_symlink()
374 Set<String> matchFiles = FileUtil.findFiles(tmpDir, ".*.config"); in testFindFilesSuccess_symlink()
382 FileUtil.recursiveDelete(tmpDir); in testFindFilesSuccess_symlink()
[all …]
DFileUtilFuncTest.java129 File tmpDir = createTempDir("foo"); in testCreateTempDir() local
130 assertTrue(tmpDir.exists()); in testCreateTempDir()
131 assertTrue(tmpDir.isDirectory()); in testCreateTempDir()
/tools/tradefederation/core/tests/src/com/android/tradefed/config/
DConfigurationUtilTest.java142 File tmpDir = null; in testGetConfigNamesFromDirs() local
144 tmpDir = FileUtil.createTempDir("test_configs_dir"); in testGetConfigNamesFromDirs()
146 File config1 = FileUtil.createTempFile("config", ".config", tmpDir); in testGetConfigNamesFromDirs()
148 File subDir = FileUtil.getFileForPath(tmpDir, "sub"); in testGetConfigNamesFromDirs()
154 ConfigurationUtil.getConfigNamesFromDirs("sub", Arrays.asList(tmpDir)); in testGetConfigNamesFromDirs()
159 configs = ConfigurationUtil.getConfigNamesFromDirs("", Arrays.asList(tmpDir)); in testGetConfigNamesFromDirs()
164 FileUtil.recursiveDelete(tmpDir); in testGetConfigNamesFromDirs()
174 File tmpDir = null; in testGetConfigNamesFromDirs_patterns() local
176 tmpDir = FileUtil.createTempDir("test_configs_dir"); in testGetConfigNamesFromDirs_patterns()
178 FileUtil.createTempFile("whatevername", ".whateverextension", tmpDir); in testGetConfigNamesFromDirs_patterns()
[all …]
DConfigurationFactoryTest.java1478 File tmpDir = externalConfig.getParentFile(); in testSearchConfigFromEnvVar() local
1481 Mockito.doReturn(Arrays.asList(tmpDir)).when(spyFactory).getExternalTestCasesDirs(); in testSearchConfigFromEnvVar()
1496 File tmpDir = FileUtil.createTempDir("config-check-var"); in testSearchConfigFromEnvVarFailed() local
1499 Mockito.doReturn(Arrays.asList(tmpDir)).when(spyFactory).getExternalTestCasesDirs(); in testSearchConfigFromEnvVarFailed()
1504 FileUtil.recursiveDelete(tmpDir); in testSearchConfigFromEnvVarFailed()
1513 File tmpDir = FileUtil.createTempDir("test-config-dir"); in testGetConfigNamesFromTestCases_subpath() local
1515 FileUtil.createTempFile("testconfig1", ".config", tmpDir); in testGetConfigNamesFromTestCases_subpath()
1516 File subDir = FileUtil.createTempDir("subdir", tmpDir); in testGetConfigNamesFromTestCases_subpath()
1519 Mockito.doReturn(Arrays.asList(tmpDir)).when(spyFactory).getExternalTestCasesDirs(); in testGetConfigNamesFromTestCases_subpath()
1527 FileUtil.recursiveDelete(tmpDir); in testGetConfigNamesFromTestCases_subpath()
/tools/tradefederation/core/tests/src/com/android/tradefed/device/
DTestDeviceStressTest.java59 File tmpDir = null; in createTempTestFiles() local
62 tmpDir = FileUtil.createTempDir("testDir"); in createTempTestFiles()
66 tmpFile = FileUtil.createTempFile(String.format("tmp_%d", i), ".txt", tmpDir); in createTempTestFiles()
69 return tmpDir; in createTempTestFiles()
111 File tmpDir = null; in testPushFolderWithManyFiles() local
121 tmpDir = createTempTestFiles(); in testPushFolderWithManyFiles()
126 assertTrue(mTestDevice.pushDir(tmpDir, deviceFilePath)); in testPushFolderWithManyFiles()
130 if (tmpDir != null) { in testPushFolderWithManyFiles()
131 FileUtil.recursiveDelete(tmpDir); in testPushFolderWithManyFiles()
143 File tmpDir = null; in testSyncDataWithManyFiles() local
[all …]
DTestDeviceFuncTest.java433 File tmpDir = FileUtil.createTempDir("tmp"); in doTestSyncFiles() local
435 File tmpFile = createTempTestFile(tmpDir); in doTestSyncFiles()
440 tmpDir.getName(), tmpFile.getName()); in doTestSyncFiles()
442 assertTrue(mTestDevice.syncFiles(tmpDir, externalStorePath)); in doTestSyncFiles()
449 File tmpFile2 = createTempTestFile(tmpDir); in doTestSyncFiles()
451 assertTrue(mTestDevice.syncFiles(tmpDir, externalStorePath)); in doTestSyncFiles()
453 tmpDir.getName(), tmpFile2.getName()); in doTestSyncFiles()
467 assertTrue(mTestDevice.syncFiles(tmpDir, externalStorePath)); in doTestSyncFiles()
476 FileUtil.recursiveDelete(tmpDir); in doTestSyncFiles()
488 File tmpDir = FileUtil.createTempDir("tmp", rootDir); in testPushDir() local
[all …]
DDeviceManagerTest.java388 File tmpDir = FileUtil.createTempDir("fake-fastbootdir"); in testUnpackZippedFastboot() local
389 File fastboot = new File(tmpDir, "fastboot"); in testUnpackZippedFastboot()
391 File zipDir = ZipUtil.createZip(tmpDir); in testUnpackZippedFastboot()
402 FileUtil.recursiveDelete(tmpDir); in testUnpackZippedFastboot()
/tools/tradefederation/core/tests/src/com/android/tradefed/targetprep/suite/
DSuiteApkInstallerTest.java94 File tmpDir = FileUtil.createTempDir("suite-apk-installer"); in testGetTestsDir_noVar() local
97 attributes.put("ROOT_DIR", tmpDir.getAbsolutePath()); in testGetTestsDir_noVar()
101 assertEquals(tmpDir.getAbsolutePath(), res.getAbsolutePath()); in testGetTestsDir_noVar()
103 FileUtil.recursiveDelete(tmpDir); in testGetTestsDir_noVar()
140 File tmpDir = FileUtil.createTempDir("suite-apk-installer"); in testGetTestsDir_notDir() local
141 File apkFile = FileUtil.createTempFile("apk-test", ".apk", tmpDir); in testGetTestsDir_notDir()
152 attributes.put("ROOT_DIR", tmpDir.getAbsolutePath()); in testGetTestsDir_notDir()
161 FileUtil.recursiveDelete(tmpDir); in testGetTestsDir_notDir()
227 File tmpDir = null; in testGetLocalPathForFileName_testsDir() local
229 tmpDir = FileUtil.createTempDir("test"); in testGetLocalPathForFileName_testsDir()
[all …]
/tools/tradefederation/core/tests/src/com/android/tradefed/testtype/suite/
DBaseTestSuiteTest.java91 File tmpDir = FileUtil.createTempDir(TEST_MODULE); in testSetupFilters_noMatch() local
92 File moduleConfig = new File(tmpDir, "module_name.config"); in testSetupFilters_noMatch()
97 mRunner.setupFilters(tmpDir); in testSetupFilters_noMatch()
102 FileUtil.recursiveDelete(tmpDir); in testSetupFilters_noMatch()
109 File tmpDir = FileUtil.createTempDir(TEST_MODULE); in testSetupFilters_match_parameterized() local
110 File moduleConfig = new File(tmpDir, "CtsGestureTestCases.config"); in testSetupFilters_match_parameterized()
118 mRunner.setupFilters(tmpDir); in testSetupFilters_match_parameterized()
132 FileUtil.recursiveDelete(tmpDir); in testSetupFilters_match_parameterized()
138 File tmpDir = FileUtil.createTempDir(TEST_MODULE); in testSetupFilters_match() local
139 File moduleConfig = new File(tmpDir, "CtsGestureTestCases.config"); in testSetupFilters_match()
[all …]
DTfSuiteRunnerTest.java235 File tmpDir = null; in testLoadTests_additionalTestsZip() local
239 tmpDir = FileUtil.createTempDir("test"); in testLoadTests_additionalTestsZip()
243 File zipDir = FileUtil.getFileForPath(tmpDir, "suite"); in testLoadTests_additionalTestsZip()
275 FileUtil.recursiveDelete(tmpDir); in testLoadTests_additionalTestsZip()
/tools/tradefederation/core/tests/src/com/android/tradefed/testtype/
DTfTestLauncherTest.java168 File tmpDir = Mockito.mock(File.class); in testTestTmpDirClean_success() local
169 Mockito.when(tmpDir.list()) in testTestTmpDirClean_success()
173 mTfTestLauncher.testTmpDirClean(tmpDir, mMockListener); in testTestTmpDirClean_success()
193 File tmpDir = Mockito.mock(File.class); in testTestTmpDirClean_failExtraFile() local
194 Mockito.when(tmpDir.list()).thenReturn(new String[] {"extra_file"}); in testTestTmpDirClean_failExtraFile()
196 mTfTestLauncher.testTmpDirClean(tmpDir, mMockListener); in testTestTmpDirClean_failExtraFile()
216 File tmpDir = Mockito.mock(File.class); in testTestTmpDirClean_failMultipleFiles() local
217 Mockito.when(tmpDir.list()).thenReturn(new String[] {"inv_1", "inv_2"}); in testTestTmpDirClean_failMultipleFiles()
219 mTfTestLauncher.testTmpDirClean(tmpDir, mMockListener); in testTestTmpDirClean_failMultipleFiles()
/tools/tradefederation/core/tests/src/com/android/tradefed/sandbox/
DTradefedSandboxTest.java220 File tmpDir = FileUtil.createTempDir("tmp-sandbox-dir"); in testSandboxOptions() local
226 setter.setOptionValue("sandbox:tf-location", tmpDir.getAbsolutePath()); in testSandboxOptions()
234 assertEquals(tmpDir, res); in testSandboxOptions()
236 FileUtil.recursiveDelete(tmpDir); in testSandboxOptions()
246 File tmpDir = FileUtil.createTempDir("tmp-sandbox-dir"); in testSandboxOptions_exclusion() local
252 setter.setOptionValue("sandbox:tf-location", tmpDir.getAbsolutePath()); in testSandboxOptions_exclusion()
269 FileUtil.recursiveDelete(tmpDir); in testSandboxOptions_exclusion()
/tools/tradefederation/core/tests/src/com/android/tradefed/targetprep/adb/
DAdbStopServerPreparerTest.java177 File tmpDir = FileUtil.createTempDir("adb-preparer-tests"); in testAdbFromEnv() local
179 FileUtil.mkdirsRWX(new File(tmpDir, "bin")); in testAdbFromEnv()
180 File fakeAdb = new File(tmpDir, "bin/adb"); in testAdbFromEnv()
182 mEnvironment = tmpDir.getAbsolutePath(); in testAdbFromEnv()
205 FileUtil.recursiveDelete(tmpDir); in testAdbFromEnv()
/tools/tradefederation/contrib/src/com/android/media/tests/
DCamera2StressTest.java109 File tmpDir = null; in postScreenshotOnFailure() local
113 tmpDir = FileUtil.createTempDir("screenshot"); in postScreenshotOnFailure()
123 File screenshot = new File(tmpDir, remoteFile.getName()); in postScreenshotOnFailure()
139 FileUtil.recursiveDelete(tmpDir); in postScreenshotOnFailure()
/tools/tradefederation/core/src/com/android/tradefed/util/
DFileUtil.java299 File tmpDir = File.createTempFile(prefix, "", parentDir); in createTempDir() local
300 return deleteFileAndCreateDirWithSameName(tmpDir); in createTempDir()
303 private static File deleteFileAndCreateDirWithSameName(File tmpDir) throws IOException { in deleteFileAndCreateDirWithSameName() argument
304 tmpDir.delete(); in deleteFileAndCreateDirWithSameName()
305 return createDir(tmpDir); in deleteFileAndCreateDirWithSameName()
308 private static File createDir(File tmpDir) throws IOException { in createDir() argument
309 if (!tmpDir.mkdirs()) { in createDir()
312 return tmpDir; in createDir()
/tools/tradefederation/core/tests/src/com/android/tradefed/targetprep/
DTestFilePushSetupTest.java80 File tmpDir = mAltDirFile1.getParentFile(); in tearDown() local
83 FileUtil.recursiveDelete(tmpDir); in tearDown()
/tools/tradefederation/core/src/com/android/tradefed/testtype/
DTfTestLauncher.java334 protected void testTmpDirClean(File tmpDir, ITestInvocationListener listener) { in testTmpDirClean() argument
338 String[] listFiles = tmpDir.list(); in testTmpDirClean()