diff --git a/.idea/runConfigurations/Codegen_Tests_on_Android.xml b/.idea/runConfigurations/Codegen_Tests_on_Android.xml
index 00a5a0d41ef..c1bad20fb22 100644
--- a/.idea/runConfigurations/Codegen_Tests_on_Android.xml
+++ b/.idea/runConfigurations/Codegen_Tests_on_Android.xml
@@ -4,8 +4,8 @@
-
-
+
+
diff --git a/compiler/android-tests/android-module/AndroidManifest.xml b/compiler/android-tests/android-module/AndroidManifest.xml
index 627a286628c..de6be785e87 100644
--- a/compiler/android-tests/android-module/AndroidManifest.xml
+++ b/compiler/android-tests/android-module/AndroidManifest.xml
@@ -1,12 +1,8 @@
-
-
@@ -16,6 +12,6 @@ which is needed when building test cases. -->
"adb shell am instrument -w com.example.tests/android.test.InstrumentationTestRunner"
-->
+ android:targetPackage="org.jetbrains.kotlin.android.tests"
+ android:label="Tests for org.jetbrains.kotlin.android.tests"/>
diff --git a/compiler/android-tests/android-module/src/org/jetbrains/jet/compiler/android/AbstractCodegenTestCaseOnAndroid.java b/compiler/android-tests/android-module/src/org/jetbrains/kotlin/android/tests/AbstractCodegenTestCaseOnAndroid.java
similarity index 92%
rename from compiler/android-tests/android-module/src/org/jetbrains/jet/compiler/android/AbstractCodegenTestCaseOnAndroid.java
rename to compiler/android-tests/android-module/src/org/jetbrains/kotlin/android/tests/AbstractCodegenTestCaseOnAndroid.java
index c38a10229b8..2f3d6ab7b3e 100644
--- a/compiler/android-tests/android-module/src/org/jetbrains/jet/compiler/android/AbstractCodegenTestCaseOnAndroid.java
+++ b/compiler/android-tests/android-module/src/org/jetbrains/kotlin/android/tests/AbstractCodegenTestCaseOnAndroid.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2010-2013 JetBrains s.r.o.
+ * Copyright 2010-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,14 +14,12 @@
* limitations under the License.
*/
-package org.jetbrains.jet.compiler.android;
+package org.jetbrains.kotlin.android.tests;
import junit.framework.TestCase;
-import java.lang.String;
import java.lang.reflect.Method;
-
public class AbstractCodegenTestCaseOnAndroid extends TestCase {
protected void invokeBoxMethod(String filePath, String expectedResult) throws Exception {
diff --git a/compiler/android-tests/android-module/src/org/jetbrains/jet/compiler/android/MyActivity.java b/compiler/android-tests/android-module/src/org/jetbrains/kotlin/android/tests/MyActivity.java
similarity index 90%
rename from compiler/android-tests/android-module/src/org/jetbrains/jet/compiler/android/MyActivity.java
rename to compiler/android-tests/android-module/src/org/jetbrains/kotlin/android/tests/MyActivity.java
index 7e025d4ab87..277753e01ea 100644
--- a/compiler/android-tests/android-module/src/org/jetbrains/jet/compiler/android/MyActivity.java
+++ b/compiler/android-tests/android-module/src/org/jetbrains/kotlin/android/tests/MyActivity.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2010-2013 JetBrains s.r.o.
+ * Copyright 2010-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.jetbrains.jet.compiler.android;
+package org.jetbrains.kotlin.android.tests;
import android.app.Activity;
import android.os.Bundle;
@@ -24,4 +24,4 @@ public class MyActivity extends Activity {
super.onCreate(savedInstanceState);
System.out.println(R.string.app_name);
}
-}
\ No newline at end of file
+}
diff --git a/compiler/android-tests/src/org/jetbrains/jet/compiler/ThreadUtils.java b/compiler/android-tests/src/org/jetbrains/jet/compiler/ThreadUtils.java
deleted file mode 100644
index 8d82e37b9a5..00000000000
--- a/compiler/android-tests/src/org/jetbrains/jet/compiler/ThreadUtils.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright 2010-2013 JetBrains s.r.o.
- *
- * 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 org.jetbrains.jet.compiler;
-
-import java.lang.InterruptedException;
-import java.lang.RuntimeException;
-import java.lang.Thread;
-
-public class ThreadUtils {
- public static void wait(Thread thread, int seconds) {
- try {
- thread.wait(seconds * 1000);
- }
- catch (InterruptedException e) {
- throw new RuntimeException(e);
- }
- }
-
- public static void sleep(int seconds) {
- try {
- Thread.sleep(seconds * 1000);
- }
- catch (InterruptedException e) {
- throw new RuntimeException(e);
- }
- }
-}
diff --git a/compiler/android-tests/src/org/jetbrains/jet/compiler/CodegenTestsOnAndroidRunner.java b/compiler/android-tests/src/org/jetbrains/kotlin/android/tests/CodegenTestsOnAndroidRunner.java
similarity index 93%
rename from compiler/android-tests/src/org/jetbrains/jet/compiler/CodegenTestsOnAndroidRunner.java
rename to compiler/android-tests/src/org/jetbrains/kotlin/android/tests/CodegenTestsOnAndroidRunner.java
index 4e0ea0e9ca0..13ec65772fc 100644
--- a/compiler/android-tests/src/org/jetbrains/jet/compiler/CodegenTestsOnAndroidRunner.java
+++ b/compiler/android-tests/src/org/jetbrains/kotlin/android/tests/CodegenTestsOnAndroidRunner.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2010-2013 JetBrains s.r.o.
+ * Copyright 2010-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,17 +14,17 @@
* limitations under the License.
*/
-package org.jetbrains.jet.compiler;
+package org.jetbrains.kotlin.android.tests;
import com.intellij.util.PlatformUtils;
import junit.framework.TestCase;
import junit.framework.TestSuite;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
-import org.jetbrains.jet.compiler.ant.AntRunner;
-import org.jetbrains.jet.compiler.download.SDKDownloader;
-import org.jetbrains.jet.compiler.emulator.Emulator;
-import org.jetbrains.jet.compiler.run.PermissionManager;
+import org.jetbrains.kotlin.android.tests.ant.AntRunner;
+import org.jetbrains.kotlin.android.tests.download.SDKDownloader;
+import org.jetbrains.kotlin.android.tests.emulator.Emulator;
+import org.jetbrains.kotlin.android.tests.run.PermissionManager;
import org.junit.Assert;
import java.io.File;
@@ -105,14 +105,14 @@ public class CodegenTestsOnAndroidRunner {
/*
Output example:
[exec] Error in testKt344:
- [exec] java.lang.RuntimeException: File: compiler\testData\codegen\regressions\kt344.jet
- [exec] at org.jetbrains.jet.compiler.android.AbstractCodegenTestCaseOnAndroid.invokeBoxMethod(AbstractCodegenTestCaseOnAndroid.java:38)
- [exec] at org.jetbrains.jet.compiler.android.CodegenTestCaseOnAndroid.testKt344(CodegenTestCaseOnAndroid.java:595)
+ [exec] java.lang.RuntimeException: File: compiler\testData\codegen\boxWithStdlib\regressions\kt344.kt
+ [exec] at org.jetbrains.kotlin.android.tests.AbstractCodegenTestCaseOnAndroid.invokeBoxMethod(AbstractCodegenTestCaseOnAndroid.java:38)
+ [exec] at org.jetbrains.kotlin.android.tests.CodegenTestCaseOnAndroid.testKt344(CodegenTestCaseOnAndroid.java:595)
[exec] at java.lang.reflect.Method.invokeNative(Native Method)
[exec] at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:169)
[exec] Caused by: java.lang.reflect.InvocationTargetException
[exec] at java.lang.reflect.Method.invokeNative(Native Method)
- [exec] at org.jetbrains.jet.compiler.android.AbstractCodegenTestCaseOnAndroid.invokeBoxMethod(AbstractCodegenTestCaseOnAndroid.java:35)
+ [exec] at org.jetbrains.kotlin.android.tests.AbstractCodegenTestCaseOnAndroid.invokeBoxMethod(AbstractCodegenTestCaseOnAndroid.java:35)
[exec] ... 13 more
[exec] Caused by: java.lang.VerifyError: compiler_testData_codegen_boxWithStdlib_regressions_kt344_kt.Compiler_testData_codegen_boxWithStdlib_regressions_kt344_ktPackage$t6$foo$1
[exec] at compiler_testData_codegen_boxWithStdlib_regressions_kt344_kt.Compiler_testData_codegen_boxWithStdlib_regressions_kt344_ktPackage.t6(dummy.jet:94)
diff --git a/compiler/android-tests/src/org/jetbrains/jet/compiler/OutputUtils.java b/compiler/android-tests/src/org/jetbrains/kotlin/android/tests/OutputUtils.java
similarity index 83%
rename from compiler/android-tests/src/org/jetbrains/jet/compiler/OutputUtils.java
rename to compiler/android-tests/src/org/jetbrains/kotlin/android/tests/OutputUtils.java
index 6aacd8eb978..69d2de34935 100644
--- a/compiler/android-tests/src/org/jetbrains/jet/compiler/OutputUtils.java
+++ b/compiler/android-tests/src/org/jetbrains/kotlin/android/tests/OutputUtils.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2010-2013 JetBrains s.r.o.
+ * Copyright 2010-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,18 +14,14 @@
* limitations under the License.
*/
-package org.jetbrains.jet.compiler;
+package org.jetbrains.kotlin.android.tests;
-import com.intellij.execution.configurations.GeneralCommandLine;
-import com.intellij.openapi.util.SystemInfo;
import org.jetbrains.annotations.Nullable;
-import org.jetbrains.jet.compiler.run.RunUtils;
-import org.jetbrains.jet.compiler.run.result.RunResult;
+import org.jetbrains.kotlin.android.tests.run.RunResult;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
-
public class OutputUtils {
private final static Pattern EMULATOR_PROCESS_PATTERN = Pattern.compile("\\w*[\\s]+([0-9]*) .* java .* emulator .*");
diff --git a/compiler/android-tests/src/org/jetbrains/jet/compiler/PathManager.java b/compiler/android-tests/src/org/jetbrains/kotlin/android/tests/PathManager.java
similarity index 96%
rename from compiler/android-tests/src/org/jetbrains/jet/compiler/PathManager.java
rename to compiler/android-tests/src/org/jetbrains/kotlin/android/tests/PathManager.java
index 4ca546a273b..f63aefaede0 100644
--- a/compiler/android-tests/src/org/jetbrains/jet/compiler/PathManager.java
+++ b/compiler/android-tests/src/org/jetbrains/kotlin/android/tests/PathManager.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2010-2013 JetBrains s.r.o.
+ * Copyright 2010-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,11 +14,10 @@
* limitations under the License.
*/
-package org.jetbrains.jet.compiler;
+package org.jetbrains.kotlin.android.tests;
import java.io.File;
-
public class PathManager {
private final String tmpFolder;
diff --git a/compiler/android-tests/src/org/jetbrains/jet/compiler/ant/AntRunner.java b/compiler/android-tests/src/org/jetbrains/kotlin/android/tests/ant/AntRunner.java
similarity index 86%
rename from compiler/android-tests/src/org/jetbrains/jet/compiler/ant/AntRunner.java
rename to compiler/android-tests/src/org/jetbrains/kotlin/android/tests/ant/AntRunner.java
index aed718849fa..4d741805bec 100644
--- a/compiler/android-tests/src/org/jetbrains/jet/compiler/ant/AntRunner.java
+++ b/compiler/android-tests/src/org/jetbrains/kotlin/android/tests/ant/AntRunner.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2010-2013 JetBrains s.r.o.
+ * Copyright 2010-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,20 +14,19 @@
* limitations under the License.
*/
-package org.jetbrains.jet.compiler.ant;
+package org.jetbrains.kotlin.android.tests.ant;
import com.intellij.execution.configurations.GeneralCommandLine;
import com.intellij.openapi.util.SystemInfo;
-import org.jetbrains.jet.compiler.OutputUtils;
-import org.jetbrains.jet.compiler.PathManager;
-import org.jetbrains.jet.compiler.ThreadUtils;
-import org.jetbrains.jet.compiler.run.RunUtils;
-import org.jetbrains.jet.compiler.run.result.RunResult;
+import org.jetbrains.jet.utils.UtilsPackage;
+import org.jetbrains.kotlin.android.tests.OutputUtils;
+import org.jetbrains.kotlin.android.tests.PathManager;
+import org.jetbrains.kotlin.android.tests.run.RunResult;
+import org.jetbrains.kotlin.android.tests.run.RunUtils;
import java.util.ArrayList;
import java.util.List;
-
public class AntRunner {
private final List listOfAntCommands;
@@ -87,7 +86,12 @@ public class AntRunner {
private static boolean isInstallSuccessful(String output) {
if (output.contains("Is the system running?")) {
System.out.println("Device not ready. Waiting for 20 sec.");
- ThreadUtils.sleep(20);
+ try {
+ Thread.sleep(20000);
+ }
+ catch (InterruptedException e) {
+ throw UtilsPackage.rethrow(e);
+ }
return false;
}
return true;
diff --git a/compiler/android-tests/src/org/jetbrains/jet/compiler/download/SDKDownloader.java b/compiler/android-tests/src/org/jetbrains/kotlin/android/tests/download/SDKDownloader.java
similarity index 89%
rename from compiler/android-tests/src/org/jetbrains/jet/compiler/download/SDKDownloader.java
rename to compiler/android-tests/src/org/jetbrains/kotlin/android/tests/download/SDKDownloader.java
index b783e609301..a8f94184669 100644
--- a/compiler/android-tests/src/org/jetbrains/jet/compiler/download/SDKDownloader.java
+++ b/compiler/android-tests/src/org/jetbrains/kotlin/android/tests/download/SDKDownloader.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2010-2013 JetBrains s.r.o.
+ * Copyright 2010-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,12 +14,12 @@
* limitations under the License.
*/
-package org.jetbrains.jet.compiler.download;
+package org.jetbrains.kotlin.android.tests.download;
import com.intellij.openapi.util.SystemInfo;
import com.intellij.openapi.util.io.FileUtil;
-import org.jetbrains.jet.compiler.PathManager;
-import org.jetbrains.jet.compiler.run.RunUtils;
+import org.jetbrains.kotlin.android.tests.PathManager;
+import org.jetbrains.kotlin.android.tests.run.RunUtils;
import java.io.*;
import java.net.URL;
@@ -27,7 +27,6 @@ import java.net.URLConnection;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
-
public class SDKDownloader {
private final String platformZipPath;
private final String systemImages;
@@ -39,11 +38,11 @@ public class SDKDownloader {
public SDKDownloader(PathManager pathManager) {
this.pathManager = pathManager;
- platformZipPath = pathManager.getRootForDownload() + "/platforms.zip";
- systemImages = pathManager.getRootForDownload() + "/system-images.zip";
- platformToolsZipPath = pathManager.getRootForDownload() + "/platform-tools.zip";
- toolsZipPath = pathManager.getRootForDownload() + "/tools.zip";
- antZipPath = pathManager.getRootForDownload() + "/apache-ant-1.8.0.zip";
+ this.platformZipPath = pathManager.getRootForDownload() + "/platforms.zip";
+ this.systemImages = pathManager.getRootForDownload() + "/system-images.zip";
+ this.platformToolsZipPath = pathManager.getRootForDownload() + "/platform-tools.zip";
+ this.toolsZipPath = pathManager.getRootForDownload() + "/tools.zip";
+ this.antZipPath = pathManager.getRootForDownload() + "/apache-ant-1.8.0.zip";
}
public void downloadPlatform() {
@@ -116,12 +115,12 @@ public class SDKDownloader {
delete(antZipPath);
}
- protected void download(String urlString, String output) {
+ private static void download(String urlString, String output) {
System.out.println("Start downloading: " + urlString + " to " + output);
OutputStream outStream = null;
- URLConnection urlConnection = null;
+ URLConnection urlConnection;
- InputStream is = null;
+ InputStream is;
try {
URL Url;
byte[] buf;
@@ -171,7 +170,7 @@ public class SDKDownloader {
}
try {
byte[] buf = new byte[1024];
- ZipInputStream zipinputstream = null;
+ ZipInputStream zipinputstream;
ZipEntry zipentry;
zipinputstream = new ZipInputStream(new FileInputStream(pathToFile));
@@ -222,9 +221,8 @@ public class SDKDownloader {
System.out.println("Finish unzipping: " + pathToFile + " to " + outputFolder);
}
- protected void delete(String filePath) {
- File file = new File(filePath);
- file.delete();
+ private static void delete(String filePath) {
+ new File(filePath).delete();
}
}
diff --git a/compiler/android-tests/src/org/jetbrains/jet/compiler/emulator/Emulator.java b/compiler/android-tests/src/org/jetbrains/kotlin/android/tests/emulator/Emulator.java
similarity index 95%
rename from compiler/android-tests/src/org/jetbrains/jet/compiler/emulator/Emulator.java
rename to compiler/android-tests/src/org/jetbrains/kotlin/android/tests/emulator/Emulator.java
index 22580253afe..36e754de6b8 100644
--- a/compiler/android-tests/src/org/jetbrains/jet/compiler/emulator/Emulator.java
+++ b/compiler/android-tests/src/org/jetbrains/kotlin/android/tests/emulator/Emulator.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2010-2013 JetBrains s.r.o.
+ * Copyright 2010-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,23 +14,21 @@
* limitations under the License.
*/
-package org.jetbrains.jet.compiler.emulator;
+package org.jetbrains.kotlin.android.tests.emulator;
import com.intellij.execution.configurations.GeneralCommandLine;
import com.intellij.openapi.util.SystemInfo;
import com.intellij.openapi.util.text.StringUtil;
import org.jetbrains.annotations.Nullable;
-import org.jetbrains.jet.compiler.OutputUtils;
-import org.jetbrains.jet.compiler.PathManager;
-import org.jetbrains.jet.compiler.ThreadUtils;
-import org.jetbrains.jet.compiler.run.RunUtils;
-import org.jetbrains.jet.compiler.run.result.RunResult;
+import org.jetbrains.kotlin.android.tests.OutputUtils;
+import org.jetbrains.kotlin.android.tests.PathManager;
+import org.jetbrains.kotlin.android.tests.run.RunResult;
+import org.jetbrains.kotlin.android.tests.run.RunUtils;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
-
public class Emulator {
private final static Pattern EMULATOR_PATTERN = Pattern.compile("emulator-([0-9])*");
@@ -85,7 +83,7 @@ public class Emulator {
}
@Nullable
- private GeneralCommandLine getStopCommand() {
+ private static GeneralCommandLine getStopCommand() {
if (SystemInfo.isWindows) {
GeneralCommandLine commandLine = new GeneralCommandLine();
commandLine.setExePath("taskkill");
@@ -143,7 +141,7 @@ public class Emulator {
}
//Only for Unix
- private void stopDdmsProcess() {
+ private static void stopDdmsProcess() {
if (SystemInfo.isUnix) {
GeneralCommandLine listOfEmulatorProcess = new GeneralCommandLine();
listOfEmulatorProcess.setExePath("sh");
@@ -169,7 +167,7 @@ public class Emulator {
}
//Only for Unix
- private void finishProcess(String processName) {
+ private static void finishProcess(String processName) {
if (SystemInfo.isUnix) {
GeneralCommandLine pidOfProcess = new GeneralCommandLine();
pidOfProcess.setExePath("pidof");
diff --git a/compiler/android-tests/src/org/jetbrains/jet/compiler/run/PermissionManager.java b/compiler/android-tests/src/org/jetbrains/kotlin/android/tests/run/PermissionManager.java
similarity index 93%
rename from compiler/android-tests/src/org/jetbrains/jet/compiler/run/PermissionManager.java
rename to compiler/android-tests/src/org/jetbrains/kotlin/android/tests/run/PermissionManager.java
index 9c0bd390cb9..e09bba1868e 100644
--- a/compiler/android-tests/src/org/jetbrains/jet/compiler/run/PermissionManager.java
+++ b/compiler/android-tests/src/org/jetbrains/kotlin/android/tests/run/PermissionManager.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2010-2013 JetBrains s.r.o.
+ * Copyright 2010-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,12 +14,11 @@
* limitations under the License.
*/
-package org.jetbrains.jet.compiler.run;
+package org.jetbrains.kotlin.android.tests.run;
import com.intellij.execution.configurations.GeneralCommandLine;
import com.intellij.openapi.util.SystemInfo;
-import org.jetbrains.jet.compiler.PathManager;
-
+import org.jetbrains.kotlin.android.tests.PathManager;
public class PermissionManager {
private PermissionManager() {
diff --git a/compiler/android-tests/src/org/jetbrains/jet/compiler/run/result/RunResult.java b/compiler/android-tests/src/org/jetbrains/kotlin/android/tests/run/RunResult.java
similarity index 88%
rename from compiler/android-tests/src/org/jetbrains/jet/compiler/run/result/RunResult.java
rename to compiler/android-tests/src/org/jetbrains/kotlin/android/tests/run/RunResult.java
index b23b4ba1586..6db84cd4005 100644
--- a/compiler/android-tests/src/org/jetbrains/jet/compiler/run/result/RunResult.java
+++ b/compiler/android-tests/src/org/jetbrains/kotlin/android/tests/run/RunResult.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2010-2013 JetBrains s.r.o.
+ * Copyright 2010-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,15 +14,14 @@
* limitations under the License.
*/
-package org.jetbrains.jet.compiler.run.result;
-
+package org.jetbrains.kotlin.android.tests.run;
public class RunResult {
private final boolean status;
private final String output;
public RunResult(boolean ok, String output) {
- status = ok;
+ this.status = ok;
this.output = output;
}
diff --git a/compiler/android-tests/src/org/jetbrains/jet/compiler/run/RunUtils.java b/compiler/android-tests/src/org/jetbrains/kotlin/android/tests/run/RunUtils.java
similarity index 94%
rename from compiler/android-tests/src/org/jetbrains/jet/compiler/run/RunUtils.java
rename to compiler/android-tests/src/org/jetbrains/kotlin/android/tests/run/RunUtils.java
index 307c785ab84..de80340ce44 100644
--- a/compiler/android-tests/src/org/jetbrains/jet/compiler/run/RunUtils.java
+++ b/compiler/android-tests/src/org/jetbrains/kotlin/android/tests/run/RunUtils.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2010-2013 JetBrains s.r.o.
+ * Copyright 2010-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.jetbrains.jet.compiler.run;
+package org.jetbrains.kotlin.android.tests.run;
import com.google.common.base.Charsets;
import com.intellij.execution.ExecutionException;
@@ -24,20 +24,16 @@ import com.intellij.execution.process.ProcessAdapter;
import com.intellij.execution.process.ProcessEvent;
import com.intellij.execution.process.ProcessOutputTypes;
import com.intellij.openapi.util.Key;
-import com.intellij.openapi.util.Ref;
import com.intellij.openapi.util.text.StringUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
-import org.jetbrains.jet.compiler.OutputUtils;
-import org.jetbrains.jet.compiler.ThreadUtils;
-import org.jetbrains.jet.compiler.run.result.RunResult;
+import org.jetbrains.kotlin.android.tests.OutputUtils;
import java.io.Closeable;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.StringWriter;
-
public class RunUtils {
private RunUtils() {
}
@@ -86,12 +82,12 @@ public class RunUtils {
}
public static RunResult execute(@NotNull RunSettings settings) {
- assert settings.waitForEnd == true : "Use executeOnSeparateThread() instead";
+ assert settings.waitForEnd : "Use executeOnSeparateThread() instead";
return run(settings);
}
public static void executeOnSeparateThread(@NotNull final RunSettings settings) {
- assert settings.waitForEnd == false : "Use execute() instead";
+ assert !settings.waitForEnd : "Use execute() instead";
Thread t = new Thread(new Runnable() {
@Override
public void run() {
diff --git a/compiler/android-tests/tests/org/jetbrains/jet/compiler/android/AndroidJpsBuildTestCase.java b/compiler/android-tests/tests/org/jetbrains/kotlin/android/tests/AndroidJpsBuildTestCase.java
similarity index 95%
rename from compiler/android-tests/tests/org/jetbrains/jet/compiler/android/AndroidJpsBuildTestCase.java
rename to compiler/android-tests/tests/org/jetbrains/kotlin/android/tests/AndroidJpsBuildTestCase.java
index 911e5664da7..af0a2381e37 100644
--- a/compiler/android-tests/tests/org/jetbrains/jet/compiler/android/AndroidJpsBuildTestCase.java
+++ b/compiler/android-tests/tests/org/jetbrains/kotlin/android/tests/AndroidJpsBuildTestCase.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2010-2013 JetBrains s.r.o.
+ * Copyright 2010-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.jetbrains.jet.compiler.android;
+package org.jetbrains.kotlin.android.tests;
import org.jetbrains.jps.builders.JpsBuildTestCase;
diff --git a/compiler/android-tests/tests/org/jetbrains/jet/compiler/android/AndroidRunner.java b/compiler/android-tests/tests/org/jetbrains/kotlin/android/tests/AndroidRunner.java
similarity index 91%
rename from compiler/android-tests/tests/org/jetbrains/jet/compiler/android/AndroidRunner.java
rename to compiler/android-tests/tests/org/jetbrains/kotlin/android/tests/AndroidRunner.java
index 400e34c97c6..a2ba78eff95 100644
--- a/compiler/android-tests/tests/org/jetbrains/jet/compiler/android/AndroidRunner.java
+++ b/compiler/android-tests/tests/org/jetbrains/kotlin/android/tests/AndroidRunner.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2010-2013 JetBrains s.r.o.
+ * Copyright 2010-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,18 +14,15 @@
* limitations under the License.
*/
-package org.jetbrains.jet.compiler.android;
+package org.jetbrains.kotlin.android.tests;
import com.google.common.io.Files;
import com.intellij.openapi.util.io.FileUtil;
import junit.framework.TestSuite;
import org.jetbrains.annotations.NotNull;
-import org.jetbrains.jet.compiler.CodegenTestsOnAndroidRunner;
-import org.jetbrains.jet.compiler.PathManager;
import java.io.File;
-
public class AndroidRunner extends TestSuite {
private static PathManager pathManager;
diff --git a/compiler/android-tests/tests/org/jetbrains/jet/compiler/android/CodegenTestsOnAndroidGenerator.java b/compiler/android-tests/tests/org/jetbrains/kotlin/android/tests/CodegenTestsOnAndroidGenerator.java
similarity index 93%
rename from compiler/android-tests/tests/org/jetbrains/jet/compiler/android/CodegenTestsOnAndroidGenerator.java
rename to compiler/android-tests/tests/org/jetbrains/kotlin/android/tests/CodegenTestsOnAndroidGenerator.java
index 249adaad99d..b7331d88775 100644
--- a/compiler/android-tests/tests/org/jetbrains/jet/compiler/android/CodegenTestsOnAndroidGenerator.java
+++ b/compiler/android-tests/tests/org/jetbrains/kotlin/android/tests/CodegenTestsOnAndroidGenerator.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2010-2013 JetBrains s.r.o.
+ * Copyright 2010-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.jetbrains.jet.compiler.android;
+package org.jetbrains.kotlin.android.tests;
import com.google.common.collect.Lists;
import com.intellij.openapi.util.io.FileUtil;
@@ -29,7 +29,7 @@ import org.jetbrains.jet.cli.common.output.outputUtils.OutputUtilsPackage;
import org.jetbrains.jet.cli.jvm.compiler.JetCoreEnvironment;
import org.jetbrains.jet.codegen.CodegenTestFiles;
import org.jetbrains.jet.codegen.GenerationUtils;
-import org.jetbrains.jet.compiler.PathManager;
+import org.jetbrains.jet.codegen.forTestCompile.ForTestCompileRuntime;
import org.jetbrains.jet.generators.tests.generator.TestGeneratorUtil;
import org.jetbrains.jet.lang.psi.JetFile;
import org.jetbrains.jet.plugin.JetFileType;
@@ -38,17 +38,17 @@ import org.junit.Assert;
import java.io.File;
import java.io.IOException;
-import java.util.List;
import java.util.ArrayList;
+import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class CodegenTestsOnAndroidGenerator extends UsefulTestCase {
private final PathManager pathManager;
- private static final String testClassPackage = "org.jetbrains.jet.compiler.android";
+ private static final String testClassPackage = "org.jetbrains.kotlin.android.tests";
private static final String testClassName = "CodegenTestCaseOnAndroid";
- private static final String baseTestClassPackage = "org.jetbrains.jet.compiler.android";
+ private static final String baseTestClassPackage = "org.jetbrains.kotlin.android.tests";
private static final String baseTestClassName = "AbstractCodegenTestCaseOnAndroid";
private static final String generatorName = "CodegenTestsOnAndroidGenerator";
@@ -81,11 +81,10 @@ public class CodegenTestsOnAndroidGenerator extends UsefulTestCase {
}
private void copyKotlinRuntimeJar() throws IOException {
- File kotlinRuntimeJar = new File(pathManager.getLibsFolderInAndroidTmpFolder() + "/kotlin-runtime.jar");
- File kotlinRuntimeInDist = new File("dist/kotlinc/lib/kotlin-runtime.jar");
- Assert.assertTrue("kotlin-runtime.jar in dist/kotlnc/lib/ doesn't exists. Run dist ant task before generating test for android.",
- kotlinRuntimeInDist.exists());
- FileUtil.copy(kotlinRuntimeInDist, kotlinRuntimeJar);
+ FileUtil.copy(
+ ForTestCompileRuntime.runtimeJarForTests(),
+ new File(pathManager.getLibsFolderInAndroidTmpFolder() + "/kotlin-runtime.jar")
+ );
}
private void generateAndSave() throws Throwable {
diff --git a/compiler/android-tests/tests/org/jetbrains/jet/compiler/android/SpecialFiles.java b/compiler/android-tests/tests/org/jetbrains/kotlin/android/tests/SpecialFiles.java
similarity index 98%
rename from compiler/android-tests/tests/org/jetbrains/jet/compiler/android/SpecialFiles.java
rename to compiler/android-tests/tests/org/jetbrains/kotlin/android/tests/SpecialFiles.java
index 9655d19ac5e..5c3a06aad0d 100644
--- a/compiler/android-tests/tests/org/jetbrains/jet/compiler/android/SpecialFiles.java
+++ b/compiler/android-tests/tests/org/jetbrains/kotlin/android/tests/SpecialFiles.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2010-2013 JetBrains s.r.o.
+ * Copyright 2010-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,13 +14,12 @@
* limitations under the License.
*/
-package org.jetbrains.jet.compiler.android;
+package org.jetbrains.kotlin.android.tests;
import com.google.common.collect.Sets;
import java.util.Set;
-
public class SpecialFiles {
private static final Set excludedFiles = Sets.newHashSet();
private static final Set filesCompiledWithoutStdLib = Sets.newHashSet();