Home
last modified time | relevance | path

Searched refs:FileUtil (Results 1 – 25 of 287) sorted by relevance

12345678910>>...12

/tools/tradefederation/core/tests/src/com/android/tradefed/util/
DFileUtilTest.java46 FileUtil.setChmodBinary("chmod"); in setUp()
52 assertEquals("", FileUtil.getExtension("filewithoutext")); in testGetExtension()
53 assertEquals(".txt", FileUtil.getExtension("file.txt")); in testGetExtension()
54 assertEquals(".txt", FileUtil.getExtension("foo.file.txt")); in testGetExtension()
62 if (!FileUtil.chmodExists()) { in testChmodGroupRW()
66 testFile = FileUtil.createTempFile("testChmodRW", ".txt"); in testChmodGroupRW()
67 assertTrue(FileUtil.chmodGroupRW(testFile)); in testChmodGroupRW()
72 FileUtil.deleteFile(testFile); in testChmodGroupRW()
83 FileUtil.setChmodBinary("fake_not_existing_chmod"); in testChmodGroupRW_noChmod()
85 testFile = FileUtil.createTempFile("testChmodRW", ".txt"); in testChmodGroupRW_noChmod()
[all …]
DFileUtilFuncTest.java55 FileUtil.recursiveDelete(file); in tearDown()
77 FileUtil.mkdirsRWX(subdirs[subdirs.length - 1]); in testMkdirsRWX_multiLevel()
91 FileUtil.mkdirsRWX(subdir); in testMkdirsRWX_singleLevel()
110 FileUtil.mkdirsRWX(subdir); in testMkdirsRWX_preExisting()
121 FileUtil.chmodGroupRW(tmpFile); in testChmodGroupRW()
173 FileUtil.writeToFile(input, tmpFile); in testWriteToFile()
183 FileUtil.recursiveDelete(tmpParentDir); in testRecursiveDelete()
199 FileUtil.writeToFile("foo", subFile); in testRecursiveCopy()
203 FileUtil.recursiveCopy(tmpParentDir, destDir); in testRecursiveCopy()
208 assertTrue(FileUtil.compareFileContents(subFile, subFileCopy)); in testRecursiveCopy()
[all …]
DTarUtilTest.java45 mWorkDir = FileUtil.createTempDir("tarutil_unit_test_dir"); in setUp()
50 FileUtil.recursiveDelete(mWorkDir); in tearDown()
57 File tmpFile = FileUtil.createTempFile("log_tarutil_test", ".tar.gz"); in testIsGzip()
59 FileUtil.writeToFile(logTarGz, tmpFile); in testIsGzip()
62 FileUtil.writeToFile("test", tmpFile); in testIsGzip()
65 FileUtil.writeToFile("", tmpFile); in testIsGzip()
68 FileUtil.deleteFile(tmpFile); in testIsGzip()
78 File logTarGzFile = FileUtil.createTempFile("log_tarutil_test", ".tar.gz"); in testUnGzip()
80 FileUtil.writeToFile(logTarGz, logTarGzFile); in testUnGzip()
88 FileUtil.deleteFile(logTarGzFile); in testUnGzip()
[all …]
DSubprocessTestResultsParserTest.java117 File tmp = FileUtil.createTempFile("sub", "unit"); in testParse_randomEvents()
126 FileUtil.deleteFile(tmp); in testParse_randomEvents()
159 File tmp = FileUtil.createTempFile("sub", "unit"); in testParse_invalidEventOrder()
168 FileUtil.deleteFile(tmp); in testParse_invalidEventOrder()
188 File tmp = FileUtil.createTempFile("sub", "unit"); in testParse_testNotStarted()
196 FileUtil.writeToFile(startRun, tmp, true); in testParse_testNotStarted()
202 FileUtil.writeToFile(testEnded, tmp, true); in testParse_testNotStarted()
207 FileUtil.deleteFile(tmp); in testParse_testNotStarted()
227 File tmp = FileUtil.createTempFile("sub", "unit"); in testParse_noTimeStamp()
234 FileUtil.writeToFile(startRun, tmp, true); in testParse_noTimeStamp()
[all …]
DBugreportTest.java51 mRegularFile = FileUtil.createTempFile("bugreport-test", "txt"); in setUp()
54 tempDir = FileUtil.createTempDir("bugreportz"); in setUp()
55 File mainEntry = FileUtil.createTempFile("main_entry", ".txt", tempDir); in setUp()
56 File bugreport = FileUtil.createTempFile(BUGREPORT_PREFIX, ".txt", tempDir); in setUp()
58 FileUtil.writeToFile(name, mainEntry); in setUp()
60 FileUtil.writeToFile(content, bugreport); in setUp()
70 FileUtil.recursiveDelete(tempDir); in setUp()
76 FileUtil.deleteFile(mRegularFile); in tearDown()
77 FileUtil.deleteFile(mZipFile); in tearDown()
105 Assert.assertEquals(BUGREPORT_CONTENT, FileUtil.readStringFromFile(mainFile)); in testBugreport_zipped()
[all …]
DRemoteZipTest.java55 FileUtil.writeToFile(inputStream, destFile, false, startOffset, size); in saveTestDataFile()
81 File zipFile = FileUtil.createTempFileForRemote("zipfile", null); in setUp()
92 FileUtil.deleteFile(zipFile); in setUp()
100 destDir = FileUtil.createTempDir("test"); in testGetZipEntries()
109 FileUtil.recursiveDelete(destDir); in testGetZipEntries()
122 destDir = FileUtil.createTempDir("test"); in testGetZipEntriesWithUseZip64()
128 FileUtil.recursiveDelete(destDir); in testGetZipEntriesWithUseZip64()
136 destDir = FileUtil.createTempDir("test"); in testDownloadFilesFromZip()
150 assertEquals(4146093769L, FileUtil.calculateCrc32(targetFile)); in testDownloadFilesFromZip()
157 FileUtil.recursiveDelete(destDir); in testDownloadFilesFromZip()
DBuildTestsZipUtilsTest.java43 File testDir = FileUtil.createTempDir("test-dir-build-tests"); in testGetApkFile_notFound()
56 FileUtil.recursiveDelete(testDir); in testGetApkFile_notFound()
64 File testDir = FileUtil.createTempDir("test-dir-build-tests"); in testGetApkFile_fromTestDir()
82 FileUtil.recursiveDelete(testDir); in testGetApkFile_fromTestDir()
93 File testDir = FileUtil.createTempDir("test-dir-build-tests"); in testGetApkFile_fromTestDir_testCase()
113 FileUtil.recursiveDelete(testDir); in testGetApkFile_fromTestDir_testCase()
124 File testDir = FileUtil.createTempDir("test-dir-build-tests"); in testGetApkFile_fromTestDir_differentModule_testCase()
144 FileUtil.recursiveDelete(testDir); in testGetApkFile_fromTestDir_differentModule_testCase()
DHprofAllocSiteParserTest.java67 File f = FileUtil.createTempFile("hprof", ".test"); in testParse()
69 FileUtil.writeToFile(TEST_STRING, f); in testParse()
75 FileUtil.deleteFile(f); in testParse()
82 File f = FileUtil.createTempFile("hprof", ".test"); in testParse_invalidContent()
84 FileUtil.writeToFile("SITES BEGIN\nugh, we are in big trouble", f); in testParse_invalidContent()
88 FileUtil.deleteFile(f); in testParse_invalidContent()
/tools/tradefederation/core/tests/src/com/android/tradefed/config/
DConfigurationUtilTest.java30 import com.android.tradefed.util.FileUtil;
56 File tmpXml = FileUtil.createTempFile("global_config", ".xml"); in testDumpClassToXml()
78 String content = FileUtil.readStringFromFile(tmpXml); in testDumpClassToXml()
87 FileUtil.deleteFile(tmpXml); in testDumpClassToXml()
97 File tmpXml = FileUtil.createTempFile("global_config", ".xml"); in testDumpClassToXml_filtered()
125 String content = FileUtil.readStringFromFile(tmpXml); in testDumpClassToXml_filtered()
136 FileUtil.deleteFile(tmpXml); in testDumpClassToXml_filtered()
148 tmpDir = FileUtil.createTempDir("test_configs_dir"); in testGetConfigNamesFromDirs()
150 File config1 = FileUtil.createTempFile("config", ".config", tmpDir); in testGetConfigNamesFromDirs()
151 FileUtil.writeToFile("<configuration></configuration>", config1); in testGetConfigNamesFromDirs()
[all …]
/tools/tradefederation/core/util-apps/ContentProvider/hostsidetests/src/com/android/tradefed/contentprovider/
DContentProviderTest.java25 import com.android.tradefed.util.FileUtil;
68 File tmpFile = FileUtil.createTempFile("tmpFileToPush (test)", ".txt"); in testPushFile_encode()
74 FileUtil.deleteFile(tmpFile); in testPushFile_encode()
85 File tmpFile = FileUtil.createTempFile("tmpFileToPush+(test)", ".txt"); in testPushFile_encode_plus()
91 FileUtil.deleteFile(tmpFile); in testPushFile_encode_plus()
97 File tmpFile = FileUtil.createTempFile("tmpFileToPush", ".txt"); in testPushFile()
105 FileUtil.deleteFile(tmpFile); in testPushFile()
112 File tmpFile = FileUtil.createTempFile("tmpFileToPush", ".txt"); in testDeleteFile()
122 FileUtil.deleteFile(tmpFile); in testDeleteFile()
131 File tmpFile = FileUtil.createTempFile("tmpFileToPush", ".txt"); in testPullFile()
[all …]
/tools/tradefederation/core/tests/src/com/android/tradefed/targetprep/suite/
DSuiteApkInstallerTest.java32 import com.android.tradefed.util.FileUtil;
63 mTmpDepDir = FileUtil.createTempDir("suite-apk-installer-dep"); in setUp()
73 FileUtil.recursiveDelete(mTmpDepDir); in tearDown()
82 File apk = FileUtil.createTempFile("testapk", ".apk", mTmpDepDir); in testGetLocalPathForFilename_withVariable()
95 File varDir = FileUtil.createTempFile("suite-apk-installer-var", ".txt"); in testGetTestsDir_notDir()
97 File tmpDir = FileUtil.createTempDir("suite-apk-installer"); in testGetTestsDir_notDir()
99 File apkFile = FileUtil.createTempFile("apk-test", ".apk", tmpDir); in testGetTestsDir_notDir()
105 FileUtil.recursiveDelete(varDir); in testGetTestsDir_notDir()
106 FileUtil.recursiveDelete(tmpDir); in testGetTestsDir_notDir()
116 File tmpApk = FileUtil.createTempFile("suite-apk-installer", ".apk"); in testGetLocalPathForFileName()
[all …]
/tools/tradefederation/core/tests/src/com/android/tradefed/util/testmapping/
DTestMappingTest.java23 import com.android.tradefed.util.FileUtil;
62 tempDir = FileUtil.createTempDir("test_mapping"); in testparseTestMapping()
65 File testMappingRootDir = FileUtil.createTempDir("subdir", tempDir); in testparseTestMapping()
68 FileUtil.saveResourceFile(resourceStream, testMappingRootDir, TEST_MAPPING); in testparseTestMapping()
120 FileUtil.recursiveDelete(tempDir); in testparseTestMapping()
130 tempDir = FileUtil.createTempDir("test_mapping"); in testparseTestMapping_BadJson()
132 FileUtil.writeToFile("bad format json file", testMappingFile); in testparseTestMapping_BadJson()
137 FileUtil.recursiveDelete(tempDir); in testparseTestMapping_BadJson()
146 tempDir = FileUtil.createTempDir("test_mapping"); in testGetTests()
148 File srcDir = FileUtil.createTempDir("src", tempDir); in testGetTests()
[all …]
/tools/tradefederation/core/tests/src/com/android/tradefed/targetprep/
DPushFilePreparerTest.java36 import com.android.tradefed.util.FileUtil;
122 File testsDir = FileUtil.createTempDir("tests_dir"); in testPushFile_RemoteIsDir()
138 FileUtil.recursiveDelete(testsDir); in testPushFile_RemoteIsDir()
146 File testsDir = FileUtil.createTempDir("tests_dir"); in testPushFile_duplicateKey()
169 FileUtil.recursiveDelete(testsDir); in testPushFile_duplicateKey()
177 File testsDir = FileUtil.createTempDir("tests_dir"); in testPushDir_RemoteIsDir()
197 FileUtil.recursiveDelete(testsDir); in testPushDir_RemoteIsDir()
205 File testsDir = FileUtil.createTempDir("tests_dir"); in testPushDir_RemoteIsFile()
223 FileUtil.recursiveDelete(testsDir); in testPushDir_RemoteIsFile()
234 File testsDir = FileUtil.createTempDir("tests_dir"); in testRemotePush_override()
[all …]
DGsiDeviceFlashPreparerTest.java36 import com.android.tradefed.util.FileUtil;
99 mTmpDir = FileUtil.createTempDir("tmp"); in setUp()
116 FileUtil.recursiveDelete(mTmpDir); in tearDown()
166 File gsiDir = FileUtil.createTempDir("gsi_folder", mTmpDir); in testSetUp_NoSystemImageInGsiZip()
168 File gsiZip = FileUtil.createTempFile("gsi_image", ".zip", mTmpDir); in testSetUp_NoSystemImageInGsiZip()
184 File gsiDir = FileUtil.createTempDir("gsi_folder", mTmpDir); in testSetUp_NoVbmetaImageInGsiZip()
186 File gsiZip = FileUtil.createTempFile("gsi_image", ".zip", mTmpDir); in testSetUp_NoVbmetaImageInGsiZip()
202 File gsiDir = FileUtil.createTempDir("gsi_folder", mTmpDir); in testSetup_Success()
205 FileUtil.writeToFile("ddd", systemImg); in testSetup_Success()
206 FileUtil.writeToFile("ddd", vbmetaImg); in testSetup_Success()
[all …]
DAllTestAppsInstallSetupTest.java7 import com.android.tradefed.util.FileUtil;
77 File testDir = FileUtil.createTempDir("TestAppSetupTest"); in testSetup()
79 FileUtil.createTempFile("fakeApk", ".apk", testDir); in testSetup()
80 FileUtil.createTempFile("fakeApk2", ".apk", testDir); in testSetup()
81 FileUtil.createTempFile("notAnApk", ".txt", testDir); in testSetup()
82 File subTestDir = FileUtil.createTempDir("SubTestAppSetupTest", testDir); in testSetup()
83 FileUtil.createTempFile("subfakeApk", ".apk", subTestDir); in testSetup()
92 FileUtil.recursiveDelete(testDir); in testSetup()
97 File testDir = FileUtil.createTempDir("TestAppSetupForceQueryableTest"); in testSetupForceQueryable()
99 FileUtil.createTempFile("fakeApk", ".apk", testDir); in testSetupForceQueryable()
[all …]
DGkiDeviceFlashPreparerTest.java36 import com.android.tradefed.util.FileUtil;
99 mTmpDir = FileUtil.createTempDir("tmp"); in setUp()
116 FileUtil.recursiveDelete(mTmpDir); in tearDown()
182 File otaDir = FileUtil.createTempDir("otatool_folder", mTmpDir); in testValidateGkiBootImg_NoMkbootimgInOtatoolsZip()
184 File otatoolsZip = FileUtil.createTempFile("otatools", ".zip", mTmpDir); in testValidateGkiBootImg_NoMkbootimgInOtatoolsZip()
204 File otaDir = FileUtil.createTempDir("otatool_folder", mTmpDir); in testValidateGkiBootImg_FailToGenerateBootImg()
206 File otatoolsZip = FileUtil.createTempFile("otatools", ".zip", mTmpDir); in testValidateGkiBootImg_FailToGenerateBootImg()
259 File otaDir = FileUtil.createTempDir("otatool_folder", mTmpDir); in testSetUp_NoMkbootimgInOtatoolsZip()
261 File otatoolsZip = FileUtil.createTempFile("otatools", ".zip", mTmpDir); in testSetUp_NoMkbootimgInOtatoolsZip()
277 File bootImg = FileUtil.createTempFile("boot", ".img", mTmpDir); in testSetup_Success()
[all …]
/tools/tradefederation/core/tests/src/com/android/tradefed/build/
DLocalDeviceBuildProviderTest.java23 import com.android.tradefed.util.FileUtil;
60 mTmpDir = FileUtil.createTempDir("tmp"); in setUp()
61 mBuildDir = FileUtil.createTempDir("buildOutput"); in setUp()
62 mTestDir = FileUtil.createTempDir("tests"); in setUp()
64 FileUtil.writeToFile(ANDROID_INFO, mAndroidInfo); in setUp()
66 FileUtil.writeToFile(BOOT_IMG, mBootImg); in setUp()
68 FileUtil.writeToFile(RADIO_IMG, mRadioImg); in setUp()
70 FileUtil.writeToFile(BOOTLOADER_IMG, mBootloaderImg); in setUp()
72 FileUtil.writeToFile(SYSTEM_IMG, mSystemImg); in setUp()
79 FileUtil.recursiveDelete(mTmpDir); in tearDown()
[all …]
DBuildInfoTest.java27 import com.android.tradefed.util.FileUtil;
54 mFile = FileUtil.createTempFile("image", "tmp"); in setUp()
55 FileUtil.writeToFile("filedata", mFile); in setUp()
61 FileUtil.deleteFile(mFile); in tearDown()
75 assertTrue(FileUtil.compareFileContents(mFile, copy.getFile(FILE_KEY))); in testClone()
78 FileUtil.deleteFile(copy.getFile(FILE_KEY)); in testClone()
134 File testFile = FileUtil.createTempFile("fake-versioned-file", ".txt"); in testCleanUpWithExemption()
135 File testFile2 = FileUtil.createTempFile("fake-versioned-file2", ".txt"); in testCleanUpWithExemption()
147 FileUtil.deleteFile(testFile); in testCleanUpWithExemption()
148 FileUtil.deleteFile(testFile2); in testCleanUpWithExemption()
[all …]
/tools/tradefederation/core/src/com/android/tradefed/util/
DBuildTestsZipUtils.java59 dirs.add(FileUtil.getFileForPath(dir, "DATA", "app")); in getApkFile()
60 dirs.add(FileUtil.getFileForPath(dir, "DATA", "app", apkBase)); in getApkFile()
61 dirs.add(FileUtil.getFileForPath(dir, "DATA", "priv-app", apkBase)); in getApkFile()
63 dirs.add(FileUtil.getFileForPath(dir, "data", "app", apkBase)); in getApkFile()
74 expandedTestDirs.add(FileUtil.getFileForPath(testsDir, "DATA", "app")); in getApkFile()
75 expandedTestDirs.add(FileUtil.getFileForPath(testsDir, "DATA", "app", apkBase)); in getApkFile()
77 FileUtil.getFileForPath(testsDir, "DATA", "priv-app", apkBase)); in getApkFile()
78 expandedTestDirs.add(FileUtil.getFileForPath(testsDir, apkBase)); in getApkFile()
82 File testcasesSubDir = FileUtil.findFile(testsDir, apkBase); in getApkFile()
115 File testAppFile = FileUtil.findFile(dir, apkFileName); in getApkFile()
[all …]
/tools/tradefederation/core/tests/src/com/android/tradefed/util/keystore/
DJSONFileKeyStoreFactoryTest.java25 import com.android.tradefed.util.FileUtil;
53 mJsonFile = FileUtil.createTempFile("json-keystore", ".json"); in setUp()
54 FileUtil.writeToFile(mJsonData, mJsonFile); in setUp()
55 mJsonFile2 = FileUtil.createTempFile("json-keystore-2", ".json"); in setUp()
56 FileUtil.writeToFile(mJsonData2, mJsonFile2); in setUp()
57 mJsonFile3 = FileUtil.createTempFile("json-keystore-3", ".json"); in setUp()
58 FileUtil.writeToFile(mJsonData3, mJsonFile3); in setUp()
63 FileUtil.recursiveDelete(mJsonFile); in tearDown()
64 FileUtil.recursiveDelete(mJsonFile2); in tearDown()
65 FileUtil.recursiveDelete(mJsonFile3); in tearDown()
[all …]
/tools/tradefederation/core/tests/src/com/android/tradefed/testtype/suite/
DTestMappingSuiteRunnerTest.java40 import com.android.tradefed.util.FileUtil;
238 tempDir = FileUtil.createTempDir("test_mapping"); in testLoadTests_testMappingsZip()
240 File srcDir = FileUtil.createTempDir("src", tempDir); in testLoadTests_testMappingsZip()
244 FileUtil.saveResourceFile(resourceStream, srcDir, DISABLED_PRESUBMIT_TESTS); in testLoadTests_testMappingsZip()
248 FileUtil.saveResourceFile(resourceStream, srcDir, TEST_MAPPING); in testLoadTests_testMappingsZip()
249 File subDir = FileUtil.createTempDir("sub_dir", srcDir); in testLoadTests_testMappingsZip()
252 FileUtil.saveResourceFile(resourceStream, subDir, TEST_MAPPING); in testLoadTests_testMappingsZip()
293 FileUtil.recursiveDelete(tempDir); in testLoadTests_testMappingsZip()
308 tempDir = FileUtil.createTempDir("test_mapping"); in testLoadTests_testMappingsZipFoundTestsWithKeywords()
310 File srcDir = FileUtil.createTempDir("src", tempDir); in testLoadTests_testMappingsZipFoundTestsWithKeywords()
[all …]
DTestSuiteInfoTest.java20 import com.android.tradefed.util.FileUtil;
57 File propertyFile = FileUtil.createTempFile("test-suite-prop", ".properties"); in testLoadConfig()
60 FileUtil.writeToFile( in testLoadConfig()
76 FileUtil.deleteFile(propertyFile); in testLoadConfig()
83 File propertyFile = FileUtil.createTempFile("test-suite-prop", ".properties"); in testLoadConfig_multiArch()
86 FileUtil.writeToFile( in testLoadConfig_multiArch()
102 FileUtil.deleteFile(propertyFile); in testLoadConfig_multiArch()
/tools/tradefederation/core/tests/src/com/android/tradefed/clearcut/
DClearcutClientTest.java20 import com.android.tradefed.util.FileUtil;
54 File testFile = FileUtil.createTempFile("uuid-test", ""); in testGetGroupingKey()
59 assertEquals(grouping, FileUtil.readStringFromFile(testFile)); in testGetGroupingKey()
61 FileUtil.deleteFile(testFile); in testGetGroupingKey()
67 File testFile = FileUtil.createTempFile("uuid-test", ""); in testGetGroupingKey_exists()
69 FileUtil.writeToFile("test", testFile); in testGetGroupingKey_exists()
74 FileUtil.deleteFile(testFile); in testGetGroupingKey_exists()
/tools/tradefederation/core/tests/src/com/android/tradefed/host/gcs/
DGCSHostResourceManagerTest.java21 import com.android.tradefed.util.FileUtil;
44 mRoot = FileUtil.createTempDir(GCSHostResourceManagerTest.class.getSimpleName()); in setUp()
57 FileUtil.writeToFile(relativeRemotePath, destFile); in setUp()
68 FileUtil.createTempFileForRemote(remoteFilePath, mRoot); in setUp()
86 FileUtil.recursiveDelete(mRoot); in tearDown()
94 Assert.assertEquals(HOST_RESOURCE1, FileUtil.readStringFromFile(file1)); in testSetUpHostResources()
95 Assert.assertEquals(HOST_RESOURCE2, FileUtil.readStringFromFile(file2)); in testSetUpHostResources()
/tools/tradefederation/contrib/src/com/android/monkey/
DAnrReportGenerator.java26 import com.android.tradefed.util.FileUtil;
106 mCachedBugreport = FileUtil.createTempFile("monkey-anr-report-bugreport", ".txt"); in setBugReportInfo()
107 FileUtil.writeToFile(bugreportStream.createInputStream(), mCachedBugreport); in setBugReportInfo()
121 mCachedMonkeyLog = FileUtil.createTempFile("monkey-anr-report-monkey-log", ".txt"); in setMonkeyLogInfo()
122 FileUtil.writeToFile(monkeyLogStream.createInputStream(), mCachedMonkeyLog); in setMonkeyLogInfo()
157 FileUtil.createTempFile( in genereateAnrReport()
184 FileUtil.deleteFile(htmlReport); in genereateAnrReport()
193 FileUtil.deleteFile(mCachedBugreport); in cleanTempFiles()
194 FileUtil.deleteFile(mCachedMonkeyLog); in cleanTempFiles()

12345678910>>...12