summaryrefslogtreecommitdiffstats
path: root/jack/tests
diff options
context:
space:
mode:
authorBenoit Lamarche <benoitlamarche@google.com>2014-10-22 11:16:38 +0200
committerBenoit Lamarche <benoitlamarche@google.com>2014-10-22 11:16:38 +0200
commitb7882875da8c92c793f0f8378a8a1beaed29aea0 (patch)
treeddb3e039a31c6da5fa6787f22d06f36c3f5bd803 /jack/tests
parent19998fe9f1c86888e199ec994e4c3f13e90bd383 (diff)
downloadtoolchain_jack-b7882875da8c92c793f0f8378a8a1beaed29aea0.zip
toolchain_jack-b7882875da8c92c793f0f8378a8a1beaed29aea0.tar.gz
toolchain_jack-b7882875da8c92c793f0f8378a8a1beaed29aea0.tar.bz2
Move FileUtils to SchedLib
Change-Id: I14754239161e7fcbebb8205e2b76e33665be76e7
Diffstat (limited to 'jack/tests')
-rw-r--r--jack/tests/com/android/jack/AllTests.java2
-rw-r--r--jack/tests/com/android/jack/FibonacciThreeAddressTest.java2
-rw-r--r--jack/tests/com/android/jack/TestTools.java2
-rw-r--r--jack/tests/com/android/jack/errorhandling/AnnotationProcessorErrorTest.java2
-rw-r--r--jack/tests/com/android/jack/util/AllTests.java26
-rw-r--r--jack/tests/com/android/jack/util/FileUtilsTest.java80
6 files changed, 3 insertions, 111 deletions
diff --git a/jack/tests/com/android/jack/AllTests.java b/jack/tests/com/android/jack/AllTests.java
index 0fe9b6f..7624b6c 100644
--- a/jack/tests/com/android/jack/AllTests.java
+++ b/jack/tests/com/android/jack/AllTests.java
@@ -32,7 +32,6 @@ import com.android.jack.tracer.TracingTest;
import com.android.jack.transformations.ast.string.StringSplittingTest;
import com.android.jack.transformations.cast.UselessCastRemoverTest;
import com.android.jack.transformations.flow.CompileFlowTest;
-import com.android.jack.util.FileUtilsTest;
import org.junit.runner.RunWith;
import org.junit.runners.Suite;
@@ -77,7 +76,6 @@ import org.junit.runners.Suite.SuiteClasses;
FieldAccessTest.class,
FieldTest.class,
FileConflictTest.class,
- FileUtilsTest.class,
FinallyTest.class,
FlowTest.class,
GenericTest.class,
diff --git a/jack/tests/com/android/jack/FibonacciThreeAddressTest.java b/jack/tests/com/android/jack/FibonacciThreeAddressTest.java
index 145e757..d765c05 100644
--- a/jack/tests/com/android/jack/FibonacciThreeAddressTest.java
+++ b/jack/tests/com/android/jack/FibonacciThreeAddressTest.java
@@ -23,7 +23,7 @@ import com.android.jack.dx.dex.file.DexFile;
import com.android.jack.ir.ast.JDefinedClassOrInterface;
import com.android.jack.ir.ast.JSession;
import com.android.jack.scheduling.marker.ClassDefItemMarker;
-import com.android.jack.util.FileUtils;
+import com.android.sched.util.file.FileUtils;
import junit.framework.Assert;
diff --git a/jack/tests/com/android/jack/TestTools.java b/jack/tests/com/android/jack/TestTools.java
index cc33f3e..c24bca9 100644
--- a/jack/tests/com/android/jack/TestTools.java
+++ b/jack/tests/com/android/jack/TestTools.java
@@ -33,13 +33,13 @@ import com.android.jack.shrob.proguard.GrammarActions;
import com.android.jack.shrob.shrink.ShrinkStructurePrinter;
import com.android.jack.shrob.spec.Flags;
import com.android.jack.util.ExecuteFile;
-import com.android.jack.util.FileUtils;
import com.android.jack.util.TextUtils;
import com.android.jack.util.filter.SignatureMethodFilter;
import com.android.sched.scheduler.PlanBuilder;
import com.android.sched.scheduler.Request;
import com.android.sched.util.RunnableHooks;
import com.android.sched.util.config.ThreadConfig;
+import com.android.sched.util.file.FileUtils;
import junit.framework.Assert;
diff --git a/jack/tests/com/android/jack/errorhandling/AnnotationProcessorErrorTest.java b/jack/tests/com/android/jack/errorhandling/AnnotationProcessorErrorTest.java
index 70ea4b5..5c314df 100644
--- a/jack/tests/com/android/jack/errorhandling/AnnotationProcessorErrorTest.java
+++ b/jack/tests/com/android/jack/errorhandling/AnnotationProcessorErrorTest.java
@@ -28,7 +28,7 @@ import com.android.jack.errorhandling.annotationprocessor.SourceAnnotationProces
import com.android.jack.errorhandling.annotationprocessor.SourceAnnotationTest;
import com.android.jack.errorhandling.annotationprocessor.SourceErrorAnnotationTest;
import com.android.jack.frontend.FrontendCompilationException;
-import com.android.jack.util.FileUtils;
+import com.android.sched.util.file.FileUtils;
import junit.framework.Assert;
diff --git a/jack/tests/com/android/jack/util/AllTests.java b/jack/tests/com/android/jack/util/AllTests.java
deleted file mode 100644
index 3d9c445..0000000
--- a/jack/tests/com/android/jack/util/AllTests.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Copyright (C) 2012 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.jack.util;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-import org.junit.runners.Suite.SuiteClasses;
-
-@RunWith(Suite.class)
-@SuiteClasses(value = {FileUtilsTest.class})
-public class AllTests {
-} \ No newline at end of file
diff --git a/jack/tests/com/android/jack/util/FileUtilsTest.java b/jack/tests/com/android/jack/util/FileUtilsTest.java
deleted file mode 100644
index 44a63b9..0000000
--- a/jack/tests/com/android/jack/util/FileUtilsTest.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Copyright (C) 2012 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.jack.util;
-
-import com.android.jack.Main;
-
-import junit.framework.Assert;
-
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-import java.io.File;
-import java.io.IOException;
-
-/**
- * JUnit tests for class {@link FileUtils}.
- */
-public class FileUtilsTest {
-
- @BeforeClass
- public static void setUpClass() {
- // Enable assertions
- Main.class.getClassLoader().setDefaultAssertionStatus(true);
- }
-
- /**
- * Test method for {@link com.android.jack.util.FileUtils#getFileSeparator()}.
- */
- public void testGetFileSeparator() {
- String fileSeparator = FileUtils.getFileSeparator();
- Assert.assertNotNull(fileSeparator);
- Assert.assertFalse(fileSeparator.isEmpty());
- }
-
- /**
- * Test method for {@link com.android.jack.util.FileUtils#getWorkingDirectory()}.
- */
- @Test
- public void testGetWorkingDirectory() {
- File workingDir = FileUtils.getWorkingDirectory();
- Assert.assertNotNull(workingDir);
- Assert.assertTrue(workingDir.isDirectory());
- }
-
- /**
- * Test method for {@link com.android.jack.util.FileUtils#createIfNotExists(java.io.File)}.
- */
- @Test
- public void testCreateIfNotExists() throws IOException {
-
- // Test creation of a directory (in tmp)
- String tmpDirPath = System.getProperty("java.io.tmpdir");
- File tempDir = new File(tmpDirPath);
- File newDir = new File(tempDir, "testDir_FileUtilTest");
- newDir.deleteOnExit();
- if (newDir.exists()) {
- if (!newDir.delete()) {
- Assert.fail("Unable to delete folder " + newDir.getAbsolutePath());
- }
- }
-
- FileUtils.createIfNotExists(newDir);
- Assert.assertTrue(newDir.exists());
- }
-
-}