OC-1869: Create Unit test project
authormasensio <masensio@solidgear.es>
Tue, 12 Nov 2013 11:36:13 +0000 (12:36 +0100)
committermasensio <masensio@solidgear.es>
Tue, 12 Nov 2013 11:36:13 +0000 (12:36 +0100)
32 files changed:
oc_framework-test-project/.classpath [new file with mode: 0644]
oc_framework-test-project/.project [new file with mode: 0644]
oc_framework-test-project/.settings/org.eclipse.jdt.core.prefs [new file with mode: 0644]
oc_framework-test-project/AndroidManifest.xml [new file with mode: 0644]
oc_framework-test-project/ic_launcher-web.png [new file with mode: 0644]
oc_framework-test-project/libs/android-support-v4.jar [new file with mode: 0644]
oc_framework-test-project/oc_framework-test-test/.classpath [new file with mode: 0644]
oc_framework-test-project/oc_framework-test-test/.project [new file with mode: 0644]
oc_framework-test-project/oc_framework-test-test/.settings/org.eclipse.jdt.core.prefs [new file with mode: 0644]
oc_framework-test-project/oc_framework-test-test/AndroidManifest.xml [new file with mode: 0644]
oc_framework-test-project/oc_framework-test-test/project.properties [new file with mode: 0644]
oc_framework-test-project/oc_framework-test-test/res/drawable-hdpi/ic_launcher.png [new file with mode: 0644]
oc_framework-test-project/oc_framework-test-test/res/drawable-ldpi/ic_launcher.png [new file with mode: 0644]
oc_framework-test-project/oc_framework-test-test/res/drawable-mdpi/ic_launcher.png [new file with mode: 0644]
oc_framework-test-project/oc_framework-test-test/res/drawable-xhdpi/ic_launcher.png [new file with mode: 0644]
oc_framework-test-project/oc_framework-test-test/res/values/strings.xml [new file with mode: 0644]
oc_framework-test-project/oc_framework-test-test/src/com/owncloud/android/oc_framework_test_project/test/CreateFolderTest.java [new file with mode: 0644]
oc_framework-test-project/project.properties [new file with mode: 0644]
oc_framework-test-project/res/drawable-hdpi/ic_launcher.png [new file with mode: 0644]
oc_framework-test-project/res/drawable-mdpi/ic_launcher.png [new file with mode: 0644]
oc_framework-test-project/res/drawable-xhdpi/ic_launcher.png [new file with mode: 0644]
oc_framework-test-project/res/drawable-xxhdpi/ic_launcher.png [new file with mode: 0644]
oc_framework-test-project/res/layout/activity_test.xml [new file with mode: 0644]
oc_framework-test-project/res/menu/test.xml [new file with mode: 0644]
oc_framework-test-project/res/values-sw600dp/dimens.xml [new file with mode: 0644]
oc_framework-test-project/res/values-sw720dp-land/dimens.xml [new file with mode: 0644]
oc_framework-test-project/res/values-v11/styles.xml [new file with mode: 0644]
oc_framework-test-project/res/values-v14/styles.xml [new file with mode: 0644]
oc_framework-test-project/res/values/dimens.xml [new file with mode: 0644]
oc_framework-test-project/res/values/strings.xml [new file with mode: 0644]
oc_framework-test-project/res/values/styles.xml [new file with mode: 0644]
oc_framework-test-project/src/com/owncloud/android/oc_framework_test_project/TestActivity.java [new file with mode: 0644]

diff --git a/oc_framework-test-project/.classpath b/oc_framework-test-project/.classpath
new file mode 100644 (file)
index 0000000..d3d9f2d
--- /dev/null
@@ -0,0 +1,10 @@
+<?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 exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
+       <classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
+       <classpathentry exported="true" kind="lib" path="/oc_framework/bin/oc_framework.jar"/>
+       <classpathentry kind="output" path="bin/classes"/>
+</classpath>
diff --git a/oc_framework-test-project/.project b/oc_framework-test-project/.project
new file mode 100644 (file)
index 0000000..8c7df64
--- /dev/null
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>oc_framework-test-project</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/oc_framework-test-project/.settings/org.eclipse.jdt.core.prefs b/oc_framework-test-project/.settings/org.eclipse.jdt.core.prefs
new file mode 100644 (file)
index 0000000..b080d2d
--- /dev/null
@@ -0,0 +1,4 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.source=1.6
diff --git a/oc_framework-test-project/AndroidManifest.xml b/oc_framework-test-project/AndroidManifest.xml
new file mode 100644 (file)
index 0000000..b7d12fd
--- /dev/null
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+    package="com.owncloud.android.oc_framework_test_project"
+    android:versionCode="1"
+    android:versionName="1.0" >
+    
+    <uses-permission android:name="android.permission.USE_CREDENTIALS" />
+    <uses-permission android:name="android.permission.AUTHENTICATE_ACCOUNTS" />
+    
+    <uses-sdk
+        android:minSdkVersion="8"
+        android:targetSdkVersion="18" />
+
+    <application
+        android:allowBackup="true"
+        android:icon="@drawable/ic_launcher"
+        android:label="@string/app_name"
+        android:theme="@style/AppTheme" >
+        <activity
+            android:name="com.owncloud.android.oc_framework_test_project.TestActivity"
+            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/oc_framework-test-project/ic_launcher-web.png b/oc_framework-test-project/ic_launcher-web.png
new file mode 100644 (file)
index 0000000..a18cbb4
Binary files /dev/null and b/oc_framework-test-project/ic_launcher-web.png differ
diff --git a/oc_framework-test-project/libs/android-support-v4.jar b/oc_framework-test-project/libs/android-support-v4.jar
new file mode 100644 (file)
index 0000000..9056828
Binary files /dev/null and b/oc_framework-test-project/libs/android-support-v4.jar differ
diff --git a/oc_framework-test-project/oc_framework-test-test/.classpath b/oc_framework-test-project/oc_framework-test-test/.classpath
new file mode 100644 (file)
index 0000000..dce5685
--- /dev/null
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+       <classpathentry kind="src" path="src"/>
+       <classpathentry kind="src" path="gen"/>
+       <classpathentry combineaccessrules="false" exported="true" kind="src" path="/oc_framework-test-project"/>
+       <classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
+       <classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
+       <classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
+       <classpathentry kind="output" path="bin/classes"/>
+</classpath>
diff --git a/oc_framework-test-project/oc_framework-test-test/.project b/oc_framework-test-project/oc_framework-test-test/.project
new file mode 100644 (file)
index 0000000..c490827
--- /dev/null
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>oc_framework-test</name>
+       <comment></comment>
+       <projects>
+               <project>oc_framework-test-project</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/oc_framework-test-project/oc_framework-test-test/.settings/org.eclipse.jdt.core.prefs b/oc_framework-test-project/oc_framework-test-test/.settings/org.eclipse.jdt.core.prefs
new file mode 100644 (file)
index 0000000..b080d2d
--- /dev/null
@@ -0,0 +1,4 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.source=1.6
diff --git a/oc_framework-test-project/oc_framework-test-test/AndroidManifest.xml b/oc_framework-test-project/oc_framework-test-test/AndroidManifest.xml
new file mode 100644 (file)
index 0000000..294f271
--- /dev/null
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+    package="com.owncloud.android.oc_framework_test_project.test"
+    android:versionCode="1"
+    android:versionName="1.0" >
+
+    <uses-sdk android:minSdkVersion="8" />
+    <application>
+        <uses-library android:name="android.test.runner" />
+    </application>
+
+    <instrumentation
+        android:name="android.test.InstrumentationTestRunner"
+        android:label="Tests for com.owncloud.android.oc_framework_test_project"
+        android:targetPackage="com.owncloud.android.oc_framework_test_project" />
+
+</manifest>
\ No newline at end of file
diff --git a/oc_framework-test-project/oc_framework-test-test/project.properties b/oc_framework-test-project/oc_framework-test-test/project.properties
new file mode 100644 (file)
index 0000000..4ab1256
--- /dev/null
@@ -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-19
diff --git a/oc_framework-test-project/oc_framework-test-test/res/drawable-hdpi/ic_launcher.png b/oc_framework-test-project/oc_framework-test-test/res/drawable-hdpi/ic_launcher.png
new file mode 100644 (file)
index 0000000..96a442e
Binary files /dev/null and b/oc_framework-test-project/oc_framework-test-test/res/drawable-hdpi/ic_launcher.png differ
diff --git a/oc_framework-test-project/oc_framework-test-test/res/drawable-ldpi/ic_launcher.png b/oc_framework-test-project/oc_framework-test-test/res/drawable-ldpi/ic_launcher.png
new file mode 100644 (file)
index 0000000..9923872
Binary files /dev/null and b/oc_framework-test-project/oc_framework-test-test/res/drawable-ldpi/ic_launcher.png differ
diff --git a/oc_framework-test-project/oc_framework-test-test/res/drawable-mdpi/ic_launcher.png b/oc_framework-test-project/oc_framework-test-test/res/drawable-mdpi/ic_launcher.png
new file mode 100644 (file)
index 0000000..359047d
Binary files /dev/null and b/oc_framework-test-project/oc_framework-test-test/res/drawable-mdpi/ic_launcher.png differ
diff --git a/oc_framework-test-project/oc_framework-test-test/res/drawable-xhdpi/ic_launcher.png b/oc_framework-test-project/oc_framework-test-test/res/drawable-xhdpi/ic_launcher.png
new file mode 100644 (file)
index 0000000..71c6d76
Binary files /dev/null and b/oc_framework-test-project/oc_framework-test-test/res/drawable-xhdpi/ic_launcher.png differ
diff --git a/oc_framework-test-project/oc_framework-test-test/res/values/strings.xml b/oc_framework-test-project/oc_framework-test-test/res/values/strings.xml
new file mode 100644 (file)
index 0000000..657f31d
--- /dev/null
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+
+    <string name="app_name">Oc_framework-testTest</string>
+
+</resources>
diff --git a/oc_framework-test-project/oc_framework-test-test/src/com/owncloud/android/oc_framework_test_project/test/CreateFolderTest.java b/oc_framework-test-project/oc_framework-test-test/src/com/owncloud/android/oc_framework_test_project/test/CreateFolderTest.java
new file mode 100644 (file)
index 0000000..61184d4
--- /dev/null
@@ -0,0 +1,45 @@
+package com.owncloud.android.oc_framework_test_project.test;
+
+import com.owncloud.android.oc_framework.operations.RemoteOperationResult;
+import com.owncloud.android.oc_framework_test_project.TestActivity;
+
+import android.test.ActivityInstrumentationTestCase2;
+import android.util.Log;
+
+public class CreateFolderTest extends ActivityInstrumentationTestCase2<TestActivity> {
+
+       private TestActivity mActivity;
+       
+       public CreateFolderTest() {
+           super(TestActivity.class);
+          
+       }
+       
+       @Override
+         protected void setUp() throws Exception {
+           super.setUp();
+           setActivityInitialTouchMode(false);
+           mActivity = getActivity();
+       }
+       
+       public void testCreateFolder() {
+               
+               String remotePath = "beta.owncloud.com/owncloud/testCreateFolder";
+               boolean createFullPath = true;
+               
+               RemoteOperationResult result =  mActivity.createFolder(remotePath, createFullPath);
+               Log.d("test CreateFolder", "-----------------------" + result.getCode().name());
+               Log.d("test CreateFolder", "-----------------------" + result.getLogMessage());
+               assertTrue(result.isSuccess());
+       }
+       
+       public void testCreateFolderSpecialCharacters() {
+               String remotePath = "beta.owncloud.com/owncloud/test^^SpecialCharacters";
+               boolean createFullPath = true;
+               
+               RemoteOperationResult result =  mActivity.createFolder(remotePath, createFullPath);
+               assertTrue(result.isSuccess());
+       }
+
+
+}
diff --git a/oc_framework-test-project/project.properties b/oc_framework-test-project/project.properties
new file mode 100644 (file)
index 0000000..153d36b
--- /dev/null
@@ -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-19
+android.library.reference.1=../oc_framework
diff --git a/oc_framework-test-project/res/drawable-hdpi/ic_launcher.png b/oc_framework-test-project/res/drawable-hdpi/ic_launcher.png
new file mode 100644 (file)
index 0000000..288b665
Binary files /dev/null and b/oc_framework-test-project/res/drawable-hdpi/ic_launcher.png differ
diff --git a/oc_framework-test-project/res/drawable-mdpi/ic_launcher.png b/oc_framework-test-project/res/drawable-mdpi/ic_launcher.png
new file mode 100644 (file)
index 0000000..6ae570b
Binary files /dev/null and b/oc_framework-test-project/res/drawable-mdpi/ic_launcher.png differ
diff --git a/oc_framework-test-project/res/drawable-xhdpi/ic_launcher.png b/oc_framework-test-project/res/drawable-xhdpi/ic_launcher.png
new file mode 100644 (file)
index 0000000..d4fb7cd
Binary files /dev/null and b/oc_framework-test-project/res/drawable-xhdpi/ic_launcher.png differ
diff --git a/oc_framework-test-project/res/drawable-xxhdpi/ic_launcher.png b/oc_framework-test-project/res/drawable-xxhdpi/ic_launcher.png
new file mode 100644 (file)
index 0000000..85a6081
Binary files /dev/null and b/oc_framework-test-project/res/drawable-xxhdpi/ic_launcher.png differ
diff --git a/oc_framework-test-project/res/layout/activity_test.xml b/oc_framework-test-project/res/layout/activity_test.xml
new file mode 100644 (file)
index 0000000..42c4fbd
--- /dev/null
@@ -0,0 +1,16 @@
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:paddingBottom="@dimen/activity_vertical_margin"
+    android:paddingLeft="@dimen/activity_horizontal_margin"
+    android:paddingRight="@dimen/activity_horizontal_margin"
+    android:paddingTop="@dimen/activity_vertical_margin"
+    tools:context=".TestActivity" >
+
+    <TextView
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:text="@string/hello_world" />
+
+</RelativeLayout>
diff --git a/oc_framework-test-project/res/menu/test.xml b/oc_framework-test-project/res/menu/test.xml
new file mode 100644 (file)
index 0000000..c002028
--- /dev/null
@@ -0,0 +1,9 @@
+<menu xmlns:android="http://schemas.android.com/apk/res/android" >
+
+    <item
+        android:id="@+id/action_settings"
+        android:orderInCategory="100"
+        android:showAsAction="never"
+        android:title="@string/action_settings"/>
+
+</menu>
diff --git a/oc_framework-test-project/res/values-sw600dp/dimens.xml b/oc_framework-test-project/res/values-sw600dp/dimens.xml
new file mode 100644 (file)
index 0000000..44f01db
--- /dev/null
@@ -0,0 +1,8 @@
+<resources>
+
+    <!--
+         Customize dimensions originally defined in res/values/dimens.xml (such as
+         screen margins) for sw600dp devices (e.g. 7" tablets) here.
+    -->
+
+</resources>
diff --git a/oc_framework-test-project/res/values-sw720dp-land/dimens.xml b/oc_framework-test-project/res/values-sw720dp-land/dimens.xml
new file mode 100644 (file)
index 0000000..61e3fa8
--- /dev/null
@@ -0,0 +1,9 @@
+<resources>
+
+    <!--
+         Customize dimensions originally defined in res/values/dimens.xml (such as
+         screen margins) for sw720dp devices (e.g. 10" tablets) in landscape here.
+    -->
+    <dimen name="activity_horizontal_margin">128dp</dimen>
+
+</resources>
diff --git a/oc_framework-test-project/res/values-v11/styles.xml b/oc_framework-test-project/res/values-v11/styles.xml
new file mode 100644 (file)
index 0000000..3c02242
--- /dev/null
@@ -0,0 +1,11 @@
+<resources>
+
+    <!--
+        Base application theme for API 11+. This theme completely replaces
+        AppBaseTheme from res/values/styles.xml on API 11+ devices.
+    -->
+    <style name="AppBaseTheme" parent="android:Theme.Holo.Light">
+        <!-- API 11 theme customizations can go here. -->
+    </style>
+
+</resources>
diff --git a/oc_framework-test-project/res/values-v14/styles.xml b/oc_framework-test-project/res/values-v14/styles.xml
new file mode 100644 (file)
index 0000000..a91fd03
--- /dev/null
@@ -0,0 +1,12 @@
+<resources>
+
+    <!--
+        Base application theme for API 14+. This theme completely replaces
+        AppBaseTheme from BOTH res/values/styles.xml and
+        res/values-v11/styles.xml on API 14+ devices.
+    -->
+    <style name="AppBaseTheme" parent="android:Theme.Holo.Light.DarkActionBar">
+        <!-- API 14 theme customizations can go here. -->
+    </style>
+
+</resources>
diff --git a/oc_framework-test-project/res/values/dimens.xml b/oc_framework-test-project/res/values/dimens.xml
new file mode 100644 (file)
index 0000000..55c1e59
--- /dev/null
@@ -0,0 +1,7 @@
+<resources>
+
+    <!-- Default screen margins, per the Android Design guidelines. -->
+    <dimen name="activity_horizontal_margin">16dp</dimen>
+    <dimen name="activity_vertical_margin">16dp</dimen>
+
+</resources>
diff --git a/oc_framework-test-project/res/values/strings.xml b/oc_framework-test-project/res/values/strings.xml
new file mode 100644 (file)
index 0000000..e50b40d
--- /dev/null
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+
+    <string name="app_name">oc_framework-test-project</string>
+    <string name="action_settings">Settings</string>
+    <string name="hello_world">Hello world!</string>
+
+</resources>
diff --git a/oc_framework-test-project/res/values/styles.xml b/oc_framework-test-project/res/values/styles.xml
new file mode 100644 (file)
index 0000000..6ce89c7
--- /dev/null
@@ -0,0 +1,20 @@
+<resources>
+
+    <!--
+        Base application theme, dependent on API level. This theme is replaced
+        by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
+    -->
+    <style name="AppBaseTheme" parent="android:Theme.Light">
+        <!--
+            Theme customizations available in newer API levels can go in
+            res/values-vXX/styles.xml, while customizations related to
+            backward-compatibility can go here.
+        -->
+    </style>
+
+    <!-- Application theme. -->
+    <style name="AppTheme" parent="AppBaseTheme">
+        <!-- All customizations that are NOT specific to a particular API-level can go here. -->
+    </style>
+
+</resources>
diff --git a/oc_framework-test-project/src/com/owncloud/android/oc_framework_test_project/TestActivity.java b/oc_framework-test-project/src/com/owncloud/android/oc_framework_test_project/TestActivity.java
new file mode 100644 (file)
index 0000000..8c5ed05
--- /dev/null
@@ -0,0 +1,75 @@
+package com.owncloud.android.oc_framework_test_project;
+
+import java.io.IOException;
+import com.owncloud.android.oc_framework.authentication.AccountUtils.AccountNotFoundException;
+import com.owncloud.android.oc_framework.network.OwnCloudClientUtils;
+import com.owncloud.android.oc_framework.network.webdav.WebdavClient;
+import com.owncloud.android.oc_framework.operations.RemoteOperationResult;
+import com.owncloud.android.oc_framework.operations.remote.CreateRemoteFolderOperation;
+
+import android.os.Bundle;
+import android.accounts.Account;
+import android.accounts.AccountManager;
+import android.accounts.AuthenticatorException;
+import android.accounts.OperationCanceledException;
+import android.app.Activity;
+import android.util.Log;
+import android.view.Menu;
+
+public class TestActivity extends Activity {
+       
+       private static final String TAG = "TestActivity";
+       
+       private Account mAccount;
+       private WebdavClient mClient;
+       
+       @Override
+       protected void onCreate(Bundle savedInstanceState) {
+               super.onCreate(savedInstanceState);
+               setContentView(R.layout.activity_test);
+
+               String accountName = "admin@beta.owncloud.com";
+               String accountHost = "beta.owncloud.com";
+               String accountUser = "admin";
+               String accountPass = "owncloud42";
+               String accountType = "owncloud";        
+               String accountTypePass = "owncloud.password";
+               String authorities = "org.owncloud";
+
+               mAccount = new Account(accountName, accountType);
+               AccountManager am = AccountManager.get(this);
+               am.addAccountExplicitly(mAccount, accountPass, null);
+               
+
+               try {
+                       mClient = OwnCloudClientUtils.createOwnCloudClient(mAccount, this.getApplicationContext(), authorities);
+               } catch (OperationCanceledException e) {
+                       Log.e(TAG, "Error while trying to access to " + mAccount.name, e);
+                       e.printStackTrace();
+               } catch (AuthenticatorException e) {
+                       Log.e(TAG, "Error while trying to access to " + mAccount.name, e);
+                       e.printStackTrace();
+               } catch (AccountNotFoundException e) {
+                       Log.e(TAG, "Error while trying to access to " + mAccount.name, e);
+                       e.printStackTrace();
+               } catch (IOException e) {
+                       Log.e(TAG, "Error while trying to access to " + mAccount.name, e);
+                       e.printStackTrace();
+               }
+       }
+
+       @Override
+       public boolean onCreateOptionsMenu(Menu menu) {
+               // Inflate the menu; this adds items to the action bar if it is present.
+               getMenuInflater().inflate(R.menu.test, menu);
+               return true;
+       }
+
+       public RemoteOperationResult createFolder(String remotePath, boolean createFullPath) {
+               
+               CreateRemoteFolderOperation createOperation = new CreateRemoteFolderOperation(remotePath, createFullPath);
+               RemoteOperationResult result =  createOperation.execute(mClient);
+               
+               return result;
+       }
+}