I want to coe covergae of my test case which used SingleLaunchActivity in android


public class MyActivityTest extends SingleLauncgActivtiy<MyMainProjectClassName> {

public MyActivityTest () {
super("com.hilti.android.plt.measure_and_record", MainMeasureAndRecordActivity.class);
}

}

2 answers

1 accepted

Accepted Answer
1 vote

Hi, here's some tutorial describing how to turn on experimental code coverage for Android platform. However keep in mind that Android OS is not officially supported.

Hi Grzegorz, the link you have provided is not understandable. Can you please share any example android code or example working script? 

Please help me out on this below questions..

How to generate instrumented Java classes of Android app from code? 

How it will generate the Clover.db file? and how to built the apk with the instrumented classes? 

Please help me out on this, Thank you!! Really appreciate your efforts !! 

 

Hello, here you have example code and tutorial how to integrate Ant or Maven with Clover. Regarding Java instrumentation, you can read about it in any of the following tutorials (depending which integration you'd like to use):

Proper source code instrumentation will generate clover.db which you can use. In order to build apk archive from instrumented sources, you need to follow any other typical build procedure. The only difference will be that you need to use instrumented sources, not the original ones.

Hi @Grzegorz Lewandowski, I am looking for specific android example code?

If you have such code, can you please paste the link for the code? 

Thank you so much!!

I am trying through command promt

C:\Temp>java -Dclover.license.path=C:\Path\clover.license -cp C:\Temp\clover-run
time.jar com.cenqua.clover.CloverInstr ...
Error: Could not find or load main class com.cenqua.clover.CloverInstr

getting highlight error ..

I have db as well as their content.

Now from the command line i have to genrate report.

Can you please tell me the process.

I have clover.db + some file generated their.

 

 

Hi, you're trying to invoke CloverInstr main class but most probably it's not in the classpath. Please, make sure clover.jar is in the classpath of that java invocation. Please take a look at this Oracle tutorial how to achieve it. 

http://docs.oracle.com/javase/6/docs/technotes/tools/solaris/classpath.html

My claspath of jave is 

C:\Program Files\Java\jdk1.7.0_45

so inside their is lib folder

I paste my colver .jar their 

After that i ran my command prompt

C:\Temp>java -Dclover.license.path=C:\Path\clover.license -cp C:\Temp\clover-run

Usage: java [-options] class [args...]
(to execute a class)
or java [-options] -jar jarfile [args...]
(to execute a jar file)
where options include:
-d32 use a 32-bit data model if available
-d64 use a 64-bit data model if available
-server to select the "server" VM
The default VM is server.

-cp <class search path of directories and zip/jar files>
-classpath <class search path of directories and zip/jar files>
A ; separated list of directories, JAR archives,
and ZIP archives to search for class files.
-D<name>=<value>
set a system property
-verbose:[class|gc|jni]
enable verbose output
-version print product version and exit
-version:<value>
Warning: this feature is deprecated and will be removed
in a future release.
require the specified version to run
-showversion print product version and continue
-jre-restrict-search | -no-jre-restrict-search
Warning: this feature is deprecated and will be removed
in a future release.
include/exclude user private JREs in the version search
-? -help print this help message
-X print help on non-standard options
-ea[:<packagename>...|:<classname>]
-enableassertions[:<packagename>...|:<classname>]
enable assertions with specified granularity
-da[:<packagename>...|:<classname>]
-disableassertions[:<packagename>...|:<classname>]
disable assertions with specified granularity
-esa | -enablesystemassertions
enable system assertions
-dsa | -disablesystemassertions
disable system assertions
-agentlib:<libname>[=<options>]
load native agent library <libname>, e.g. -agentlib:hprof
see also, -agentlib:jdwp=help and -agentlib:hprof=help
-agentpath:<pathname>[=<options>]
load native agent library by full pathname
-javaagent:<jarpath>[=<options>]
load Java programming language agent, see java.lang.instrument

-splash:<imagepath>
show splash screen with specified image
See http://www.oracle.com/technetwork/java/javase/documentation/index.html for m
ore details.

C:\Temp>time.jar com.cenqua.clover.CloverInstr ...

 

I am getting above error.

 

Can u please elaborate in step by step

 

Thanks u so much for guding

It not working at all .

I have a android project in eclipse which have a test class like below

public class MainMeasureAndRecordActivityTest extends SingleLaunchActivityTestCase<MainMeasureAndRecordActivity> {

private static MainMeasureAndRecordActivity activity;
private long projectId;
private ContentResolver contentResolver;
private long jobId;
private long projectUUID;
private Station station;
private long stationId;
MainMeasureAndRecordActivity activity2=new MainMeasureAndRecordActivity();

public MainMeasureAndRecordActivityTest() {
super("com.hilti.android.plt.measure_and_record", MainMeasureAndRecordActivity.class);
}

 

Error I am geeting SingleLaunchActivityTestCase not defined.I have to show my client at any cost.

 

Can you please help me out.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Monday in Jira Ops

Jira Ops Early Access Program Update #1: Announcing our next feature and a new integration

Thanks for signing up for Jira Ops! I’m Matt Ryall, leader for the Jira Ops product team at Atlassian. Since this is a brand new product, we’ll be delivering improvements quickly and sharing updates...

482 views 0 9
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you