Search in sources :

Example 1 with AndroidJUnitConfigurationConverter

use of com.android.tools.idea.testartifacts.junit.AndroidJUnitConfigurationConverter in project android by JetBrains.

the class AndroidJUnitConfigurationConverterTest method testConfigurationsAreNotConvertedInIdea.

public void testConfigurationsAreNotConvertedInIdea() {
    mockIdeInfo = IdeComponents.replaceServiceWithMock(IdeInfo.class);
    when(mockIdeInfo.isAndroidStudio()).thenReturn(false);
    ConversionProcessor<RunManagerSettings> converter = new AndroidJUnitConfigurationConverter().createRunConfigurationsConverter();
    RunManagerSettings runManagerSettings = getStubRunManagerSettings();
    assertFalse(converter.isConversionNeeded(runManagerSettings));
}
Also used : AndroidJUnitConfigurationConverter(com.android.tools.idea.testartifacts.junit.AndroidJUnitConfigurationConverter) IdeInfo(com.android.tools.idea.IdeInfo) RunManagerSettings(com.intellij.conversion.RunManagerSettings)

Example 2 with AndroidJUnitConfigurationConverter

use of com.android.tools.idea.testartifacts.junit.AndroidJUnitConfigurationConverter in project android by JetBrains.

the class AndroidJUnitConfigurationConverterTest method testConfigurationsAreConvertedInStudio.

public void testConfigurationsAreConvertedInStudio() throws Exception {
    mockIdeInfo = IdeComponents.replaceServiceWithMock(IdeInfo.class);
    when(mockIdeInfo.isAndroidStudio()).thenReturn(true);
    ConversionProcessor<RunManagerSettings> converter = new AndroidJUnitConfigurationConverter().createRunConfigurationsConverter();
    RunManagerSettings runManagerSettings = getStubRunManagerSettings();
    Collection<? extends Element> runConfigurations = runManagerSettings.getRunConfigurations();
    assertTrue(converter.isConversionNeeded(runManagerSettings));
    assertSize(2, getJUnitConfigurations(runConfigurations));
    assertEmpty(getAndroidJUnitConfigurations(runConfigurations));
    converter.process(runManagerSettings);
    assertEmpty(getJUnitConfigurations(runConfigurations));
    assertSize(2, getAndroidJUnitConfigurations(runConfigurations));
}
Also used : AndroidJUnitConfigurationConverter(com.android.tools.idea.testartifacts.junit.AndroidJUnitConfigurationConverter) IdeInfo(com.android.tools.idea.IdeInfo) RunManagerSettings(com.intellij.conversion.RunManagerSettings)

Aggregations

IdeInfo (com.android.tools.idea.IdeInfo)2 AndroidJUnitConfigurationConverter (com.android.tools.idea.testartifacts.junit.AndroidJUnitConfigurationConverter)2 RunManagerSettings (com.intellij.conversion.RunManagerSettings)2