i try to get the data by CTS test ,but fail,who can tell me how to
resolve this provblem?Thanks! My code and results are as follows:
package android.location.cts;
import dalvik.annotation.TestLevel;
import dalvik.annotation.TestTargetClass;
import dalvik.annotation.TestTargetNew;
import dalvik.annotation.TestTargets;
import android.content.Context;
import android.location.GpsSatellite;
import android.location.GpsStatus;
import android.location.LocationManager;
import android.test.AndroidTestCase;
import java.util.Iterator;
@TestTargetClass(GpsStatus.class)
public class GpsStatusTest extends AndroidTestCase {
private GpsStatus mGpsStatus;
@Override
protected void setUp() throws Exception {
super.setUp();
LocationManager lm =
(LocationManager)
getContext().getSystemService(Context.LOCATION_SERVICE);
mGpsStatus = lm.getGpsStatus(null);
}
@TestTargets({
@TestTargetNew(
level = TestLevel.COMPLETE,
method = "getSatellites",
args = {}
),
@TestTargetNew(
level = TestLevel.COMPLETE,
method = "getMaxSatellites",
args = {}
)
})
public void testGetSatellites() {
Iterable<GpsSatellite> satellites =
mGpsStatus.getSatellites();
assertNull("**********"+satellites,satellites);
Results:
android.location.cts.GpsStatusTest
-- testGetSatellites
fail
junit.framework.AssertionFailedError:
**********android.location.gpsstatu...@43e32288 at
android.location.cts.GpsStatusTest.testGetSatellites(GpsStatusTest.java:
58)
--
unsubscribe: [email protected]
website: http://groups.google.com/group/android-porting