1

Enter image description here

android jnuit test project

import ***
....
@SuppressWarnings("rawtypes")
public class LoginTest extends ActivityInstrumentationTestCase2 {
    public Solo solo;
    public Activity activity;
    private static Class<?> launchActivityClass;
    private static String mainActiviy = "com.tencent.mm.ui.LauncherUI";
    private static String packageName = "com.tencent.mm";
    static {
        try {
            launchActivityClass = Class.forName(mainActiviy);
        } catch (ClassNotFoundException e) {
            throw new RuntimeException(e);
        }
    }
    @SuppressWarnings("unchecked")
    public LoginTest() {
        super(packageName, launchActivityClass);
    }
    @Override
    protected void setUp() throws Exception {
        super.setUp();
        this.activity = this.getActivity();
        this.solo = new Solo(getInstrumentation(), getActivity());
    }
    public void testLoginWithIncorrentUsernameAndPassword() throws Exception {
        TimeUnit.SECONDS.sleep(5);
    //......    
    }
    @Override
    public void tearDown() throws Exception {
        try {
            this.solo.finishOpenedActivities();
        } catch (Throwable e) {
            e.printStackTrace();
        }
        this.activity.finish();
        super.tearDown();
    }
}

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.android.notepad.test.test.test"
    android:versionCode="1"
    android:versionName="1.0" >
    <uses-sdk android:minSdkVersion="18" />
    <instrumentation
        android:name="android.test.InstrumentationTestRunner"
        android:targetPackage="com.tencent.mm" />
    <application
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name" >
        <uses-library android:name="android.test.runner" />
    </application>
</manifest>

eclipse error massage:

An internal error occurred during: "Launching LoginTest ". org.eclipse.jdt.internal.junit.runner.IVisitsTestTrees.visitTreeEntry(Lorg/eclipse/jdt/internal/junit/runner/ITestIdentifier;ZI)V

Usman Ali
  • 425
  • 1
  • 9
  • 31
AsapRun
  • 11
  • 3
  • What is in the image? Where does it come from? Under what circumstances does it happen? Respond by editing your question, not here in comments. Thanks in advance. – Peter Mortensen Aug 17 '18 at 04:49
  • I am afraid we need more information to answer the question. Respond by editing your question, not here in comments. Thanks in advance. – Peter Mortensen Aug 17 '18 at 04:54

0 Answers0