core tests coverage report 0%

by James Wang » Sat, 12 Dec 2009 16:48:53 GMT


Sponsored Links
 We ran core tests by the command "/development/testrunner/runtest.py  -
v --coverage core" and got coverage report successfully. But the
reports says all are 0%.
We ran apidemos and got coverage report which looks good.

Below is the console output for core tests:
-------------------------------------------------------------------------------------
No private recovery resources for TARGET_DEVICE dream-open
make:  `/usr/forCurl/android1.6r1' make: `files' 
make:  `/usr/forCurl/android1.6r1' Syncing to device...
about to run adb  sync
syncing /system...
0 files pushed. 377 files skipped.
syncing /data...
0 files pushed. 8 files skipped.

Waiting for device package manager...
about to run adb  wait-for-device
about to run adb  shell pm path android
about to run adb  shell cat init.rc | grep BOOTCLASSPATH | grep
emma.jar
Waiting for instrumentation to be present
about to run adb  shell pm list instrumentation | grep android.core/
android.test.InstrumentationTestRunner
Running in coverage mode, suppressing test output
am instrument -e class 'android.core.CoreTests' -e coverage 'true' -r -
w android.core/android.test.InstrumentationTestRunner
about to run adb  shell am instrument -e class
'android.core.CoreTests' -e coverage 'true' -r -w android.core/
android.test.InstrumentationTestRunner
Failure in android.webkit.CookieTest:testPath:
junit.framework.AssertionFailedError
        at android.webkit.CookieTest.testPath(CookieTest.java:191)
        at java.lang.reflect.Method.invokeNative(Native Method)
        at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:164)
        at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:151)
        at android.test.InstrumentationTestRunner.onStart
(InstrumentationTestRunner.java:425)
        at android.app.Instrumentation$InstrumentationThread.run
(Instrumentation.java:1520)


Tests run: 312, Failures: 1, Errors: 0
about to run adb  shell ls /data/data/android.core/files/coverage.ec
about to run adb  pull /data/data/android.core/files/coverage.ec /usr/
forCurl/android1.6r1/out/emma/framework/core/core.ec
EMMA: processing input files ...
EMMA: 2 file(s) read and merged in 503 ms
EMMA: writing [html] report to [/usr/forCurl/android1.6r1/out/emma/
framework/core/core.html] ...
Coverage report generated at /usr/forCurl/android1.6r1/out/emma/
framework/core/core.html
----------------------------------------------------------------

So I wonder why core tests's coverage report says 0% and how can I
make the report make sense.

Thanks in advance.

James

--



core tests coverage report 0%

by James Wang » Mon, 14 Dec 2009 09:03:30 GMT


 Hello, nobody had run core tests? Anybody can help me? Please!

--


Sponsored Links


Other Threads

1. Configuring the icons of an ExpandableListView - A simple example

Hi,

Recently I was trying to configure the icons of an ExpandableListView.
As many people would do, I was trying to replace the default icons for
the minimized and maximized states. As it appears, doing this basic
thing it's not that straightforward as one would expect/guess. There
are not many examples in the forums either (at least I couldn't find
one). I would like to share a code excerpt which shows the steps for
replacing the default icons in an ExpandableListView. Please beware
that the code excerpt of this discussion has been pruned a lot, to
show only the steps relevant for replacing the default icons. Hope
that this example will be useful for people who are new in Android and
who wish to work with ExpandableListViews.

Here is the explanation:

Step-1: You need two icons under <YourCodeBase>\res\drawable. Let's
say that these icons are my_icon_min.png and my_icon_max.png.

Step-2: The way to override the default icons of an ExpandableListView
lies in creating a Drawable object which has states (minimized and
maximized, or expanded and collapsed), and set this object as the
group indicator of your ExpandableListView. We need a way for creating
the needed Drawable object with states. One decent way of doing this
is through an XML file. Android SDK provides an example XML file for
this purpose. Under Windows for Android-1.5 the location is android-
sdk-windows\platforms\android-1.5\data\res\drawable
\expander_group.xml. Since you're interested in replacing the default
icons, probably you'll need to copy this file under <YourCodeBase>\res
\drawable, edit it and put in the names of your icons (my_icon_min and
my_icon_max). See below:

expander_group.xml
-------------------------
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item
        android:state_expanded="true"
        android:drawable="@drawable/my_icon_max" />
    <item
        android:drawable="@drawable/my_icon_min" />
</selector>

Step-3: Next comes the coding part. Below is a super simple example:

public class MyExpandableList extends ExpandableListActivity
{
  @Override
  public void onCreate(Bundle savedInstanceState)
  {
    super.onCreate(savedInstanceState);
        .
        .
        .
    // Create a Drawable object with states
    Drawable icon =
this.getResources().getDrawable(R.drawable.expander_group);

    // Set the newly created Drawable object as group indicator.
    // Now you should be seeing your icons as group indicators.
    getExpandableListView().setGroupIndicator(icon);
        .
        .
        .
  }
}

-- 

2. ADO.NET like database interface

Is there a data interface that performs similarly to ADO.NET for
windows?
The current data access methodology is quite rudimentary.

-- 

3. Override default icons of BaseExpandableListAdapter

4. Dashcode and android webview

5. Do Cursors provide write access?

6. ViewFactory for multiple switchers?

7. Activity that checks for nonexistent folder causes startActivityForResult to fail?