Hi,

   Junit EMMA code coverage generation process seems to work for
applications blackbox testing as well. For this, the application shall
provide a control (e.g. Menu option) to execute following
generateCoverageReport() method. At the end of manual tetsing, code
coverage menu option can trigger generateCoverageReport()  call to
generate coverage.ec.

=========================
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;


private void generateCoverageReport() {

            java.io.File coverageFile = new java.io.File("/sdcard/
coverage.ec");


                    Class emmaRTClass;
                  try {
                        emmaRTClass =
Class.forName("com.vladium.emma.rt.RT");
                          Method dumpCoverageMethod =
emmaRTClass.getMethod("dumpCoverageData",
                                      coverageFile.getClass(),
boolean.class, boolean.class);
                          dumpCoverageMethod.invoke(null,
coverageFile, false, false);
                  } catch (ClassNotFoundException e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                  } catch (SecurityException e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                  } catch (NoSuchMethodException e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                  } catch (IllegalArgumentException e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                  } catch (IllegalAccessException e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                  } catch (InvocationTargetException e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                  }
}

/Ramesh


On Apr 8, 9:50 am, Brett Chabot <[email protected]> wrote:
> There's no standard support for doing this, sorry.
>
> On Wed, Apr 7, 2010 at 11:38 AM, androiduser mobile <
>
>
>
> [email protected]> wrote:
> > Hi,
>
> > I would like to measure the code coverage for the UI application
> > without using JUnit test cases. Is there any way that we can capture
> > the report for the user key events on the application which is running
> > on device.
>
> > Thanks,
> > Android user.
>
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Android Developers" group.
> > To post to this group, send email to [email protected]
> > To unsubscribe from this group, send email to
> > [email protected]<android-developers%2bunsubs­[email protected]>
> > For more options, visit this group at
> >http://groups.google.com/group/android-developers?hl=en- Hide quoted text -
>
> - Show quoted text -

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

To unsubscribe, reply using "remove me" as the subject.

Reply via email to