migrating-from-android-test-classes

Migrate deprecated android.test.* classes to AndroidX Test and JUnit4.

Updated Jul 20, 2026
One-click install
npx skills add https://github.com/trancee/MeshLink-template --skill migrating-from-android-test-classes-trancee
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: migrating-from-android-test-classes
Source: https://github.com/trancee/MeshLink-template/tree/main/.agents/skills/android-testing-skills/platform/legacy/migrating-from-android-test-classes
Command: npx skills add https://github.com/trancee/MeshLink-template --skill migrating-from-android-test-classes-trancee

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill resolves the technical debt caused by deprecated android.test.* classes, which prevent modern testing frameworks like JUnit4 and Espresso from functioning correctly in Android projects.

Core Features & Use Cases

  • Automated Migration Mapping: Provides a direct class-by-class replacement guide for legacy components like InstrumentationTestCase and ActivityInstrumentationTestCase2.
  • Modernization Workflow: Guides the transition from JUnit3-style test structures to the current AndroidX Test and JUnit4 standards.
  • Use Case: When a legacy codebase fails to run tests under the AndroidJUnitRunner or relies on deprecated base classes, this skill provides the exact steps to refactor the test suite for compatibility with modern Android development.

Quick Start

Use the migrating-from-android-test-classes skill to generate a refactoring plan for converting my legacy ActivityInstrumentationTestCase2 classes to ActivityScenario.

Frequently Asked Questions about migrating-from-android-test-classes

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I migrate deprecated android.test classes to AndroidX Test libraries?

Migrating deprecated android.test classes involves replacing obsolete base classes like InstrumentationTestCase with modern AndroidX Test equivalents and JUnit4 standards to ensure compatibility with AndroidJUnitRunner.

What is the replacement for ActivityInstrumentationTestCase2 in modern Android testing?

The modern replacement for ActivityInstrumentationTestCase2 is ActivityScenario, which facilitates transitioning legacy instrumentation tests to current Android testing infrastructure including Espresso.

Why do my legacy Android tests fail to run under AndroidJUnitRunner?

Legacy Android tests fail under AndroidJUnitRunner because they rely on deprecated android.test platform classes that prevent modern testing frameworks like JUnit4 and Espresso from functioning correctly.

How do I transition from JUnit3-style test structures to JUnit4 standards?

Transitioning from JUnit3-style structures to JUnit4 standards requires replacing obsolete base classes and assertion helpers with contemporary AndroidX Test equivalents to modernize the test suite.

Can I use Espresso with legacy InstrumentationTestCase classes?

Espresso cannot function correctly with legacy InstrumentationTestCase classes because these deprecated android.test components prevent modern testing frameworks from operating within the Android project.

What are the limitations of keeping deprecated android.test classes in my codebase?

Keeping deprecated android.test classes creates technical debt by blocking compatibility with modern testing frameworks like JUnit4 and Espresso, ultimately preventing tests from running under AndroidJUnitRunner.