I'm trying to execute a test class extending an AndroidTestCase that I've made but apparently I've kept on getting the following error:
No apk changes detected. Skipping file upload, force stopping package instead. DEVICE SHELL COMMAND: am force-stop Running tests Test running startedTest running failed: Unable to find instrumentation info for: ComponentInfo{/android.test.InstrumentationTestRunner} Empty test suite.
The only solution that I remember that I found is that I need to indicate my InstrumentationTestRunner in the Run/Debug Configurations. But even though I've specified the instrumentation runner of Android API 21, I still get the error mentioned above. Other solutions points out on adding some info in build.gradle but it isn't possible since my Android Project is generated by IBM MobileFirst and Gradle is not supported.
For my code, please check below:
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.test.AndroidTestCase;
import android.test.suitebuilder.annotation.SmallTest;
import <package>.R;
import <package>.<Class to be tested>;
public class SampleTest extends AndroidTestCase {
@SmallTest
public void testHidePartsOfLicense(){
<Class to be tested> sample = new <Class to be tested>();
Bitmap bitmap = BitmapFactory.decodeResource(super.getContext().getResources(),
R.drawable.testImage);
String imageString = sample.addShapesInBitmapImage(bitmap);
assertNotNull(imageString);
}
}
Or are there other ways to me to be able to just execute a simple JUnit Test with the bitmap image? As much as I'd like to use the java.awt.image package, I read that it is not possible in Android Studio as well..
Aucun commentaire:
Enregistrer un commentaire