--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="src" path="gen"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/gitter"/>
+ <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>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>gitter-tests</name>
+ <comment></comment>
+ <projects>
+ <project>gitter</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>
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="ch.codelabs.gitter.test"
+ android:versionCode="1"
+ android:versionName="1.0" >
+
+ <uses-sdk android:minSdkVersion="8" />
+
+ <instrumentation
+ android:name="android.test.InstrumentationTestRunner"
+ android:targetPackage="ch.codelabs.gitter" />
+
+ <application
+ android:icon="@drawable/ic_launcher"
+ android:label="@string/app_name" >
+ <uses-library android:name="android.test.runner" />
+ </application>
+
+</manifest>
\ No newline at end of file
--- /dev/null
+# 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 use,
+# "ant.properties", and override values to adapt the script to your
+# project structure.
+
+# Project target.
+target=android-8
--- /dev/null
+<?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
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+
+ <string name="hello">Hello World!</string>
+ <string name="app_name">Gitter-testsTest</string>
+
+</resources>
\ No newline at end of file
--- /dev/null
+/*
+ * Copyright (C) 2012 Martin Kempf <mkempf@hsr.ch>
+ * Copyright (C) 2012 Reto Buerki <reet@codelabs.ch>
+ * Copyright (C) 2012 Adrian-Ken Rueegsegger <ken@codelabs.ch>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * for more details.
+ */
+
+package ch.codelabs.gitter.test;
+
+import android.database.Cursor;
+import android.test.AndroidTestCase;
+
+import ch.codelabs.gitter.CommitDbAdapter;
+
+public class CommitDbAdapterTest extends AndroidTestCase {
+
+ /*
+ * Register tests.
+ */
+ public CommitDbAdapterTest() {
+ super();
+ }
+
+ /*
+ * Insert commit into database.
+ */
+ public void testInsertCommit() {
+ CommitDbAdapter commitDbAdapter = new CommitDbAdapter(getContext());
+ commitDbAdapter.open();
+
+ long id = commitDbAdapter.insertCommit("Update TODO",
+ "John Doe doe@example.com", "http://1.com/abc", "testdata");
+
+ Cursor c = commitDbAdapter.fetchAllCommits();
+ assertTrue(c.getCount() > 0);
+
+ c.moveToFirst();
+ assertEquals("Update TODO", c.getString
+ (c.getColumnIndexOrThrow(CommitDbAdapter.KEY_TITLE)));
+ assertEquals("John Doe doe@example.com", c.getString
+ (c.getColumnIndexOrThrow(CommitDbAdapter.KEY_AUTHOR)));
+ assertEquals("http://1.com/abc", c.getString
+ (c.getColumnIndexOrThrow(CommitDbAdapter.KEY_DIFFLINK)));
+ assertEquals("testdata", c.getString
+ (c.getColumnIndexOrThrow(CommitDbAdapter.KEY_CONTENT)));
+
+ commitDbAdapter.deleteCommit(id);
+ c.close();
+ commitDbAdapter.close();
+ }
+}