Permalink
Browse files

CL-161:Create Separate Unit Tests into Seperate Android App

  • Loading branch information...
1 parent 31738ac commit 49238714d6763716b471a204ab2ac3a0b65b5d79 tanaji committed Sep 6, 2012
Showing with 1,700 additions and 0 deletions.
  1. +8 −0 android/PubnubUnitTest/.classpath
  2. +33 −0 android/PubnubUnitTest/.project
  3. +25 −0 android/PubnubUnitTest/AndroidManifest.xml
  4. +25 −0 android/PubnubUnitTest/bin/AndroidManifest.xml
  5. BIN android/PubnubUnitTest/bin/PubnubUnitTest.apk
  6. BIN android/PubnubUnitTest/bin/PubnubUnitTest_.apk
  7. BIN android/PubnubUnitTest/bin/classes.dex
  8. +3 −0 android/PubnubUnitTest/bin/jarlist.cache
  9. BIN android/PubnubUnitTest/bin/res/drawable-hdpi/ic_launcher.png
  10. BIN android/PubnubUnitTest/bin/res/drawable-ldpi/ic_launcher.png
  11. BIN android/PubnubUnitTest/bin/res/drawable-mdpi/ic_launcher.png
  12. BIN android/PubnubUnitTest/bin/res/drawable-xhdpi/ic_launcher.png
  13. BIN android/PubnubUnitTest/bin/resources.ap_
  14. +6 −0 android/PubnubUnitTest/gen/com/sample/pubnubunittest/gui/BuildConfig.java
  15. +35 −0 android/PubnubUnitTest/gen/com/sample/pubnubunittest/gui/R.java
  16. BIN android/PubnubUnitTest/ic_launcher-web.png
  17. BIN android/PubnubUnitTest/libs/PubnubCrypto.jar
  18. BIN android/PubnubUnitTest/libs/android-support-v4.jar
  19. +5 −0 android/PubnubUnitTest/lint.xml
  20. +20 −0 android/PubnubUnitTest/proguard-project.txt
  21. +14 −0 android/PubnubUnitTest/project.properties
  22. BIN android/PubnubUnitTest/res/drawable-hdpi/ic_launcher.png
  23. BIN android/PubnubUnitTest/res/drawable-ldpi/ic_launcher.png
  24. BIN android/PubnubUnitTest/res/drawable-mdpi/ic_launcher.png
  25. BIN android/PubnubUnitTest/res/drawable-xhdpi/ic_launcher.png
  26. +13 −0 android/PubnubUnitTest/res/layout/activity_item_detail.xml
  27. +9 −0 android/PubnubUnitTest/res/layout/activity_item_list.xml
  28. +22 −0 android/PubnubUnitTest/res/layout/activity_item_twopane.xml
  29. +9 −0 android/PubnubUnitTest/res/layout/fragment_item_detail.xml
  30. +3 −0 android/PubnubUnitTest/res/values-large/refs.xml
  31. +3 −0 android/PubnubUnitTest/res/values-sw600dp/refs.xml
  32. +3 −0 android/PubnubUnitTest/res/values-v11/styles.xml
  33. +3 −0 android/PubnubUnitTest/res/values-v14/styles.xml
  34. +4 −0 android/PubnubUnitTest/res/values/strings.xml
  35. +3 −0 android/PubnubUnitTest/res/values/styles.xml
  36. +41 −0 android/PubnubUnitTest/src/com/sample/pubnubunittest/gui/ItemDetailActivity.java
  37. +95 −0 android/PubnubUnitTest/src/com/sample/pubnubunittest/gui/ItemDetailFragment.java
  38. +42 −0 android/PubnubUnitTest/src/com/sample/pubnubunittest/gui/ItemListActivity.java
  39. +96 −0 android/PubnubUnitTest/src/com/sample/pubnubunittest/gui/ItemListFragment.java
  40. +38 −0 android/PubnubUnitTest/src/com/sample/pubnubunittest/gui/MenuItemContent.java
  41. +18 −0 android/PubnubUnitTest/src/com/sample/pubnubunittest/pubnub/Callback.java
  42. +849 −0 android/PubnubUnitTest/src/com/sample/pubnubunittest/pubnub/Pubnub.java
  43. +275 −0 android/PubnubUnitTest/src/com/sample/pubnubunittest/unittest/CL_155.java
@@ -0,0 +1,8 @@
+<?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="output" path="bin/classes"/>
+</classpath>
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>PubnubUnitTest</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>
@@ -0,0 +1,25 @@
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.sample.pubnubunittest.gui"
+ android:versionCode="1"
+ android:versionName="1.0" >
+ <uses-sdk
+ android:minSdkVersion="11"
+ android:targetSdkVersion="15" />
+ <uses-permission android:name="android.permission.INTERNET" />
+ <application
+ android:icon="@drawable/ic_launcher"
+ android:label="@string/app_name"
+ android:theme="@style/AppTheme" >
+ <activity android:name=".ItemListActivity" >
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN" />
+ <category android:name="android.intent.category.LAUNCHER" />
+ </intent-filter>
+ </activity>
+ <activity android:name=".ItemDetailActivity" >
+ <meta-data
+ android:name="android.support.PARENT_ACTIVITY"
+ android:value=".ItemListActivity" />
+ </activity>
+ </application>
+</manifest>
@@ -0,0 +1,25 @@
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.sample.pubnubunittest.gui"
+ android:versionCode="1"
+ android:versionName="1.0" >
+ <uses-sdk
+ android:minSdkVersion="11"
+ android:targetSdkVersion="15" />
+ <uses-permission android:name="android.permission.INTERNET" />
+ <application
+ android:icon="@drawable/ic_launcher"
+ android:label="@string/app_name"
+ android:theme="@style/AppTheme" >
+ <activity android:name=".ItemListActivity" >
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN" />
+ <category android:name="android.intent.category.LAUNCHER" />
+ </intent-filter>
+ </activity>
+ <activity android:name=".ItemDetailActivity" >
+ <meta-data
+ android:name="android.support.PARENT_ACTIVITY"
+ android:value=".ItemListActivity" />
+ </activity>
+ </application>
+</manifest>
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,3 @@
+# cache for current jar dependecy. DO NOT EDIT.
+# format is <lastModified> <length> <SHA-1> <path>
+# Encoding is UTF-8
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
@@ -0,0 +1,6 @@
+/** Automatically generated file. DO NOT MODIFY */
+package com.sample.pubnubunittest.gui;
+
+public final class BuildConfig {
+ public final static boolean DEBUG = true;
+}
@@ -0,0 +1,35 @@
+/* AUTO-GENERATED FILE. DO NOT MODIFY.
+ *
+ * This class was automatically generated by the
+ * aapt tool from the resource data it found. It
+ * should not be modified by hand.
+ */
+
+package com.sample.pubnubunittest.gui;
+
+public final class R {
+ public static final class attr {
+ }
+ public static final class drawable {
+ public static final int ic_launcher=0x7f020000;
+ }
+ public static final class id {
+ public static final int item_detail=0x7f060003;
+ public static final int item_detail_container=0x7f060001;
+ public static final int item_list=0x7f060002;
+ public static final int scrollView1=0x7f060000;
+ }
+ public static final class layout {
+ public static final int activity_item_detail=0x7f030000;
+ public static final int activity_item_list=0x7f030001;
+ public static final int activity_item_twopane=0x7f030002;
+ public static final int fragment_item_detail=0x7f030003;
+ }
+ public static final class string {
+ public static final int app_name=0x7f040000;
+ public static final int title_item_list=0x7f040001;
+ }
+ public static final class style {
+ public static final int AppTheme=0x7f050000;
+ }
+}
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<lint>
+ <issue id="HandlerLeak" severity="ignore" />
+ <issue id="ParserError" severity="ignore" />
+</lint>
@@ -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 *;
+#}
@@ -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-16
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -0,0 +1,13 @@
+<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/scrollView1"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent" >
+ <FrameLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:id="@+id/item_detail_container"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ tools:context=".ItemDetailActivity" >
+ </FrameLayout>
+</ScrollView>
@@ -0,0 +1,9 @@
+<fragment xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:id="@+id/item_list"
+ android:name="com.sample.pubnubunittest.gui.ItemListFragment"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:layout_marginLeft="16dp"
+ android:layout_marginRight="16dp"
+ tools:context=".ItemListActivity" />
@@ -0,0 +1,22 @@
+<LinearLayout 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:layout_marginLeft="16dp"
+ android:layout_marginRight="16dp"
+ android:divider="?android:attr/dividerHorizontal"
+ android:orientation="horizontal"
+ android:showDividers="middle"
+ tools:context=".ItemListActivity" >
+ <fragment
+ android:id="@+id/item_list"
+ android:name="com.sample.pubnubunittest.gui.ItemListFragment"
+ android:layout_width="0dp"
+ android:layout_height="match_parent"
+ android:layout_weight="1" />
+ <FrameLayout
+ android:id="@+id/item_detail_container"
+ android:layout_width="0dp"
+ android:layout_height="match_parent"
+ android:layout_weight="3" />
+</LinearLayout>
@@ -0,0 +1,9 @@
+<TextView xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:id="@+id/item_detail"
+ style="?android:attr/textAppearanceLarge"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:padding="16dp"
+ android:textSize="12sp"
+ tools:context=".ItemDetailFragment" />
@@ -0,0 +1,3 @@
+<resources>
+ <item type="layout" name="activity_item_list">@layout/activity_item_twopane</item>
+</resources>
@@ -0,0 +1,3 @@
+<resources>
+ <item type="layout" name="activity_item_list">@layout/activity_item_twopane</item>
+</resources>
@@ -0,0 +1,3 @@
+<resources>
+ <style name="AppTheme" parent="android:Theme.Holo.Light" />
+</resources>
@@ -0,0 +1,3 @@
+<resources>
+ <style name="AppTheme" parent="android:Theme.Holo.Light.DarkActionBar" />
+</resources>
@@ -0,0 +1,4 @@
+<resources>
+ <string name="app_name">PubnubUnitTest</string>
+ <string name="title_item_list">Items</string>
+</resources>
@@ -0,0 +1,3 @@
+<resources>
+ <style name="AppTheme" parent="android:Theme.Light" />
+</resources>
@@ -0,0 +1,41 @@
+package com.sample.pubnubunittest.gui;
+
+import android.content.Intent;
+import android.os.Bundle;
+import android.support.v4.app.FragmentActivity;
+import android.support.v4.app.NavUtils;
+import android.view.MenuItem;
+
+public class ItemDetailActivity extends FragmentActivity {
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_item_detail);
+
+ getActionBar().setDisplayHomeAsUpEnabled(true);
+
+ if (savedInstanceState == null) {
+ Bundle arguments = new Bundle();
+ arguments.putString(ItemDetailFragment.ARG_ITEM_ID,
+ getIntent().getStringExtra(ItemDetailFragment.ARG_ITEM_ID));
+ ItemDetailFragment fragment = new ItemDetailFragment();
+ fragment.setArguments(arguments);
+ getSupportFragmentManager().beginTransaction()
+ .add(R.id.item_detail_container, fragment)
+ .commit();
+ }
+
+ setTitle(""+MenuItemContent.ITEM_MAP.get(getIntent().getStringExtra(ItemDetailFragment.ARG_ITEM_ID)));
+ }
+
+ @Override
+ public boolean onOptionsItemSelected(MenuItem item) {
+ if (item.getItemId() == android.R.id.home) {
+ NavUtils.navigateUpTo(this, new Intent(this, ItemListActivity.class));
+ return true;
+ }
+
+ return super.onOptionsItemSelected(item);
+ }
+}
Oops, something went wrong.

0 comments on commit 4923871

Please sign in to comment.