Sha256: 06865d50e2436dd71670d0704731b40bb27535125221fef8eec7a0e371346b3c

Contents?: true

Size: 1.37 KB

Versions: 4

Compression:

Stored size: 1.37 KB

Contents

package sh.calaba.instrumentationbackend;

import java.lang.reflect.Method;

import android.content.Context;
import android.os.Bundle;
import android.test.InstrumentationTestRunner;
import sh.calaba.instrumentationbackend.actions.HttpServer;

public class CalabashInstrumentationTestRunner extends InstrumentationTestRunner {
	@Override
    public void onCreate(Bundle arguments) {		
		try {
			Context context = getTargetContext ();
			Class<?> c = Class.forName("mono.MonoPackageManager");
			Method  method = c.getDeclaredMethod ("LoadApplication", Context.class, String.class, String[].class);
			method.invoke (null, context, null, new String[]{context.getApplicationInfo ().sourceDir});
			System.out.println("Calabash loaded Mono");
		} catch (Exception e) {
			System.out.println("Calabash did not load Mono. This is only a problem if you are trying to test a Mono application");
		}

        // Start the HttpServer as soon as possible in a not-ready state
        HttpServer.instantiate(Integer.parseInt(arguments.getString("test_server_port")));

        InstrumentationBackend.testPackage = arguments.getString("target_package");

        try {
            InstrumentationBackend.mainActivity = Class.forName(arguments.getString("main_activity"));
        } catch (ClassNotFoundException e) {
            throw new RuntimeException(e);
        }

        super.onCreate(arguments);

	}	
}

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
testautoa-0.4.2.pre1 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/CalabashInstrumentationTestRunner.java
testautoa-0.4.2 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/CalabashInstrumentationTestRunner.java
calabash-android-0.4.3.pre2 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/CalabashInstrumentationTestRunner.java
calabash-android-0.4.3.pre1 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/CalabashInstrumentationTestRunner.java