use of com.android.tools.idea.testartifacts.junit.AndroidJUnitConfigurationProducer in project android by JetBrains.
the class AndroidStudioInitializer method disableIdeaJUnitConfigurations.
// JUnit original Extension JUnitConfigurationType is disabled so it can be replaced by its child class AndroidJUnitConfigurationType
private static void disableIdeaJUnitConfigurations() {
// First we unregister the ConfigurationProducers, and after the ConfigurationType
ExtensionPoint<RunConfigurationProducer> configurationProducerExtensionPoint = Extensions.getRootArea().getExtensionPoint(RunConfigurationProducer.EP_NAME);
for (RunConfigurationProducer runConfigurationProducer : configurationProducerExtensionPoint.getExtensions()) {
if (runConfigurationProducer instanceof JUnitConfigurationProducer && !(runConfigurationProducer instanceof AndroidJUnitConfigurationProducer)) {
// In AndroidStudio these ConfigurationProducer s are replaced
configurationProducerExtensionPoint.unregisterExtension(runConfigurationProducer);
}
}
ExtensionPoint<ConfigurationType> configurationTypeExtensionPoint = Extensions.getRootArea().getExtensionPoint(ConfigurationType.CONFIGURATION_TYPE_EP);
for (ConfigurationType configurationType : configurationTypeExtensionPoint.getExtensions()) {
if (configurationType instanceof JUnitConfigurationType && !(configurationType instanceof AndroidJUnitConfigurationType)) {
// In Android Studio the user is forced to use AndroidJUnitConfigurationType instead of JUnitConfigurationType
configurationTypeExtensionPoint.unregisterExtension(configurationType);
}
}
// We hide actions registered by the JUnit plugin and instead we use those registered in android-junit.xml
hideAction("excludeFromSuite");
hideAction("AddToISuite");
}
Aggregations