diff --git a/mobile/com.sap.sailing.android.tracking.app.test-test/.classpath b/mobile/com.sap.sailing.android.tracking.app.test-test/.classpath
new file mode 100644
index 00000000000..f895a38f5f3
--- /dev/null
+++ b/mobile/com.sap.sailing.android.tracking.app.test-test/.classpath
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/mobile/com.sap.sailing.android.tracking.app.test-test/.project b/mobile/com.sap.sailing.android.tracking.app.test-test/.project
new file mode 100644
index 00000000000..fb93d637769
--- /dev/null
+++ b/mobile/com.sap.sailing.android.tracking.app.test-test/.project
@@ -0,0 +1,34 @@
+
+
+ com.sap.sailing.android.tracking.app.test
+
+
+ com.sap.sailing.android.tracking.app
+
+
+
+ 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/mobile/com.sap.sailing.android.tracking.app.test-test/.settings/org.eclipse.jdt.core.prefs b/mobile/com.sap.sailing.android.tracking.app.test-test/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 00000000000..b080d2ddc88
--- /dev/null
+++ b/mobile/com.sap.sailing.android.tracking.app.test-test/.settings/org.eclipse.jdt.core.prefs
@@ -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/mobile/com.sap.sailing.android.tracking.app.test-test/AndroidManifest.xml b/mobile/com.sap.sailing.android.tracking.app.test-test/AndroidManifest.xml
new file mode 100644
index 00000000000..fd69f4b8347
--- /dev/null
+++ b/mobile/com.sap.sailing.android.tracking.app.test-test/AndroidManifest.xml
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/mobile/com.sap.sailing.android.tracking.app.test-test/bin/AndroidManifest.xml b/mobile/com.sap.sailing.android.tracking.app.test-test/bin/AndroidManifest.xml
new file mode 100644
index 00000000000..fd69f4b8347
--- /dev/null
+++ b/mobile/com.sap.sailing.android.tracking.app.test-test/bin/AndroidManifest.xml
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/mobile/com.sap.sailing.android.tracking.app.test-test/gen/.gitignore b/mobile/com.sap.sailing.android.tracking.app.test-test/gen/.gitignore
new file mode 100644
index 00000000000..c2d9872a163
--- /dev/null
+++ b/mobile/com.sap.sailing.android.tracking.app.test-test/gen/.gitignore
@@ -0,0 +1 @@
+/com/
diff --git a/mobile/com.sap.sailing.android.tracking.app.test-test/proguard-project.txt b/mobile/com.sap.sailing.android.tracking.app.test-test/proguard-project.txt
new file mode 100644
index 00000000000..f2fe1559a21
--- /dev/null
+++ b/mobile/com.sap.sailing.android.tracking.app.test-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/mobile/com.sap.sailing.android.tracking.app.test-test/project.properties b/mobile/com.sap.sailing.android.tracking.app.test-test/project.properties
new file mode 100644
index 00000000000..6e18427a424
--- /dev/null
+++ b/mobile/com.sap.sailing.android.tracking.app.test-test/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-21
diff --git a/mobile/com.sap.sailing.android.tracking.app.test-test/res/drawable-hdpi/ic_launcher.png b/mobile/com.sap.sailing.android.tracking.app.test-test/res/drawable-hdpi/ic_launcher.png
new file mode 100644
index 00000000000..96a442e5b8e
Binary files /dev/null and b/mobile/com.sap.sailing.android.tracking.app.test-test/res/drawable-hdpi/ic_launcher.png differ
diff --git a/mobile/com.sap.sailing.android.tracking.app.test-test/res/drawable-ldpi/ic_launcher.png b/mobile/com.sap.sailing.android.tracking.app.test-test/res/drawable-ldpi/ic_launcher.png
new file mode 100644
index 00000000000..99238729d87
Binary files /dev/null and b/mobile/com.sap.sailing.android.tracking.app.test-test/res/drawable-ldpi/ic_launcher.png differ
diff --git a/mobile/com.sap.sailing.android.tracking.app.test-test/res/drawable-mdpi/ic_launcher.png b/mobile/com.sap.sailing.android.tracking.app.test-test/res/drawable-mdpi/ic_launcher.png
new file mode 100644
index 00000000000..359047dfa4e
Binary files /dev/null and b/mobile/com.sap.sailing.android.tracking.app.test-test/res/drawable-mdpi/ic_launcher.png differ
diff --git a/mobile/com.sap.sailing.android.tracking.app.test-test/res/drawable-xhdpi/ic_launcher.png b/mobile/com.sap.sailing.android.tracking.app.test-test/res/drawable-xhdpi/ic_launcher.png
new file mode 100644
index 00000000000..71c6d760f05
Binary files /dev/null and b/mobile/com.sap.sailing.android.tracking.app.test-test/res/drawable-xhdpi/ic_launcher.png differ
diff --git a/mobile/com.sap.sailing.android.tracking.app.test-test/res/values/strings.xml b/mobile/com.sap.sailing.android.tracking.app.test-test/res/values/strings.xml
new file mode 100644
index 00000000000..8c405e56633
--- /dev/null
+++ b/mobile/com.sap.sailing.android.tracking.app.test-test/res/values/strings.xml
@@ -0,0 +1,6 @@
+
+
+
+ Com.sap.sailing.android.tracking.app.testTest
+
+
diff --git a/mobile/com.sap.sailing.android.tracking.app.test-test/src/com/sap/sailing/android/tracking/app/test/ActivityUnitTestCase.java b/mobile/com.sap.sailing.android.tracking.app.test-test/src/com/sap/sailing/android/tracking/app/test/ActivityUnitTestCase.java
new file mode 100644
index 00000000000..ec40cee60cf
--- /dev/null
+++ b/mobile/com.sap.sailing.android.tracking.app.test-test/src/com/sap/sailing/android/tracking/app/test/ActivityUnitTestCase.java
@@ -0,0 +1,343 @@
+/*
+ * 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.sap.sailing.android.tracking.app.test;
+
+import android.app.Activity;
+import android.app.Application;
+import android.content.ComponentName;
+import android.content.Context;
+import android.content.Intent;
+import android.content.pm.ActivityInfo;
+import android.os.Bundle;
+import android.os.IBinder;
+import android.test.ActivityInstrumentationTestCase;
+import android.test.ActivityTestCase;
+import android.test.mock.MockApplication;
+import android.view.Window;
+
+/**
+ * This class provides isolated testing of a single activity. The activity under test will
+ * be created with minimal connection to the system infrastructure, and you can inject mocked or
+ * wrappered versions of many of Activity's dependencies. Most of the work is handled
+ * automatically here by {@link #setUp} and {@link #tearDown}.
+ *
+ *
If you prefer a functional test, see {@link android.test.ActivityInstrumentationTestCase}.
+ *
+ *
It must be noted that, as a true unit test, your Activity will not be running in the
+ * normal system and will not participate in the normal interactions with other Activities.
+ * The following methods should not be called in this configuration - most of them will throw
+ * exceptions:
+ *
The following methods may be called but will not do anything. For test purposes, you can use
+ * the methods {@link #getStartedActivityIntent()} and {@link #getStartedActivityRequest()} to
+ * inspect the parameters that they were called with.
+ *
The following methods may be called but will not do anything. For test purposes, you can use
+ * the methods {@link #isFinishCalled()} and {@link #getFinishedActivityRequest()} to inspect the
+ * parameters that they were called with.
+ *
+ *
+ */
+public abstract class ActivityUnitTestCase
+ extends ActivityTestCase {
+
+ private Class mActivityClass;
+
+ private Context mActivityContext;
+ private Application mApplication;
+ private MockParent mMockParent;
+
+ private boolean mAttached = false;
+ private boolean mCreated = false;
+
+ public ActivityUnitTestCase(Class activityClass) {
+ mActivityClass = activityClass;
+ }
+
+ @Override
+ public T getActivity() {
+ return (T) super.getActivity();
+ }
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+
+ // default value for target context, as a default
+ mActivityContext = getInstrumentation().getTargetContext();
+ }
+
+ /**
+ * Start the activity under test, in the same way as if it was started by
+ * {@link android.content.Context#startActivity Context.startActivity()}, providing the
+ * arguments it supplied. When you use this method to start the activity, it will automatically
+ * be stopped by {@link #tearDown}.
+ *
+ *
This method will call onCreate(), but if you wish to further exercise Activity life
+ * cycle methods, you must call them yourself from your test case.
+ *
+ *
Do not call from your setUp() method. You must call this method from each of your
+ * test methods.
+ *
+ * @param intent The Intent as if supplied to {@link android.content.Context#startActivity}.
+ * @param savedInstanceState The instance state, if you are simulating this part of the life
+ * cycle. Typically null.
+ * @param lastNonConfigurationInstance This Object will be available to the
+ * Activity if it calls {@link android.app.Activity#getLastNonConfigurationInstance()}.
+ * Typically null.
+ * @return Returns the Activity that was created
+ */
+ protected T startActivity(Intent intent, Bundle savedInstanceState,
+ Object lastNonConfigurationInstance) {
+ assertFalse("Activity already created", mCreated);
+
+ if (!mAttached) {
+ assertNotNull(mActivityClass);
+ setActivity(null);
+ T newActivity = null;
+ try {
+ IBinder token = null;
+ if (mApplication == null) {
+ setApplication(new MockApplication());
+ }
+// ComponentName cn = new ComponentName(mActivityClass.getPackage().getName(),
+// mActivityClass.getName());
+ ComponentName cn = new ComponentName(getInstrumentation().getTargetContext(), mActivityClass);
+ intent.setComponent(cn);
+ ActivityInfo info = new ActivityInfo();
+ CharSequence title = mActivityClass.getName();
+ mMockParent = new MockParent();
+ String id = null;
+
+ newActivity = (T) getInstrumentation().newActivity(mActivityClass, mActivityContext,
+ token, mApplication, intent, info, title, mMockParent, id,
+ lastNonConfigurationInstance);
+ } catch (Exception e) {
+ assertNotNull(newActivity);
+ }
+
+ assertNotNull(newActivity);
+ setActivity(newActivity);
+
+ mAttached = true;
+ }
+
+ T result = getActivity();
+ if (result != null) {
+ getInstrumentation().callActivityOnCreate(getActivity(), savedInstanceState);
+ mCreated = true;
+ }
+ return result;
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+
+ setActivity(null);
+
+ // Scrub out members - protects against memory leaks in the case where someone
+ // creates a non-static inner class (thus referencing the test case) and gives it to
+ // someone else to hold onto
+ scrubClass(ActivityInstrumentationTestCase.class);
+
+ super.tearDown();
+ }
+
+ /**
+ * Set the application for use during the test. You must call this function before calling
+ * {@link #startActivity}. If your test does not call this method,
+ * @param application The Application object that will be injected into the Activity under test.
+ */
+ public void setApplication(Application application) {
+ mApplication = application;
+ }
+
+ /**
+ * If you wish to inject a Mock, Isolated, or otherwise altered context, you can do so
+ * here. You must call this function before calling {@link #startActivity}. If you wish to
+ * obtain a real Context, as a building block, use getInstrumentation().getTargetContext().
+ */
+ public void setActivityContext(Context activityContext) {
+ mActivityContext = activityContext;
+ }
+
+ /**
+ * This method will return the value if your Activity under test calls
+ * {@link android.app.Activity#setRequestedOrientation}.
+ */
+ public int getRequestedOrientation() {
+ if (mMockParent != null) {
+ return mMockParent.mRequestedOrientation;
+ }
+ return 0;
+ }
+
+ /**
+ * This method will return the launch intent if your Activity under test calls
+ * {@link android.app.Activity#startActivity(Intent)} or
+ * {@link android.app.Activity#startActivityForResult(Intent, int)}.
+ * @return The Intent provided in the start call, or null if no start call was made.
+ */
+ public Intent getStartedActivityIntent() {
+ if (mMockParent != null) {
+ return mMockParent.mStartedActivityIntent;
+ }
+ return null;
+ }
+
+ /**
+ * This method will return the launch request code if your Activity under test calls
+ * {@link android.app.Activity#startActivityForResult(Intent, int)}.
+ * @return The request code provided in the start call, or -1 if no start call was made.
+ */
+ public int getStartedActivityRequest() {
+ if (mMockParent != null) {
+ return mMockParent.mStartedActivityRequest;
+ }
+ return 0;
+ }
+
+ /**
+ * This method will notify you if the Activity under test called
+ * {@link android.app.Activity#finish()},
+ * {@link android.app.Activity#finishFromChild(Activity)}, or
+ * {@link android.app.Activity#finishActivity(int)}.
+ * @return Returns true if one of the listed finish methods was called.
+ */
+ public boolean isFinishCalled() {
+ if (mMockParent != null) {
+ return mMockParent.mFinished;
+ }
+ return false;
+ }
+
+ /**
+ * This method will return the request code if the Activity under test called
+ * {@link android.app.Activity#finishActivity(int)}.
+ * @return The request code provided in the start call, or -1 if no finish call was made.
+ */
+ public int getFinishedActivityRequest() {
+ if (mMockParent != null) {
+ return mMockParent.mFinishedActivityRequest;
+ }
+ return 0;
+ }
+
+ /**
+ * This mock Activity represents the "parent" activity. By injecting this, we allow the user
+ * to call a few more Activity methods, including:
+ *
+ *
+ * TODO: Make this overrideable, and the unit test can look for calls to other methods
+ */
+ private static class MockParent extends Activity {
+
+ public int mRequestedOrientation = 0;
+ public Intent mStartedActivityIntent = null;
+ public int mStartedActivityRequest = -1;
+ public boolean mFinished = false;
+ public int mFinishedActivityRequest = -1;
+
+ /**
+ * Implementing in the parent allows the user to call this function on the tested activity.
+ */
+ @Override
+ public void setRequestedOrientation(int requestedOrientation) {
+ mRequestedOrientation = requestedOrientation;
+ }
+
+ /**
+ * Implementing in the parent allows the user to call this function on the tested activity.
+ */
+ @Override
+ public int getRequestedOrientation() {
+ return mRequestedOrientation;
+ }
+
+ /**
+ * By returning null here, we inhibit the creation of any "container" for the window.
+ */
+ @Override
+ public Window getWindow() {
+ return null;
+ }
+
+ /**
+ * By defining this in the parent, we allow the tested activity to call
+ *
+ */
+ @Override
+ public void startActivityFromChild(Activity child, Intent intent, int requestCode) {
+ mStartedActivityIntent = intent;
+ mStartedActivityRequest = requestCode;
+ }
+
+ /**
+ * By defining this in the parent, we allow the tested activity to call
+ *
+ */
+ @Override
+ public void finishFromChild(Activity child) {
+ mFinished = true;
+ }
+
+ /**
+ * By defining this in the parent, we allow the tested activity to call
+ *