let tests run on emulator 2.2
authorBartek Przybylski <bart.p.pl@gmail.com>
Sun, 30 Sep 2012 12:01:36 +0000 (14:01 +0200)
committerBartek Przybylski <bart.p.pl@gmail.com>
Sun, 30 Sep 2012 12:01:36 +0000 (14:01 +0200)
.classpath
tests/.classpath
tests/AndroidManifest.xml
tests/src/com/owncloud/android/test/AccountUtilsTest.java

index a4763d1..3f9691c 100644 (file)
@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
 <?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="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
        <classpathentry kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
+       <classpathentry kind="src" path="src"/>
+       <classpathentry kind="src" path="gen"/>
        <classpathentry kind="output" path="bin/classes"/>
 </classpath>
        <classpathentry kind="output" path="bin/classes"/>
 </classpath>
index f8cb89d..4abbae7 100644 (file)
@@ -1,10 +1,10 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
-       <classpathentry kind="src" path="src"/>
-       <classpathentry kind="src" path="gen"/>
        <classpathentry combineaccessrules="false" kind="src" path="/owncloud-android"/>
        <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.junit.JUNIT_CONTAINER/4"/>
        <classpathentry combineaccessrules="false" kind="src" path="/owncloud-android"/>
        <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.junit.JUNIT_CONTAINER/4"/>
+       <classpathentry kind="src" path="src"/>
+       <classpathentry kind="src" path="gen"/>
        <classpathentry kind="output" path="bin/classes"/>
 </classpath>
        <classpathentry kind="output" path="bin/classes"/>
 </classpath>
index bc65d1c..8c613c2 100644 (file)
@@ -1,19 +1,21 @@
 <?xml version="1.0" encoding="utf-8"?>
 <?xml version="1.0" encoding="utf-8"?>
+<!-- package name must be unique so suffix with "tests" so package loader doesn't ignore us -->
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.owncloud.android.test"
-    android:versionCode="1"
-    android:versionName="1.0" >
-
-    <uses-sdk android:minSdkVersion="8" />
-
-    <instrumentation
-        android:name="android.test.InstrumentationTestRunner"
-        android:targetPackage="com.owncloud.android" />
-
-    <application
-        android:icon="@drawable/ic_launcher"
-        android:label="@string/app_name" >
+          package="com.owncloud.android.test"
+          android:versionCode="1"
+          android:versionName="1.0">
+    <!-- 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>
         <uses-library android:name="android.test.runner" />
     </application>
-
-</manifest>
\ No newline at end of file
+    <!--
+    This declares that this application uses the instrumentation test runner targeting
+    the package of com.owncloud.android.test.  To run the tests use the command:
+    "adb shell am instrument -w com.owncloud.android.tests/android.test.InstrumentationTestRunner"
+    -->
+    <instrumentation android:name="android.test.InstrumentationTestRunner"
+                     android:targetPackage="com.owncloud.android"
+                     android:label="Tests for com.owncloud.android"/>
+</manifest>
index 582e968..d444b91 100644 (file)
@@ -1,15 +1,12 @@
 package com.owncloud.android.test;
 
 package com.owncloud.android.test;
 
-import org.junit.Test;
+import android.test.AndroidTestCase;
 
 import com.owncloud.android.AccountUtils;
 import com.owncloud.android.utils.OwnCloudVersion;
 
 
 import com.owncloud.android.AccountUtils;
 import com.owncloud.android.utils.OwnCloudVersion;
 
-import junit.framework.TestCase;
-
-public class AccountUtilsTest extends TestCase {
+public class AccountUtilsTest extends AndroidTestCase {
     
     
-    @Test
     public void testGetWebdavPath() {
         OwnCloudVersion ocv12 = new OwnCloudVersion(0x010200);
         OwnCloudVersion ocv22 = new OwnCloudVersion(0x020200);
     public void testGetWebdavPath() {
         OwnCloudVersion ocv12 = new OwnCloudVersion(0x010200);
         OwnCloudVersion ocv22 = new OwnCloudVersion(0x020200);