< target name ="run-with-coverage" >
< java
classname ="com.sonyericsson.sdkme.junit.OnDeviceTest"
fork ="true" failonerror ="true" >
< classpath refid ="test-classpath" />
< arg value ="--javac:${javac}" />
< arg value ="--project-dir:${project-dir}" />
< arg value ="--device:SonyEricsson_K750_Emu" />
< arg value ="--compile:true" />
< arg value ="--compile-midlet:true" />
< arg value ="--coverage:L" />
< arg value ="--coverage-report:${project-dir}/coverage.html" />
< arg value ="--name:Mobile JUnit Sample Project" />
</ java >
< echo message ="A coverage HTML report has been written to ${project-dir}/coverage.html" />
</ target >
* This source code was highlighted with Source Code Highlighter .
< java classname ="com.sonyericsson.sdkme.junit.OnDeviceTest" fork ="true" failonerror ="true" >
< classpath >
< pathelement path ="${env.MJUNIT_HOME}/junit.jar" />
< pathelement path ="${env.MJUNIT_HOME}/mobile-ju-1.0.jar" />
< pathelement path ="${java.home}/lib" />
</ classpath >
< arg value ="--project-dir:${basedir}" />
< arg value ="--device:SonyEricsson_K750_Emu" />
< arg value ="--compile:false" />
< arg value ="--compile-midlet:false" />
< arg value ="--coverage:L" />
< arg value ="--runmode:${tests.runmode}" />
< arg value ="--coverage-report:${basedir}/coverage.html" />
< arg value ="--name:Stiter Client" />
< arg value =""--wtk:${env.WTK_HOME}"" />
< arg value ="--print-config:on" />
< arg value ="--midlet-under-test:${jarpath}" />
< arg value ="--bootclasspath:"${toString:tests.bcp}"" />
</ java >
* This source code was highlighted with Source Code Highlighter .
public void setUp() throws Throwable {
super.setUp();
midlet = new OurMIDlet();
}
* This source code was highlighted with Source Code Highlighter .
public void setUp(MIDlet miDlet) throws Throwable {
super.setUp(miDlet);
testMidlet = miDlet;
OurApplication.setMidletInstance(testMidlet);
}
* This source code was highlighted with Source Code Highlighter .
Source: https://habr.com/ru/post/51519/