From: Bartek Przybylski Date: Sat, 29 Sep 2012 23:14:38 +0000 (+0200) Subject: junit for android app X-Git-Tag: oc-android-1.4.3~172 X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/commitdiff_plain/333514da7300046906d9101ca76bc753c16f437b junit for android app --- diff --git a/.project b/.project index a1311141..27eaad68 100644 --- a/.project +++ b/.project @@ -1,6 +1,6 @@ - ownCloud + owncloud-android diff --git a/tests/.classpath b/tests/.classpath new file mode 100644 index 00000000..f8cb89d9 --- /dev/null +++ b/tests/.classpath @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/tests/.project b/tests/.project new file mode 100644 index 00000000..eea585ba --- /dev/null +++ b/tests/.project @@ -0,0 +1,34 @@ + + + owncloud-android-tests + + + owncloud-android + + + + com.android.ide.eclipse.adt.ResourceManagerBuilder + + + + + com.android.ide.eclipse.adt.PreCompilerBuilder + + + + + org.eclipse.jdt.core.javabuilder + + + + + com.android.ide.eclipse.adt.ApkBuilder + + + + + + com.android.ide.eclipse.adt.AndroidNature + org.eclipse.jdt.core.javanature + + diff --git a/tests/AndroidManifest.xml b/tests/AndroidManifest.xml new file mode 100644 index 00000000..bc65d1c0 --- /dev/null +++ b/tests/AndroidManifest.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/tests/proguard-project.txt b/tests/proguard-project.txt new file mode 100644 index 00000000..f2fe1559 --- /dev/null +++ b/tests/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/tests/project.properties b/tests/project.properties new file mode 100644 index 00000000..8937e94b --- /dev/null +++ b/tests/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-14 diff --git a/tests/res/drawable-hdpi/ic_launcher.png b/tests/res/drawable-hdpi/ic_launcher.png new file mode 100644 index 00000000..96a442e5 Binary files /dev/null and b/tests/res/drawable-hdpi/ic_launcher.png differ diff --git a/tests/res/drawable-ldpi/ic_launcher.png b/tests/res/drawable-ldpi/ic_launcher.png new file mode 100644 index 00000000..99238729 Binary files /dev/null and b/tests/res/drawable-ldpi/ic_launcher.png differ diff --git a/tests/res/drawable-mdpi/ic_launcher.png b/tests/res/drawable-mdpi/ic_launcher.png new file mode 100644 index 00000000..359047df Binary files /dev/null and b/tests/res/drawable-mdpi/ic_launcher.png differ diff --git a/tests/res/drawable-xhdpi/ic_launcher.png b/tests/res/drawable-xhdpi/ic_launcher.png new file mode 100644 index 00000000..71c6d760 Binary files /dev/null and b/tests/res/drawable-xhdpi/ic_launcher.png differ diff --git a/tests/res/values/strings.xml b/tests/res/values/strings.xml new file mode 100644 index 00000000..eec01078 --- /dev/null +++ b/tests/res/values/strings.xml @@ -0,0 +1,6 @@ + + + + Owncloud-android-testsTest + + \ No newline at end of file diff --git a/tests/src/com/owncloud/android/test/AccountUtilsTest.java b/tests/src/com/owncloud/android/test/AccountUtilsTest.java new file mode 100644 index 00000000..582e9681 --- /dev/null +++ b/tests/src/com/owncloud/android/test/AccountUtilsTest.java @@ -0,0 +1,26 @@ +package com.owncloud.android.test; + +import org.junit.Test; + +import com.owncloud.android.AccountUtils; +import com.owncloud.android.utils.OwnCloudVersion; + +import junit.framework.TestCase; + +public class AccountUtilsTest extends TestCase { + + @Test + public void testGetWebdavPath() { + OwnCloudVersion ocv12 = new OwnCloudVersion(0x010200); + OwnCloudVersion ocv22 = new OwnCloudVersion(0x020200); + OwnCloudVersion ocv30 = new OwnCloudVersion(0x030000); + OwnCloudVersion ocv45 = new OwnCloudVersion(0x040500); + OwnCloudVersion ocv70 = new OwnCloudVersion(0x070000); + assertTrue(AccountUtils.getWebdavPath(ocv12).equals("/webdav/owncloud.php")); + assertTrue(AccountUtils.getWebdavPath(ocv22).equals("/files/webdav.php")); + assertTrue(AccountUtils.getWebdavPath(ocv30).equals("/files/webdav.php")); + assertTrue(AccountUtils.getWebdavPath(ocv45).equals("/remote.php/webdav")); + assertTrue(AccountUtils.getWebdavPath(ocv70).equals("/remote.php/webdav")); + } + +}