diff options
author | Xavier Ducrohet <xav@android.com> | 2012-03-02 19:23:09 -0800 |
---|---|---|
committer | Xavier Ducrohet <xav@android.com> | 2012-03-02 19:30:58 -0800 |
commit | 9834e28a9868d8193df5b6ee4634b999079c2a8a (patch) | |
tree | 968b6b5fb01c270471250777c3f55c629b1e3a14 /testapps | |
parent | 420f7b22e62d45ff579e700c6456834c0739e37f (diff) | |
download | sdk-9834e28a9868d8193df5b6ee4634b999079c2a8a.zip sdk-9834e28a9868d8193df5b6ee4634b999079c2a8a.tar.gz sdk-9834e28a9868d8193df5b6ee4634b999079c2a8a.tar.bz2 |
Add new test projects.
- test for User Library usage
- test for test project with library.
Change-Id: I49b7d4702937f634a1df907af327a979af09f227
Diffstat (limited to 'testapps')
47 files changed, 605 insertions, 2 deletions
diff --git a/testapps/javaProjectTest/app/res/values/strings.xml b/testapps/javaProjectTest/app/res/values/strings.xml index 96d8724..705a565 100644 --- a/testapps/javaProjectTest/app/res/values/strings.xml +++ b/testapps/javaProjectTest/app/res/values/strings.xml @@ -1,4 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <resources> - <string name="app_name">basicProjectWithJava</string> -</resources> + + <string name="app_name">javaProjectTest-app</string> + +</resources>
\ No newline at end of file diff --git a/testapps/testProjectTest/SUCCESS b/testapps/testProjectTest/SUCCESS new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/testapps/testProjectTest/SUCCESS diff --git a/testapps/testProjectTest/app/.classpath b/testapps/testProjectTest/app/.classpath new file mode 100644 index 0000000..a4763d1 --- /dev/null +++ b/testapps/testProjectTest/app/.classpath @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="src" path="src"/> + <classpathentry kind="src" path="gen"/> + <classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/> + <classpathentry kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/> + <classpathentry kind="output" path="bin/classes"/> +</classpath> diff --git a/testapps/testProjectTest/app/.project b/testapps/testProjectTest/app/.project new file mode 100644 index 0000000..344feb8 --- /dev/null +++ b/testapps/testProjectTest/app/.project @@ -0,0 +1,33 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>testProjectTest-app</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>com.android.ide.eclipse.adt.PreCompilerBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>com.android.ide.eclipse.adt.ApkBuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>com.android.ide.eclipse.adt.AndroidNature</nature> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> diff --git a/testapps/testProjectTest/app/AndroidManifest.xml b/testapps/testProjectTest/app/AndroidManifest.xml new file mode 100644 index 0000000..821ae78 --- /dev/null +++ b/testapps/testProjectTest/app/AndroidManifest.xml @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="utf-8"?> +<manifest xmlns:android="http://schemas.android.com/apk/res/android" + package="com.android.tests.testprojecttest.app" + android:versionCode="1" + android:versionName="1.0" > + + <uses-sdk android:minSdkVersion="15" /> + + <application + android:icon="@drawable/ic_launcher" + android:label="@string/app_name" > + <activity + android:name="com.android.tests.testprojecttest.lib.LibActivity" + android:label="@string/app_name" > + <intent-filter> + <action android:name="android.intent.action.MAIN" /> + + <category android:name="android.intent.category.LAUNCHER" /> + </intent-filter> + </activity> + </application> + +</manifest>
\ No newline at end of file diff --git a/testapps/testProjectTest/app/proguard-project.txt b/testapps/testProjectTest/app/proguard-project.txt new file mode 100644 index 0000000..f2fe155 --- /dev/null +++ b/testapps/testProjectTest/app/proguard-project.txt @@ -0,0 +1,20 @@ +# To enable ProGuard in your project, edit project.properties +# to define the proguard.config property as described in that file. +# +# Add project specific ProGuard rules here. +# By default, the flags in this file are appended to flags specified +# in ${sdk.dir}/tools/proguard/proguard-android.txt +# You can edit the include path and order by changing the ProGuard +# include property in project.properties. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# Add any project specific keep options here: + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} diff --git a/testapps/testProjectTest/app/project.properties b/testapps/testProjectTest/app/project.properties new file mode 100644 index 0000000..60765b6 --- /dev/null +++ b/testapps/testProjectTest/app/project.properties @@ -0,0 +1,15 @@ +# This file is automatically generated by Android Tools. +# Do not modify this file -- YOUR CHANGES WILL BE ERASED! +# +# This file must be checked in Version Control Systems. +# +# To customize properties used by the Ant build system edit +# "ant.properties", and override values to adapt the script to your +# project structure. +# +# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home): +#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt + +# Project target. +target=android-15 +android.library.reference.1=../lib diff --git a/testapps/testProjectTest/app/res/drawable-hdpi/ic_launcher.png b/testapps/testProjectTest/app/res/drawable-hdpi/ic_launcher.png Binary files differnew file mode 100644 index 0000000..96a442e --- /dev/null +++ b/testapps/testProjectTest/app/res/drawable-hdpi/ic_launcher.png diff --git a/testapps/testProjectTest/app/res/drawable-ldpi/ic_launcher.png b/testapps/testProjectTest/app/res/drawable-ldpi/ic_launcher.png Binary files differnew file mode 100644 index 0000000..9923872 --- /dev/null +++ b/testapps/testProjectTest/app/res/drawable-ldpi/ic_launcher.png diff --git a/testapps/testProjectTest/app/res/drawable-mdpi/ic_launcher.png b/testapps/testProjectTest/app/res/drawable-mdpi/ic_launcher.png Binary files differnew file mode 100644 index 0000000..359047d --- /dev/null +++ b/testapps/testProjectTest/app/res/drawable-mdpi/ic_launcher.png diff --git a/testapps/testProjectTest/app/res/drawable-xhdpi/ic_launcher.png b/testapps/testProjectTest/app/res/drawable-xhdpi/ic_launcher.png Binary files differnew file mode 100644 index 0000000..71c6d76 --- /dev/null +++ b/testapps/testProjectTest/app/res/drawable-xhdpi/ic_launcher.png diff --git a/testapps/testProjectTest/app/res/values/strings.xml b/testapps/testProjectTest/app/res/values/strings.xml new file mode 100644 index 0000000..c933032 --- /dev/null +++ b/testapps/testProjectTest/app/res/values/strings.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + + <string name="app_name">TestProjectTest-app</string> + +</resources>
\ No newline at end of file diff --git a/testapps/testProjectTest/lib/.classpath b/testapps/testProjectTest/lib/.classpath new file mode 100644 index 0000000..a4763d1 --- /dev/null +++ b/testapps/testProjectTest/lib/.classpath @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="src" path="src"/> + <classpathentry kind="src" path="gen"/> + <classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/> + <classpathentry kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/> + <classpathentry kind="output" path="bin/classes"/> +</classpath> diff --git a/testapps/testProjectTest/lib/.project b/testapps/testProjectTest/lib/.project new file mode 100644 index 0000000..274b512 --- /dev/null +++ b/testapps/testProjectTest/lib/.project @@ -0,0 +1,33 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>testProjectTest-lib</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>com.android.ide.eclipse.adt.PreCompilerBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>com.android.ide.eclipse.adt.ApkBuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>com.android.ide.eclipse.adt.AndroidNature</nature> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> diff --git a/testapps/testProjectTest/lib/AndroidManifest.xml b/testapps/testProjectTest/lib/AndroidManifest.xml new file mode 100644 index 0000000..f8cc83d --- /dev/null +++ b/testapps/testProjectTest/lib/AndroidManifest.xml @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="utf-8"?> +<manifest xmlns:android="http://schemas.android.com/apk/res/android" + package="com.android.tests.testprojecttest.lib" + android:versionCode="1" + android:versionName="1.0" > + + <uses-sdk android:minSdkVersion="15" /> + +</manifest>
\ No newline at end of file diff --git a/testapps/testProjectTest/lib/proguard-project.txt b/testapps/testProjectTest/lib/proguard-project.txt new file mode 100644 index 0000000..f2fe155 --- /dev/null +++ b/testapps/testProjectTest/lib/proguard-project.txt @@ -0,0 +1,20 @@ +# To enable ProGuard in your project, edit project.properties +# to define the proguard.config property as described in that file. +# +# Add project specific ProGuard rules here. +# By default, the flags in this file are appended to flags specified +# in ${sdk.dir}/tools/proguard/proguard-android.txt +# You can edit the include path and order by changing the ProGuard +# include property in project.properties. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# Add any project specific keep options here: + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} diff --git a/testapps/testProjectTest/lib/project.properties b/testapps/testProjectTest/lib/project.properties new file mode 100644 index 0000000..36f1594 --- /dev/null +++ b/testapps/testProjectTest/lib/project.properties @@ -0,0 +1,15 @@ +# This file is automatically generated by Android Tools. +# Do not modify this file -- YOUR CHANGES WILL BE ERASED! +# +# This file must be checked in Version Control Systems. +# +# To customize properties used by the Ant build system edit +# "ant.properties", and override values to adapt the script to your +# project structure. +# +# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home): +#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt + +# Project target. +target=android-15 +android.library=true diff --git a/testapps/testProjectTest/lib/res/layout/main.xml b/testapps/testProjectTest/lib/res/layout/main.xml new file mode 100644 index 0000000..14a9c4b --- /dev/null +++ b/testapps/testProjectTest/lib/res/layout/main.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="utf-8"?> +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:tools="http://schemas.android.com/tools" + android:layout_width="fill_parent" + android:layout_height="fill_parent" + android:orientation="vertical" > + + <TextView + android:id="@+id/text" + android:layout_width="fill_parent" + android:layout_height="wrap_content" + android:text="some string" + tools:ignore="HardcodedText" /> + +</LinearLayout>
\ No newline at end of file diff --git a/testapps/testProjectTest/lib/src/com/android/tests/testprojecttest/lib/LibActivity.java b/testapps/testProjectTest/lib/src/com/android/tests/testprojecttest/lib/LibActivity.java new file mode 100644 index 0000000..7d7f607 --- /dev/null +++ b/testapps/testProjectTest/lib/src/com/android/tests/testprojecttest/lib/LibActivity.java @@ -0,0 +1,13 @@ +package com.android.tests.testprojecttest.lib; + +import android.app.Activity; +import android.os.Bundle; + +public class LibActivity extends Activity { + /** Called when the activity is first created. */ + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.main); + } +}
\ No newline at end of file diff --git a/testapps/testProjectTest/test/.classpath b/testapps/testProjectTest/test/.classpath new file mode 100644 index 0000000..9afbc38 --- /dev/null +++ b/testapps/testProjectTest/test/.classpath @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="src" path="src"/> + <classpathentry kind="src" path="gen"/> + <classpathentry combineaccessrules="false" kind="src" path="/testProjectTest-app"/> + <classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/> + <classpathentry kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/> + <classpathentry kind="output" path="bin/classes"/> +</classpath> diff --git a/testapps/testProjectTest/test/.project b/testapps/testProjectTest/test/.project new file mode 100644 index 0000000..bffbba0 --- /dev/null +++ b/testapps/testProjectTest/test/.project @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>testProjectTest-test</name> + <comment></comment> + <projects> + <project>testProjectTest-app</project> + </projects> + <buildSpec> + <buildCommand> + <name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>com.android.ide.eclipse.adt.PreCompilerBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>com.android.ide.eclipse.adt.ApkBuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>com.android.ide.eclipse.adt.AndroidNature</nature> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> diff --git a/testapps/testProjectTest/test/AndroidManifest.xml b/testapps/testProjectTest/test/AndroidManifest.xml new file mode 100644 index 0000000..8ac5dbe --- /dev/null +++ b/testapps/testProjectTest/test/AndroidManifest.xml @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="utf-8"?> +<manifest xmlns:android="http://schemas.android.com/apk/res/android" + package="com.android.tests.testprojecttest.test" + android:versionCode="1" + android:versionName="1.0" > + + <uses-sdk android:minSdkVersion="15" /> + + <!-- + We add an application tag here just so that we can indicate that + this package needs to link against the android.test library, + which is needed when building test cases. + --> + <application> + <uses-library android:name="android.test.runner" /> + </application> + + <!-- + This declares that this app uses the instrumentation test runner targeting + the package of com.android.tests.testprojecttest.app. To run the tests use the command: + "adb shell am instrument -w com.android.tests.testprojecttest.test/android.test.InstrumentationTestRunner" + --> + <instrumentation + android:name="android.test.InstrumentationTestRunner" + android:targetPackage="com.android.tests.testprojecttest.app" /> + +</manifest>
\ No newline at end of file diff --git a/testapps/testProjectTest/test/proguard-project.txt b/testapps/testProjectTest/test/proguard-project.txt new file mode 100644 index 0000000..f2fe155 --- /dev/null +++ b/testapps/testProjectTest/test/proguard-project.txt @@ -0,0 +1,20 @@ +# To enable ProGuard in your project, edit project.properties +# to define the proguard.config property as described in that file. +# +# Add project specific ProGuard rules here. +# By default, the flags in this file are appended to flags specified +# in ${sdk.dir}/tools/proguard/proguard-android.txt +# You can edit the include path and order by changing the ProGuard +# include property in project.properties. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# Add any project specific keep options here: + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} diff --git a/testapps/testProjectTest/test/project.properties b/testapps/testProjectTest/test/project.properties new file mode 100644 index 0000000..4c13b85 --- /dev/null +++ b/testapps/testProjectTest/test/project.properties @@ -0,0 +1,15 @@ +# This file is automatically generated by Android Tools. +# Do not modify this file -- YOUR CHANGES WILL BE ERASED! +# +# This file must be checked in Version Control Systems. +# +# To customize properties used by the Ant build system edit +# "ant.properties", and override values to adapt the script to your +# project structure. +# +# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home): +#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt + +# Project target. +target=android-15 +tested.project.dir=../app diff --git a/testapps/testProjectTest/test/res/drawable-hdpi/ic_launcher.png b/testapps/testProjectTest/test/res/drawable-hdpi/ic_launcher.png Binary files differnew file mode 100644 index 0000000..96a442e --- /dev/null +++ b/testapps/testProjectTest/test/res/drawable-hdpi/ic_launcher.png diff --git a/testapps/testProjectTest/test/res/drawable-ldpi/ic_launcher.png b/testapps/testProjectTest/test/res/drawable-ldpi/ic_launcher.png Binary files differnew file mode 100644 index 0000000..9923872 --- /dev/null +++ b/testapps/testProjectTest/test/res/drawable-ldpi/ic_launcher.png diff --git a/testapps/testProjectTest/test/res/drawable-mdpi/ic_launcher.png b/testapps/testProjectTest/test/res/drawable-mdpi/ic_launcher.png Binary files differnew file mode 100644 index 0000000..359047d --- /dev/null +++ b/testapps/testProjectTest/test/res/drawable-mdpi/ic_launcher.png diff --git a/testapps/testProjectTest/test/res/drawable-xhdpi/ic_launcher.png b/testapps/testProjectTest/test/res/drawable-xhdpi/ic_launcher.png Binary files differnew file mode 100644 index 0000000..71c6d76 --- /dev/null +++ b/testapps/testProjectTest/test/res/drawable-xhdpi/ic_launcher.png diff --git a/testapps/testProjectTest/test/res/layout/main.xml b/testapps/testProjectTest/test/res/layout/main.xml new file mode 100644 index 0000000..bc12cd8 --- /dev/null +++ b/testapps/testProjectTest/test/res/layout/main.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="utf-8"?> +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="fill_parent" + android:layout_height="fill_parent" + android:orientation="vertical" > + + <TextView + android:layout_width="fill_parent" + android:layout_height="wrap_content" + android:text="@string/hello" /> + +</LinearLayout>
\ No newline at end of file diff --git a/testapps/testProjectTest/test/res/values/strings.xml b/testapps/testProjectTest/test/res/values/strings.xml new file mode 100644 index 0000000..ef42478 --- /dev/null +++ b/testapps/testProjectTest/test/res/values/strings.xml @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + + <string name="hello">Hello World!</string> + <string name="app_name">TestProjectTest-testTest</string> + +</resources>
\ No newline at end of file diff --git a/testapps/testProjectTest/test/src/com/android/tests/testprojecttest/lib/LibActivityTest.java b/testapps/testProjectTest/test/src/com/android/tests/testprojecttest/lib/LibActivityTest.java new file mode 100644 index 0000000..9be6f97 --- /dev/null +++ b/testapps/testProjectTest/test/src/com/android/tests/testprojecttest/lib/LibActivityTest.java @@ -0,0 +1,72 @@ +/* + * Copyright (C) 2008 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.tests.testprojecttest.lib; + +import android.test.ActivityInstrumentationTestCase2; +import android.test.suitebuilder.annotation.MediumTest; +import android.widget.TextView; + +import com.android.tests.testprojecttest.app.R; + +/** + * An example of an {@link ActivityInstrumentationTestCase2} of a specific activity {@link Focus2}. + * By virtue of extending {@link ActivityInstrumentationTestCase2}, the target activity is automatically + * launched and finished before and after each test. This also extends + * {@link android.test.InstrumentationTestCase}, which provides + * access to methods for sending events to the target activity, such as key and + * touch events. See {@link #sendKeys}. + * + * In general, {@link android.test.InstrumentationTestCase}s and {@link ActivityInstrumentationTestCase2}s + * are heavier weight functional tests available for end to end testing of your + * user interface. When run via a {@link android.test.InstrumentationTestRunner}, + * the necessary {@link android.app.Instrumentation} will be injected for you to + * user via {@link #getInstrumentation} in your tests. + * + * See {@link com.example.android.apis.AllTests} for documentation on running + * all tests and individual tests in this application. + */ +public class LibActivityTest extends ActivityInstrumentationTestCase2<LibActivity> { + + private TextView mTextView; + + /** + * Creates an {@link ActivityInstrumentationTestCase2} that tests the {@link Focus2} activity. + */ + public LibActivityTest() { + super(LibActivity.class); + } + + @Override + protected void setUp() throws Exception { + super.setUp(); + final LibActivity a = getActivity(); + // ensure a valid handle to the activity has been returned + assertNotNull(a); + mTextView = (TextView) a.findViewById(R.id.text); + } + + /** + * The name 'test preconditions' is a convention to signal that if this + * test doesn't pass, the test case was not set up properly and it might + * explain any and all failures in other tests. This is not guaranteed + * to run before other tests, as junit uses reflection to find the tests. + */ + @MediumTest + public void testPreconditions() { + assertNotNull(mTextView); + } +} diff --git a/testapps/testProjectTest/test/src/com/android/tests/testprojecttest/test/AllTests.java b/testapps/testProjectTest/test/src/com/android/tests/testprojecttest/test/AllTests.java new file mode 100644 index 0000000..a77b53c --- /dev/null +++ b/testapps/testProjectTest/test/src/com/android/tests/testprojecttest/test/AllTests.java @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2008 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.tests.testprojecttest.test; + +import junit.framework.Test; +import junit.framework.TestSuite; + +import android.test.suitebuilder.TestSuiteBuilder; + +/** + * A test suite containing all tests for ApiDemos. + * + * To run all suites found in this apk: + * $ adb shell am instrument -w \ + * com.example.android.apis.tests/android.test.InstrumentationTestRunner + * + * To run just this suite from the command line: + * $ adb shell am instrument -w \ + * -e class com.example.android.apis.AllTests \ + * com.example.android.apis.tests/android.test.InstrumentationTestRunner + * + * To run an individual test case, e.g. {@link com.example.android.apis.os.MorseCodeConverterTest}: + * $ adb shell am instrument -w \ + * -e class com.example.android.apis.os.MorseCodeConverterTest \ + * com.example.android.apis.tests/android.test.InstrumentationTestRunner + * + * To run an individual test, e.g. {@link com.example.android.apis.os.MorseCodeConverterTest#testCharacterS()}: + * $ adb shell am instrument -w \ + * -e class com.example.android.apis.os.MorseCodeConverterTest#testCharacterS \ + * com.example.android.apis.tests/android.test.InstrumentationTestRunner + */ +public class AllTests extends TestSuite { + + public static Test suite() { + return new TestSuiteBuilder(AllTests.class) + .includeAllPackagesUnderHere() + .build(); + } +} diff --git a/testapps/userLibTest/.classpath b/testapps/userLibTest/.classpath new file mode 100644 index 0000000..132d8c9 --- /dev/null +++ b/testapps/userLibTest/.classpath @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="src" path="src"/> + <classpathentry kind="src" path="gen"/> + <classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/> + <classpathentry kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/> + <classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/USERLIBTEST"/> + <classpathentry kind="output" path="bin/classes"/> +</classpath> diff --git a/testapps/userLibTest/.project b/testapps/userLibTest/.project new file mode 100644 index 0000000..226edb7 --- /dev/null +++ b/testapps/userLibTest/.project @@ -0,0 +1,33 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>userLibTest</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>com.android.ide.eclipse.adt.PreCompilerBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>com.android.ide.eclipse.adt.ApkBuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>com.android.ide.eclipse.adt.AndroidNature</nature> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> diff --git a/testapps/userLibTest/AndroidManifest.xml b/testapps/userLibTest/AndroidManifest.xml new file mode 100644 index 0000000..5883607 --- /dev/null +++ b/testapps/userLibTest/AndroidManifest.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="utf-8"?> +<manifest xmlns:android="http://schemas.android.com/apk/res/android" + package="com.android.tests.userlibtest" + android:versionCode="1" + android:versionName="1.0"> + <application android:label="@string/app_name" android:icon="@drawable/ic_launcher"> + <activity android:name="Main" + android:label="@string/app_name"> + <intent-filter> + <action android:name="android.intent.action.MAIN" /> + <category android:name="android.intent.category.LAUNCHER" /> + </intent-filter> + </activity> + </application> +</manifest> diff --git a/testapps/userLibTest/ECLIPSEONLY b/testapps/userLibTest/ECLIPSEONLY new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/testapps/userLibTest/ECLIPSEONLY diff --git a/testapps/userLibTest/README.txt b/testapps/userLibTest/README.txt new file mode 100644 index 0000000..5d63f4e --- /dev/null +++ b/testapps/userLibTest/README.txt @@ -0,0 +1,5 @@ +This test requires a workspace setup: + +- Create User Library called "USERLIBTEST" +- Add to this library the jar located in jars/basicJar.jar +- App should compile, and deploy on device and UI show show SUCCESS
\ No newline at end of file diff --git a/testapps/userLibTest/SUCCESS b/testapps/userLibTest/SUCCESS new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/testapps/userLibTest/SUCCESS diff --git a/testapps/userLibTest/jars/basicJar.jar b/testapps/userLibTest/jars/basicJar.jar Binary files differnew file mode 100644 index 0000000..a81b929 --- /dev/null +++ b/testapps/userLibTest/jars/basicJar.jar diff --git a/testapps/userLibTest/proguard-project.txt b/testapps/userLibTest/proguard-project.txt new file mode 100644 index 0000000..f2fe155 --- /dev/null +++ b/testapps/userLibTest/proguard-project.txt @@ -0,0 +1,20 @@ +# To enable ProGuard in your project, edit project.properties +# to define the proguard.config property as described in that file. +# +# Add project specific ProGuard rules here. +# By default, the flags in this file are appended to flags specified +# in ${sdk.dir}/tools/proguard/proguard-android.txt +# You can edit the include path and order by changing the ProGuard +# include property in project.properties. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# Add any project specific keep options here: + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} diff --git a/testapps/userLibTest/project.properties b/testapps/userLibTest/project.properties new file mode 100644 index 0000000..0840b4a --- /dev/null +++ b/testapps/userLibTest/project.properties @@ -0,0 +1,14 @@ +# This file is automatically generated by Android Tools. +# Do not modify this file -- YOUR CHANGES WILL BE ERASED! +# +# This file must be checked in Version Control Systems. +# +# To customize properties used by the Ant build system edit +# "ant.properties", and override values to adapt the script to your +# project structure. +# +# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home): +#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt + +# Project target. +target=android-15 diff --git a/testapps/userLibTest/res/drawable-hdpi/ic_launcher.png b/testapps/userLibTest/res/drawable-hdpi/ic_launcher.png Binary files differnew file mode 100644 index 0000000..8074c4c --- /dev/null +++ b/testapps/userLibTest/res/drawable-hdpi/ic_launcher.png diff --git a/testapps/userLibTest/res/drawable-ldpi/ic_launcher.png b/testapps/userLibTest/res/drawable-ldpi/ic_launcher.png Binary files differnew file mode 100644 index 0000000..1095584 --- /dev/null +++ b/testapps/userLibTest/res/drawable-ldpi/ic_launcher.png diff --git a/testapps/userLibTest/res/drawable-mdpi/ic_launcher.png b/testapps/userLibTest/res/drawable-mdpi/ic_launcher.png Binary files differnew file mode 100644 index 0000000..a07c69f --- /dev/null +++ b/testapps/userLibTest/res/drawable-mdpi/ic_launcher.png diff --git a/testapps/userLibTest/res/layout/main.xml b/testapps/userLibTest/res/layout/main.xml new file mode 100644 index 0000000..3e65644 --- /dev/null +++ b/testapps/userLibTest/res/layout/main.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="utf-8"?> +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:tools="http://schemas.android.com/tools" + android:layout_width="fill_parent" + android:layout_height="fill_parent" + android:orientation="vertical" > + + <TextView + android:id="@+id/basicJar" + android:layout_width="fill_parent" + android:layout_height="wrap_content" + android:text="\\?" + tools:ignore="HardcodedText" /> + +</LinearLayout>
\ No newline at end of file diff --git a/testapps/userLibTest/res/values/strings.xml b/testapps/userLibTest/res/values/strings.xml new file mode 100644 index 0000000..549e4ea --- /dev/null +++ b/testapps/userLibTest/res/values/strings.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <string name="app_name">Main</string> +</resources> diff --git a/testapps/userLibTest/src/com/android/tests/userlibtest/Main.java b/testapps/userLibTest/src/com/android/tests/userlibtest/Main.java new file mode 100644 index 0000000..b2f1be3 --- /dev/null +++ b/testapps/userLibTest/src/com/android/tests/userlibtest/Main.java @@ -0,0 +1,19 @@ +package com.android.tests.userlibtest; + +import android.app.Activity; +import android.os.Bundle; +import android.widget.TextView; + +import com.android.tests.basicjar.BasicJar; + +public class Main extends Activity { + /** Called when the activity is first created. */ + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.main); + + TextView tv = (TextView) findViewById(R.id.basicJar); + tv.setText("BasicJar: " + BasicJar.getContent()); + } +} |