From 84d5c944663e5617a586b86a656ed2cec3dbebb6 Mon Sep 17 00:00:00 2001 From: Yan Zhulanow Date: Thu, 6 Nov 2014 15:19:16 +0300 Subject: [PATCH] Move Android JPS plugin tests to android-jps-plugin module Original commit: b7f8496e5bd7d3967b74b4f3b0715dff8fb608f6 --- .../android/AbstractAndroidJpsTestCase.kt | 70 ------------------- .../android/AndroidJpsTestCaseGenerated.java | 44 ------------ .../android/simple/AndroidManifest.xml | 16 ----- .../android/simple/res/layout/main.xml | 13 ---- .../testData/android/simple/simple.iml | 44 ------------ .../testData/android/simple/simple.ipr | 18 ----- .../src/com/example/myapp/MyActivity.kt | 12 ---- 7 files changed, 217 deletions(-) delete mode 100644 jps/jps-plugin/test/org/jetbrains/jet/jps/build/android/AbstractAndroidJpsTestCase.kt delete mode 100644 jps/jps-plugin/test/org/jetbrains/jet/jps/build/android/AndroidJpsTestCaseGenerated.java delete mode 100644 jps/jps-plugin/testData/android/simple/AndroidManifest.xml delete mode 100644 jps/jps-plugin/testData/android/simple/res/layout/main.xml delete mode 100644 jps/jps-plugin/testData/android/simple/simple.iml delete mode 100644 jps/jps-plugin/testData/android/simple/simple.ipr delete mode 100644 jps/jps-plugin/testData/android/simple/src/com/example/myapp/MyActivity.kt diff --git a/jps/jps-plugin/test/org/jetbrains/jet/jps/build/android/AbstractAndroidJpsTestCase.kt b/jps/jps-plugin/test/org/jetbrains/jet/jps/build/android/AbstractAndroidJpsTestCase.kt deleted file mode 100644 index e1b06bdaa45..00000000000 --- a/jps/jps-plugin/test/org/jetbrains/jet/jps/build/android/AbstractAndroidJpsTestCase.kt +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright 2010-2014 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.jps.build.android - -import org.jetbrains.jps.builders.JpsBuildTestCase -import org.jetbrains.jps.android.model.JpsAndroidSdkProperties -import org.jetbrains.jps.android.model.JpsAndroidSdkType -import org.jetbrains.jps.model.library.JpsOrderRootType -import org.jetbrains.jps.model.JpsSimpleElement -import org.jetbrains.jps.model.library.sdk.JpsSdk -import org.jetbrains.jps.model.impl.JpsSimpleElementImpl - -import java.io.File - -public abstract class AbstractAndroidJpsTestCase : JpsBuildTestCase() { - - private val SDK_NAME = "Android API 17 Platform" - - override fun setUp() { - super.setUp() - System.setProperty("kotlin.jps.tests", "true") - } - - public fun doTest(path: String) { - addJdkAndAndroidSdk() - loadProject(path + getTestName(true) + ".ipr") - rebuildAll() - makeAll().assertSuccessful() - deleteDirectory(File(path + "/out")) - } - - public fun deleteDirectory(path: File): Boolean { - if (path.exists() && path.isDirectory()) { - val files = path.listFiles()!! - for (i in files.indices) { - if (files[i].isDirectory()) { - deleteDirectory(files[i]) - } - else { - files[i].delete() - } - } - } - return (path.delete()) - } - - private fun addJdkAndAndroidSdk(): JpsSdk> { - val jdkName = "java_sdk" - addJdk(jdkName) - val properties = JpsAndroidSdkProperties("android-17", jdkName) - val sdkPath = getHomePath() + "/androidSDK/" - val library = myModel!!.getGlobal().addSdk>(SDK_NAME, sdkPath, "", JpsAndroidSdkType.INSTANCE, JpsSimpleElementImpl(properties)) - library!!.addRoot(File(sdkPath + "/platforms/android-17/android.jar"), JpsOrderRootType.COMPILED) - return library.getProperties() - } -} diff --git a/jps/jps-plugin/test/org/jetbrains/jet/jps/build/android/AndroidJpsTestCaseGenerated.java b/jps/jps-plugin/test/org/jetbrains/jet/jps/build/android/AndroidJpsTestCaseGenerated.java deleted file mode 100644 index bc507501bfc..00000000000 --- a/jps/jps-plugin/test/org/jetbrains/jet/jps/build/android/AndroidJpsTestCaseGenerated.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2010-2014 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.jps.build.android; - -import com.intellij.testFramework.TestDataPath; -import junit.framework.Test; -import junit.framework.TestSuite; -import org.jetbrains.jet.JetTestUtils; -import org.jetbrains.jet.test.InnerTestClasses; -import org.jetbrains.jet.test.TestMetadata; - -import java.io.File; -import java.util.regex.Pattern; - -/** This class is generated by {@link org.jetbrains.jet.generators.tests.TestsPackage}. DO NOT MODIFY MANUALLY */ -@SuppressWarnings("all") -@TestMetadata("jps-plugin/testData/android") -@TestDataPath("$PROJECT_ROOT") -public class AndroidJpsTestCaseGenerated extends AbstractAndroidJpsTestCase { - public void testAllFilesPresentInAndroid() throws Exception { - JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("jps-plugin/testData/android"), Pattern.compile("^([^\\.]+)$"), false); - } - - @TestMetadata("simple") - public void testSimple() throws Exception { - String fileName = JetTestUtils.navigationMetadata("jps-plugin/testData/android/simple/"); - doTest(fileName); - } - -} diff --git a/jps/jps-plugin/testData/android/simple/AndroidManifest.xml b/jps/jps-plugin/testData/android/simple/AndroidManifest.xml deleted file mode 100644 index 85352f74f1b..00000000000 --- a/jps/jps-plugin/testData/android/simple/AndroidManifest.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - diff --git a/jps/jps-plugin/testData/android/simple/res/layout/main.xml b/jps/jps-plugin/testData/android/simple/res/layout/main.xml deleted file mode 100644 index aceae08fc2f..00000000000 --- a/jps/jps-plugin/testData/android/simple/res/layout/main.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - diff --git a/jps/jps-plugin/testData/android/simple/simple.iml b/jps/jps-plugin/testData/android/simple/simple.iml deleted file mode 100644 index 6dfe1ad5ce8..00000000000 --- a/jps/jps-plugin/testData/android/simple/simple.iml +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - - - - - - - - - - - diff --git a/jps/jps-plugin/testData/android/simple/simple.ipr b/jps/jps-plugin/testData/android/simple/simple.ipr deleted file mode 100644 index 0c3ebcbc5ae..00000000000 --- a/jps/jps-plugin/testData/android/simple/simple.ipr +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - diff --git a/jps/jps-plugin/testData/android/simple/src/com/example/myapp/MyActivity.kt b/jps/jps-plugin/testData/android/simple/src/com/example/myapp/MyActivity.kt deleted file mode 100644 index b57014a16bf..00000000000 --- a/jps/jps-plugin/testData/android/simple/src/com/example/myapp/MyActivity.kt +++ /dev/null @@ -1,12 +0,0 @@ -package com.example.myapp - -import android.app.Activity -import android.os.Bundle - -public class MyActivity : Activity() { - override fun onCreate(savedInstanceState: Bundle?) { - super.onCreate(savedInstanceState) - setContentView(R.layout.main) - textField.setText("test") - } -}