incubator-callback-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bows...@apache.org
Subject android commit: Adding empty tests. May have to re-think the way we test this method
Date Fri, 11 May 2012 22:14:53 GMT
Updated Branches:
  refs/heads/CordovaWebView 5b324c85b -> dd0b6b1e3


Adding empty tests. May have to re-think the way we test this method


Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/commit/dd0b6b1e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/tree/dd0b6b1e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/diff/dd0b6b1e

Branch: refs/heads/CordovaWebView
Commit: dd0b6b1e30f592a208147fb76a2f7079e421de85
Parents: 5b324c8
Author: Joe Bowser <bowserj@apache.org>
Authored: Fri May 11 15:14:35 2012 -0700
Committer: Joe Bowser <bowserj@apache.org>
Committed: Fri May 11 15:14:35 2012 -0700

----------------------------------------------------------------------
 .../org/apache/cordova/test/BackButtonTest.java    |   49 +++++++++++++++
 .../apache/cordova/test/CordovaActivityTest.java   |    3 +-
 test/src/org/apache/cordova/test/ErrorUrlTest.java |   35 ++++++++++
 .../org/apache/cordova/test/HtmlNotFoundTest.java  |   11 +++
 test/src/org/apache/cordova/test/IFrameTest.java   |   11 +++
 test/src/org/apache/cordova/test/JQMTabTest.java   |   12 ++++
 .../src/org/apache/cordova/test/LifecycleTest.java |   11 +++
 .../org/apache/cordova/test/LoadTimeoutTest.java   |   10 +++
 .../org/apache/cordova/test/SplashscreenTest.java  |   12 ++++
 .../org/apache/cordova/test/UserWebViewTest.java   |   11 +++
 .../src/org/apache/cordova/test/WhitelistTest.java |   12 ++++
 test/src/org/apache/cordova/test/XhrTest.java      |   11 +++
 test/src/org/apache/cordova/test/errorurl.java     |    2 +
 13 files changed, 189 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/blob/dd0b6b1e/test/src/org/apache/cordova/test/BackButtonTest.java
----------------------------------------------------------------------
diff --git a/test/src/org/apache/cordova/test/BackButtonTest.java b/test/src/org/apache/cordova/test/BackButtonTest.java
new file mode 100644
index 0000000..db09792
--- /dev/null
+++ b/test/src/org/apache/cordova/test/BackButtonTest.java
@@ -0,0 +1,49 @@
+package org.apache.cordova.test;
+
+import org.apache.cordova.CordovaWebView;
+
+import android.test.ActivityInstrumentationTestCase2;
+import android.test.TouchUtils;
+import android.widget.FrameLayout;
+import android.widget.LinearLayout;
+
+public class BackButtonTest extends ActivityInstrumentationTestCase2<backbuttonmultipage>
{
+
+  private backbuttonmultipage testActivity;
+  private FrameLayout containerView;
+  private LinearLayout innerContainer;
+  private CordovaWebView testView;
+  private TouchUtils touchTest;
+  private long TIMEOUT = 5000;
+  
+  public BackButtonTest() {
+    super("org.apache.cordova.test",backbuttonmultipage.class);
+  }
+
+  protected void setUp() throws Exception {
+    super.setUp();
+    testActivity = this.getActivity();
+    containerView = (FrameLayout) testActivity.findViewById(android.R.id.content);
+    innerContainer = (LinearLayout) containerView.getChildAt(0);
+    testView = (CordovaWebView) innerContainer.getChildAt(0);
+    touchTest = new TouchUtils();
+  }
+  
+  public void testPreconditions(){
+    assertNotNull(innerContainer);
+    assertNotNull(testView);
+  }
+
+  public void testClick() {
+    touchTest.tapView(this, testView);
+  }
+  
+  private void sleep() {
+    try {
+      Thread.sleep(TIMEOUT );
+    } catch (InterruptedException e) {
+      fail("Unexpected Timeout");
+    }
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/blob/dd0b6b1e/test/src/org/apache/cordova/test/CordovaActivityTest.java
----------------------------------------------------------------------
diff --git a/test/src/org/apache/cordova/test/CordovaActivityTest.java b/test/src/org/apache/cordova/test/CordovaActivityTest.java
index 8a38b1a..3a5b47d 100644
--- a/test/src/org/apache/cordova/test/CordovaActivityTest.java
+++ b/test/src/org/apache/cordova/test/CordovaActivityTest.java
@@ -33,9 +33,10 @@ public class CordovaActivityTest extends ActivityInstrumentationTestCase2<PhoneG
     private LinearLayout innerContainer;
     private CordovaWebView testView;
     
+    @SuppressWarnings("deprecation")
     public CordovaActivityTest()
     {
-        super("com.phonegap.test.activities",PhoneGapActivity.class);
+        super("org.apache.cordova.test",PhoneGapActivity.class);
     }
     
     protected void setUp() throws Exception {

http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/blob/dd0b6b1e/test/src/org/apache/cordova/test/ErrorUrlTest.java
----------------------------------------------------------------------
diff --git a/test/src/org/apache/cordova/test/ErrorUrlTest.java b/test/src/org/apache/cordova/test/ErrorUrlTest.java
new file mode 100644
index 0000000..74a35c7
--- /dev/null
+++ b/test/src/org/apache/cordova/test/ErrorUrlTest.java
@@ -0,0 +1,35 @@
+package org.apache.cordova.test;
+
+import org.apache.cordova.CordovaWebView;
+
+import android.test.ActivityInstrumentationTestCase2;
+import android.widget.FrameLayout;
+import android.widget.LinearLayout;
+
+public class ErrorUrlTest extends ActivityInstrumentationTestCase2<errorurl> {
+
+  errorurl testActivity;
+  private FrameLayout containerView;
+  private LinearLayout innerContainer;
+  private CordovaWebView testView;
+  
+  public ErrorUrlTest() {
+    super("org.apache.cordova.test",errorurl.class);
+  }
+  
+  
+  protected void setUp() throws Exception {
+      super.setUp();
+      testActivity = this.getActivity();
+      containerView = (FrameLayout) testActivity.findViewById(android.R.id.content);
+      innerContainer = (LinearLayout) containerView.getChildAt(0);
+      testView = (CordovaWebView) innerContainer.getChildAt(0);
+      
+  }
+  
+  public void testPreconditions(){
+      assertNotNull(innerContainer);
+      assertNotNull(testView);
+  }
+  
+}

http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/blob/dd0b6b1e/test/src/org/apache/cordova/test/HtmlNotFoundTest.java
----------------------------------------------------------------------
diff --git a/test/src/org/apache/cordova/test/HtmlNotFoundTest.java b/test/src/org/apache/cordova/test/HtmlNotFoundTest.java
new file mode 100644
index 0000000..4546e5a
--- /dev/null
+++ b/test/src/org/apache/cordova/test/HtmlNotFoundTest.java
@@ -0,0 +1,11 @@
+package org.apache.cordova.test;
+
+import android.test.ActivityInstrumentationTestCase2;
+
+public class HtmlNotFoundTest extends ActivityInstrumentationTestCase2<htmlnotfound>
{
+
+  
+  public HtmlNotFoundTest() {
+    super("org.apache.cordova.test",htmlnotfound.class);
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/blob/dd0b6b1e/test/src/org/apache/cordova/test/IFrameTest.java
----------------------------------------------------------------------
diff --git a/test/src/org/apache/cordova/test/IFrameTest.java b/test/src/org/apache/cordova/test/IFrameTest.java
new file mode 100644
index 0000000..07fba57
--- /dev/null
+++ b/test/src/org/apache/cordova/test/IFrameTest.java
@@ -0,0 +1,11 @@
+package org.apache.cordova.test;
+
+import android.test.ActivityInstrumentationTestCase2;
+
+public class IFrameTest extends ActivityInstrumentationTestCase2<iframe> {
+  
+  public IFrameTest() {
+    super("org.apache.cordova.test",iframe.class);
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/blob/dd0b6b1e/test/src/org/apache/cordova/test/JQMTabTest.java
----------------------------------------------------------------------
diff --git a/test/src/org/apache/cordova/test/JQMTabTest.java b/test/src/org/apache/cordova/test/JQMTabTest.java
new file mode 100644
index 0000000..aa69825
--- /dev/null
+++ b/test/src/org/apache/cordova/test/JQMTabTest.java
@@ -0,0 +1,12 @@
+package org.apache.cordova.test;
+
+import android.test.ActivityInstrumentationTestCase2;
+
+public class JQMTabTest extends ActivityInstrumentationTestCase2<jqmtabbackbutton>
{
+
+  public JQMTabTest(Class<jqmtabbackbutton> activityClass) {
+    super(activityClass);
+    // TODO Auto-generated constructor stub
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/blob/dd0b6b1e/test/src/org/apache/cordova/test/LifecycleTest.java
----------------------------------------------------------------------
diff --git a/test/src/org/apache/cordova/test/LifecycleTest.java b/test/src/org/apache/cordova/test/LifecycleTest.java
new file mode 100644
index 0000000..f9ff930
--- /dev/null
+++ b/test/src/org/apache/cordova/test/LifecycleTest.java
@@ -0,0 +1,11 @@
+package org.apache.cordova.test;
+
+import android.test.ActivityInstrumentationTestCase2;
+
+public class LifecycleTest extends ActivityInstrumentationTestCase2<lifecycle> {
+  
+  public LifecycleTest()
+  {
+    super("org.apache.cordova.test",lifecycle.class);
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/blob/dd0b6b1e/test/src/org/apache/cordova/test/LoadTimeoutTest.java
----------------------------------------------------------------------
diff --git a/test/src/org/apache/cordova/test/LoadTimeoutTest.java b/test/src/org/apache/cordova/test/LoadTimeoutTest.java
new file mode 100644
index 0000000..e161058
--- /dev/null
+++ b/test/src/org/apache/cordova/test/LoadTimeoutTest.java
@@ -0,0 +1,10 @@
+package org.apache.cordova.test;
+
+import android.test.ActivityInstrumentationTestCase2;
+
+public class LoadTimeoutTest extends ActivityInstrumentationTestCase2<loading> {
+  public LoadTimeoutTest()
+  {
+    super("org.apache.cordova.test",loading.class);
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/blob/dd0b6b1e/test/src/org/apache/cordova/test/SplashscreenTest.java
----------------------------------------------------------------------
diff --git a/test/src/org/apache/cordova/test/SplashscreenTest.java b/test/src/org/apache/cordova/test/SplashscreenTest.java
new file mode 100644
index 0000000..2935991
--- /dev/null
+++ b/test/src/org/apache/cordova/test/SplashscreenTest.java
@@ -0,0 +1,12 @@
+package org.apache.cordova.test;
+
+import android.test.ActivityInstrumentationTestCase2;
+
+public class SplashscreenTest extends ActivityInstrumentationTestCase2<splashscreen>
{
+  
+  public SplashscreenTest()
+  {
+      super("org.apache.cordova.test",splashscreen.class);
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/blob/dd0b6b1e/test/src/org/apache/cordova/test/UserWebViewTest.java
----------------------------------------------------------------------
diff --git a/test/src/org/apache/cordova/test/UserWebViewTest.java b/test/src/org/apache/cordova/test/UserWebViewTest.java
new file mode 100644
index 0000000..a3f82d8
--- /dev/null
+++ b/test/src/org/apache/cordova/test/UserWebViewTest.java
@@ -0,0 +1,11 @@
+package org.apache.cordova.test;
+
+import android.test.ActivityInstrumentationTestCase2;
+
+public class UserWebViewTest extends ActivityInstrumentationTestCase2<userwebview>
{
+
+  public UserWebViewTest ()
+  {
+    super(userwebview.class);
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/blob/dd0b6b1e/test/src/org/apache/cordova/test/WhitelistTest.java
----------------------------------------------------------------------
diff --git a/test/src/org/apache/cordova/test/WhitelistTest.java b/test/src/org/apache/cordova/test/WhitelistTest.java
new file mode 100644
index 0000000..f3477c4
--- /dev/null
+++ b/test/src/org/apache/cordova/test/WhitelistTest.java
@@ -0,0 +1,12 @@
+package org.apache.cordova.test;
+
+import android.test.ActivityInstrumentationTestCase2;
+
+public class WhitelistTest extends ActivityInstrumentationTestCase2<whitelist> {
+  
+  public WhitelistTest()
+  {
+    super(whitelist.class);
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/blob/dd0b6b1e/test/src/org/apache/cordova/test/XhrTest.java
----------------------------------------------------------------------
diff --git a/test/src/org/apache/cordova/test/XhrTest.java b/test/src/org/apache/cordova/test/XhrTest.java
new file mode 100644
index 0000000..bc86138
--- /dev/null
+++ b/test/src/org/apache/cordova/test/XhrTest.java
@@ -0,0 +1,11 @@
+package org.apache.cordova.test;
+
+import android.test.ActivityInstrumentationTestCase2;
+
+public class XhrTest extends ActivityInstrumentationTestCase2<xhr> {
+
+  public XhrTest()
+  {
+    super(xhr.class);
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/blob/dd0b6b1e/test/src/org/apache/cordova/test/errorurl.java
----------------------------------------------------------------------
diff --git a/test/src/org/apache/cordova/test/errorurl.java b/test/src/org/apache/cordova/test/errorurl.java
index b30a444..48e6ada 100755
--- a/test/src/org/apache/cordova/test/errorurl.java
+++ b/test/src/org/apache/cordova/test/errorurl.java
@@ -29,4 +29,6 @@ public class errorurl extends DroidGap {
         this.setStringProperty("errorUrl", "file:///android_asset/www/htmlnotfound/error.html");
         super.loadUrl("file:///android_asset/www/htmlnotfound/index.html");
     }
+    
+    
 }


Mime
View raw message